From: Nikita Kalyazin Date: Sat, 13 Jul 2013 10:15:14 +0000 (+0400) Subject: [IMPROVE] add generating scripts for api header and list X-Git-Tag: Tizen_SDK_2.3~179 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f4f93de47b3ec00b74b4de5e7bb95728a7b7352d;p=platform%2Fcore%2Fsystem%2Fswap-probe.git [IMPROVE] add generating scripts for api header and list --- diff --git a/scripts/gen_api_id_mapping_header.awk b/scripts/gen_api_id_mapping_header.awk new file mode 100644 index 0000000..5b01a55 --- /dev/null +++ b/scripts/gen_api_id_mapping_header.awk @@ -0,0 +1,17 @@ +# This script generates api_id_mapping header from api list + +BEGIN { + api_id = 1 + macro_prefix = "API_ID_" +} { + if ( $0 == "" ) { + print + } else { + orig = $0 + def = orig + gsub(/[,:()*&~\[\] ]/, "_", def) + def = macro_prefix def + printf "#define %-135s %d // %s\n", def, api_id, orig + api_id = api_id + 1 + } +} diff --git a/scripts/gen_api_id_mapping_list.awk b/scripts/gen_api_id_mapping_list.awk new file mode 100644 index 0000000..2bc14fd --- /dev/null +++ b/scripts/gen_api_id_mapping_list.awk @@ -0,0 +1,11 @@ +# This script generates api_id_mapping text file from api list + +BEGIN { + api_id = 1 +} { + if ( $0 != "" ) { + api_name = $0 + printf "%d %s\n", api_id, api_name + api_id = api_id + 1 + } +}