+
+static void repositoryExtractG (ZebraHandle zh, const char *path,
+ int deleteFlag)
+{
+ if (!strcmp(path, "") || !strcmp(path, "-"))
+ {
+ char src[1024];
+
+ while (scanf ("%1020s", src) == 1)
+ repositoryExtract (zh, deleteFlag, src);
+ }
+ else
+ repositoryExtract (zh, deleteFlag, path);
+}
+
+#if 0
+static int dump_file_dict_func(char *name, const char *info, int pos,
+ void *client)
+{
+ yaz_log(YLOG_LOG, "%s", name);
+ return 0;
+}
+static void dump_file_dict(Dict dict)
+{
+ int before = 10;
+ int after = 1000;
+ char term[1000];
+
+ strcpy(term, "0");
+ dict_scan (dict, term, &before, &after, 0, dump_file_dict_func);
+}
+#endif
+
+void repositoryUpdate (ZebraHandle zh, const char *path)
+{
+ assert (path);
+ if (zh->m_record_id && !strcmp (zh->m_record_id, "file"))
+ {
+ Dict dict;
+ if (!(dict = dict_open_res (zh->reg->bfs, FMATCH_DICT, 50,
+ zh->m_flag_rw, 0, zh->res)))
+ {
+ yaz_log (YLOG_FATAL, "dict_open fail of %s", FMATCH_DICT);
+ return ;
+ }
+ if (!strcmp(path, "") || !strcmp(path, "-"))
+ {
+ char src[1024];
+ while (scanf ("%s", src) == 1)
+ fileUpdate (zh, dict, src);
+ }
+ else
+ fileUpdate (zh, dict, path);
+#if 0
+ dump_file_dict(dict);
+#endif
+ dict_close (dict);
+
+ }
+ else
+ repositoryExtractG (zh, path, 0);
+}
+
+void repositoryDelete (ZebraHandle zh, const char *path)
+{
+ assert (path);
+ repositoryExtractG (zh, path, 1);
+}
+