cosmetic changes - make keylist[] static and remove extern definition
in fsort.h, move macro SALIGN() from sort.h to fsort.c
This commit is contained in:
parent
ac52e9e4de
commit
7f547730fd
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: fsort.c,v 1.12 2001/02/05 14:25:34 itojun Exp $ */
|
/* $NetBSD: fsort.c,v 1.13 2001/02/19 19:31:29 jdolecek Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1993
|
* Copyright (c) 1993
|
||||||
@ -47,14 +47,14 @@
|
|||||||
#include "fsort.h"
|
#include "fsort.h"
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
__RCSID("$NetBSD: fsort.c,v 1.12 2001/02/05 14:25:34 itojun Exp $");
|
__RCSID("$NetBSD: fsort.c,v 1.13 2001/02/19 19:31:29 jdolecek Exp $");
|
||||||
__SCCSID("@(#)fsort.c 8.1 (Berkeley) 6/6/93");
|
__SCCSID("@(#)fsort.c 8.1 (Berkeley) 6/6/93");
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
const u_char **keylist = 0;
|
static const u_char **keylist = 0;
|
||||||
u_char *buffer = 0, *linebuf = 0;
|
u_char *buffer = 0, *linebuf = 0;
|
||||||
size_t bufsize = DEFLLEN;
|
size_t bufsize = DEFLLEN;
|
||||||
size_t linebuf_size;
|
size_t linebuf_size;
|
||||||
@ -64,6 +64,7 @@ extern char *toutpath;
|
|||||||
int PANIC = FSORTMAX;
|
int PANIC = FSORTMAX;
|
||||||
|
|
||||||
#define MSTART (MAXFCT - MERGE_FNUM)
|
#define MSTART (MAXFCT - MERGE_FNUM)
|
||||||
|
#define SALIGN(n) ((n+sizeof(length_t)-1) & ~(sizeof(length_t)-1))
|
||||||
|
|
||||||
void
|
void
|
||||||
fsort(binno, depth, top, filelist, nfiles, outfp, ftbl)
|
fsort(binno, depth, top, filelist, nfiles, outfp, ftbl)
|
||||||
@ -142,6 +143,7 @@ fsort(binno, depth, top, filelist, nfiles, outfp, ftbl)
|
|||||||
crec =(RECHEADER *) ((char *) crec +
|
crec =(RECHEADER *) ((char *) crec +
|
||||||
SALIGN(crec->length) + sizeof(TRECHEADER));
|
SALIGN(crec->length) + sizeof(TRECHEADER));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == BUFFEND && nelem < min(9, MAXNUM)) {
|
if (c == BUFFEND && nelem < min(9, MAXNUM)) {
|
||||||
const u_char **keyp;
|
const u_char **keyp;
|
||||||
u_char *oldb = buffer;
|
u_char *oldb = buffer;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: fsort.h,v 1.6 2001/01/19 10:12:35 jdolecek Exp $ */
|
/* $NetBSD: fsort.h,v 1.7 2001/02/19 19:31:29 jdolecek Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1993
|
* Copyright (c) 1993
|
||||||
@ -51,7 +51,6 @@
|
|||||||
*/
|
*/
|
||||||
#define MERGE_FNUM 16
|
#define MERGE_FNUM 16
|
||||||
|
|
||||||
extern const u_char **keylist;
|
|
||||||
extern u_char *buffer, *linebuf;
|
extern u_char *buffer, *linebuf;
|
||||||
extern size_t bufsize, linebuf_size;
|
extern size_t bufsize, linebuf_size;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: sort.h,v 1.11 2001/01/19 10:14:31 jdolecek Exp $ */
|
/* $NetBSD: sort.h,v 1.12 2001/02/19 19:31:29 jdolecek Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1993
|
* Copyright (c) 1993
|
||||||
@ -84,8 +84,6 @@
|
|||||||
/* length of record is currently limited to maximum string length (size_t) */
|
/* length of record is currently limited to maximum string length (size_t) */
|
||||||
typedef size_t length_t;
|
typedef size_t length_t;
|
||||||
|
|
||||||
#define SALIGN(n) ((n+sizeof(length_t)-1) & ~(sizeof(length_t)-1))
|
|
||||||
|
|
||||||
/* a record is a key/line pair starting at rec.data. It has a total length
|
/* a record is a key/line pair starting at rec.data. It has a total length
|
||||||
* and an offset to the start of the line half of the pair.
|
* and an offset to the start of the line half of the pair.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user