version 1.17, 2002/04/26 13:13:41 |
version 1.18, 2002/04/26 16:15:16 |
|
|
static struct input_file *dopath(struct input_file *, const char *); |
static struct input_file *dopath(struct input_file *, const char *); |
|
|
static struct path_entry * |
static struct path_entry * |
new_path_entry(dirname) |
new_path_entry(const char *dirname) |
const char *dirname; |
|
{ |
{ |
struct path_entry *n; |
struct path_entry *n; |
|
|
|
|
} |
} |
|
|
void |
void |
addtoincludepath(dirname) |
addtoincludepath(const char *dirname) |
const char *dirname; |
|
{ |
{ |
struct path_entry *n; |
struct path_entry *n; |
|
|
|
|
|
|
static |
static |
struct input_file * |
struct input_file * |
dopath(i, filename) |
dopath(struct input_file *i, const char *filename) |
struct input_file *i; |
|
const char *filename; |
|
{ |
{ |
char path[MAXPATHLEN]; |
char path[MAXPATHLEN]; |
struct path_entry *pe; |
struct path_entry *pe; |
|
|
} |
} |
|
|
struct input_file * |
struct input_file * |
fopen_trypath(i, filename) |
fopen_trypath(struct input_file *i, const char *filename) |
struct input_file *i; |
|
const char *filename; |
|
{ |
{ |
FILE *f; |
FILE *f; |
|
|
|
|
} |
} |
|
|
void |
void |
doindir(argv, argc) |
doindir(const char *argv[], int argc) |
const char *argv[]; |
|
int argc; |
|
{ |
{ |
ndptr p; |
ndptr p; |
|
|
|
|
} |
} |
|
|
void |
void |
dobuiltin(argv, argc) |
dobuiltin(const char *argv[], int argc) |
const char *argv[]; |
|
int argc; |
|
{ |
{ |
int n; |
int n; |
argv[1] = NULL; |
argv[1] = NULL; |
|
|
#define addconstantstring(s) addchars((s), sizeof(s)-1) |
#define addconstantstring(s) addchars((s), sizeof(s)-1) |
|
|
static void |
static void |
addchars(c, n) |
addchars(const char *c, size_t n) |
const char *c; |
|
size_t n; |
|
{ |
{ |
if (n == 0) |
if (n == 0) |
return; |
return; |
|
|
} |
} |
|
|
static void |
static void |
addchar(c) |
addchar(int c) |
int c; |
|
{ |
{ |
if (current +1 > bufsize) { |
if (current +1 > bufsize) { |
if (bufsize == 0) |
if (bufsize == 0) |
|
|
|
|
|
|
static void |
static void |
exit_regerror(er, re) |
exit_regerror(int er, regex_t *re) |
int er; |
|
regex_t *re; |
|
{ |
{ |
size_t errlen; |
size_t errlen; |
char *errbuf; |
char *errbuf; |
|
|
} |
} |
|
|
static void |
static void |
add_sub(n, string, re, pm) |
add_sub(int n, const char *string, regex_t *re, regmatch_t *pm) |
int n; |
|
const char *string; |
|
regex_t *re; |
|
regmatch_t *pm; |
|
{ |
{ |
if (n > re->re_nsub) |
if (n > re->re_nsub) |
warnx("No subexpression %d", n); |
warnx("No subexpression %d", n); |
|
|
* constructs and replacing them with substrings of the original string. |
* constructs and replacing them with substrings of the original string. |
*/ |
*/ |
static void |
static void |
add_replace(string, re, replace, pm) |
add_replace(const char *string, regex_t *re, const char *replace, regmatch_t *pm) |
const char *string; |
|
regex_t *re; |
|
const char *replace; |
|
regmatch_t *pm; |
|
{ |
{ |
const char *p; |
const char *p; |
|
|
|
|
} |
} |
|
|
static void |
static void |
do_subst(string, re, replace, pm) |
do_subst(const char *string, regex_t *re, const char *replace, regmatch_t *pm) |
const char *string; |
|
regex_t *re; |
|
const char *replace; |
|
regmatch_t *pm; |
|
{ |
{ |
int error; |
int error; |
int flags = 0; |
int flags = 0; |
|
|
} |
} |
|
|
static void |
static void |
do_regexp(string, re, replace, pm) |
do_regexp(const char *string, regex_t *re, const char *replace, regmatch_t *pm) |
const char *string; |
|
regex_t *re; |
|
const char *replace; |
|
regmatch_t *pm; |
|
{ |
{ |
int error; |
int error; |
|
|
|
|
} |
} |
|
|
static void |
static void |
do_regexpindex(string, re, pm) |
do_regexpindex(const char *string, regex_t *re, regmatch_t *pm) |
const char *string; |
|
regex_t *re; |
|
regmatch_t *pm; |
|
{ |
{ |
int error; |
int error; |
|
|
|
|
* says. So we twiddle with the regexp before passing it to regcomp. |
* says. So we twiddle with the regexp before passing it to regcomp. |
*/ |
*/ |
static char * |
static char * |
twiddle(p) |
twiddle(const char *p) |
const char *p; |
|
{ |
{ |
/* This could use strcspn for speed... */ |
/* This could use strcspn for speed... */ |
while (*p != '\0') { |
while (*p != '\0') { |
|
|
* argv[4]: opt rep |
* argv[4]: opt rep |
*/ |
*/ |
void |
void |
dopatsubst(argv, argc) |
dopatsubst(const char *argv[], int argc) |
const char *argv[]; |
|
int argc; |
|
{ |
{ |
int error; |
int error; |
regex_t re; |
regex_t re; |
|
|
} |
} |
|
|
void |
void |
doregexp(argv, argc) |
doregexp(const char *argv[], int argc) |
const char *argv[]; |
|
int argc; |
|
{ |
{ |
int error; |
int error; |
regex_t re; |
regex_t re; |
|
|
} |
} |
|
|
void |
void |
doesyscmd(cmd) |
doesyscmd(const char *cmd) |
const char *cmd; |
|
{ |
{ |
int p[2]; |
int p[2]; |
pid_t pid, cpid; |
pid_t pid, cpid; |