version 1.13, 2003/06/26 00:12:39 |
version 1.14, 2004/07/20 03:50:27 |
|
|
static int insert(struct mfile **, struct mfile **, int, int); |
static int insert(struct mfile **, struct mfile **, int, int); |
|
|
void |
void |
fmerge(binno, files, nfiles, get, outfp, fput, ftbl) |
fmerge(int binno, union f_handle files, int nfiles, |
union f_handle files; |
int (*get)(int, union f_handle, int, RECHEADER *, u_char *, struct field *), |
int binno, nfiles; |
FILE *outfp, void (*fput)(RECHEADER *, FILE *), struct field *ftbl) |
int (*get)(int, union f_handle, int, RECHEADER *, u_char *, struct field *); |
|
FILE *outfp; |
|
void (*fput)(RECHEADER *, FILE *); |
|
struct field *ftbl; |
|
{ |
{ |
FILE *tout; |
FILE *tout; |
int i, j, last; |
int i, j, last; |
|
|
} |
} |
|
|
void |
void |
merge(infl0, nfiles, get, outfp, put, ftbl) |
merge(int infl0, int nfiles, |
int infl0, nfiles; |
int (*get)(int, union f_handle, int, RECHEADER *, u_char *, struct field *), |
int (*get)(int, union f_handle, int, RECHEADER *, u_char *, struct field *); |
FILE *outfp, void (*put)(RECHEADER *, FILE *), struct field *ftbl) |
void (*put)(RECHEADER *, FILE *); |
|
FILE *outfp; |
|
struct field *ftbl; |
|
{ |
{ |
int c, i, j; |
int c, i, j; |
union f_handle dummy = {0}; |
union f_handle dummy = {0}; |
|
|
* otherwise just inserts *rec in flist. |
* otherwise just inserts *rec in flist. |
*/ |
*/ |
static int |
static int |
insert(flist, rec, ttop, delete) |
insert(struct mfile **flist, struct mfile **rec, int ttop, |
struct mfile **flist, **rec; |
int delete) /* delete = 0 or 1 */ |
int delete, ttop; /* delete = 0 or 1 */ |
|
{ |
{ |
struct mfile *tmprec; |
struct mfile *tmprec; |
int top, mid, bot = 0, cmpv = 1; |
int top, mid, bot = 0, cmpv = 1; |
|
|
* check order on one file |
* check order on one file |
*/ |
*/ |
void |
void |
order(infile, get, ftbl) |
order(union f_handle infile, |
union f_handle infile; |
int (*get)(int, union f_handle, int, RECHEADER *, u_char *, struct field *), |
int (*get)(int, union f_handle, int, RECHEADER *, u_char *, struct field *); |
struct field *ftbl) |
struct field *ftbl; |
|
{ |
{ |
u_char *crec_end, *prec_end, *trec_end; |
u_char *crec_end, *prec_end, *trec_end; |
int c; |
int c; |
|
|
} |
} |
|
|
static int |
static int |
cmp(rec1, rec2) |
cmp(RECHEADER *rec1, RECHEADER *rec2) |
RECHEADER *rec1, *rec2; |
|
{ |
{ |
int r; |
int r; |
u_char *pos1, *pos2, *end; |
u_char *pos1, *pos2, *end; |