version 1.23, 2005/11/12 19:13:09 |
version 1.24, 2005/11/18 20:56:53 |
|
|
static int grep(int, int); |
static int grep(int, int); |
static int compile(int, int); |
static int compile(int, int); |
static int gid(int, int); |
static int gid(int, int); |
static BUFFER *compile_mode(const char *, const char *, const char *); |
static struct buffer *compile_mode(const char *, const char *, const char *); |
static int getbufcwd(char *, size_t); |
static int getbufcwd(char *, size_t); |
|
|
void grep_init(void); |
void grep_init(void); |
|
|
* |
* |
* XXX - need some kind of callback to find out when those get killed. |
* XXX - need some kind of callback to find out when those get killed. |
*/ |
*/ |
MGWIN *compile_win; |
struct mgwin *compile_win; |
BUFFER *compile_buffer; |
struct buffer *compile_buffer; |
|
|
static PF compile_pf[] = { |
static PF compile_pf[] = { |
compile_goto_error |
compile_goto_error |
|
|
{ |
{ |
char command[NFILEN + 20]; |
char command[NFILEN + 20]; |
char prompt[NFILEN], *bufp; |
char prompt[NFILEN], *bufp; |
BUFFER *bp; |
struct buffer *bp; |
MGWIN *wp; |
struct mgwin *wp; |
char path[NFILEN]; |
char path[NFILEN]; |
|
|
/* get buffer cwd */ |
/* get buffer cwd */ |
|
|
{ |
{ |
char command[NFILEN + 20]; |
char command[NFILEN + 20]; |
char prompt[NFILEN], *bufp; |
char prompt[NFILEN], *bufp; |
BUFFER *bp; |
struct buffer *bp; |
MGWIN *wp; |
struct mgwin *wp; |
char path[NFILEN]; |
char path[NFILEN]; |
|
|
/* get buffer cwd */ |
/* get buffer cwd */ |
|
|
{ |
{ |
char command[NFILEN + 20]; |
char command[NFILEN + 20]; |
char prompt[NFILEN], c, *bufp; |
char prompt[NFILEN], c, *bufp; |
BUFFER *bp; |
struct buffer *bp; |
MGWIN *wp; |
struct mgwin *wp; |
int i, j; |
int i, j; |
char path[NFILEN]; |
char path[NFILEN]; |
|
|
|
|
return (TRUE); |
return (TRUE); |
} |
} |
|
|
BUFFER * |
struct buffer * |
compile_mode(const char *name, const char *command, const char *path) |
compile_mode(const char *name, const char *command, const char *path) |
{ |
{ |
BUFFER *bp; |
struct buffer *bp; |
FILE *pipe; |
FILE *pipe; |
char *buf; |
char *buf; |
size_t len; |
size_t len; |
|
|
static int |
static int |
compile_goto_error(int f, int n) |
compile_goto_error(int f, int n) |
{ |
{ |
BUFFER *bp; |
struct buffer *bp; |
MGWIN *wp; |
struct mgwin *wp; |
char *fname, *line, *lp, *ln; |
char *fname, *line, *lp, *ln; |
int lineno, len; |
int lineno, len; |
char *adjf; |
char *adjf; |
const char *errstr; |
const char *errstr; |
LINE *last; |
struct line *last; |
|
|
compile_win = curwp; |
compile_win = curwp; |
compile_buffer = curbp; |
compile_buffer = curbp; |
|
|
goto fail; |
goto fail; |
if ((ln = strsep(&lp, ":")) == NULL || *ln == '\0') |
if ((ln = strsep(&lp, ":")) == NULL || *ln == '\0') |
goto fail; |
goto fail; |
lineno = strtonum(ln, INT_MIN, INT_MAX, &errstr); |
lineno = (int)strtonum(ln, INT_MIN, INT_MAX, &errstr); |
if (errstr) |
if (errstr) |
goto fail; |
goto fail; |
|
|