[FIX] dastout license
[platform/core/system/swap-probe.git] / scripts / gen_api_id_mapping_header.awk
1 # This script generates api_id_mapping header from api list
2
3 BEGIN {
4         print "/*"
5         print " * this file genereted by <swap-probe> project with cmd <make headers>"
6         print " */"
7         print
8         print "#ifndef __API_ID_MAP__"
9         print "#define __API_ID_MAP__"
10         print
11         print "#ifdef __cplusplus"
12         print "extern \"C\"{"
13         print "#endif"
14         print
15         api_id = 1
16         macro_prefix = "API_ID_"
17 } {
18         if ( $0 == "" ) {
19                 print
20         } else {
21                 orig = $0
22                 def = orig
23                 split(def, splited, "###")
24                 def = splited[1]
25                 gsub(/[,:()*&~\[\] ]/, "_", def)
26                 def = macro_prefix def
27                 printf "#define %-135s %d // %s\n", def, api_id, orig
28                 api_id = api_id + 1
29         }
30 }
31 END {
32         print
33         print "#ifdef __cplusplus"
34         print "}"
35         print "#endif"
36         print
37         print "#endif /* __API_ID_MAP__ */"
38 }