Added support for C++, headers uses extern "C" for public definitions.
+Added support for C++, headers uses extern "C" for public definitions.
+
+New filter grs.marc.<syntax> that reads MARC records in the ISO2709
+format. <syntax> refers to the abstract syntax.
+
Bug fix: The show records facility (-s) only displayed information for
the first record in a file (and not for every record in the file).
/*
- * Copyright (C) 1994-1996, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dfa.c,v $
- * Revision 1.15 1997-02-10 10:19:20 adam
+ * Revision 1.16 1997-09-05 15:29:57 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.15 1997/02/10 10:19:20 adam
* Added facility for open character sets, eg [a-].
*
* Revision 1.14 1996/10/29 13:57:22 adam
break;
if (parse_info->cmap)
{
- char **mapto, mapfrom[2];
+ const char **mapto;
+ char mapfrom[2];
const char *mcp = mapfrom;
mapfrom[0] = ch0;
mapto = (*parse_info->cmap)(&mcp, 1);
#endif
if (!open_range && parse_info->cmap)
{
- char **mapto, mapfrom[2];
+ const char **mapto;
+ char mapfrom[2];
const char *mcp = mapfrom;
mapfrom[0] = ch1;
mapto = (*parse_info->cmap) (&mcp, 1);
static int map_l_char (void)
{
- char **mapto;
+ const char **mapto;
const char *cp0 = (const char *) (expr_ptr-1);
int i = 0, len = strlen(cp0);
return dfa;
}
-void dfa_set_cmap (struct DFA *dfa, char **(*cmap)(const char **from, int len))
+void dfa_set_cmap (struct DFA *dfa,
+ const char **(*cmap)(const char **from, int len))
{
dfa->parse_info->cmap = cmap;
}
/*
- * Copyright (C) 1994, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dfap.h,v $
- * Revision 1.4 1996-06-04 10:20:03 adam
+ * Revision 1.5 1997-09-05 15:29:58 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.4 1996/06/04 10:20:03 adam
* Added support for character mapping.
*
* Revision 1.3 1996/01/08 09:09:19 adam
struct Tblock *end; /* end block of Tnodes */
int *charMap;
int charMapSize;
- char **(*cmap)(const char **from, int len);
+ const char **(*cmap)(const char **from, int len);
};
typedef struct DFA_stateb_ {
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: lookgrep.c,v $
- * Revision 1.17 1996-06-04 10:20:06 adam
+ * Revision 1.18 1997-09-05 15:29:58 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.17 1996/06/04 10:20:06 adam
* Added support for character mapping.
*
* Revision 1.16 1996/05/24 14:46:04 adam
return i;
}
-void dict_grep_cmap (Dict dict, char **(*cmap)(const char **from, int len))
+void dict_grep_cmap (Dict dict,
+ const char **(*cmap)(const char **from, int len))
{
dict->grep_cmap = cmap;
}
/*
- * Copyright (C) 1994-1995, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: bfile.h,v $
- * Revision 1.13 1996-10-29 13:43:07 adam
+ * Revision 1.14 1997-09-05 15:29:58 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.13 1996/10/29 13:43:07 adam
* Added a few comments.
*
* Revision 1.12 1996/03/26 16:00:44 adam
#include <mfile.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define bf_blocksize(bf) mf_blocksize(bf->mf)
typedef struct BFile_struct
/* bf_commitClean: cleans commit files, etc */
void bf_commitClean (void);
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1994, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: bset.h,v $
- * Revision 1.1 1994-09-26 10:17:42 adam
+ * Revision 1.2 1997-09-05 15:29:59 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.1 1994/09/26 10:17:42 adam
* Dfa-module header files.
*
*/
#ifndef BSET_H
#define BSET_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef unsigned short BSetWord;
typedef BSetWord *BSet;
int eq_BSet (BSetHandle *sh, BSet dst, BSet src);
void pr_charBSet (BSetHandle *sh, BSet src, void (*f)(int));
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (c) 1995, Index Data.
+ * Copyright (c) 1995-1997, Index Data.
*
* All rights reserved.
*
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
+ * $Log: charmap.h,v $
+ * Revision 1.3 1997-09-05 15:29:59 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
*/
#ifndef CHARMAP_H
#define CHARMAP_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const char *CHR_UNKNOWN;
extern const char *CHR_SPACE;
extern const char *CHR_BASE;
chrmaptab *chr_read_maptab(const char *tabpath, const char *name);
int chr_map_chrs(chr_t_entry *t, char **from, int len, int *read, char **to,
int max);
-char **chr_map_input(chr_t_entry *t, char **from, int len);
+const char **chr_map_input(chr_t_entry *t, const char **from, int len);
+
+#ifdef __cplusplus
+}
+#endif
#endif
/*
- * Copyright (C) 1994-1996, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dfa.h,v $
- * Revision 1.6 1996-06-04 10:20:10 adam
+ * Revision 1.7 1997-09-05 15:29:59 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.6 1996/06/04 10:20:10 adam
* Added support for character mapping.
*
* Revision 1.5 1996/01/08 09:09:48 adam
#include <bset.h>
#include <set.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct DFA_tran {
unsigned char ch[2]; /* transition on ch[0] <= c <= ch[1] to */
unsigned short to; /* this state */
struct DFA *dfa_init (void);
void dfa_set_cmap (struct DFA *dfa,
- char **(*cmap)(const char **from, int len));
+ const char **(*cmap)(const char **from, int len));
int dfa_parse (struct DFA *, const char **);
void dfa_mkstate (struct DFA *);
void dfa_delete (struct DFA **);
#define DFA_ERR_SYNTAX 1
#define DFA_ERR_LP 2
#define DFA_ERR_RP 3
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1994-1996, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dict.h,v $
- * Revision 1.23 1996-10-29 13:45:33 adam
+ * Revision 1.24 1997-09-05 15:30:00 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.23 1996/10/29 13:45:33 adam
* Changed definition of DICT_DEFAULT_PAGESIZE.
*
* Revision 1.22 1996/06/04 10:20:10 adam
#include <bfile.h>
#include <log.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef unsigned Dict_ptr;
typedef unsigned char Dict_char;
typedef struct Dict_struct {
int rw;
Dict_BFile dbf;
- char **(*grep_cmap)(const char **from, int len);
+ const char **(*grep_cmap)(const char **from, int len);
struct Dict_head head;
} *Dict;
void *client));
void dict_grep_cmap (Dict dict,
- char **(*cmap)(const char **from, int len));
+ const char **(*cmap)(const char **from, int len));
#define DICT_EOS 0
dir[0..nodir-1]
ptr,info,string
*/
+#ifdef __cplusplus
+}
+#endif
#endif
/*
- * Copyright (C) 1994, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: isam.h,v $
- * Revision 1.11 1996-10-29 13:43:44 adam
+ * Revision 1.12 1997-09-05 15:30:00 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.11 1996/10/29 13:43:44 adam
* Removed definition of SYSNO.
*
* Revision 1.10 1995/09/06 16:10:57 adam
#include "../isam/memory.h"
#include "../isam/physical.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define IS_MAX_BLOCKTYPES 4
#define IS_MAX_RECORD 512
#define IS_DEF_REPACK_PERCENT "30" /* how much relative change before repack */
ISAM_P is_merge(ISAM is, ISAM_P pos, int num, char *data);
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (c) 1995-1996, Index Data.
+ * Copyright (c) 1995-1997, Index Data.
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: isamc.h,v $
- * Revision 1.4 1996-11-08 11:08:01 adam
+ * Revision 1.5 1997-09-05 15:30:00 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.4 1996/11/08 11:08:01 adam
* New internal release.
*
* Revision 1.3 1996/11/01 13:35:03 adam
#ifndef ISAMC_H
#define ISAMC_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct ISAMC_s *ISAMC;
typedef int ISAMC_P;
typedef struct ISAMC_PP_s *ISAMC_PP;
#define isc_type(x) ((x) & 7)
#define isc_block(x) ((x) >> 3)
+#ifdef __cplusplus
+}
+#endif
+
#endif
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: mfile.h,v $
- * Revision 1.6 1996-10-29 13:46:10 adam
+ * Revision 1.7 1997-09-05 15:30:01 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.6 1996/10/29 13:46:10 adam
* Removed obsolete headers alexpath, alexutil. Created zebrautl.h as
* a replacement.
*
#define FILENAME_MAX MAXPATHLEN
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MF_MIN_BLOCKS_CREAT 1 /* minimum free blocks in new dir */
#define MF_DEFAULT_AREA "register" /* Use if no mf_init */
#define MF_MAX_PARTS 28 /* max # of part-files per metafile */
* Unlink the file by name, rather than MFile-handle.
*/
int mf_unlink_name(MFile_area, const char *name);
+#ifdef __cplusplus
+}
+#endif
#endif
/*
- * Copyright (C) 1994-1996, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: recctrl.h,v $
- * Revision 1.18 1997-09-04 13:56:15 adam
+ * Revision 1.19 1997-09-05 15:30:02 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.18 1997/09/04 13:56:15 adam
* Added new filter grs.marc.<syntax> where <syntax> refers to
* abstract syntax. New method tellf in extract/retrieve control
* block.
#include <oid.h>
#include <odr.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+ Word_String,
+ Word_Phrase,
+ Word_Numeric
+} RecWordType;
+
/* single word entity */
typedef struct {
int attrSet;
int attrUse;
+ RecWordType which;
+#if 0
enum {
Word_String,
Word_Phrase,
Word_Numeric
} which;
+#endif
union {
char *string;
int numeric;
char *subType;
void (*init)(RecWord *p);
void (*add)(const RecWord *p);
- char **(*map_chrs_input)(char **from, int len);
+ const char **(*map_chrs_input)(const char **from, int len);
int flagShowRecords;
};
RecType recType_byName (const char *name, char *subType);
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1994, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: res.h,v $
- * Revision 1.6 1996-10-29 13:44:12 adam
+ * Revision 1.7 1997-09-05 15:30:02 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.6 1996/10/29 13:44:12 adam
* Added res_get_match.
*
* Revision 1.5 1994/09/16 14:37:46 quinn
#ifndef RES_H
#define RES_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct res_entry {
char *name;
char *value;
void res_trav (Res r, const char *prefix,
void (*f)(const char *name, const char *value));
int res_write (Res r);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1994-1995, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsbool.h,v $
- * Revision 1.4 1995-12-11 09:07:53 adam
+ * Revision 1.5 1997-09-05 15:30:02 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.4 1995/12/11 09:07:53 adam
* New rset member 'flag', that holds various flags about a result set -
* currently 'volatile' (set is register dependent) and 'ranked' (set is
* ranked).
#include <rset.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const rset_control *rset_kind_and;
extern const rset_control *rset_kind_or;
extern const rset_control *rset_kind_not;
int (*cmp)(const void *p1, const void *p2);
} rset_bool_parms;
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1994-1995, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rset.h,v $
- * Revision 1.11 1995-12-11 09:07:53 adam
+ * Revision 1.12 1997-09-05 15:30:03 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.11 1995/12/11 09:07:53 adam
* New rset member 'flag', that holds various flags about a result set -
* currently 'volatile' (set is register dependent) and 'ranked' (set is
* ranked).
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
typedef void *RSFD;
typedef struct rset *RSET;
#define rset_is_volatile(rs) ((rs)->flags & RSET_FLAG_VOLATILE)
#define rset_is_ranked(rs) ((rs)->flags & RSET_FLAG_RANKED)
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1994, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsisam.h,v $
- * Revision 1.2 1995-09-04 09:09:53 adam
+ * Revision 1.3 1997-09-05 15:30:04 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.2 1995/09/04 09:09:53 adam
* String arg in dict lookup is const.
* Minor changes.
*
#include <rset.h>
#include <isam.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const rset_control *rset_kind_isam;
typedef struct rset_isam_parms
ISAM_P pos;
} rset_isam_parms;
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1996, Index Data I/S
+ * Copyright (C) 1996-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsisamc.h,v $
- * Revision 1.1 1996-10-29 13:41:33 adam
+ * Revision 1.2 1997-09-05 15:30:04 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.1 1996/10/29 13:41:33 adam
* First use of isamc.
*
*/
#include <rset.h>
#include <isamc.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const rset_control *rset_kind_isamc;
typedef struct rset_isamc_parms
ISAMC_P pos;
} rset_isamc_parms;
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1994-1996, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsm_or.h,v $
- * Revision 1.2 1996-12-23 15:29:54 adam
+ * Revision 1.3 1997-09-05 15:30:04 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.2 1996/12/23 15:29:54 adam
* More work on truncation algorithm.
*
* Revision 1.1 1996/12/20 11:06:45 adam
#include <rset.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const rset_control *rset_kind_m_or;
typedef struct rset_m_or_parms
int no_save_positions;
} rset_m_or_parms;
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1994-1995, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsnull.h,v $
- * Revision 1.1 1995-09-06 10:36:16 adam
+ * Revision 1.2 1997-09-05 15:30:05 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.1 1995/09/06 10:36:16 adam
* Null set implemented.
*
*/
#include <rset.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const rset_control *rset_kind_null;
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1994-1995, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rsrel.h,v $
- * Revision 1.3 1996-11-08 11:08:02 adam
+ * Revision 1.4 1997-09-05 15:30:05 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.3 1996/11/08 11:08:02 adam
* New internal release.
*
* Revision 1.2 1996/06/11 10:53:16 quinn
#include <rset.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const rset_control *rset_kind_relevance;
typedef struct rset_relevance_parms
int *term_no;
} rset_relevance_parms;
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1994, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: rstemp.h,v $
- * Revision 1.2 1995-09-04 15:20:13 adam
+ * Revision 1.3 1997-09-05 15:30:05 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.2 1995/09/04 15:20:13 adam
* More work on temp sets. is_open member removed.
*
* Revision 1.1 1994/11/04 13:21:23 quinn
#include <rset.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const rset_control *rset_kind_temp;
typedef struct rset_temp_parms
int key_size;
} rset_temp_parms;
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1994, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: set.h,v $
- * Revision 1.1 1994-09-26 10:17:44 adam
+ * Revision 1.2 1997-09-05 15:30:05 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.1 1994/09/26 10:17:44 adam
* Dfa-module header files.
*
*/
#ifndef SET_H
#define SET_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct SetElement_ {
struct SetElement_ *next;
int value;
unsigned hash_Set (SetType st, Set s);
int eq_Set (SetType s, Set s1, Set s2);
+#ifdef __cplusplus
+}
+#endif
+
#endif
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: str.h,v $
- * Revision 1.2 1994-10-20 17:36:06 quinn
+ * Revision 1.3 1997-09-05 15:30:06 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.2 1994/10/20 17:36:06 quinn
* Minimal
*
* Revision 1.1 1994/10/20 13:46:36 quinn
#ifndef STR_H
#define STR_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct str_index
{
int size;
char *str(STRINGS st, int num);
char *strf(STRINGS st, int num, ...);
+#ifdef __cplusplus
+}
+#endif
+
#endif
/*
- * Copyright (C) 1995-1996, Index Data I/S
+ * Copyright (C) 1995-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zebrautl.h,v $
- * Revision 1.1 1996-10-29 13:46:12 adam
+ * Revision 1.2 1997-09-05 15:30:06 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.1 1996/10/29 13:46:12 adam
* Removed obsolete headers alexpath, alexutil. Created zebrautl.h as
* a replacement.
*
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: attribute.c,v $
- * Revision 1.4 1996-10-29 14:06:48 adam
+ * Revision 1.5 1997-09-05 15:30:08 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.4 1996/10/29 14:06:48 adam
* Include zebrautl.h instead of alexutil.h.
*
* Revision 1.3 1996/05/09 07:28:54 quinn
static void att_loadset(const char *n, const char *name)
{
- data1_attset *new;
+ data1_attset *cnew;
- if (!(new = data1_read_attset((char*) name)))
+ if (!(cnew = data1_read_attset((char*) name)))
{
logf(LOG_WARN|LOG_ERRNO, "%s", name);
return;
}
- new->next = registered_sets;
- registered_sets = new;
- return;
+ cnew->next = registered_sets;
+ registered_sets = cnew;
}
static void load_atts()
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: index.h,v $
- * Revision 1.48 1997-02-12 20:39:45 adam
+ * Revision 1.49 1997-09-05 15:30:08 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.48 1997/02/12 20:39:45 adam
* Implemented options -f <n> that limits the log to the first <n>
* records.
* Changed some log messages also.
int zebraUnlock (int fd);
void init_charmap(void);
-char **map_chrs_input(char **from, int len);
+const char **map_chrs_input(const char **from, int len);
const char *map_chrs_output(const char **from);
/*
- * Copyright (C) 1994-1996, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zrpn.c,v $
- * Revision 1.61 1997-02-10 10:21:14 adam
+ * Revision 1.62 1997-09-05 15:30:09 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.61 1997/02/10 10:21:14 adam
* Bug fix: in search terms character (^) wasn't observed.
*
* Revision 1.60 1997/01/31 11:10:34 adam
return 0;
}
-static int term_pre (char **src, const char *ct1, const char *ct2)
+static int term_pre (const char **src, const char *ct1, const char *ct2)
{
- char *s1, *s0 = *src;
- char **map;
+ const char *s1, *s0 = *src;
+ const char **map;
/* skip white space */
while (*s0)
return *s0;
}
-static int term_100 (char **src, char *dst, int space_split)
+static int term_100 (const char **src, char *dst, int space_split)
{
- char *s0, *s1, **map;
+ const char *s0, *s1;
+ const char **map;
int i = 0;
if (!term_pre (src, NULL, NULL))
return i;
}
-static int term_101 (char **src, char *dst, int space_split)
+static int term_101 (const char **src, char *dst, int space_split)
{
- char *s0, *s1, **map;
+ const char *s0, *s1;
+ const char **map;
int i = 0;
if (!term_pre (src, "#", "#"))
}
-static int term_103 (char **src, char *dst, int *errors, int space_split)
+static int term_103 (const char **src, char *dst, int *errors, int space_split)
{
int i = 0;
- char *s0, *s1, **map;
+ const char *s0, *s1;
+ const char **map;
if (!term_pre (src, "^\\()[].*+?|", "("))
return 0;
return i;
}
-static int term_102 (char **src, char *dst, int space_split)
+static int term_102 (const char **src, char *dst, int space_split)
{
return term_103 (src, dst, NULL, space_split);
}
}
static int relational_term (ZServerInfo *zi, Z_AttributesPlusTerm *zapt,
- char **term_sub,
+ const char **term_sub,
char *term_dict,
oid_value attributeSet,
struct grep_info *grep_info,
}
static int field_term (ZServerInfo *zi, Z_AttributesPlusTerm *zapt,
- char **term_sub, int regType,
+ const char **term_sub, int regType,
oid_value attributeSet, struct grep_info *grep_info,
int num_bases, char **basenames, int space_split)
{
AttrType use;
int use_value;
oid_value curAttributeSet = attributeSet;
- char *termp;
+ const char *termp;
attr_init (&use, zapt, 1);
use_value = attr_find (&use, &curAttributeSet);
char *termz)
{
Z_Term *term = zapt->term;
- char **map;
- char *cp = (char*) term->u.general->buf;
+ const char **map;
+ const char *cp = (const char *) term->u.general->buf;
const char *cp_end = cp + term->u.general->len;
const char *src;
int i = 0;
{
rset_relevance_parms parms;
char termz[IT_MAX_WORD+1];
- char *termp = termz;
+ const char *termp = termz;
struct grep_info grep_info;
RSET result;
int term_index = 0;
char termz[IT_MAX_WORD+1];
struct grep_info grep_info;
RSET result;
- char *termp = termz;
+ const char *termp = termz;
int r;
if (zapt->term->which != Z_Term_general)
int num_bases, char **basenames)
{
char termz[IT_MAX_WORD+1];
- char *termp = termz;
+ const char *termp = termz;
RSET rset[60], result;
int i, r, rset_no = 0;
struct grep_info grep_info;
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: memory.h,v $
- * Revision 1.5 1996-03-11 14:52:25 quinn
+ * Revision 1.6 1997-09-05 15:30:10 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.5 1996/03/11 14:52:25 quinn
* Fixed update bug. Repeated insertion in the same area sometimes caused
* problems.
*
#ifndef MEMORY_H
#define MEMORY_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern int is_mbuf_size[3];
typedef unsigned int ISAM_P;
int is_m_read_full(is_mtable *tab, is_mblock *mblock);
int is_m_num_records(is_mtable *tab);
+#ifdef __cplusplus
+}
+#endif
+
+
#endif
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: physical.h,v $
- * Revision 1.3 1994-09-26 17:11:32 quinn
+ * Revision 1.4 1997-09-05 15:30:10 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.3 1994/09/26 17:11:32 quinn
* Trivial
*
* Revision 1.2 1994/09/26 17:06:37 quinn
#include "memory.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void is_p_sync(is_mtable *tab);
void is_p_unmap(is_mtable *tab);
void is_p_align(is_mtable *tab);
int is_p_read_partial(is_mtable *tab, is_mblock *block);
int is_p_read_full(is_mtable *tab, is_mblock *block);
+#ifdef __cplusplus
+}
+#endif
+
+
#endif
/*
- * Copyright (C) 1994-1996, Index Data I/S
+ * Copyright (C) 1994-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: recgrs.c,v $
- * Revision 1.6 1997-09-04 13:54:40 adam
+ * Revision 1.7 1997-09-05 15:30:10 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.6 1997/09/04 13:54:40 adam
* Added MARC filter - type grs.marc.<syntax> where syntax refers
* to abstract syntax. New method tellf in retrieve/extract method.
*
static void dumpkeys_word(data1_node *n, struct recExtractCtrl *p,
data1_att *att)
{
- char *b = n->u.data.data;
+ const char *b = n->u.data.data;
int remain;
- char **map = 0;
+ const char **map = 0;
remain = n->u.data.len - (b - n->u.data.data);
if (remain > 0)
i = 0;
while (map && *map && **map != *CHR_SPACE)
{
- char *cp = *map;
+ const char *cp = *map;
while (i < GRS_MAX_WORD && *cp)
buf[i++] = *(cp++);
static void dumpkeys_phrase(data1_node *n, struct recExtractCtrl *p,
data1_att *att)
{
- char *b = n->u.data.data;
- char buf[GRS_MAX_WORD+1], **map = 0;
+ const char *b = n->u.data.data;
+ char buf[GRS_MAX_WORD+1];
+ const char **map = 0;
RecWord wrd;
int i = 0, remain;
buf[i++] = *CHR_SPACE;
while (map && *map && **map != *CHR_SPACE)
{
- char *cp = *map;
+ const char *cp = *map;
if (i >= GRS_MAX_WORD)
break;
/*
- * Copyright (C) 1994, Index Data I/S
+ * Copyright (C) 1996-1997, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: charmap.c,v $
- * Revision 1.11 1997-09-05 09:52:32 adam
+ * Revision 1.12 1997-09-05 15:30:11 adam
+ * Changed prototype for chr_map_input - added const.
+ * Added support for C++, headers uses extern "C" for public definitions.
+ *
+ * Revision 1.11 1997/09/05 09:52:32 adam
* Extra argument added to function chr_read_maptab (tab path).
*
* Revision 1.10 1997/07/01 13:01:08 adam
/*
* Add an entry to the character map.
*/
-static chr_t_entry *set_map_string(chr_t_entry *root, char *from, int len,
- char *to)
+static chr_t_entry *set_map_string(chr_t_entry *root, const char *from,
+ int len, char *to)
{
if (!root)
{
return i;
}
-#if 1
-static chr_t_entry *find_entry(chr_t_entry *t, char **from, int len)
+static chr_t_entry *find_entry(chr_t_entry *t, const char **from, int len)
{
chr_t_entry *res;
if (len && t->children && t->children[(unsigned char) **from])
{
- char *pos = *from;
+ const char *pos = *from;
(*from)++;
if ((res = find_entry(t->children[(unsigned char) *pos],
return t->target ? t : 0;
}
-char **chr_map_input(chr_t_entry *t, char **from, int len)
+const char **chr_map_input(chr_t_entry *t, const char **from, int len)
{
- static char *buf[2] = {0, 0};
+ static const char *buf[2] = {0, 0};
chr_t_entry *res;
if (!(res = find_entry(t, from, len)))
return buf;
}
-#else
-
-char **chr_map_input(chr_t_entry *t, char **from, int len)
-{
- static char *buf[2] = {0, 0}, str[2] = {0, 0};
- char *start = *from;
-
- if (t)
- {
- while (len && t->children && t->children[(unsigned char) **from])
- {
- t = t->children[(unsigned char) **from];
- (*from)++;
- len--;
- }
- buf[0] = (char*) t->target;
- }
- else /* null mapping */
- {
- if (isalnum(**from))
- {
- str[0] = **from;
- buf[0] = str;
- }
- else if (isspace(**from))
- buf[0] = (char*) CHR_SPACE;
- else
- buf[0] = (char*) CHR_UNKNOWN;
- }
- if (start == *from)
- (*from)++;
- return buf;
- /* return (char*) t->target; */
-}
-
-#endif
static unsigned char prim(char **s)
{
* Callback function.
* Add an entry to the value space.
*/
-static void fun_addentry(char *s, void *data, int num)
+static void fun_addentry(const char *s, void *data, int num)
{
chrmaptab *tab = data;
char tmp[2];
* Callback function.
* Add a space-entry to the value space.
*/
-static void fun_addspace(char *s, void *data, int num)
+static void fun_addspace(const char *s, void *data, int num)
{
chrmaptab *tab = data;
tab->input = set_map_string(tab->input, s, strlen(s), (char*) CHR_SPACE);
/*
* Create a string containing the mapped characters provided.
*/
-static void fun_mkstring(char *s, void *data, int num)
+static void fun_mkstring(const char *s, void *data, int num)
{
chrwork *arg = data;
- char **res, *p = s;
+ const char **res, *p = s;
res = chr_map_input(arg->map->input, &s, strlen(s));
if (*res == (char*) CHR_UNKNOWN)
/*
* Add a map to the string contained in the argument.
*/
-static void fun_addmap(char *s, void *data, int num)
+static void fun_addmap(const char *s, void *data, int num)
{
chrwork *arg = data;
set_map_string(arg->map->input, s, strlen(s), arg->string);
}
-static int scan_string(char *s, void (*fun)(char *c, void *data, int num),
+static int scan_string(char *s, void (*fun)(const char *c, void *data, int num),
void *data, int *num)
{
unsigned char c, str[1024], begin, end, *p;