]> diplodocus.org Git - nmh/blobdiff - h/fmt_scan.h
Added mention of "Reply to <address>?" prompt to repl(1) man
[nmh] / h / fmt_scan.h
index e499d51dd47e9aea8b9fdf34e29bbcbe14e75d2e..d50dc4416ae813ae8b44c603c3c3d3ad7c23a32e 100644 (file)
@@ -37,6 +37,8 @@ struct comp {
 #define        CT_ADDR       (1<<0)    /* referenced as address    */
 #define        CT_DATE       (1<<1)    /* referenced as date       */
 
 #define        CT_ADDR       (1<<0)    /* referenced as address    */
 #define        CT_DATE       (1<<1)    /* referenced as date       */
 
+#define CT_BITS       "\020\01ADDR\02DATE"
+
 /*
  * c_flags bits
  */
 /*
  * c_flags bits
  */
@@ -45,7 +47,7 @@ struct comp {
 #define        CF_DATEFAB    (1<<2)    /* datefield fabricated */
 #define CF_TRIMMED    (1<<3)   /* Component has been trimmed */
 
 #define        CF_DATEFAB    (1<<2)    /* datefield fabricated */
 #define CF_TRIMMED    (1<<3)   /* Component has been trimmed */
 
-extern int fmt_norm;
+#define CF_BITS       "\020\01TRUE\02PARSED\03CF_DATEFAB\04TRIMMED"
 
 /*
  * This structure defines one formatting instruction.
 
 /*
  * This structure defines one formatting instruction.
@@ -87,12 +89,13 @@ struct format {
 
 typedef char * (*formataddr_cb)(char *, char *);
 typedef char * (*concataddr_cb)(char *, char *);
 
 typedef char * (*formataddr_cb)(char *, char *);
 typedef char * (*concataddr_cb)(char *, char *);
-typedef void (*trace_cb)(void *, int, int, char *, char *);
+typedef void (*trace_cb)(void *, struct format *, int, char *, char *);
 
 struct fmt_callbacks {
     formataddr_cb      formataddr;
     concataddr_cb      concataddr;
 
 struct fmt_callbacks {
     formataddr_cb      formataddr;
     concataddr_cb      concataddr;
-    trace_cb           trace;
+    trace_cb           trace_func;
+    void *             trace_context;
 };
 
 /*
 };
 
 /*
@@ -264,6 +267,25 @@ int fmt_addcomptext(char *component, char *text);
 
 void fmt_appendcomp(int bucket, char *component, char *text);
 
 
 void fmt_appendcomp(int bucket, char *component, char *text);
 
+/*
+ * Iterate over the complete hash table of component structures.
+ *
+ * Arguments are:
+ *
+ * comp                - Pointer to the current component structure.  The next
+ *               component in the hash table after this component.  To
+ *               start (or restart) the iteration of the hash table
+ *               this argument should be NULL.
+ * bucket      - Pointer to hash bucket.  Will be managed by this function,
+ *               the caller should not modify this value.
+ *
+ * Returns the next component in the hash table.  This value should be
+ * passed into the next call to fmt_nextcomp().  Returns NULL at the end
+ * of the hash table.
+ */
+
+struct comp *fmt_nextcomp(struct comp *comp, unsigned int *bucket);
+
 /*
  * The implementation of the %(formataddr) function.  This is available for
  * programs to provide their own local implementation if they wish to do
 /*
  * The implementation of the %(formataddr) function.  This is available for
  * programs to provide their own local implementation if they wish to do