projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 5.7.2
[yaz-moved-to-github.git]
/
util
/
cclsh.c
diff --git
a/util/cclsh.c
b/util/cclsh.c
index
322d515
..
419fcb7
100644
(file)
--- a/
util/cclsh.c
+++ b/
util/cclsh.c
@@
-1,9
+1,10
@@
-/*
- * Copyright (C) 1995-2008, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- *
- * $Id: cclsh.c,v 1.9 2008-01-09 21:32:28 adam Exp $
*/
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
@@
-13,7
+14,7
@@
#include <yaz/options.h>
#if HAVE_READLINE_READLINE_H
#include <yaz/options.h>
#if HAVE_READLINE_READLINE_H
-#include <readline/readline.h>
+#include <readline/readline.h>
#endif
#if HAVE_READLINE_HISTORY_H
#include <readline/history.h>
#endif
#if HAVE_READLINE_HISTORY_H
#include <readline/history.h>
@@
-43,8
+44,8
@@
int main(int argc, char **argv)
WRBUF q_wrbuf = 0;
prog = *argv;
WRBUF q_wrbuf = 0;
prog = *argv;
- bibset = ccl_qual_mk();
-
+ bibset = ccl_qual_mk();
+
while ((ret = options("db:x:", argv, argc, &arg)) != -2)
{
switch(ret)
while ((ret = options("db:x:", argv, argc, &arg)) != -2)
{
switch(ret)
@@
-96,11
+97,11
@@
int main(int argc, char **argv)
CCL_parser cclp = ccl_parser_create(bibset);
int error;
struct ccl_rpn_node *rpn;
CCL_parser cclp = ccl_parser_create(bibset);
int error;
struct ccl_rpn_node *rpn;
-
+
rpn = ccl_parser_find_str(cclp, wrbuf_cstr(q_wrbuf));
rpn = ccl_parser_find_str(cclp, wrbuf_cstr(q_wrbuf));
-
+
error = ccl_parser_get_error(cclp, 0);
error = ccl_parser_get_error(cclp, 0);
-
+
if (error)
{
printf("%s\n", ccl_err_msg(error));
if (error)
{
printf("%s\n", ccl_err_msg(error));
@@
-140,19
+141,19
@@
int main(int argc, char **argv)
}
strcpy(buf,line_in);
free(line_in);
}
strcpy(buf,line_in);
free(line_in);
-#else
+#else
printf("CCLSH>"); fflush(stdout);
if (!fgets(buf, 999, stdin))
break;
printf("CCLSH>"); fflush(stdout);
if (!fgets(buf, 999, stdin))
break;
-#endif
+#endif
for (i = 0; i<1; i++)
{
CCL_parser cclp = ccl_parser_create(bibset);
int pos;
for (i = 0; i<1; i++)
{
CCL_parser cclp = ccl_parser_create(bibset);
int pos;
-
+
rpn = ccl_parser_find_str(cclp, buf);
rpn = ccl_parser_find_str(cclp, buf);
-
+
error = ccl_parser_get_error(cclp, &pos);
if (error)
error = ccl_parser_get_error(cclp, &pos);
if (error)
@@
-173,7
+174,7
@@
int main(int argc, char **argv)
printf("Second:\n");
ccl_pr_tree(rpn, stdout);
printf("\n");
printf("Second:\n");
ccl_pr_tree(rpn, stdout);
printf("\n");
-
+
for (idx = 0; ; idx++)
{
const char *qname;
for (idx = 0; ; idx++)
{
const char *qname;
@@
-181,7
+182,7
@@
int main(int argc, char **argv)
if (!ccl_stop_words_info(csw, idx,
&qname, &term))
break;
if (!ccl_stop_words_info(csw, idx,
&qname, &term))
break;
- printf("Removed from %s: %s\n",
+ printf("Removed from %s: %s\n",
qname ? qname : "none", term);
}
}
qname ? qname : "none", term);
}
}
@@
-200,6
+201,7
@@
int main(int argc, char **argv)
/*
* Local variables:
* c-basic-offset: 4
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab