-/* $Id: dirs.c,v 1.19 2002-08-17 07:59:03 adam Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
- Index Data Aps
+/* $Id: dirs.c,v 1.28 2007-10-29 09:25:40 adam Exp $
+ Copyright (C) 1995-2007
+ Index Data ApS
-along with Zebra; see the file LICENSE.zebra. If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
-static int dirs_client_proc (char *name, const char *info, int pos,
+static int dirs_client_proc(char *name, const char *info, int pos,
- memcpy (&entry->sysno, info+1, sizeof(entry->sysno));
- memcpy (&entry->mtime, info+1+sizeof(entry->sysno),
+ memcpy(&entry->sysno, info+1, sizeof(entry->sysno));
+ memcpy(&entry->mtime, info+1+sizeof(entry->sysno),
- logf (LOG_DEBUG, "dirs_open %s", rep);
- p = (struct dirs_info *) xmalloc (sizeof (*p));
+ yaz_log(YLOG_DEBUG, "dirs_open %s", rep);
+ p = (struct dirs_info *) xmalloc(sizeof(*p));
- xmalloc (sizeof(*p->entries) * (p->no_max));
- logf (LOG_DEBUG, "dirs_open first scan");
- dict_scan (p->dict, p->nextpath, &before, &after, p, dirs_client_proc);
+ xmalloc(sizeof(*p->entries) * (p->no_max));
+ yaz_log(YLOG_DEBUG, "dirs_open first scan");
+ dict_scan(p->dict, p->nextpath, &before, &after, p, dirs_client_proc);
- memcpy (&entry->sysno, info+1, sizeof(entry->sysno));
- memcpy (&entry->mtime, info+1+sizeof(entry->sysno),
+ memcpy(&entry->sysno, info+1, sizeof(entry->sysno));
+ memcpy(&entry->mtime, info+1+sizeof(entry->sysno),
{
int before = 0, after = p->no_max+1;
if (p->no_read < p->no_cur)
{
{
int before = 0, after = p->no_max+1;
if (p->no_read < p->no_cur)
{
- logf (LOG_DEBUG, "dirs_read %d. returns %s", p->no_read,
+ yaz_log(YLOG_DEBUG, "dirs_read %d. returns %s", p->no_read,
- logf (LOG_DEBUG, "dirs_read rescan %s", p->nextpath);
- dict_scan (p->dict, p->nextpath, &before, &after, p, dirs_client_proc);
+ yaz_log(YLOG_DEBUG, "dirs_read rescan %s", p->nextpath);
+ dict_scan(p->dict, p->nextpath, &before, &after, p, dirs_client_proc);
if (p->no_read <= p->no_cur)
return p->last_entry = p->entries;
return p->last_entry = NULL;
}
if (p->no_read <= p->no_cur)
return p->last_entry = p->entries;
return p->last_entry = NULL;
}
- sprintf (path, "%s%s", p->prefix, src);
- logf (LOG_DEBUG, "dirs_mkdir %s", path);
+ sprintf(path, "%s%s", p->prefix, src);
+ yaz_log(YLOG_DEBUG, "dirs_mkdir %s", path);
- dict_insert (p->dict, path, sizeof(mtime), &mtime);
+ dict_insert(p->dict, path, sizeof(mtime), &mtime);
- sprintf (path, "%s%s", p->prefix, src);
- logf (LOG_DEBUG, "dirs_rmdir %s", path);
+ sprintf(path, "%s%s", p->prefix, src);
+ yaz_log(YLOG_DEBUG, "dirs_rmdir %s", path);
-void dirs_add (struct dirs_info *p, const char *src, int sysno, time_t mtime)
+void dirs_add(struct dirs_info *p, const char *src, zint sysno, time_t mtime)
- sprintf (path, "%s%s", p->prefix, src);
- logf (LOG_DEBUG, "dirs_add %s", path);
- memcpy (info, &sysno, sizeof(sysno));
- memcpy (info+sizeof(sysno), &mtime, sizeof(mtime));
+ sprintf(path, "%s%s", p->prefix, src);
+ yaz_log(YLOG_DEBUG, "dirs_add %s", path);
+ memcpy(info, &sysno, sizeof(sysno));
+ memcpy(info+sizeof(sysno), &mtime, sizeof(mtime));
- dict_insert (p->dict, path, sizeof(sysno)+sizeof(mtime), info);
+ dict_insert(p->dict, path, sizeof(sysno)+sizeof(mtime), info);
- sprintf (path, "%s%s", p->prefix, src);
- logf (LOG_DEBUG, "dirs_del %s", path);
+ sprintf(path, "%s%s", p->prefix, src);
+ yaz_log(YLOG_DEBUG, "dirs_del %s", path);