of unused/undefined functions.
-/* $Id: api.h,v 1.40 2006-11-14 08:12:07 adam Exp $
+/* $Id: api.h,v 1.41 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
int len; /* length */
oid_value format; /* record syntax */
char *base;
- SYSNO sysno;
+ zint sysno;
int score;
} ZebraRetrievalRecord;
YAZ_EXPORT
ZEBRA_RES zebra_insert_record(ZebraHandle zh,
const char *recordType,
- SYSNO *sysno, const char *match,
+ zint *sysno, const char *match,
const char *fname,
const char *buf, int buf_size,
int force_update);
YAZ_EXPORT
ZEBRA_RES zebra_update_record(ZebraHandle zh,
const char *recordType,
- SYSNO *sysno, const char *match,
+ zint *sysno, const char *match,
const char *fname,
const char *buf, int buf_size,
int force_update);
YAZ_EXPORT
ZEBRA_RES zebra_delete_record(ZebraHandle zh,
const char *recordType,
- SYSNO *sysno, const char *match, const char *fname,
+ zint *sysno, const char *match,
+ const char *fname,
const char *buf, int buf_size,
int force_update);
-/* $Id: util.h,v 1.10 2006-11-14 08:12:07 adam Exp $
+/* $Id: util.h,v 1.11 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
#define ZEBRA_FAIL -1
#define ZEBRA_OK 0
-typedef zint SYSNO;
+YAZ_EXPORT zint atoi_zn(const char *buf, zint len);
-YAZ_EXPORT
-zint atoi_zn (const char *buf, zint len);
+YAZ_EXPORT void zebra_zint_encode(char **dst, zint pos);
-YAZ_EXPORT
-void zebra_zint_encode(char **dst, zint pos);
+YAZ_EXPORT void zebra_zint_decode(const char **src, zint *pos);
-YAZ_EXPORT
-void zebra_zint_decode(const char **src, zint *pos);
-
-YAZ_EXPORT
-void zebra_exit(const char *msg);
+YAZ_EXPORT void zebra_exit(const char *msg);
YAZ_END_CDECL
-/* $Id: sortidx.h,v 1.10 2006-08-14 10:40:12 adam Exp $
+/* $Id: sortidx.h,v 1.11 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
typedef struct sortIdx *SortIdx;
-SortIdx sortIdx_open (BFiles bfs, int write_flag);
-void sortIdx_close (SortIdx si);
-int sortIdx_type (SortIdx si, int type);
-void sortIdx_sysno (SortIdx si, SYSNO sysno);
-void sortIdx_add (SortIdx si, const char *buf, int len);
-void sortIdx_read (SortIdx si, char *buf);
+SortIdx sortIdx_open(BFiles bfs, int write_flag);
+void sortIdx_close(SortIdx si);
+int sortIdx_type(SortIdx si, int type);
+void sortIdx_sysno(SortIdx si, zint sysno);
+void sortIdx_add(SortIdx si, const char *buf, int len);
+void sortIdx_read(SortIdx si, char *buf);
YAZ_END_CDECL
-/* $Id: dirs.c,v 1.25 2006-08-14 10:40:15 adam Exp $
+/* $Id: dirs.c,v 1.26 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
dict_delete (p->dict, path);
}
-void dirs_add (struct dirs_info *p, const char *src, SYSNO sysno, time_t mtime)
+void dirs_add (struct dirs_info *p, const char *src, zint sysno, time_t mtime)
{
char path[DIRS_MAX_PATH];
char info[16];
-/* $Id: extract.c,v 1.240 2006-11-21 17:48:08 adam Exp $
+/* $Id: extract.c,v 1.241 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
}
}
-static void extract_flushRecordKeys (ZebraHandle zh, SYSNO sysno,
- int cmd, zebra_rec_keys_t reckeys,
- zint staticrank);
-static void extract_flushSortKeys (ZebraHandle zh, SYSNO sysno,
- int cmd, zebra_rec_keys_t skp);
+static void extract_flush_record_keys(ZebraHandle zh, zint sysno,
+ int cmd, zebra_rec_keys_t reckeys,
+ zint staticrank);
+static void extract_flush_sort_keys(ZebraHandle zh, zint sysno,
+ int cmd, zebra_rec_keys_t skp);
static void extract_schema_add (struct recExtractCtrl *p, Odr_oid *oid);
static void extract_token_add (RecWord *p);
#define FILE_MATCH_BLANK "\t "
-static char *fileMatchStr (ZebraHandle zh,
- zebra_rec_keys_t reckeys,
- const char *fname, const char *spec)
+static char *get_match_from_spec(ZebraHandle zh,
+ zebra_rec_keys_t reckeys,
+ const char *fname, const char *spec)
{
static char dstBuf[2048]; /* static here ??? */
char *dst = dstBuf;
"", 0);
}
-ZEBRA_RES zebra_extract_file(ZebraHandle zh, SYSNO *sysno, const char *fname,
+ZEBRA_RES zebra_extract_file(ZebraHandle zh, zint *sysno, const char *fname,
int deleteFlag)
{
ZEBRA_RES r = ZEBRA_OK;
int delete_flag,
int test_mode,
const char *recordType,
- SYSNO *sysno,
+ zint *sysno,
const char *match_criteria,
const char *fname,
int force_update,
int delete_flag,
int test_mode,
const char *recordType,
- SYSNO *sysno,
+ zint *sysno,
const char *match_criteria,
const char *fname,
int force_update,
void *recTypeClientData)
{
- SYSNO sysno0 = 0;
+ zint sysno0 = 0;
RecordAttr *recordAttr;
struct recExtractCtrl extractCtrl;
int r;
matchStr = match_criteria;
} else {
if (zh->m_record_id && *zh->m_record_id) {
- matchStr = fileMatchStr (zh, zh->reg->keys, pr_fname,
- zh->m_record_id);
+ matchStr = get_match_from_spec(zh, zh->reg->keys, pr_fname,
+ zh->m_record_id);
if (!matchStr)
{
- yaz_log (YLOG_WARN, "Bad match criteria (recordID)");
+ yaz_log(YLOG_WARN, "Bad match criteria (recordID)");
return ZEBRA_FAIL;
}
}
sizeof(*sysno), sysno);
}
-
- extract_flushSortKeys (zh, *sysno, 1, zh->reg->sortKeys);
- extract_flushRecordKeys (zh, *sysno, 1, zh->reg->keys,
- recordAttr->staticrank);
+ extract_flush_sort_keys(zh, *sysno, 1, zh->reg->sortKeys);
+ extract_flush_record_keys(zh, *sysno, 1, zh->reg->keys,
+ recordAttr->staticrank);
zh->records_inserted++;
}
else
rec->size[recInfo_sortKeys],
0);
- extract_flushSortKeys (zh, *sysno, 0, sortKeys);
- extract_flushRecordKeys (zh, *sysno, 0, delkeys,
- recordAttr->staticrank);
+ extract_flush_sort_keys(zh, *sysno, 0, sortKeys);
+ extract_flush_record_keys(zh, *sysno, 0, delkeys,
+ recordAttr->staticrank);
if (delete_flag)
{
/* record going to be deleted */
yaz_log(YLOG_LOG, "update %s %s " ZINT_FORMAT, recordType,
pr_fname, (zint) ZINT_FORMAT);
recordAttr->staticrank = extractCtrl.staticrank;
- extract_flushSortKeys (zh, *sysno, 1, zh->reg->sortKeys);
- extract_flushRecordKeys (zh, *sysno, 1, zh->reg->keys,
- recordAttr->staticrank);
+ extract_flush_sort_keys(zh, *sysno, 1, zh->reg->sortKeys);
+ extract_flush_record_keys(zh, *sysno, 1, zh->reg->keys,
+ recordAttr->staticrank);
zh->records_updated++;
}
zebra_rec_keys_close(delkeys);
zebra_rec_keys_set_buf(delkeys, rec->info[recInfo_delKeys],
rec->size[recInfo_delKeys],
0);
- extract_flushRecordKeys (zh, rec->sysno, 0, delkeys, 0);
+ extract_flush_record_keys(zh, rec->sysno, 0, delkeys, 0);
zebra_rec_keys_close(delkeys);
zebra_rec_keys_set_buf(sortkeys, rec->info[recInfo_sortKeys],
rec->size[recInfo_sortKeys],
0);
- extract_flushSortKeys (zh, rec->sysno, 0, sortkeys);
+ extract_flush_sort_keys(zh, rec->sysno, 0, sortkeys);
zebra_rec_keys_close(sortkeys);
}
- extract_flushRecordKeys (zh, rec->sysno, 1, zh->reg->keys, 0);
- extract_flushSortKeys (zh, rec->sysno, 1, zh->reg->sortKeys);
-
+ extract_flush_record_keys(zh, rec->sysno, 1, zh->reg->keys, 0);
+ extract_flush_sort_keys(zh, rec->sysno, 1, zh->reg->sortKeys);
+
xfree (rec->info[recInfo_delKeys]);
zebra_rec_keys_get_buf(zh->reg->keys,
&rec->info[recInfo_delKeys],
}
}
-void extract_flushRecordKeys(ZebraHandle zh, SYSNO sysno, int cmd,
- zebra_rec_keys_t reckeys,
- zint staticrank)
+void extract_flush_record_keys(ZebraHandle zh, zint sysno, int cmd,
+ zebra_rec_keys_t reckeys,
+ zint staticrank)
{
ZebraExplainInfo zei = zh->reg->zei;
zebraExplain_addSchema (zh->reg->zei, oid);
}
-void extract_flushSortKeys(ZebraHandle zh, SYSNO sysno,
- int cmd, zebra_rec_keys_t reckeys)
+void extract_flush_sort_keys(ZebraHandle zh, zint sysno,
+ int cmd, zebra_rec_keys_t reckeys)
{
if (zebra_rec_keys_rewind(reckeys))
{
-/* $Id: index.h,v 1.182 2006-11-21 14:32:38 adam Exp $
+/* $Id: index.h,v 1.183 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
struct dirs_entry {
enum dirsKind kind;
char path[256];
- SYSNO sysno;
+ zint sysno;
time_t mtime;
};
struct dirs_entry *dirs_last(struct dirs_info *p);
void dirs_mkdir(struct dirs_info *p, const char *src, time_t mtime);
void dirs_rmdir(struct dirs_info *p, const char *src);
-void dirs_add(struct dirs_info *p, const char *src, SYSNO sysno, time_t mtime);
+void dirs_add(struct dirs_info *p, const char *src, zint sysno, time_t mtime);
void dirs_del(struct dirs_info *p, const char *src);
void dirs_free(struct dirs_info **pp);
struct dir_entry *dir_open(const char *rep, const char *base,
- int follow_links);
+ int follow_links);
void dir_sort(struct dir_entry *e);
void dir_free(struct dir_entry **e_p);
#define GMATCH_DICT "gmatch"
#define FMATCH_DICT "fmatch%d"
-struct strtab *strtab_mk(void);
-int strtab_src(struct strtab *t, const char *name, void ***infop);
-void strtab_del(struct strtab *t,
- void (*func)(const char *name, void *info, void *data),
- void *data);
-
-void zebraIndexLockMsg(ZebraHandle zh, const char *str);
-void zebraIndexUnlock(ZebraHandle zh);
-int zebraIndexLock(BFiles bfs, ZebraHandle zh, int commitNow, const char *rval);
-int zebraIndexWait(ZebraHandle zh, int commitPhase);
-
void zebra_lock_prefix(Res res, char *dst);
#define FNAME_MAIN_LOCK "zebraidx.LCK"
NMEM nmem);
void resultSetInvalidate(ZebraHandle zh);
-int zebra_record_fetch(ZebraHandle zh, SYSNO sysno, int score,
+int zebra_record_fetch(ZebraHandle zh, zint sysno, int score,
zebra_snippets *hit_snippet, ODR stream,
oid_value input_format, Z_RecordComposition *comp,
oid_value *output_format, char **rec_bufp,
int delete_flag,
int test_mode,
const char *recordType,
- SYSNO *sysno,
+ zint *sysno,
const char *match_criteria,
const char *fname,
int force_update,
int delete_flag,
int test_mode,
const char *recordType,
- SYSNO *sysno,
+ zint *sysno,
const char *match_criteria,
const char *fname,
int force_update,
ZEBRA_RES zebra_extract_explain(void *handle, Record rec, data1_node *n);
-ZEBRA_RES zebra_extract_file(ZebraHandle zh, SYSNO *sysno, const char *fname,
+ZEBRA_RES zebra_extract_file(ZebraHandle zh, zint *sysno, const char *fname,
int deleteFlag);
ZEBRA_RES zebra_begin_read(ZebraHandle zh);
-/* $Id: key_block.c,v 1.3 2006-11-21 17:48:08 adam Exp $
+/* $Id: key_block.c,v 1.4 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <assert.h>
#include <ctype.h>
#include <pthread.h>
#endif
-#include <yaz/nmem.h>
-#include "index.h"
#include "key_block.h"
+#include <yaz/nmem.h>
+#include <yaz/xmalloc.h>
struct zebra_key_block {
char **key_buf;
}
}
-void key_block_write(zebra_key_block_t p, SYSNO sysno, struct it_key *key_in,
+void key_block_write(zebra_key_block_t p, zint sysno, struct it_key *key_in,
int cmd, const char *str_buf, size_t str_len,
zint staticrank, int static_rank_enable)
{
-/* $Id: key_block.h,v 1.2 2006-11-21 17:48:08 adam Exp $
+/* $Id: key_block.h,v 1.3 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
#ifndef ZEBRA_KEY_BLOCK_H
#define ZEBRA_KEY_BLOCK_H
+#include "it_key.h"
+
YAZ_BEGIN_CDECL
typedef struct zebra_key_block *zebra_key_block_t;
int use_threads);
void key_block_destroy(zebra_key_block_t *pp);
void key_block_flush(zebra_key_block_t p, int is_final);
-void key_block_write(zebra_key_block_t p, SYSNO sysno, struct it_key *key_in,
+void key_block_write(zebra_key_block_t p, zint sysno, struct it_key *key_in,
int cmd, const char *str_buf, size_t str_len,
zint staticrank, int static_rank_enable);
int key_block_get_no_files(zebra_key_block_t p);
-/* $Id: recindex.c,v 1.53 2006-11-14 08:12:08 adam Exp $
+/* $Id: recindex.c,v 1.54 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
#define USUAL_RANGE 2000000000LL
#endif
-static SYSNO rec_sysno_to_ext(SYSNO sysno)
+static zint rec_sysno_to_ext(zint sysno)
{
assert(sysno >= 0 && sysno <= USUAL_RANGE);
return sysno + FAKE_OFFSET;
}
-SYSNO rec_sysno_to_int(SYSNO sysno)
+zint rec_sysno_to_int(zint sysno)
{
assert(sysno >= FAKE_OFFSET && sysno <= FAKE_OFFSET + USUAL_RANGE);
return sysno - FAKE_OFFSET;
}
}
-static int read_indx(Records p, SYSNO sysno, void *buf, int itemsize,
+static int read_indx(Records p, zint sysno, void *buf, int itemsize,
int ignoreError)
{
int r;
return r;
}
-static void write_indx(Records p, SYSNO sysno, void *buf, int itemsize)
+static void write_indx(Records p, zint sysno, void *buf, int itemsize)
{
zint pos = (sysno-1)*itemsize;
int off = CAST_ZINT_TO_INT(pos%RIDX_CHUNK);
(char*) buf + sz1);
}
-static ZEBRA_RES rec_release_blocks(Records p, SYSNO sysno)
+static ZEBRA_RES rec_release_blocks(Records p, zint sysno)
{
struct record_index_entry entry;
zint freeblock;
return ZEBRA_OK;
}
-static ZEBRA_RES rec_write_tmp_buf(Records p, int size, SYSNO *sysnos)
+static ZEBRA_RES rec_write_tmp_buf(Records p, int size, zint *sysnos)
{
struct record_index_entry entry;
int no_written = 0;
int out_size = 1000;
int out_offset = 0;
char *out_buf = (char *) xmalloc(out_size);
- SYSNO *sysnos = (SYSNO *) xmalloc(sizeof(*sysnos) * (p->cache_cur + 1));
- SYSNO *sysnop = sysnos;
+ zint *sysnos = (zint *) xmalloc(sizeof(*sysnos) * (p->cache_cur + 1));
+ zint *sysnop = sysnos;
ZEBRA_RES ret = ZEBRA_OK;
for (i = 0; i<p->cache_cur - saveCount; i++)
return ret;
}
-static Record *rec_cache_lookup(Records p, SYSNO sysno,
+static Record *rec_cache_lookup(Records p, zint sysno,
enum recordCacheFlag flag)
{
int i;
return ret;
}
-static Record rec_get_int(Records p, SYSNO sysno)
+static Record rec_get_int(Records p, zint sysno)
{
int i, in_size, r;
Record rec, *recp;
return rec;
}
-Record rec_get(Records p, SYSNO sysno)
+Record rec_get(Records p, zint sysno)
{
Record rec;
zebra_mutex_lock(&p->mutex);
static Record rec_new_int(Records p)
{
int i;
- SYSNO sysno;
+ zint sysno;
Record rec;
assert(p);
-/* $Id: recindex.h,v 1.29 2006-09-15 10:45:13 adam Exp $
+/* $Id: recindex.h,v 1.30 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
#define REC_NO_INFO 8
typedef struct record_info {
- SYSNO sysno;
+ zint sysno;
int newFlag;
char *info[REC_NO_INFO];
size_t size[REC_NO_INFO];
\param sysno system ID (external number)
\returns record pointer (or NULL on error)
*/
-Record rec_get(Records p, SYSNO sysno);
+Record rec_get(Records p, zint sysno);
/** \brief gets root record
\param p records handle
char *rec_strdup(const char *s, size_t *len);
void rec_prstat(Records p);
-SYSNO rec_sysno_to_int(SYSNO sysno);
+zint rec_sysno_to_int(zint sysno);
/** \brief compression types */
#define REC_COMPRESS_NONE 0
-/* $Id: reckeys.c,v 1.9 2006-11-20 13:59:35 adam Exp $
+/* $Id: reckeys.c,v 1.10 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <assert.h>
#include <ctype.h>
-#include <yaz/nmem.h>
-#include "index.h"
#include "reckeys.h"
+#include <yaz/nmem.h>
+#include <yaz/xmalloc.h>
struct zebra_rec_key_entry {
char *buf;
-/* $Id: reckeys.h,v 1.7 2006-11-21 14:32:38 adam Exp $
+/* $Id: reckeys.h,v 1.8 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
#ifndef RECKEYS_H
#define RECKEYS_H
+#include <yaz/yconfig.h>
+#include "it_key.h"
+
YAZ_BEGIN_CDECL
typedef struct zebra_rec_keys_t_ *zebra_rec_keys_t;
-/* $Id: retrieve.c,v 1.54 2006-11-17 08:20:17 marc Exp $
+/* $Id: retrieve.c,v 1.55 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
}
-int zebra_special_index_fetch(ZebraHandle zh, SYSNO sysno, ODR odr,
+int zebra_special_index_fetch(ZebraHandle zh, zint sysno, ODR odr,
Record rec,
const char *elemsetname,
oid_value input_format,
}
-int zebra_special_fetch(ZebraHandle zh, SYSNO sysno, ODR odr,
+int zebra_special_fetch(ZebraHandle zh, zint sysno, ODR odr,
const char *elemsetname,
oid_value input_format,
oid_value *output_format,
}
-int zebra_record_fetch(ZebraHandle zh, SYSNO sysno, int score,
+int zebra_record_fetch(ZebraHandle zh, zint sysno, int score,
zebra_snippets *hit_snippet, ODR odr,
oid_value input_format, Z_RecordComposition *comp,
oid_value *output_format,
-/* $Id: sortidx.c,v 1.18 2006-08-14 10:40:15 adam Exp $
+/* $Id: sortidx.c,v 1.19 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
#define SORT_IDX_BLOCKSIZE 64
struct sortFileHead {
- SYSNO sysno_max;
+ zint sysno_max;
};
struct sortFile {
struct sortIdx {
BFiles bfs;
int write_flag;
- SYSNO sysno;
+ zint sysno;
char *entry_buf;
struct sortFile *current_file;
struct sortFile *files;
return 0;
}
-void sortIdx_sysno (SortIdx si, SYSNO sysno)
+void sortIdx_sysno(SortIdx si, zint sysno)
{
si->sysno = rec_sysno_to_int(sysno);
}
-void sortIdx_add (SortIdx si, const char *buf, int len)
+void sortIdx_add(SortIdx si, const char *buf, int len)
{
if (!si->current_file || !si->current_file->bf)
return;
-/* $Id: symtab.c,v 1.10 2006-08-14 10:40:15 adam Exp $
+/* $Id: symtab.c,v 1.11 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
#include <string.h>
#include <assert.h>
-#include "index.h"
-
struct strentry {
char *name;
void *info;
-/* $Id: update_file.c,v 1.3 2006-09-11 22:57:54 adam Exp $
+/* $Id: update_file.c,v 1.4 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
sprintf (tmppath, "%s%s", base, src);
e_src = dir_open (tmppath, zh->path_reg, zh->m_follow_links);
- yaz_log (YLOG_LOG, "dir %s", tmppath);
+ yaz_log(YLOG_LOG, "dir %s", tmppath);
#if 0
if (!dst || repComp (dst->path, src, src_len))
{
if (e_src[i_src].name)
{
- yaz_log (YLOG_DEBUG, "dst=%s src=%s", dst->path + src_len,
+ yaz_log(YLOG_DEBUG, "dst=%s src=%s", dst->path + src_len,
e_src[i_src].name);
sd = strcmp (dst->path + src_len, e_src[i_src].name);
}
sd = 1;
else
break;
- yaz_log (YLOG_DEBUG, "trav sd=%d", sd);
+ yaz_log(YLOG_DEBUG, "trav sd=%d", sd);
if (sd == 0)
{
{
dirs_add (di, src, dst->sysno, e_src[i_src].mtime);
}
- yaz_log (YLOG_DEBUG, "old: %s", ctime (&dst->mtime));
- yaz_log (YLOG_DEBUG, "new: %s", ctime (&e_src[i_src].mtime));
+ yaz_log(YLOG_DEBUG, "old: %s", ctime (&dst->mtime));
+ yaz_log(YLOG_DEBUG, "new: %s", ctime (&e_src[i_src].mtime));
}
dst = dirs_read (di);
break;
case dirs_dir:
file_update_r(zh, di, dst, base, src, level+1);
dst = dirs_last (di);
- yaz_log (YLOG_DEBUG, "last is %s", dst ? dst->path : "null");
+ yaz_log(YLOG_DEBUG, "last is %s", dst ? dst->path : "null");
break;
default:
dst = dirs_read (di);
}
else if (sd > 0)
{
- SYSNO sysno = 0;
+ zint sysno = 0;
strcpy (src + src_len, e_src[i_src].name);
sprintf (tmppath, "%s%s", base, src);
if (ret == -1)
{
- yaz_log (YLOG_WARN|YLOG_ERRNO, "Cannot access path %s", src);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "Cannot access path %s", src);
}
else if (S_ISREG(sbuf.st_mode))
{
struct dirs_entry *e_dst;
di = dirs_fopen (dict, src, zh->m_flag_rw);
- e_dst = dirs_read (di);
+ e_dst = dirs_read(di);
if (e_dst)
{
if (sbuf.st_mtime > e_dst->mtime)
}
else
{
- SYSNO sysno = 0;
+ zint sysno = 0;
if (zebra_extract_file (zh, &sysno, src, 0) == ZEBRA_OK)
dirs_add (di, src, sysno, sbuf.st_mtime);
}
- dirs_free (&di);
+ dirs_free(&di);
}
else if (S_ISDIR(sbuf.st_mode))
{
}
else
{
- yaz_log (YLOG_WARN, "Skipping path %s", src);
+ yaz_log(YLOG_WARN, "Skipping path %s", src);
}
}
if (!(*dictp = dict_open_res (zh->reg->bfs, fmatch_fname, 50,
zh->m_flag_rw, 0, zh->res)))
{
- yaz_log (YLOG_FATAL, "dict_open fail of %s", fmatch_fname);
+ yaz_log(YLOG_FATAL, "dict_open fail of %s", fmatch_fname);
return ZEBRA_FAIL;
}
return ZEBRA_OK;
-/* $Id: zebraapi.c,v 1.233 2006-11-21 14:32:38 adam Exp $
+/* $Id: zebraapi.c,v 1.234 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
ZEBRA_RES zebra_admin_import_segment (ZebraHandle zh, Z_Segment *segment)
{
ZEBRA_RES res = ZEBRA_OK;
- SYSNO sysno;
+ zint sysno;
int i;
ZEBRA_CHECK_HANDLE(zh);
yaz_log(log_level, "zebra_admin_import_segment");
/* 4 = update. Insert/replace */
{
ZEBRA_RES res;
- SYSNO sysno = 0;
+ zint sysno = 0;
char *rinfo = 0;
char recid_z[256];
int db_ord;
ZEBRA_RES zebra_insert_record(ZebraHandle zh,
const char *recordType,
- SYSNO *sysno, const char *match,
+ zint *sysno, const char *match,
const char *fname,
const char *buf, int buf_size, int force_update)
{
return res;
}
-ZEBRA_RES zebra_update_record (ZebraHandle zh,
- const char *recordType,
- SYSNO* sysno, const char *match,
- const char *fname,
- const char *buf, int buf_size,
- int force_update)
+ZEBRA_RES zebra_update_record(ZebraHandle zh,
+ const char *recordType,
+ zint *sysno, const char *match,
+ const char *fname,
+ const char *buf, int buf_size,
+ int force_update)
{
ZEBRA_RES res;
return res;
}
-ZEBRA_RES zebra_delete_record (ZebraHandle zh,
- const char *recordType,
- SYSNO *sysno, const char *match,
- const char *fname,
- const char *buf, int buf_size,
- int force_update)
+ZEBRA_RES zebra_delete_record(ZebraHandle zh,
+ const char *recordType,
+ zint *sysno, const char *match,
+ const char *fname,
+ const char *buf, int buf_size,
+ int force_update)
{
ZEBRA_RES res;
zh->errString = nmem_strdup(zh->nmem_error, vstr);
}
-void zebra_lock_prefix (Res res, char *path)
+void zebra_lock_prefix(Res res, char *path)
{
const char *lock_dir = res_get_def (res, "lockDir", "");
-
- strcpy (path, lock_dir);
+
+ strcpy(path, lock_dir);
if (*path && path[strlen(path)-1] != '/')
strcat (path, "/");
}
-/* $Id: zebrash.c,v 1.40 2006-10-29 17:20:01 adam Exp $
+/* $Id: zebrash.c,v 1.41 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
static int cmd_record_insert( char *args[], WRBUF outbuff)
{
- SYSNO sysno=0;
+ zint sysno = 0;
int rc;
char *rec=restargs(args,1);
-/* $Id: zebrasrv.c,v 1.1 2006-09-22 10:18:08 adam Exp $
+/* $Id: zebrasrv.c,v 1.2 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
Z_External *rec = notToKeep->elements[i]->record;
struct oident *oident = 0;
Odr_oct *opaque_recid = 0;
- SYSNO *sysno = 0;
- SYSNO sysno_tmp;
+ zint *sysno = 0;
+ zint sysno_tmp;
if (notToKeep->elements[i]->u.opaque)
{
-/* $Id: zinfo.c,v 1.71 2006-11-14 08:12:08 adam Exp $
+/* $Id: zinfo.c,v 1.72 2006-11-21 22:17:49 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
typedef struct zebAccessObjectB *zebAccessObject;
struct zebAccessObjectB {
void *handle;
- SYSNO sysno;
+ zint sysno;
Odr_oid *oid;
zebAccessObject next;
};
typedef struct {
struct zebSUInfoB *SUInfo;
- SYSNO sysno;
+ zint sysno;
int dirty;
int readFlag;
data1_node *data1_tree;
data1_node *data1_database;
zint recordCount; /* records in db */
zint recordBytes; /* size of records */
- SYSNO sysno; /* sysno of database info */
+ zint sysno; /* sysno of database info */
int readFlag; /* 1: read is needed when referenced; 0 if not */
int dirty; /* 1: database is dirty: write is needed */
struct zebDatabaseInfoB *next;
struct zebraCategoryListInfo {
int dirty;
- SYSNO sysno;
+ zint sysno;
data1_node *data1_categoryList;
};
int key_flush);
-static Record createRecord(Records records, SYSNO *sysno)
+static Record createRecord(Records records, zint *sysno)
{
Record rec;
if (*sysno)
int i;
Record drec;
data1_node *node_ci, *node_categoryList;
- SYSNO sysno = 0;
+ zint sysno = 0;
static char *category[] = {
"CategoryList",
"TargetInfo",
-/* $Id: t13.c,v 1.9 2006-08-14 10:40:22 adam Exp $
+/* $Id: t13.c,v 1.10 2006-11-21 22:17:50 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
static char *xml_buf = "<gils><title>myx</title></gils>";
ZebraService zs;
ZebraHandle zh;
- SYSNO sysno = 0;
+ zint sysno = 0;
zs = zebra_start_res(0, 0, 0);
YAZ_CHECK(zs);