summaryrefslogtreecommitdiffhomepage
path: root/mixlib/mix_symbol_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'mixlib/mix_symbol_table.c')
-rw-r--r--mixlib/mix_symbol_table.c10
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 */