summaryrefslogtreecommitdiffhomepage
path: root/mixlib
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2004-06-07 20:16:19 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2004-06-07 20:16:19 +0000
commit3b06a639c971cbde3321fc350120e6c7bfe0e0de (patch)
treeaf3a855f42f5e20081eb2a8ff596cede1f0e9c12 /mixlib
parentf9ae8fe7ad82618870acdac84cb376a32ec76f56 (diff)
downloadmdk-3b06a639c971cbde3321fc350120e6c7bfe0e0de.tar.gz
mdk-3b06a639c971cbde3321fc350120e6c7bfe0e0de.tar.bz2
(print_sym_rows_): align symbol values.
Diffstat (limited to 'mixlib')
-rw-r--r--mixlib/mix_symbol_table.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/mixlib/mix_symbol_table.c b/mixlib/mix_symbol_table.c
index debf04b..2ddec40 100644
--- a/mixlib/mix_symbol_table.c
+++ b/mixlib/mix_symbol_table.c
@@ -1,22 +1,22 @@
/* -*-c-*- -------------- mix_symbol_table.c :
* Implementation of the functions declared in mix_symbol_table.h
* ------------------------------------------------------------------
- * Copyright (C) 2000, 2001 Free Software Foundation, Inc.
- *
+ * Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
+ *
*/
#include <ctype.h> /* isdigit */
@@ -42,7 +42,7 @@ mix_symbol_table_new_from_file (FILE *file)
{
gchar sym[MIX_SYM_MAX_LEN + 1];
glong val;
-
+
while ( getc (file) == ',' )
{
if ( fscanf (file, "%s =%ld", sym, &val) != EOF )
@@ -111,11 +111,11 @@ mix_symbol_table_substract_table (mix_symbol_table_t *table,
/* Add/remove symbols one by one */
gint
-mix_symbol_table_add (mix_symbol_table_t *table,
+mix_symbol_table_add (mix_symbol_table_t *table,
const gchar *sym, mix_word_t value)
{
gpointer key, val;
-
+
if ( table == NULL || sym == NULL ) return MIX_SYM_FAIL;
if ( strlen (sym) > MIX_SYM_MAX_LEN ) return MIX_SYM_LONG;
@@ -131,11 +131,11 @@ mix_symbol_table_add (mix_symbol_table_t *table,
/* Add or modify symbol if it exists */
gint
-mix_symbol_table_insert (mix_symbol_table_t *table,
+mix_symbol_table_insert (mix_symbol_table_t *table,
const gchar *sym, mix_word_t new_value)
{
gpointer key, val;
-
+
if ( table == NULL || sym == NULL ) return MIX_SYM_FAIL;
if ( strlen (sym) > MIX_SYM_MAX_LEN ) return MIX_SYM_LONG;
@@ -166,7 +166,7 @@ print_sym_rows_ (gpointer symbol, gpointer value, gpointer file)
char *s = (char *)symbol;
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,
+ fprintf((FILE *)file, "%-20s: %s%ld\n", s,
mix_word_is_negative (word)? "-":"",
mix_word_magnitude (word));
}
@@ -178,7 +178,7 @@ print_sym_line_ (gpointer symbol, gpointer value, gpointer file)
char *s = (char *)symbol;
if (skip_ && !is_local_sym_ (s)) {
mix_word_t word = (mix_word_t)GPOINTER_TO_UINT (value);
- fprintf((FILE *)file, ",%s =%s%ld", s,
+ fprintf((FILE *)file, ",%s =%s%ld", s,
mix_word_is_negative (word)? "-":"",
mix_word_magnitude (word));
}
@@ -195,4 +195,4 @@ mix_symbol_table_print (const mix_symbol_table_t *table, gint mode,
if ( mode == MIX_SYM_LINE ) putc (';', file); /* to mark end-of-table */
}
-
+