X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ccl%2Fcclsh.c;h=d2aaf46b8fe62377e5eccfbda9a13d937a9b0322;hb=45f8f517ebe10930067907c19a56557afd779826;hp=6a69c9d640b30812db067d5e735b111f18e6c759;hpb=3888e88cde70f36851544ab7acc04e0943470ec6;p=yaz-moved-to-github.git diff --git a/ccl/cclsh.c b/ccl/cclsh.c index 6a69c9d..d2aaf46 100644 --- a/ccl/cclsh.c +++ b/ccl/cclsh.c @@ -45,7 +45,21 @@ * Europagate 1995 * * $Log: cclsh.c,v $ - * Revision 1.2 1996-10-11 15:00:25 adam + * Revision 1.6 2000-01-31 13:15:21 adam + * Removed uses of assert(3). Cleanup of ODR. CCL parser update so + * that some characters are not surrounded by spaces in resulting term. + * ILL-code updates. + * + * Revision 1.5 1999/12/16 23:36:19 adam + * Implemented ILL protocol. Minor updates ASN.1 compiler. + * + * Revision 1.4 1999/03/31 11:15:37 adam + * Fixed memory leaks in ccl_find_str and ccl_qual_rm. + * + * Revision 1.3 1997/04/30 08:52:07 quinn + * Null + * + * Revision 1.2 1996/10/11 15:00:25 adam * CCL parser from Europagate Email gateway 1.0. * * Revision 1.11 1995/05/16 09:39:27 adam @@ -87,9 +101,8 @@ #include #include -#include -#include +#include static int debug = 0; static char *prog; @@ -108,9 +121,6 @@ int main (int argc, char **argv) { switch (argv[0][1]) { - case 'c': - ccl_case_sensitive = 0; - break; case 'd': debug = 1; break; @@ -152,23 +162,30 @@ int main (int argc, char **argv) while (1) { char buf[80]; - int error, pos; + int i, error, pos; struct ccl_rpn_node *rpn; printf ("CCLSH>"); fflush (stdout); if (!fgets (buf, 79, stdin)) break; - rpn = ccl_find_str (bibset, buf, &error, &pos); - if (error) - { - printf ("%*s^ - ", 6+pos, " "); - printf ("%s\n", ccl_err_msg (error)); - } - else + for (i = 0; i<1; i++) { - assert (rpn); - ccl_pr_tree (rpn, stdout); - putchar ('\n'); + rpn = ccl_find_str (bibset, buf, &error, &pos); + if (error) + { + printf ("%*s^ - ", 6+pos, " "); + printf ("%s\n", ccl_err_msg (error)); + } + else + { + if (rpn && i == 0) + { + ccl_pr_tree (rpn, stdout); + putchar ('\n'); + } + } + if (rpn) + ccl_rpn_delete(rpn); } } putchar ('\n');