30 #include <yaz/snprintf.h>
33 #define DIRS_MAX_PATH 1024
64 if (info[0] ==
sizeof(entry->
sysno)+
sizeof(entry->
mtime))
68 memcpy(&entry->
sysno, info+1,
sizeof(entry->
sysno));
69 memcpy(&entry->
mtime, info+1+
sizeof(entry->
sysno),
70 sizeof(entry->
mtime));
73 else if (info[0] ==
sizeof(entry->
mtime))
77 memcpy(&entry->
mtime, info+1,
sizeof(entry->
mtime));
86 int before = 0, after;
88 yaz_log(YLOG_DEBUG,
"dirs_open %s", rep);
89 p = (
struct dirs_info *) xmalloc(
sizeof(*p));
100 yaz_log(YLOG_DEBUG,
"dirs_open first scan");
111 p = (
struct dirs_info *) xmalloc(
sizeof(*p));
122 if (info && info[0] ==
sizeof(entry->
sysno)+
sizeof(entry->
mtime))
126 memcpy(&entry->
sysno, info+1,
sizeof(entry->
sysno));
127 memcpy(&entry->
mtime, info+1+
sizeof(entry->
sysno),
128 sizeof(entry->
mtime));
136 int before = 0, after = p->
no_max+1;
140 yaz_log(YLOG_DEBUG,
"dirs_read %d. returns %s", p->
no_read,
158 yaz_log(YLOG_DEBUG,
"dirs_read rescan %s", p->
nextpath);
175 yaz_log(YLOG_DEBUG,
"dirs_mkdir %s",
path);
185 yaz_log(YLOG_DEBUG,
"dirs_rmdir %s",
path);
196 yaz_log(YLOG_DEBUG,
"dirs_add %s",
path);
208 yaz_log(YLOG_DEBUG,
"dirs_del %s",
path);
char * dict_lookup(Dict dict, const char *p)
lookup item in dictionary
int dict_delete(Dict dict, const char *p)
deletes item from dictionary
int dict_insert(Dict dict, const char *p, int userlen, void *userinfo)
insert item into dictionary
int dict_scan(Dict dict, char *str, int *before, int *after, void *client, int(*f)(char *name, const char *info, int pos, void *client))
dictionary scan
struct dirs_info * dirs_fopen(Dict dict, const char *path, int rw)
void dirs_mkdir(struct dirs_info *p, const char *src, time_t mtime)
static int dirs_client_proc(char *name, const char *info, int pos, void *client)
void dirs_rmdir(struct dirs_info *p, const char *src)
struct dirs_entry * dirs_last(struct dirs_info *p)
void dirs_add(struct dirs_info *p, const char *src, zint sysno, time_t mtime)
void dirs_free(struct dirs_info **pp)
struct dirs_entry * dirs_read(struct dirs_info *p)
struct dirs_info * dirs_open(Dict dict, const char *rep, int rw)
void dirs_del(struct dirs_info *p, const char *src)
char nextpath[DIRS_MAX_PATH]
char prefix[DIRS_MAX_PATH]
struct dirs_entry * last_entry
struct dirs_entry * entries