X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=h%2Ffmt_scan.h;h=ea348987d83efd102d1960595324a787ffdbbefb;hp=9872e09c15d459977eeacfb1a5ffc57163efdfd4;hb=a485ed478abbd599d8c9aab48934e7a26733ecb1;hpb=f480c03187724e54e5391ee61b810827da319a6c diff --git a/h/fmt_scan.h b/h/fmt_scan.h index 9872e09..ea34898 100644 --- a/h/fmt_scan.h +++ b/h/fmt_scan.h @@ -1,4 +1,3 @@ - /* * fmt_scan.h -- definitions for fmt_scan() */ @@ -13,15 +12,15 @@ * processing once. e.g., parse an address.). */ struct comp { - char *c_name; /* component name (in lower case) */ - char *c_text; /* component text (if found) */ - struct comp *c_next; /* hash chain linkage */ - short c_flags; /* misc. flags (from fmt_scan) */ - short c_type; /* type info (from fmt_compile) */ - union { - struct tws *c_u_tws; - struct mailname *c_u_mn; - } c_un; + char *c_name; /* component name (in lower case) */ + char *c_text; /* component text (if found) */ + struct comp *c_next; /* hash chain linkage */ + short c_flags; /* misc. flags (from fmt_scan) */ + short c_type; /* type info (from fmt_compile) */ + union { + struct tws *c_u_tws; + struct mailname *c_u_mn; + } c_un; }; #define c_tws c_un.c_u_tws @@ -30,15 +29,15 @@ struct comp { /* * c_type bits */ -#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 */ /* * c_flags bits */ -#define CF_TRUE (1<<0) /* usually means component is present */ -#define CF_PARSED (1<<1) /* address/date has been parsed */ -#define CF_DATEFAB (1<<2) /* datefield fabricated */ +#define CF_TRUE (1<<0) /* usually means component is present */ +#define CF_PARSED (1<<1) /* address/date has been parsed */ +#define CF_DATEFAB (1<<2) /* datefield fabricated */ extern int fmt_norm; @@ -47,38 +46,38 @@ extern int fmt_norm; */ extern struct comp *wantcomp[128]; -/* +/* * Hash function for component name. The function should be * case independent and probably shouldn't involve a routine * call. This function is pretty good but will not work on - * single character component names. + * single character component names. */ -#define CHASH(nm) (((((nm)[0]) - ((nm)[1])) & 0x1f) + (((nm)[2]) & 0x5f)) +#define CHASH(nm) (((((nm)[0]) - ((nm)[1])) & 0x1f) + (((nm)[2]) & 0x5f)) /* * Find a component in the hash table. */ #define FINDCOMP(comp,name) \ for (comp = wantcomp[CHASH(name)]; \ - comp && strcmp(comp->c_name,name); \ - comp = comp->c_next) ; + comp && strcmp(comp->c_name,name); \ + comp = comp->c_next) ; /* * This structure defines one formatting instruction. */ struct format { - unsigned char f_type; - char f_fill; - short f_width; /* output field width */ - union { - struct comp *f_u_comp; /* associated component */ - char *f_u_text; /* literal text */ - char f_u_char; /* literal character */ - int f_u_value; /* literal value */ - } f_un; + unsigned char f_type; + char f_fill; + short f_width; /* output field width */ + union { + struct comp *f_u_comp; /* associated component */ + char *f_u_text; /* literal text */ + char f_u_char; /* literal character */ + int f_u_value; /* literal value */ + } f_un; }; -#define f_skip f_width /* instr to skip (false "if") */ +#define f_skip f_width /* instr to skip (false "if") */ #define f_comp f_un.f_u_comp #define f_text f_un.f_u_text