Reflect size_t changes in glob.h

Obtained from: NetBSD (mostly)
This commit is contained in:
Andrey A. Chernov 2006-05-22 06:33:19 +00:00
parent d61b5f8ac7
commit 4b767fa67f

@ -144,7 +144,7 @@ typedef char Char;
static int compare(const void *, const void *); static int compare(const void *, const void *);
static int g_Ctoc(const Char *, char *, u_int); static int g_Ctoc(const Char *, char *, size_t);
static int g_lstat(Char *, struct stat *, glob_t *); static int g_lstat(Char *, struct stat *, glob_t *);
static DIR *g_opendir(Char *, glob_t *); static DIR *g_opendir(Char *, glob_t *);
static Char *g_strchr(Char *, wchar_t); static Char *g_strchr(Char *, wchar_t);
@ -152,15 +152,15 @@ static Char *g_strchr(Char *, wchar_t);
static Char *g_strcat(Char *, const Char *); static Char *g_strcat(Char *, const Char *);
#endif #endif
static int g_stat(Char *, struct stat *, glob_t *); static int g_stat(Char *, struct stat *, glob_t *);
static int glob0(const Char *, glob_t *, int *); static int glob0(const Char *, glob_t *, size_t *);
static int glob1(Char *, glob_t *, int *); static int glob1(Char *, glob_t *, size_t *);
static int glob2(Char *, Char *, Char *, Char *, glob_t *, int *); static int glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *);
static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, int *); static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, size_t *);
static int globextend(const Char *, glob_t *, int *); static int globextend(const Char *, glob_t *, size_t *);
static const Char * static const Char *
globtilde(const Char *, Char *, size_t, glob_t *); globtilde(const Char *, Char *, size_t, glob_t *);
static int globexp1(const Char *, glob_t *, int *); static int globexp1(const Char *, glob_t *, size_t *);
static int globexp2(const Char *, const Char *, glob_t *, int *, int *); static int globexp2(const Char *, const Char *, glob_t *, int *, size_t *);
static int match(Char *, Char *, Char *); static int match(Char *, Char *, Char *);
#ifdef DEBUG #ifdef DEBUG
static void qprintf(const char *, Char *); static void qprintf(const char *, Char *);
@ -173,7 +173,7 @@ glob(pattern, flags, errfunc, pglob)
glob_t *pglob; glob_t *pglob;
{ {
const u_char *patnext; const u_char *patnext;
int limit; size_t limit;
Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot; Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot;
mbstate_t mbs; mbstate_t mbs;
wchar_t wc; wchar_t wc;
@ -247,7 +247,7 @@ static int
globexp1(pattern, pglob, limit) globexp1(pattern, pglob, limit)
const Char *pattern; const Char *pattern;
glob_t *pglob; glob_t *pglob;
int *limit; size_t *limit;
{ {
const Char* ptr = pattern; const Char* ptr = pattern;
int rv; int rv;
@ -273,7 +273,8 @@ static int
globexp2(ptr, pattern, pglob, rv, limit) globexp2(ptr, pattern, pglob, rv, limit)
const Char *ptr, *pattern; const Char *ptr, *pattern;
glob_t *pglob; glob_t *pglob;
int *rv, *limit; int *rv;
size_t *limit;
{ {
int i; int i;
Char *lm, *ls; Char *lm, *ls;
@ -450,10 +451,11 @@ static int
glob0(pattern, pglob, limit) glob0(pattern, pglob, limit)
const Char *pattern; const Char *pattern;
glob_t *pglob; glob_t *pglob;
int *limit; size_t *limit;
{ {
const Char *qpatnext; const Char *qpatnext;
int c, err, oldpathc; int c, err;
size_t oldpathc;
Char *bufnext, patbuf[MAXPATHLEN]; Char *bufnext, patbuf[MAXPATHLEN];
qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob); qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob);
@ -546,7 +548,7 @@ static int
glob1(pattern, pglob, limit) glob1(pattern, pglob, limit)
Char *pattern; Char *pattern;
glob_t *pglob; glob_t *pglob;
int *limit; size_t *limit;
{ {
Char pathbuf[MAXPATHLEN]; Char pathbuf[MAXPATHLEN];
@ -566,7 +568,7 @@ static int
glob2(pathbuf, pathend, pathend_last, pattern, pglob, limit) glob2(pathbuf, pathend, pathend_last, pattern, pglob, limit)
Char *pathbuf, *pathend, *pathend_last, *pattern; Char *pathbuf, *pathend, *pathend_last, *pattern;
glob_t *pglob; glob_t *pglob;
int *limit; size_t *limit;
{ {
struct stat sb; struct stat sb;
Char *p, *q; Char *p, *q;
@ -626,7 +628,7 @@ static int
glob3(pathbuf, pathend, pathend_last, pattern, restpattern, pglob, limit) glob3(pathbuf, pathend, pathend_last, pattern, restpattern, pglob, limit)
Char *pathbuf, *pathend, *pathend_last, *pattern, *restpattern; Char *pathbuf, *pathend, *pathend_last, *pattern, *restpattern;
glob_t *pglob; glob_t *pglob;
int *limit; size_t *limit;
{ {
struct dirent *dp; struct dirent *dp;
DIR *dirp; DIR *dirp;
@ -725,11 +727,10 @@ static int
globextend(path, pglob, limit) globextend(path, pglob, limit)
const Char *path; const Char *path;
glob_t *pglob; glob_t *pglob;
int *limit; size_t *limit;
{ {
char **pathv; char **pathv;
int i; size_t i, newsize, len;
u_int newsize, len;
char *copy; char *copy;
const Char *p; const Char *p;
@ -753,7 +754,7 @@ globextend(path, pglob, limit)
if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {
/* first time around -- clear initial gl_offs items */ /* first time around -- clear initial gl_offs items */
pathv += pglob->gl_offs; pathv += pglob->gl_offs;
for (i = pglob->gl_offs; --i >= 0; ) for (i = pglob->gl_offs + 1; --i > 0; )
*--pathv = NULL; *--pathv = NULL;
} }
pglob->gl_pathv = pathv; pglob->gl_pathv = pathv;
@ -832,7 +833,7 @@ void
globfree(pglob) globfree(pglob)
glob_t *pglob; glob_t *pglob;
{ {
int i; size_t i;
char **pp; char **pp;
if (pglob->gl_pathv != NULL) { if (pglob->gl_pathv != NULL) {
@ -915,7 +916,7 @@ static int
g_Ctoc(str, buf, len) g_Ctoc(str, buf, len)
const Char *str; const Char *str;
char *buf; char *buf;
u_int len; size_t len;
{ {
mbstate_t mbs; mbstate_t mbs;
size_t clen; size_t clen;