diff options
author | jaortega <jaortega> | 2000-11-19 00:38:43 +0000 |
---|---|---|
committer | jaortega <jaortega> | 2000-11-19 00:38:43 +0000 |
commit | c6acfb52dcad94462a4dac6fe0bac5d2d0e022b5 (patch) | |
tree | 8183a179e32c094b35394ded3fb4c51534171c56 /mixlib/mix_symbol_table.c | |
parent | b096c061eb3e2992830f37c361f9179738aba5eb (diff) | |
download | mdk-c6acfb52dcad94462a4dac6fe0bac5d2d0e022b5.tar.gz mdk-c6acfb52dcad94462a4dac6fe0bac5d2d0e022b5.tar.bz2 |
using skip local symbols mode when printing symbol table
Diffstat (limited to 'mixlib/mix_symbol_table.c')
-rw-r--r-- | mixlib/mix_symbol_table.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mixlib/mix_symbol_table.c b/mixlib/mix_symbol_table.c index 36c15a9..1045886 100644 --- a/mixlib/mix_symbol_table.c +++ b/mixlib/mix_symbol_table.c @@ -114,11 +114,13 @@ mix_symbol_table_is_defined(const mix_symbol_table_t *table, const gchar *sym) #define is_local_sym_(sym) \ ((sym) && (strlen(sym)==2) && (sym[1] == 'B') && isdigit(sym[0])) +static gboolean skip_ = FALSE; + static void print_sym_rows_(gpointer symbol, gpointer value, gpointer file) { char *s = (char *)symbol; - if (!is_local_sym_(s)) { + if (skip_ && !is_local_sym_(s)) { mix_word_t word = (mix_word_t)GPOINTER_TO_UINT(value); fprintf((FILE *)file, "%s: %s%ld\n", s, mix_word_is_negative(word)? "-":"", @@ -130,7 +132,7 @@ static void print_sym_line_(gpointer symbol, gpointer value, gpointer file) { char *s = (char *)symbol; - if (!is_local_sym_(s)) { + if (skip_ && !is_local_sym_(s)) { mix_word_t word = (mix_word_t)GPOINTER_TO_UINT(value); fprintf((FILE *)file, ",%s =%s%ld", s, mix_word_is_negative(word)? "-":"", @@ -139,9 +141,11 @@ print_sym_line_(gpointer symbol, gpointer value, gpointer file) } void -mix_symbol_table_print(const mix_symbol_table_t *table, gint mode, FILE *file) +mix_symbol_table_print(const mix_symbol_table_t *table, gint mode, + FILE *file, gboolean skiplocal) { GHFunc func = (mode == MIX_SYM_LINE)? print_sym_line_ : print_sym_rows_; + skip_ = skiplocal; if ( table != NULL ) g_hash_table_foreach((GHashTable *)table, func, (gpointer)file); if ( mode == MIX_SYM_LINE ) putc(';', file); /* to mark end-of-table */ |