Repositories » libk0
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

prettyprinting tuned.

Changeset 59ef01b84511

Parent 8dbd824eddc1

by Rup Palchowdhury

Changes to one file · Browse files at 59ef01b84511 Showing diff from parent 8dbd824eddc1 Diff from another changeset...

Change 1 of 1 Show Entire File khash.c Stacked
 
75
76
77
 
78
79
80
81
 
82
 
 
 
 
 
 
83
84
 
85
86
87
 
75
76
77
78
79
80
81
 
82
83
84
85
86
87
88
89
90
 
91
92
93
94
@@ -75,13 +75,20 @@
   void fprinthash(FILE *stream, Hash *h, void (*printdata)(FILE*, void*))  { + int flag;   for (int i = 0; i < h->n; i++) {   if (h->tab[i] == NULL)   continue; - fprintf(stream, "%-8d ", i); + flag = 0;   for (Node *np = h->tab[i]; np != NULL; np = np->next) { + if (flag == 0) { + fprintf(stream, "%10d ", i); + flag = 1; + } + else + fprintf(stream, "\n%-10s ", " ");   (*printdata)(stream, np->data); - fprintf(stream, "\n%-8s ", " "); +   }   fprintf(stream, "\n");   }