Changed string output of hash tables.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@653 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-08-15 14:57:09 +00:00
commit b3c17a0a3d

View file

@ -356,9 +356,10 @@ Hash_nextkey(DOH *ho) {
static DOH *
Hash_str(DOH *ho) {
int i;
int i,j;
HashNode *n;
DOH *s;
static int indent = 4;
Hash *h = (Hash *) ObjData(ho);
s = NewString("");
@ -371,10 +372,14 @@ Hash_str(DOH *ho) {
for (i = 0; i < h->hashsize; i++) {
n = h->hashtable[i];
while (n) {
Printf(s," '%s' : %s, \n", n->key, n->object);
n = n->next;
for (j = 0; j < indent; j++) Putc(' ',s);
indent+=4;
Printf(s,"'%s' : %s, \n", n->key, n->object);
indent-=4;
n = n->next;
}
}
for (j = 0; j < (indent-4); j++) Putc(' ',s);
Printf(s,"}\n");
ObjSetMark(ho,0);
return s;