1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

Low-hanging fruit: Fix most warnings in lib/DtSearch.

Most of these are related to missing includes and prototypes as well as
parens/braces.  A few are also potential 64bit issues.
This commit is contained in:
Pascal Stumpf 2012-08-12 18:51:53 +02:00 committed by Jon Trulson
parent 0bbd4ff9aa
commit a1cbcd24db
89 changed files with 181 additions and 33 deletions

View file

@ -94,6 +94,7 @@
* Revision 1.4 1995/08/31 21:54:23 miker
* Rename austext_exit() to DtSearchExit().
*/
#include <stdlib.h>
#include "Search.h"
void (*austext_exit_first) (int) = NULL;

View file

@ -83,6 +83,7 @@
* Initial revision
*/
#include "SearchE.h"
#include <stdlib.h>
#include <string.h>
#include "boolpars.h"
#include "boolyac.h"
@ -223,7 +224,7 @@ static TRUTHTAB *creatett (int stemno, int pmsz, unsigned char *permutes)
/* Destructor of passed truth table.
* Unlinks it from ttlist and frees it.
*/
static void *freett (TRUTHTAB *argtt)
static void freett (TRUTHTAB *argtt)
{
TRUTHTAB *tt;
TRUTHTAB **lastlink = &ttlist;
@ -809,7 +810,7 @@ GET_ANOTHER_TOKEN:
}
/* Load stem into stems arrays and return it's truth table. */
if (yylval.truthtab = get_stem_truthtab (stembufp, yytext)) {
if ((yylval.truthtab = get_stem_truthtab (stembufp, yytext))) {
retn_token = WORD_TOKEN;
last_token_was_boolop = FALSE;
}

View file

@ -169,6 +169,8 @@ static long tot_addr_count; /* may be > reccount bcs deletes */
static int vistano;
static float *wtvec = NULL;
extern void find_keyword (char *cur_word, int vista_num);
extern void read_wordstr (struct or_hwordrec * glob_word, int vista_num);
/************************************************/
/* */

View file

@ -60,6 +60,8 @@
#define PROGNAME "DBCHANGE"
void oe_uninitialize (void);
/************************************************/
/* */
/* file_has_changed */

View file

@ -91,6 +91,7 @@
#include <errno.h>
#include <signal.h>
#include <sys/stat.h>
#include <stdlib.h>
#define PROGNAME "DTOE"
#define MAX_LASTQRY 64
@ -104,6 +105,9 @@ typedef struct {
char *str;
} NUMSTR;
int boolean_parse (void);
void boolean_search (void);
void ve_delete (void);
/*------------------ OPERA ENGINE GLOBALS --------------------
* Default values set by init_globals() in oeinit.c
@ -120,7 +124,7 @@ char *global_memory_ptr = NULL; /* shared mem, dynam
int shm_id = 0; /* shared mem, dynam defrag */
int OE_bmhtab_strlen[DtSrMAX_STEMCOUNT] = { 0 };
size_t OE_bmhtables[DtSrMAX_STEMCOUNT][MAX_BMHTAB] = { 0 };
size_t OE_bmhtables[DtSrMAX_STEMCOUNT][MAX_BMHTAB] = { { 0 } };
int OE_dbn = 0; /* dynamic */
int OE_enable_markdel = 0;
int OE_enable_usernotes = 0;

View file

@ -66,6 +66,7 @@
#include "SearchE.h"
#include <string.h>
#include <sys/stat.h>
#include <stdlib.h>
#define XOS_USE_NO_LOCKING
#define X_INCLUDE_TIME_H

View file

@ -110,6 +110,7 @@
#include <signal.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#define PROGNAME "DTSRAPI"
@ -120,7 +121,7 @@
/*------------------- PRIVATE GLOBALS ---------------------*/
/* Usrblk should not be visible to user interface code,
* but must be visible to real engine... */
USRBLK usrblk = { 0 };
USRBLK usrblk = { { 0 } };
static int save_search_type = '$';
static char *sprintbuf = NULL;
@ -321,7 +322,7 @@ int DtSearchInit (
sprintbuf = austext_malloc (SPRINTBUFSZ, PROGNAME "135", NULL);
/* Open msgs and help text catalogs. */
if (switches & DtSrInNOLOCALE == 0) {
if (switches & (DtSrInNOLOCALE == 0)) {
setlocale (LC_ALL, "");
dtsearch_catd = catopen (FNAME_DTSRCAT, 0);
}

View file

@ -66,6 +66,7 @@
*/
#include "SearchE.h"
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#define MS_misc 1

View file

@ -75,6 +75,7 @@
*/
#include "SearchE.h"
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include "vista.h"
@ -93,6 +94,8 @@ extern time_t hctree_id; /**** hardcoded only temporarily ******/
static int max_abstrbufsz = 0;
static int max_ormisc_size;
char *strupr(char *);
/************************************************/
/* */
/* dummy_workproc */
@ -669,7 +672,7 @@ static void store_next_misc (
* terminate the abstract string in case there are no more misc recs.
* (but should not occur).
*/
if (store_state = STORE_ABSTR)
if ((store_state = STORE_ABSTR))
*targ = 0;
return;
} /* store_next_misc() */

View file

@ -57,6 +57,7 @@
*/
#include "SearchP.h"
#include <errno.h>
#include <stdlib.h>
#define X_INCLUDE_STRING_H
#define XOS_USE_NO_LOCKING

View file

@ -51,6 +51,7 @@
* Name changes for DtSearch.
*/
#include "SearchP.h"
#include <stdlib.h>
#define X_INCLUDE_STRING_H
#define XOS_USE_NO_LOCKING

View file

@ -232,6 +232,7 @@ static UCHAR *save_parg_string = NULL;
static UCHAR *substrbuf = NULL;
static long substr_offset;
char *ensure_end_slash (char *pathstr);
/************************************************/
/* */
@ -311,7 +312,7 @@ static int read_jchar (void)
jstate = JS_KANJI;
else
jstate = jstates_set1 [(jchar[0] & 0x7F) - 32];
if (jchar[1] = readchar (NULL))
if ((jchar[1] = readchar (NULL)))
readcount++;
else
jstate = JS_ETX;
@ -362,7 +363,7 @@ static int read_jchar (void)
if (jchar[0] == SS2_CHAR) {
jcharlen = 2;
jstate = JS_HALFKATA;
if (jchar[1] = readchar (NULL))
if ((jchar[1] = readchar (NULL)))
readcount++;
else
jstate = JS_ETX;
@ -908,7 +909,7 @@ FILL_ANOTHER_SUBSTRING:
* one by one, ie parse and return word tokens from string,
* including possible kanji compounds if switched on.
*/
if (token = parse_substring())
if ((token = parse_substring()))
return (char *) token;
/* When current substring is empty, go back and fill another one.

View file

@ -156,6 +156,8 @@ typedef struct prule_t {
char is_last_rule; /* '$' terminate or '>' continue algorithm */
} PRULE;
char *ensure_end_slash (char *pathstr);
void unload_jpn_language (DBLK *dblk);
/************************************************/
/* */
@ -389,7 +391,7 @@ char *teskey_parser (PARG *parg)
READ_ANOTHER_WORD:
outp = outbuf;
tpstate = BETW_WORDS;
while (*outp = cofunction (cofunction_arg)) {
while ((*outp = cofunction (cofunction_arg))) {
readcount++;
cofunction_arg = NULL;
@ -421,7 +423,7 @@ READ_ANOTHER_WORD:
* Otherwise discard just like non_concord.
*/
outp++;
if (*outp = cofunction(NULL))
if ((*outp = cofunction(NULL)))
readcount++;
if ((charmap[*outp] & CONCORDABLE) != 0) {
*outp = charmap[*outp] & 0x00ff;
@ -476,7 +478,7 @@ READ_ANOTHER_WORD:
}
/* Must be opt_concord... */
outp++;
if (*outp = cofunction(NULL))
if ((*outp = cofunction(NULL)))
readcount++;
if ((charmap[*outp] & CONCORDABLE) != 0) {
if (outp < endmaxword) {

View file

@ -50,6 +50,7 @@
* Freeze DtSearch 0.1, AusText 2.1.8
*/
#include "SearchP.h"
#include <stdlib.h>
#define PROGNAME "MSGS"
/****************************************/

View file

@ -67,6 +67,7 @@
*/
#include "SearchP.h"
#include <stdlib.h>
#define X_INCLUDE_STRING_H
#define XOS_USE_NO_LOCKING
#include <X11/Xos_r.h>

View file

@ -102,6 +102,7 @@
*/
#include "SearchE.h"
#include <ctype.h>
#include <stdlib.h>
#define X_INCLUDE_STRING_H
#define XOS_USE_NO_LOCKING
@ -110,6 +111,8 @@
#include <unistd.h> /* for POSIX getcwd() */
#include <sys/stat.h>
char *strupr (char *s);
/*****#define DEBUG_DUMP******/
/********#define DEBUG_OEF**********/
@ -145,13 +148,13 @@ char *OE_inittab_dir = NULL;
********/
OEFTAB oef_table[] =
{
"AUDIT", &OEF_audit, FALSE,
"DISCARD", &OEF_discard, FALSE,
"NEWS", &OEF_news, FALSE,
"NOTESNOT", &OEF_notesnot, FALSE,
"NOTESSEM", &OEF_notessem, FALSE,
"README", &OEF_readme, FALSE,
NULL, NULL, FALSE /* end of list */
{ "AUDIT", &OEF_audit, FALSE, },
{ "DISCARD", &OEF_discard, FALSE, },
{ "NEWS", &OEF_news, FALSE, },
{ "NOTESNOT", &OEF_notesnot, FALSE, },
{ "NOTESSEM", &OEF_notessem, FALSE, },
{ "README", &OEF_readme, FALSE, },
{ NULL, NULL, FALSE }, /* end of list */
};

View file

@ -99,6 +99,7 @@
*/
#include "SearchE.h"
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>

View file

@ -68,12 +68,10 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include "vista.h"
#include "dbtype.h"
char *malloc(P1(unsigned));
char *calloc(P1(unsigned) Pi(unsigned));
#define memlock(p) (p)
#define memunlock(p) 1

View file

@ -51,6 +51,7 @@
/* Get current member type
*/
int
d_cmtype(set, cmtype TASK_PARM DBN_PARM)
int set;
int FAR *cmtype;

View file

@ -73,6 +73,7 @@ typedef struct {
/* Connect the current record as member of set
*/
int
d_connect(set TASK_PARM DBN_PARM)
int set; /* Set constant */
TASK_DECL
@ -357,8 +358,8 @@ char FAR *mem2; /* member record 2 */
/* compare the two fields */
/* computation is pointer to next sort field in member record */
fld_ptr = &field_table[srt1_ptr->se_fld];
if (cmp = fldcmp(fld_ptr, mem1 + fld_ptr->fd_ptr,
mem2 + field_table[srt2_ptr->se_fld].fd_ptr))
if ((cmp = fldcmp(fld_ptr, mem1 + fld_ptr->fd_ptr,
mem2 + field_table[srt2_ptr->se_fld].fd_ptr)))
return (cmp); /* return at first unequal fields */
}
/* fields match */

View file

@ -50,6 +50,7 @@
/* Get current owner type
*/
int
d_cotype(set, cotype TASK_PARM DBN_PARM)
int set;
int FAR *cotype;

View file

@ -49,6 +49,7 @@
/* Get current record
*/
int
d_crget(dba TASK_PARM DBN_PARM)
DB_ADDR FAR *dba; /* db address of record to become current */
TASK_DECL
@ -58,7 +59,7 @@ DBN_DECL
if ( ! dbopen ) RETURN( dberr(S_DBOPEN) );
if ( *dba = curr_rec )
if (( *dba = curr_rec ))
db_status = S_OKAY;
else
db_status = S_NOCR;

View file

@ -50,6 +50,7 @@
/* Read data from field of current record
*/
int
d_crread(field, data TASK_PARM DBN_PARM)
long field; /* Field constant */
char FAR *data; /* Data area to contain field contents */

View file

@ -49,6 +49,7 @@
/* Set current record
*/
int
d_crset(dba TASK_PARM DBN_PARM)
DB_ADDR FAR *dba; /* db address of record to become current */
TASK_DECL

View file

@ -49,6 +49,7 @@
/* Get current record type
*/
int
d_crtype(crtype TASK_PARM DBN_PARM)
int FAR *crtype;
TASK_DECL

View file

@ -50,6 +50,7 @@
/* Write data to a field in the current record
*/
int
d_crwrite(field, data TASK_PARM DBN_PARM)
long field; /* field constant */
char FAR *data; /* data area to contain field contents */

View file

@ -49,6 +49,7 @@
/* Get current set member
*/
int
d_csmget(set, dba TASK_PARM DBN_PARM)
int set; /* Set table entry */
DB_ADDR FAR *dba; /* db address of record to become current */

View file

@ -50,6 +50,7 @@
/* Read data from field of current set member
*/
int
d_csmread(set, field, data TASK_PARM DBN_PARM)
int set; /* Set constant */
long field; /* Field constant */

View file

@ -49,6 +49,7 @@
/* Set current set member
*/
int
d_csmset(set, dba TASK_PARM DBN_PARM)
int set; /* Set table entry */
DB_ADDR FAR *dba; /* db address of record to become current */

View file

@ -50,6 +50,7 @@
/* Write data to a field in the current set member
*/
int
d_csmwrite(set, field, data TASK_PARM DBN_PARM)
int set; /* Set constant */
long field; /* Field constant */

View file

@ -50,6 +50,7 @@
/* Get current set owner
*/
int
d_csoget(set, dba TASK_PARM DBN_PARM)
int set; /* Set table entry */
DB_ADDR FAR *dba; /* db address of record to become current */

View file

@ -50,6 +50,7 @@
/* Read data from field of current set owner
*/
int
d_csoread(set, field, data TASK_PARM DBN_PARM)
int set; /* Set constant */
long field; /* Field constant */

View file

@ -50,6 +50,7 @@
/* Set current set owner
*/
int
d_csoset(set, dba TASK_PARM DBN_PARM)
int set; /* Set table entry */
DB_ADDR FAR *dba; /* db address of record to become current */

View file

@ -50,6 +50,7 @@
/* Write data to a field in the current set owner
*/
int
d_csowrite(set, field, data TASK_PARM DBN_PARM)
int set; /* Set constant */
long field; /* Field constant */

View file

@ -43,6 +43,7 @@
/* Decode file and slot number from a database address
*/
int
d_decode_dba(dba, file, slot)
DB_ADDR dba; /* database address */
int FAR *file; /* returned file number */
@ -57,6 +58,7 @@ long FAR *slot; /* returned slot number */
/* Encode database address from file and slot number
*/
int
d_encode_dba(file, slot, dba)
int file; /* returned file number */
long slot; /* returned slot number */

View file

@ -49,6 +49,7 @@
/* Set Database Dictionary Path
*/
int
d_dbdpath(path TASK_PARM)
CONST char FAR *path;
TASK_DECL

View file

@ -49,6 +49,7 @@
/* Set Database Files Path
*/
int
d_dbfpath(path TASK_PARM)
CONST char FAR *path;
TASK_DECL

View file

@ -275,6 +275,7 @@ TASK_DECL
/* Open db_VISTA database
*/
int
d_open(dbnames, opentype TASK_PARM)
CONST char FAR *dbnames;
CONST char FAR *opentype;
@ -441,6 +442,7 @@ TASK FAR *tsk;
/* Initialize multiple database table entries
*/
int
initdbt(dbnames )
CONST char FAR *dbnames;
{
@ -901,6 +903,7 @@ static int bld_lock_tables()
/****************************************/
/* Close database
*/
int
d_close(TASK_ONLY)
TASK_DECL
{

View file

@ -627,6 +627,10 @@ typedef struct page_entry {
} PAGE_ENTRY;
#define buff Buff.ptr
#include <string.h>
#ifndef _STRING_H
#define _STRING_H
#endif
#include "proto.h"
#ifdef MULTI_TASK
#ifdef NO_DT_COVER

View file

@ -51,6 +51,7 @@
/* Set Database User Identifier
*/
int
d_dbuserid(id TASK_PARM)
CONST char FAR *id;
TASK_DECL

View file

@ -52,6 +52,7 @@ static DB_ADDR zap_dba = NULL_DBA;
/* Delete the current record, with error checking
*/
int
d_delete(TASK_DBN_ONLY)
TASK_DECL
DBN_DECL

View file

@ -54,6 +54,7 @@
/* Warning: this function will destroy the entire contents
of the database
*/
int
d_destroy(dbname TASK_PARM)
CONST char FAR *dbname;
TASK_DECL

View file

@ -228,6 +228,7 @@ static int dio_in(P1(PAGE_ENTRY FAR *) Pi(LOOKUP_ENTRY FAR *)
/* Set the maximum number of open db_VISTA files
*/
int
d_setfiles(num)
int num;
{
@ -242,6 +243,7 @@ int num;
/* Set number of virtual memory pages
*/
int
d_setpages(dbpgs, ixpgs)
int dbpgs; /* # of db cache pages */
int ixpgs; /* # of index cache pages - ignored in single-user version */
@ -266,6 +268,7 @@ int ixpgs; /* # of index cache pages - ignored in single-user version */
/****************************************/
/* Open a database file
*/
int
dio_open( fno )
FILE_NO fno;
{
@ -313,6 +316,7 @@ FILE_NO fno;
/****************************************/
/* Close a database file
*/
int
dio_close( fno )
FILE_NO fno;
{
@ -335,6 +339,7 @@ FILE_NO fno;
/****************************************/
/* Initialize database I/O
*/
int
dio_init()
{
CHAR_P Tempbuff;
@ -549,6 +554,7 @@ void dio_free()
/****************************************/
/* Clear pages for a single file.
*/
int
dio_clrfile(fno )
register FILE_NO fno;
{
@ -564,6 +570,7 @@ register FILE_NO fno;
/****************************************/
/* Clear all pages for *all* files from I/O buffer
*/
int
dio_clear()
{
return( clear_cache(0, size_ft) );
@ -787,6 +794,7 @@ FILE_NO file_no;
/****************************************/
/* Database I/O page get
*/
int
dio_get( page_no, page_ptr, hold )
F_ADDR page_no;
char FAR * FAR *page_ptr;
@ -829,6 +837,7 @@ int hold;
/****************************************/
/* Set modified flag for a page
*/
int
dio_touch( page_no )
F_ADDR page_no;
{
@ -879,6 +888,7 @@ F_ADDR page_no;
* Merely returns ptr into rec in a page
* unless a page swap is necessary.
*/
int
dio_read( dba, recptr, hold )
DB_ADDR dba;
char FAR * FAR *recptr;
@ -935,6 +945,7 @@ int hold;
* Sets page's 'touched' flags, timestamps, etc.
* If recptr not NULL, copies rec to page cache.
*/
int
dio_write( dba, recptr, release )
DB_ADDR dba;
CONST char FAR *recptr;
@ -994,6 +1005,7 @@ int release;
/* Release database page hold
*/
int
dio_release( dba )
DB_ADDR dba;
{
@ -1130,6 +1142,7 @@ INT rid;
/****************************************/
/* Search a cache for page
*/
int
dio_findpg(file, page, pg_table, xpg_ptr, xlu_ptr )
FILE_NO file; /* file number = 0..size_ft-1 */
F_ADDR page; /* database page number */
@ -1435,6 +1448,7 @@ LOOKUP_ENTRY FAR * FAR *xlu_ptr;/* pointer to lookup table slot for found page*/
* slot is byte swapped before the io by calling the
* page swap function.
*/
int
#ifndef NO_TRANS
dio_out(pg_ptr, lu_ptr, db_cache)
#else
@ -1722,6 +1736,7 @@ static int dio_pzflush()
/****************************************/
/* Read a file's page zero
*/
int
dio_pzread(fno)
FILE_NO fno; /* file number */
{
@ -1764,6 +1779,7 @@ FILE_NO fno; /* file number */
* ie from delete chain if possible.
* Returns memory address of the free slot into 'loc'.
*/
int
dio_pzalloc(fno, loc )
FILE_NO fno; /* file number */
F_ADDR *loc; /* pointer to allocated location */
@ -1831,6 +1847,7 @@ F_ADDR *loc; /* pointer to allocated location */
/****************************************/
/* Delete record slot or key node from page zero
*/
int
dio_pzdel(fno, loc )
FILE_NO fno; /* file number */
F_ADDR loc; /* location to be freed */

View file

@ -67,6 +67,7 @@ typedef struct {
/* Disconnect the current member of set
*/
int
d_discon(nset TASK_PARM DBN_PARM)
int nset; /* set number */
TASK_DECL

View file

@ -50,6 +50,7 @@
/* Disconnect from all sets (owner and member) and delete record
*/
int
d_disdel(TASK_DBN_ONLY)
TASK_DECL
DBN_DECL

View file

@ -54,6 +54,7 @@
/* Create and fill a new record
*/
int
d_fillnew( nrec, recval TASK_PARM DBN_PARM )
int nrec; /* record number */
CONST char FAR *recval; /* record value */

View file

@ -49,6 +49,7 @@
/* Find owner of current record
*/
int
d_findco(nset TASK_PARM DBN_PARM)
int nset;
TASK_DECL

View file

@ -49,6 +49,7 @@
/* Find first member of set
*/
int
d_findfm(nset TASK_PARM DBN_PARM)
int nset;
TASK_DECL

View file

@ -49,6 +49,7 @@
/* Find last member of set
*/
int
d_findlm(nset TASK_PARM DBN_PARM)
int nset;
TASK_DECL

View file

@ -49,6 +49,7 @@
/* Find next member of set
*/
int
d_findnm(nset TASK_PARM DBN_PARM)
int nset;
TASK_DECL

View file

@ -49,6 +49,7 @@
/* Find previous member of set
*/
int
d_findpm(nset TASK_PARM DBN_PARM)
int nset;
TASK_DECL

View file

@ -87,6 +87,7 @@ extern int max_open_files; /* see dio.c */
/* Database initialization function
*/
int
d_initialize(TASK_DBN_ONLY)
TASK_DECL
DBN_DECL
@ -111,6 +112,7 @@ DBN_DECL
/* Initialize database file
*/
int
d_initfile(fno TASK_PARM DBN_PARM)
FILE_NO fno; /* file table entry of file to be initialized */
TASK_DECL

View file

@ -94,6 +94,7 @@ static int initcurr(P0);
/* Initialize database tables
*/
int
inittab()
{
register int dbt_lc; /* loop control */

View file

@ -50,6 +50,7 @@
/* Check to see if current record is a connected member of SET
*/
int
d_ismember(set TASK_PARM DBN_PARM)
int set; /* set table entry */
TASK_DECL

View file

@ -50,6 +50,7 @@
/* Check to see if current record is a owner of non-empty SET
*/
int
d_isowner(set TASK_PARM DBN_PARM)
int set; /* set table entry */
TASK_DECL

View file

@ -53,6 +53,7 @@
/* Delete optional key value
*/
int
d_keydel(field TASK_PARM DBN_PARM)
long field; /* key field constant */
TASK_DECL

View file

@ -45,6 +45,7 @@
/* Check for optional key existence
*/
int
d_keyexist(field TASK_PARM DBN_PARM)
long field; /* key field constant */
TASK_DECL

View file

@ -149,6 +149,7 @@ static int unique;
/* Open B-tree key field index processing
*/
int
key_open()
{
register int fd_lc; /* loop control */
@ -234,6 +235,7 @@ void key_close()
/* Initialize key function operation
*/
int
key_init(field )
int field; /* field number to be processed */
{
@ -267,6 +269,7 @@ int field; /* field number to be processed */
/* Reset key_info last status to reposition keys on file "fno"
*/
int
key_reset(fno )
FILE_NO fno;
{
@ -285,6 +288,7 @@ FILE_NO fno;
/* Locate proper key position on B-tree
*/
int
key_locpos(key_val, dba)
CONST char FAR *key_val; /* key search value */
DB_ADDR FAR *dba; /* database address of located key */
@ -454,6 +458,7 @@ DB_ADDR FAR *dba; /* database address included in comparison if not null */
/* Scan thru key field
*/
int
key_scan(fcn, dba )
int fcn; /* next or prev */
DB_ADDR *dba; /* db address of scanned record */
@ -571,6 +576,7 @@ DB_ADDR *dba;
/* Find key boundary
*/
int
key_boundary(fcn, dba )
int fcn; /* KEYFRST or KEYLAST */
DB_ADDR *dba; /* to get dba of first or last key */
@ -660,6 +666,7 @@ DB_ADDR *dba; /* to get dba of first or last key */
/* Insert key field into B-tree
*/
int
key_insert(fld, key_val, dba )
int fld; /* key field number */
CONST char FAR *key_val; /* key value */
@ -850,6 +857,7 @@ NODE FAR *node;
/* Delete key from B-tree
*/
int
key_delete(fld, key_val, dba )
int fld;
char CONST FAR *key_val;
@ -1140,6 +1148,7 @@ int n;
/* Read value of last key scanned
*/
int
d_keyread(key_val TASK_PARM)
char FAR *key_val;
TASK_DECL
@ -1214,6 +1223,7 @@ TASK_DECL
/* Build compound key value from record
*/
int
key_bldcom(fld, rec, key, cflag )
int fld; /* compound key field number */
char FAR *rec; /* ptr to record data */

View file

@ -56,6 +56,7 @@ static void chk_desc_key(P1(int) Pi(FIELD_ENTRY FAR *)
/* Find record thru key field
*/
int
d_keyfind(field, fldval TASK_PARM DBN_PARM)
long field; /* field constant */
CONST char FAR *fldval; /* value of the data field */

View file

@ -50,6 +50,7 @@
/* Find first key
*/
int
d_keyfrst(field TASK_PARM DBN_PARM)
long field; /* field constant */
TASK_DECL

View file

@ -50,6 +50,7 @@
/* Find last key
*/
int
d_keylast(field TASK_PARM DBN_PARM)
long field; /* field constant */
TASK_DECL

View file

@ -51,6 +51,7 @@
/* Find next record thru key field
*/
int
d_keynext(field TASK_PARM DBN_PARM)
long field; /* field constant */
TASK_DECL

View file

@ -51,6 +51,7 @@
/* Find previous record thru key field
*/
int
d_keyprev(field TASK_PARM DBN_PARM)
long field; /* field constant */
TASK_DECL

View file

@ -52,6 +52,7 @@
/* Store optional key value
*/
int
d_keystore(field TASK_PARM DBN_PARM)
long field; /* key field constant */
TASK_DECL

View file

@ -71,6 +71,7 @@ static int ctblcmp(P1(CONST unsigned char FAR*)
#ifndef ONE_DB
/* Check for valid db number and set curr_db, curr_db_table and curr_rn_table
*/
int
dbn_check(dbn)
int dbn;
{
@ -93,6 +94,7 @@ int dbn;
/* Check for valid (external) set number and return (internal) set number
and set_table pointer.
*/
int
nset_check(nset, set, set_ptr )
register int nset;
int *set;
@ -110,6 +112,7 @@ SET_ENTRY FAR * FAR *set_ptr;
/* Check for valid (external) field number and return (internal) record
and field numbers and pointers.
*/
int
nfld_check(nfld, rec, fld, rec_ptr, fld_ptr )
long nfld;
int *rec;
@ -134,6 +137,7 @@ FIELD_ENTRY FAR * FAR *fld_ptr;
/* Check for valid (external) record number and return (internal) record
number and pointer.
*/
int
nrec_check(nrec, rec, rec_ptr)
int nrec;
int *rec;
@ -301,7 +305,7 @@ CONST char FAR *f2; /* pointer to field 2 */
(sfld_ptr < fld_max) && (sfld_ptr->fd_flags & STRUCTFLD);
++sfld_ptr) {
sub_len = cur_len + sfld_ptr->fd_ptr - fld_ptr->fd_ptr;
if (k = fldcmp(sfld_ptr, f1 + sub_len, f2 + sub_len))
if ((k = fldcmp(sfld_ptr, f1 + sub_len, f2 + sub_len)))
return ( k );
}
}
@ -312,7 +316,7 @@ CONST char FAR *f2; /* pointer to field 2 */
(--kt_lc >= 0) && (&field_table[key_ptr->kt_key] == fld_ptr);
++key_ptr) {
i = key_ptr->kt_ptr;
if ( k = fldcmp(&field_table[key_ptr->kt_field], f1 + i, f2 + i) )
if (( k = fldcmp(&field_table[key_ptr->kt_field], f1 + i, f2 + i) ))
return ( k );
}
return ( 0 );
@ -365,6 +369,7 @@ CONST DB_ADDR FAR *d1, FAR *d2;
/* check for empty DB_ADDR
*/
int
null_dba( db_addr )
CONST char FAR *db_addr;
{
@ -377,6 +382,7 @@ CONST char FAR *db_addr;
/* check for valid DB_ADDR
*/
int
check_dba( dba )
DB_ADDR dba;
{
@ -419,14 +425,14 @@ int n; /* Max. String length */
f2 = db_global.country_tbl.ptr[*t].sort_as1;
else f2 = *t;
if (x = f1 - f2) return(x);
if ((x = f1 - f2)) return(x);
/* Check sort_as2-values if sort_as1-values are equal */
/*----------------------------------------------------*/
x1 = db_global.country_tbl.ptr[*s].sort_as2;
x2 = db_global.country_tbl.ptr[*t].sort_as2;
if ( x1 && x2 ) { /* We have an entry for char. of both strings */
if ( x = x1 - x2 ) return(x);
if (( x = x1 - x2 )) return(x);
}
else {
if ( x1 || x2 ) { /* Only sort_as2 value for one string */
@ -435,21 +441,21 @@ int n; /* Max. String length */
if ( db_global.country_tbl.ptr[*t].sort_as1 )
f2 = db_global.country_tbl.ptr[*t].sort_as1;
else f2 = *t;
if ( x = x1 - f2 ) return(x);
if (( x = x1 - f2 )) return(x);
}
if ( x2 ) {
*s++; /* Compare with next character in string 1 */
if ( db_global.country_tbl.ptr[*s].sort_as1 )
f1 = db_global.country_tbl.ptr[*s].sort_as1;
else f1 = *s;
if ( x = f1 - x2 ) return(x);
if (( x = f1 - x2 )) return(x);
}
}
/* if both are equal compare sub_sort values */
/*-------------------------------------------*/
if (x = db_global.country_tbl.ptr[*s].sub_sort -
db_global.country_tbl.ptr[*t].sub_sort)
if ((x = db_global.country_tbl.ptr[*s].sub_sort -
db_global.country_tbl.ptr[*t].sub_sort))
return(x);
}
*s++;

View file

@ -53,6 +53,7 @@
/* Set the value of a key field
*/
int
d_setkey( field, fldvalue TASK_PARM DBN_PARM )
long field;
CONST char FAR *fldvalue;
@ -134,6 +135,7 @@ int sk_free()
/* Create a new empty record
*/
int
d_makenew( nrec TASK_PARM DBN_PARM )
int nrec;
TASK_DECL

View file

@ -50,6 +50,7 @@
/* Get number of members of the current set owner
*/
int
d_members(set, tot TASK_PARM DBN_PARM)
int set; /* Set table entry */
LONG FAR *tot; /* total members of set */

View file

@ -49,6 +49,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include "vista.h"
#ifdef MSC
#include <share.h>

View file

@ -43,6 +43,7 @@
/* Turn on db_VISTA runtime options
*/
int
d_on_opt(optflag TASK_PARM)
int optflag;
TASK_DECL
@ -75,6 +76,7 @@ TASK_DECL
/* Turn off db_VISTA runtime options
*/
int
d_off_opt(optflag TASK_PARM)
int optflag;
TASK_DECL

View file

@ -70,6 +70,7 @@ static int struct_key_chk = 1;
/* Check a field for permission to change it
*/
int
r_chkfld(field, fld_ptr, rec, data )
INT field; /* field_table entry number */
FIELD_ENTRY FAR *fld_ptr; /* corresponds to field */
@ -138,6 +139,7 @@ CONST char FAR *data; /* pointer to data area containing field contents */
/* Delete the current record
*/
int
r_delrec( rt, db_addr )
INT rt;
DB_ADDR db_addr;
@ -197,6 +199,7 @@ DB_ADDR db_addr;
/* Get data field from record
*/
int
r_gfld(fld_ptr, rec, data )
FIELD_ENTRY FAR *fld_ptr;
char FAR *rec; /* pointer to record */
@ -250,6 +253,7 @@ char FAR *data; /* pointer to data area to contain field contents */
/* Get member pointer from record
*/
int
r_gmem(set, rec, mem_addr )
int set; /* set table entry number */
char FAR *rec; /* pointer to record */
@ -281,6 +285,7 @@ char FAR *mem_addr; /* pointer to member pointer */
/* Get set pointer from record
*/
int
r_gset(set, rec, setptr )
int set; /* set table entry number */
char FAR *rec; /* pointer to record */
@ -308,6 +313,7 @@ char FAR *setptr; /* pointer to set pointer */
/* Put data field into record
*/
int
r_pfld(field, fld_ptr, rec, data, db_addr )
INT field; /* field_table entry number */
FIELD_ENTRY FAR *fld_ptr; /* corresponds to field */
@ -431,6 +437,7 @@ DB_ADDR FAR *db_addr;
/* Put member pointer into record
*/
int
r_pmem(set, rec, mem_addr )
int set; /* set table entry number */
char FAR *rec; /* pointer to record */
@ -462,6 +469,7 @@ char FAR *mem_addr; /* pointer to member pointer */
/* Put set pointer into record
*/
int
r_pset(set, rec, setptr )
int set; /* set table entry number */
char FAR *rec; /* pointer to record */
@ -491,6 +499,7 @@ char FAR *setptr; /* pointer to set pointer */
/* Set the current set member from record
*/
int
r_smem( db_addr, set )
DB_ADDR FAR *db_addr;
INT set;
@ -528,6 +537,7 @@ INT set;
}
/* Set the optional key field "stored" bit */
int
r_setopt( fld_ptr, rec )
FIELD_ENTRY FAR *fld_ptr; /* field table entry of optional key */
char FAR *rec; /* Pointer to record */
@ -555,6 +565,7 @@ char FAR *rec; /* Pointer to record */
}
/* Clear the optional key field "stored" bit */
int
r_clropt( fld_ptr, rec )
FIELD_ENTRY FAR *fld_ptr; /* Field table entry of optional key */
char FAR *rec; /* Pointer to record */
@ -582,6 +593,7 @@ char FAR *rec; /* Pointer to record */
}
/* Test the optional key field "stored" bit */
int
r_tstopt( fld_ptr, rec )
FIELD_ENTRY FAR *fld_ptr; /* Field table entry of optional key */
char FAR *rec; /* Pointer to record */

View file

@ -48,6 +48,7 @@
/* Find first record of type
*/
int
d_recfrst( rec TASK_PARM DBN_PARM )
int rec; /* record type/table entry */
TASK_DECL

View file

@ -49,6 +49,7 @@
/* Find next record of type
*/
int
d_recnext(TASK_DBN_ONLY)
TASK_DECL
DBN_DECL

View file

@ -51,6 +51,7 @@
/* Read contents of current record
*/
int
d_recread(rec TASK_PARM DBN_PARM)
char FAR *rec; /* ptr to record area */
TASK_DECL

View file

@ -51,6 +51,7 @@
/* Write contents to current record
*/
int
d_recwrite(rec TASK_PARM DBN_PARM)
CONST char FAR *rec; /* ptr to record area */
TASK_DECL

View file

@ -46,6 +46,7 @@
/* Rename database file
*/
int
d_renfile(dbn, fno, fnm TASK_PARM)
CONST char FAR *dbn; /* database containing file to be renamed */
FILE_NO fno; /* file id number for file to be renamed */
@ -86,6 +87,7 @@ TASK_DECL
/* Process renamed file table
*/
int
renfiles()
{
register int dbt_lc; /* loop control */

View file

@ -57,6 +57,7 @@ static DB_ADDR_P Cb = POINTER_INIT();
/* Read currency table
*/
int
d_rdcurr(currbuff, currsize TASK_PARM)
DB_ADDR **currbuff;
int FAR *currsize;
@ -106,6 +107,7 @@ TASK_DECL
/* Write currency table
*/
int
d_wrcurr(currbuff TASK_PARM)
DB_ADDR *currbuff;
TASK_DECL

View file

@ -52,6 +52,7 @@
#ifndef ONE_DB
/* Set current database
*/
int
d_setdb(dbn TASK_PARM)
int dbn; /* database number */
TASK_DECL

View file

@ -49,6 +49,7 @@
/* Set current member to current member
*/
int
d_setmm(sett, sets TASK_PARM DBN_PARM)
int sett; /* set table entry number of target member */
int sets; /* set table entry number of source member */

View file

@ -49,6 +49,7 @@
/* Set current member to current owner
*/
int
d_setmo(setm, seto TASK_PARM DBN_PARM)
int setm; /* set table entry number of member */
int seto; /* set table entry number of owner */

View file

@ -49,6 +49,7 @@
/* Set current member to current record
*/
int
d_setmr(set TASK_PARM DBN_PARM)
int set; /* set table entry number */
TASK_DECL

View file

@ -50,6 +50,7 @@
/* Set current owner to current member
*/
int
d_setom(nseto, nsetm TASK_PARM DBN_PARM)
int nseto; /* set table entry number of owner */
int nsetm; /* set table entry number of member */

View file

@ -50,6 +50,7 @@
/* Set current owner to current owner
*/
int
d_setoo(nsett, nsets TASK_PARM DBN_PARM)
int nsett; /* set table entry number of target owner */
int nsets; /* set table entry number of source owner */

View file

@ -49,6 +49,7 @@
/* Set current owner to current record
*/
int
d_setor(nset TASK_PARM DBN_PARM)
int nset; /* set number */
TASK_DECL

View file

@ -49,6 +49,7 @@
/* Set current record to current member
*/
int
d_setrm(set TASK_PARM DBN_PARM)
int set; /* set table entry number */
TASK_DECL

View file

@ -49,6 +49,7 @@
/* Set current record to current owner
*/
int
d_setro(set TASK_PARM DBN_PARM)
int set; /* set table entry number */
TASK_DECL

View file

@ -395,4 +395,5 @@ typedef struct {
#ifdef MULTI_TASK
#include "task.h"
#endif
/* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC vista.h */

View file

@ -59,6 +59,7 @@
* Initial revision
*/
#include "SearchP.h"
#include <stdlib.h>
#include <string.h>
#define PROGNAME "READCHAR"

View file

@ -63,6 +63,7 @@
*/
#include "SearchE.h"
#include <ctype.h>
#include <stdlib.h>
#include "vista.h"
#define PROGNAME "VEDELETE"

View file

@ -96,6 +96,7 @@
#define MEMORY_SIZE 64000 /* 65536 is 64 KBytes of memory */
#define REC_TYPES 256
#define NORM_VALUE 30
#undef INFINITY /* XXX does GCC's __builtin_inff() work here? */
#define INFINITY 9999.0
#define SORT_MESG 10000
#define CHAR_BITS 8