/* This file is part of the Zebra server.
- Copyright (C) 1994-2009 Index Data
+ Copyright (C) Index Data
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
strcpy(dst+j, env_val);
j += strlen(env_val);
}
- else if (src[i] == ':' && src[i+1] == '-')
+ else if (src[i] == ':' && src[i+1] == '-')
{
i = i + 2;
while (src[i] && !strchr("}\n\r\f", src[i]))
int lineno = 1;
WRBUF wrbuf_val = wrbuf_alloc();
yaz_tok_cfg_t yt = yaz_tok_cfg_create();
-
+
while ((line = fgets(fr_buf, sizeof(fr_buf)-1, fr)))
{
yaz_tok_parse_t tp = yaz_tok_parse_buf(yt, line);
int t = yaz_tok_move(tp);
-
+
if (t == YAZ_TOK_STRING)
{
size_t sz;
{
/* name: value */
t = yaz_tok_move(tp);
-
+
if (t != YAZ_TOK_STRING)
{
resp->value = xstrdup("");
}
lineno++;
yaz_tok_parse_destroy(tp);
- }
+ }
fclose(fr);
yaz_tok_cfg_destroy(yt);
wrbuf_destroy(wrbuf_val);
if (prefix)
{
char rname[128];
-
+
if (strlen(name) + strlen(prefix) >= (sizeof(rname)-2))
return 0;
strcpy(rname, prefix);
if (!r)
return 0;
-
+
v = res_get(r->over_res, name);
if (v)
return v;
struct res_entry *re;
int l = 0;
int no = 0;
-
+
if (!r)
return 0;
no = res_trav(r->over_res, prefix, p, f);
re->value = xstrdup_env(value);
}
-void res_dump(Res r, int level)
+void res_dump(Res r, int level)
{
struct res_entry *re;
-
+
if (!r)
return;
-
+
for (re = r->first; re; re=re->next) {
printf("%*s - %s:='%s'\n",level * 4,"",re->name,re->value);
}
-
+
if (r->def_res) {
printf("%*s DEF ",level * 4,"");
res_dump(r->def_res, level + 1);
}
-
+
if (r->over_res) {
printf("%*s OVER ",level * 4,"");
res_dump(r->over_res, level + 1);
{
struct res_entry *e_i;
int errors = 0;
-
+
for (e_i = r_i->first; e_i; e_i = e_i->next)
{
struct res_entry *e_v;
prefix_allowed = 1;
if (strchr(e_v->value, 's'))
suffix_allowed = 1;
-
+
first_dot = strchr(name, '.');
if (prefix_allowed && first_dot)
{