/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data
+ * Copyright (C) 1995-2012 Index Data
* See the file LICENSE for details.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#ifdef WIN32
#include <process.h>
#include "session.h"
#include <yaz/statserv.h>
#include <yaz/daemon.h>
+#include <yaz/yaz-iconv.h>
static IOCHAN pListener = NULL;
cp = p->content;
if (first)
{
- while(*cp && isspace(*cp))
+ while(*cp && yaz_isspace(*cp))
cp++;
if (*cp)
first = 0; /* reset if we got non-whitespace out */
}
/* remove trailing whitespace */
cp = strlen((const char *)str) + str;
- while (cp != str && isspace(cp[-1]))
+ while (cp != str && yaz_isspace(cp[-1]))
cp--;
*cp = '\0';
/* return resulting string */
#endif
#if YAZ_HAVE_XML2
-static struct gfs_server * gfs_server_new(void)
+static struct gfs_server * gfs_server_new(const char *id)
{
struct gfs_server *n = (struct gfs_server *)
nmem_malloc(gfs_nmem, sizeof(*n));
n->directory = 0;
n->docpath = 0;
n->stylesheet = 0;
+ n->id = nmem_strdup_null(gfs_nmem, id);
n->retrieval = yaz_retrieval_create();
return n;
}
else
yaz_log(YLOG_WARN, "Unknown attribute '%s' for server",
attr->name);
- gfs = *gfsp = gfs_server_new();
+ gfs = *gfsp = gfs_server_new(id);
gfs->server_node_ptr = ptr_server;
if (listenref)
{
}
else if (!strcmp((const char *) ptr->name, "cql2rpn"))
{
- gfs->cql_transform = cql_transform_open_fname(
- nmem_dup_xml_content(gfs_nmem, ptr->children)
- );
+ char *name = nmem_dup_xml_content(gfs_nmem, ptr->children);
+ gfs->cql_transform = cql_transform_open_fname(name);
+ if (!gfs->cql_transform)
+ {
+ yaz_log(YLOG_FATAL|YLOG_ERRNO,
+ "open CQL transform file '%s'", name);
+ exit(1);
+ }
}
else if (!strcmp((const char *) ptr->name, "ccl2rpn"))
{
fprintf(stderr, "Usage: %s [ -a <pdufile> -v <loglevel>"
" -l <logfile> -u <user> -c <config> -t <minutes>"
" -k <kilobytes> -d <daemon> -p <pidfile> -C certfile"
- " -ziDST1 -m <time-format> -w <directory> <listener-addr>... ]\n", me);
+ " -zKiDST1 -m <time-format> -w <directory> <listener-addr>... ]\n", me);
return 1;
}
}