X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/582d5e802ceb8e0c7f0dc5b83fdbf2a62fc10fb3..4974d09cc659e2859fcf916ad020628c9695e2f8:/uip/picksbr.c diff --git a/uip/picksbr.c b/uip/picksbr.c index c0799bd9..ca330b96 100644 --- a/uip/picksbr.c +++ b/uip/picksbr.c @@ -62,7 +62,7 @@ DEFINE_SWITCH_ARRAY(PARSE, parswit); #define STAR 01 -#define LBSIZE 1024 +#define LBSIZE NMH_BUFSIZ #define ESIZE 1024 @@ -180,13 +180,19 @@ static struct nexus *parse(void); static struct nexus *nexp1(void); static struct nexus *nexp2(void); static struct nexus *nexp3(void); -static struct nexus *newnexus(int (*)()); +static struct nexus *newnexus(int (*)(struct nexus *n, + FILE *fp, int msgnum, long start, long stop)); -static int ORaction(); -static int ANDaction(); -static int NOTaction(); -static int GREPaction(); -static int TWSaction(); +static int ORaction(struct nexus *n, FILE *fp, int msgnum, + long start, long stop); +static int ANDaction(struct nexus *n, FILE *fp, int msgnum, + long start, long stop); +static int NOTaction(struct nexus *n, FILE *fp, int msgnum, + long start, long stop); +static int GREPaction(struct nexus *n, FILE *fp, int msgnum, + long start, long stop); +static int TWSaction(struct nexus *n, FILE *fp, int msgnum, + long start, long stop); int @@ -198,7 +204,7 @@ pcompile (char **vec, char *date) talked = 0; if ((head = parse ()) == NULL) - return (talked ? 0 : 1); + return !talked; if (*argp) { inform("%s unexpected", *argp); @@ -453,7 +459,8 @@ nexp3 (void) static struct nexus * -newnexus (int (*action)()) +newnexus(int (*action)(struct nexus *n, FILE *fp, int msgnum, + long start, long stop)) { struct nexus *p; @@ -463,15 +470,6 @@ newnexus (int (*action)()) } -#define args(a) a, fp, msgnum, start, stop -#define params args (n) -#define plist \ - struct nexus *n; \ - FILE *fp; \ - int msgnum; \ - long start, \ - stop; - int pmatches (FILE *fp, int msgnum, long start, long stop, int debug) { @@ -481,7 +479,7 @@ pmatches (FILE *fp, int msgnum, long start, long stop, int debug) if (!talked++ && debug) PRaction (head, 0); - return (*head->n_action) (args (head)); + return (*head->n_action)(head, fp, msgnum, start, stop); } @@ -527,30 +525,27 @@ PRaction (struct nexus *n, int level) static int -ORaction (params) -plist +ORaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop) { - if ((*n->n_L_child->n_action) (args (n->n_L_child))) + if ((*n->n_L_child->n_action)(n->n_L_child, fp, msgnum, start, stop)) return 1; - return (*n->n_R_child->n_action) (args (n->n_R_child)); + return (*n->n_R_child->n_action)(n->n_R_child, fp, msgnum, start, stop); } static int -ANDaction (params) -plist +ANDaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop) { - if (!(*n->n_L_child->n_action) (args (n->n_L_child))) + if (!(*n->n_L_child->n_action)(n->n_L_child, fp, msgnum, start, stop)) return 0; - return (*n->n_R_child->n_action) (args (n->n_R_child)); + return (*n->n_R_child->n_action)(n->n_R_child, fp, msgnum, start, stop); } static int -NOTaction (params) -plist +NOTaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop) { - return (!(*n->n_L_child->n_action) (args (n->n_L_child))); + return (!(*n->n_L_child->n_action)(n->n_L_child, fp, msgnum, start, stop)); } @@ -645,8 +640,7 @@ cerror: ; static int -GREPaction (params) -plist +GREPaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop) { int c, body, lf; long pos = start; @@ -925,12 +919,11 @@ tws_special (char *ap) static int -TWSaction (params) -plist +TWSaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop) { int state; char *bp; - char buf[BUFSIZ], name[NAMESZ]; + char buf[NMH_BUFSIZ], name[NAMESZ]; struct tws *tw; m_getfld_state_t gstate = 0; NMH_UNUSED (stop);