New functions: iso2709_a_.. for record manipulation.
[egate.git] / util / iso27dis.c
index 247f216..437e497 100644 (file)
@@ -4,7 +4,10 @@
  * Europagate, 1994-1995.
  *
  * $Log: iso27dis.c,v $
- * Revision 1.3  1995/02/22 21:32:36  adam
+ * Revision 1.4  1995/03/29 11:44:29  adam
+ * New functions: iso2709_a_.. for record manipulation.
+ *
+ * Revision 1.3  1995/02/22  21:32:36  adam
  * Changed header.
  *
  * Revision 1.1  1995/02/10  17:05:18  adam
 #include <assert.h>
 #include <ctype.h>
 
-#include <iso2709p.h>
+#include <iso2709.h>
 
 void iso2709_display (Iso2709Rec rec, FILE *out)
 {
-    struct iso2709_dir *dir;
-
-    for (dir = rec->directory; dir; dir = dir->next)
+    Iso2709Anchor a;
+    char *tag;
+    char *indicator;
+    char *identifier;
+    char *data;
+    
+    a = iso2709_a_mk (rec);
+    do
     {
-        struct iso2709_field *field;
-
-        fprintf (out, "%s", dir->tag);
-        if (dir->indicator)
-            fprintf (out, " %s", dir->indicator);
-        for (field = dir->fields; field; field = field->next)
+        if (!iso2709_a_info_line (a, &tag, &indicator))
+            break;
+        fprintf (out, "%s", tag);
+        if (indicator)
+            fprintf (out, " %s", indicator);
+        do
         {
-            if (field->identifier)
-                fprintf (out, " $%s", field->identifier);
-            fprintf (out, " %s", field->data);
-        }
+            iso2709_a_info_field (a, NULL, NULL, &identifier, &data);
+            if (identifier)
+                fprintf (out, " $%s", identifier);
+            fprintf (out, " %s", data);
+        } while (iso2709_a_next_field (a));
         fprintf (out, "\n");
-    }
+    } while (iso2709_a_next_line(a));
 }
+