diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-02-15 01:08:00 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-02-15 01:08:00 -0500 |
commit | c2eee93088aad4876c2f25fcb78d67ad18ffa425 (patch) | |
tree | 992578dace40f636257459f16bfcc09194896daa /scripts | |
parent | libsandbox: make sure all mknod symbols are wrapped (diff) | |
download | sandbox-c2eee93088aad4876c2f25fcb78d67ad18ffa425.tar.gz sandbox-c2eee93088aad4876c2f25fcb78d67ad18ffa425.tar.bz2 sandbox-c2eee93088aad4876c2f25fcb78d67ad18ffa425.zip |
libsandbox: calculate longest symbol name dynamically
The longest wrapped symbol name has hit the hard limit of 10 chars, so
rather than manually bump it up, calculate it on the fly with the awk
scripts.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/gen_symbol_header.awk | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/gen_symbol_header.awk b/scripts/gen_symbol_header.awk index 826d75c..e7ee2ab 100644 --- a/scripts/gen_symbol_header.awk +++ b/scripts/gen_symbol_header.awk @@ -82,11 +82,16 @@ END { printf("#define __symbols_h\n\n"); printf("#define SB_NR_UNDEF -99999\n\n"); + SB_MAX_STRING_LEN = 0 + # We use the order in SYMBOLS, as some wrappers depends on others ... for (i = 1; i <= COUNT; ++i) { sym_index = SYMBOLS[i]; full_count = split(SYMBOL_LIST[sym_index], sym_full_names); + if (length(sym_index) > SB_MAX_STRING_LEN) + SB_MAX_STRING_LEN = length(sym_index); + if (full_count == 0) printf("#define SB_NR_%s SB_NR_UNDEF\n", toupper(sym_index)); @@ -170,5 +175,7 @@ END { } } + printf("#define SB_MAX_STRING_LEN %i\n\n", SB_MAX_STRING_LEN); + printf("#endif /* __symbols_h */\n"); } |