X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fupdate_path.c;h=238d5b8230da6bb24a99553dfc0e52777c9e881d;hp=9cc66322e506d267af3e99144d7e188bb8914bf5;hb=c3ff843e467932c6027a8b3b2ebda7b44612447e;hpb=89d16cf15eda0e4802d18b8ad09bd3653508ebfc diff --git a/index/update_path.c b/index/update_path.c index 9cc6632..238d5b8 100644 --- a/index/update_path.c +++ b/index/update_path.c @@ -1,5 +1,5 @@ /* 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 @@ -17,6 +17,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -49,7 +52,7 @@ static void repositoryExtractR(ZebraHandle zh, char *rep, int level, rep[rep_len] = '/'; else --rep_len; - + for (i=0; e[i].name; i++) { char *ecp; @@ -84,19 +87,19 @@ void repositoryShow(ZebraHandle zh, const char *path) yaz_log(YLOG_FATAL, "dict_open fail of %s", FMATCH_DICT); return; } - + strncpy(src, path, sizeof(src)-1); src[sizeof(src)-1]='\0'; src_len = strlen(src); - + if (src_len && src[src_len-1] != '/') { src[src_len] = '/'; src[++src_len] = '\0'; } - + di = dirs_open(dict, src, zh->m_flag_rw); - + while ((dst = dirs_read(di))) yaz_log(YLOG_LOG, "%s", dst->path); dirs_free(&di); @@ -137,13 +140,13 @@ static void repositoryExtract(ZebraHandle zh, } -ZEBRA_RES zebra_update_from_path(ZebraHandle zh, const char *path, +ZEBRA_RES zebra_update_from_path(ZebraHandle zh, const char *path, enum zebra_recctrl_action_t action) { if (!strcmp(path, "") || !strcmp(path, "-")) { char src[1024]; - + while (scanf("%1020s", src) == 1) repositoryExtract(zh, src, action); } @@ -155,6 +158,7 @@ ZEBRA_RES zebra_update_from_path(ZebraHandle zh, const char *path, /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab