case TT_API_CALL_LAST: return NULL;
#endif
}
+ return (const char *) NULL;
}
static void _readallrecords(), _attach_dups_serial();
static Blkno _buildbtree();
static int _duplicate_exist();
-static checkavailfd();
+static void checkavailfd(void);
/*
* _amaddindex(isfhandle, keydesc, errcode)
-Static
-checkavailfd()
+static void
+checkavailfd(void)
{
Fcb *fcb;
Bytearray *isfhandle2;
#include "isam_impl.h"
extern int _iskeycmp();
-Static insert_key();
+
+void leftkey_up(Btree *, int);
+
+static void insert_key(Btree *, char *, int, char *, Blkno);
+static void splitblock(Btree *, char *, char *, int);
/* _isbtree_insert() - Insert entry into B-tree ----------------------------*/
void
-_isbtree_insert(btree, key)
- register Btree *btree;
- char *key;
+_isbtree_insert(Btree *btree, char *key)
{
Keydesc2 *pkeydesc2 = btree->keydesc2;
int keylength = pkeydesc2->k2_len;
/*--------- insert supporting local functions -------------------------------*/
/* leftkey_up() - Update upper levels with new leftmost entry -----------*/
-leftkey_up(btree, level)
- register Btree *btree;
- int level;
+void
+leftkey_up(Btree *btree, int level)
{
int keylength = btree->keydesc2->k2_len;
char *pkp;
}
/* insert_key - Insert key into block ------------------------*/
-Static insert_key(btree, pkp, pos, key, blkno)
- register Btree *btree;
- char *pkp;
- int pos;
- char *key;
- Blkno blkno;
+static void
+insert_key(Btree *btree, char *pkp, int pos, char *key, Blkno blkno)
{
int keylength = btree->keydesc2->k2_len;
int nkeys = ldshort(pkp + BT_NKEYS_OFF);
}
/* splitblock() - Split block into two -----------------------------*/
-splitblock(btree, fullpage, newpage, pos)
- register Btree *btree;
- register char *fullpage, *newpage;
- int pos;
+static void
+splitblock(Btree *btree, char *fullpage, char *newpage, int pos)
{
int keylength = btree->keydesc2->k2_len;
int nkeys, capac, level;
#include "isam_impl.h"
extern int _iskeycmp();
-static remove_entry();
+
+static void remove_entry(Btree *, char *, int);
+static void move_from_right(Btree *, char *, char *, int);
+static void move_from_left(Btree *, char *, char *, int);
/* _isbtree_remove() - Remove entry from B-tree ----------------------------*/
void
-_isbtree_remove(btree)
- register Btree *btree;
+_isbtree_remove(Btree *btree)
{
struct keydesc2 *pkeydesc2 = btree->keydesc2;
int nkeys; /* Number of keys in the page */
/*--------- remove supporting local functions -------------------------------*/
-static remove_entry(btree, pkp, pos)
- register Btree *btree;
- char *pkp;
- int pos;
+static void
+remove_entry(Btree *btree, char *pkp, int pos)
{
int keylength = btree->keydesc2->k2_len;
int nkeys = ldshort(pkp + BT_NKEYS_OFF);
stshort((short) (nkeys - 1), pkp + BT_NKEYS_OFF);
}
-move_from_right(btree, l, r, move_keys)
- Btree *btree;
- char *l, *r;
- int move_keys;
+static void
+move_from_right(Btree *btree, char *l, char *r, int move_keys)
{
int keylength = btree->keydesc2->k2_len;
int lnkeys = ldshort(l + BT_NKEYS_OFF);
stshort((short) rnkeys, r + BT_NKEYS_OFF);
}
-move_from_left(btree, l, r, move_keys)
- Btree *btree;
- char *l, *r;
- int move_keys;
+static void
+move_from_left(Btree *btree, char *l, char *r, int move_keys)
{
int keylength = btree->keydesc2->k2_len;
int lnkeys = ldshort(l + BT_NKEYS_OFF);
}
*++p = '\0';
+ return 0;
}
int
/* Pad with blanks. */
if (len > 0)
(void) memset((void *) dst, BLANK, len);
+ return 0;
}
/* ldchar2() - Load character field (C style, NULL padded) */
/* Load the entire string. */
memcpy((void *) dst, (const void *) src, len);
*(dst + len) = '\0';
+ return 0;
}
int
/* Pad with NULLs. */
if (len > 0)
memset(dst, 0, len);
+ return 0;
}
/* ldfloat() - Load a float number from a potentially unaligned address */
register char *p;
{
memcpy ( p,(char *)&val, DOUBLESIZE);
+ return 0;
}
#else /* 386i -- do it the long way round.... */
static int (*fatal_error_user_handler)(); /* set by iscntl(..,ISCNTL_FATAL,..) */
void
-_isfatal_error(msg)
- char *msg;
+_isfatal_error(char *msg)
{
int logerr;
}
void
-_isfatal_error1(msg)
- char *msg;
+_isfatal_error1(char *msg)
{
extern int _is_rpcnetisamd; /* is 1 if this is rpc.netisamd */
extern int _is_netisamlockd; /* is 1 if this is netisamlockd */
}
}
-_isam_warning(msg)
- char *msg;
+void
+_isam_warning(char *msg)
{
openlog("NetISAM", LOG_PID, LOG_USER);
syslog(LOG_ERR, "%s", msg);
*/
void
-_setiserrno2(error, is1, is2)
- int error;
- int is1, is2;
+_setiserrno2(int error, int is1, int is2)
{
iserrno = error;
isstat1 = is1;
*/
void
-_seterr_errcode(errcode)
- register struct errcode *errcode;
+_seterr_errcode(struct errcode *errcode)
{
iserrno = errcode->iserrno;
isstat1 = errcode->isstat[0];
* _iskey_itox(pikdesc,pxkdesc)
*
* Convert internal key desc. to X/OPEN key descriptor.
+ *
+ * @param pikdesc NetISAM internal format
+ * @param pxkdesc X/OPEN format
*/
-
-_iskey_itox(pikdesc,pxkdesc)
- register struct keydesc2 *pikdesc; /* NetISAM internal format */
- register struct keydesc *pxkdesc; /* X/OPEN format */
+void
+_iskey_itox(struct keydesc2 *pikdesc, struct keydesc *pxkdesc)
{
int nparts;
register int i;
*
* Convert X/OPEN key descriptor to internal key descriptor.
*
+ * @param pikdesc NetISAM internal format
+ * @param pxkdesc X/OPEN format
*/
-
-_iskey_xtoi(pikdesc,pxkdesc)
- register struct keydesc2 *pikdesc; /* NetISAM internal format */
- register struct keydesc *pxkdesc; /* X/OPEN format */
+void
+_iskey_xtoi(struct keydesc2 *pikdesc, struct keydesc *pxkdesc)
{
int nparts;
register int i;
*/
Static char *rp_readrecord_v(), *rp_readrecord_f();
-Static printkey();
-Static cmd_error();
+Static int printkey(int, struct keydesc *, int (*)(const char *, ...));
+Static void cmd_error(const char *, int (*)(const char *, ...));
Static int typeletter();
Static rp_readcntlpg();
static int isnoprintf(const char *, ...);
+
isrepair(isfname, verbose)
char *isfname;
int verbose;
return(0);
}
-static
-printkey(n, pkdesc, print)
- int n;
- struct keydesc *pkdesc;
- int (*print)();
+static int
+printkey(int n, struct keydesc *pkdesc, int (*print)(const char *, ...))
{
int i;
struct keypart *pk;
(pk->kp_type & ISDESC)?"D":" ");
}
print("\n");
+ return 1;
}
-static
-cmd_error(str,print)
- char *str;
- int (*print)();
+static void
+cmd_error(const char *str, int (*print)(const char *, ...))
{
(void)print("%s: ISAM error %d\n", str, iserrno);
}
return (oldmask);
}
-_issignals_mask()
+void
+_issignals_mask(void)
{
if (do_mask && !already_masked) {
(void) sigfillset(&allsignals);
}
}
-_issignals_unmask()
+void
+_issignals_unmask(void)
{
if (do_mask) {
(void)sigprocmask(SIG_SETMASK, &oldmask, NULL);