From c2eee93088aad4876c2f25fcb78d67ad18ffa425 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 15 Feb 2009 01:08:00 -0500 Subject: 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 --- scripts/gen_symbol_header.awk | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts') 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"); } -- cgit v1.2.3-65-gdbad