From: Adam Dickmeiss Date: Wed, 15 Feb 1995 17:42:16 +0000 (+0000) Subject: Minor changes of the api of this module. FILE* argument added X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=68f891ca4abf2ebc80ab70f95a036b39edb9320c;p=egate.git Minor changes of the api of this module. FILE* argument added to ccl_pr_tree. --- diff --git a/ccl/cclptree.c b/ccl/cclptree.c index 0f533e2..4a4a5fc 100644 --- a/ccl/cclptree.c +++ b/ccl/cclptree.c @@ -2,7 +2,11 @@ * Europagate, 1995 * * $Log: cclptree.c,v $ - * Revision 1.2 1995/02/14 19:55:11 adam + * Revision 1.3 1995/02/15 17:42:16 adam + * Minor changes of the api of this module. FILE* argument added + * to ccl_pr_tree. + * + * Revision 1.2 1995/02/14 19:55:11 adam * Header files ccl.h/cclp.h are gone! They have been merged an * moved to ../include/ccl.h. * Node kind(s) in ccl_rpn_node have changed names. @@ -18,50 +22,50 @@ #include -void ccl_pr_tree (struct ccl_rpn_node *rpn) +void ccl_pr_tree (struct ccl_rpn_node *rpn, FILE *fd_out) { switch (rpn->kind) { case CCL_RPN_TERM: - printf ("\"%s\"", rpn->u.t.term); + fprintf (fd_out, "\"%s\"", rpn->u.t.term); if (rpn->u.t.attr_list) { struct ccl_rpn_attr *attr; for (attr = rpn->u.t.attr_list; attr; attr = attr->next) - printf (" %d=%d", attr->type, attr->value); + fprintf (fd_out, " %d=%d", attr->type, attr->value); } break; case CCL_RPN_AND: - printf ("("); - ccl_pr_tree (rpn->u.p[0]); - printf (") and ("); - ccl_pr_tree (rpn->u.p[1]); - printf (")"); + fprintf (fd_out, "("); + ccl_pr_tree (rpn->u.p[0], fd_out); + fprintf (fd_out, ") and ("); + ccl_pr_tree (rpn->u.p[1], fd_out); + fprintf (fd_out, ")"); break; case CCL_RPN_OR: - printf ("("); - ccl_pr_tree (rpn->u.p[0]); - printf (") or ("); - ccl_pr_tree (rpn->u.p[1]); - printf (")"); + fprintf (fd_out, "("); + ccl_pr_tree (rpn->u.p[0], fd_out); + fprintf (fd_out, ") or ("); + ccl_pr_tree (rpn->u.p[1], fd_out); + fprintf (fd_out, ")"); break; case CCL_RPN_NOT: - printf ("("); - ccl_pr_tree (rpn->u.p[0]); - printf (") not ("); - ccl_pr_tree (rpn->u.p[1]); - printf (")"); + fprintf (fd_out, "("); + ccl_pr_tree (rpn->u.p[0], fd_out); + fprintf (fd_out, ") not ("); + ccl_pr_tree (rpn->u.p[1], fd_out); + fprintf (fd_out, ")"); break; case CCL_RPN_SET: - printf ("set=%s", rpn->u.setname); + fprintf (fd_out, "set=%s", rpn->u.setname); break; case CCL_RPN_PROX: - printf ("("); - ccl_pr_tree (rpn->u.p[0]); - printf (") prox ("); - ccl_pr_tree (rpn->u.p[1]); - printf (")"); + fprintf (fd_out, "("); + ccl_pr_tree (rpn->u.p[0], fd_out); + fprintf (fd_out, ") prox ("); + ccl_pr_tree (rpn->u.p[1], fd_out); + fprintf (fd_out, ")"); break; default: assert (0); diff --git a/ccl/cclsh.c b/ccl/cclsh.c index 1e7e976..5d2eff3 100644 --- a/ccl/cclsh.c +++ b/ccl/cclsh.c @@ -2,7 +2,11 @@ * Europagate 1995 * * $Log: cclsh.c,v $ - * Revision 1.6 1995/02/14 19:55:13 adam + * Revision 1.7 1995/02/15 17:42:16 adam + * Minor changes of the api of this module. FILE* argument added + * to ccl_pr_tree. + * + * Revision 1.6 1995/02/14 19:55:13 adam * Header files ccl.h/cclp.h are gone! They have been merged an * moved to ../include/ccl.h. * Node kind(s) in ccl_rpn_node have changed names. @@ -103,7 +107,7 @@ int main (int argc, char **argv) else { assert (rpn); - ccl_pr_tree (rpn); + ccl_pr_tree (rpn, stdout); putchar ('\n'); } } diff --git a/ccl/ccltoken.c b/ccl/ccltoken.c index 26b0052..39083b1 100644 --- a/ccl/ccltoken.c +++ b/ccl/ccltoken.c @@ -2,7 +2,11 @@ * Europagate, 1995 * * $Log: ccltoken.c,v $ - * Revision 1.2 1995/02/14 19:55:13 adam + * Revision 1.3 1995/02/15 17:42:16 adam + * Minor changes of the api of this module. FILE* argument added + * to ccl_pr_tree. + * + * Revision 1.2 1995/02/14 19:55:13 adam * Header files ccl.h/cclp.h are gone! They have been merged an * moved to ../include/ccl.h. * Node kind(s) in ccl_rpn_node have changed names. @@ -29,10 +33,10 @@ static int strin (const char *s, const char *cset) return 0; } -char *ccl_token_and = "and"; -char *ccl_token_or = "or"; -char *ccl_token_not = "not"; -char *ccl_token_set = "set"; +const char *ccl_token_and = "and"; +const char *ccl_token_or = "or"; +const char *ccl_token_not = "not"; +const char *ccl_token_set = "set"; struct ccl_token *ccl_tokenize (const char *command) {