summaryrefslogtreecommitdiffstats
path: root/usr.bin/grep/grep.h
diff options
context:
space:
mode:
authorgabor <gabor@FreeBSD.org>2010-08-18 17:40:10 +0000
committergabor <gabor@FreeBSD.org>2010-08-18 17:40:10 +0000
commitfb7d7246f68844fc4062c081c8cab78a7a9320db (patch)
tree31c9b1f57fe3aca149aa8365f6e17a9bb8f206fb /usr.bin/grep/grep.h
parent82e4bb536ac304054c6d49d74651f89b7846106d (diff)
downloadFreeBSD-src-fb7d7246f68844fc4062c081c8cab78a7a9320db.zip
FreeBSD-src-fb7d7246f68844fc4062c081c8cab78a7a9320db.tar.gz
- Refactor file reading code to use pure syscalls and an internal buffer
instead of stdio. This gives BSD grep a very big performance boost, its speed is now almost comparable to GNU grep. Submitted by: Dimitry Andric <dimitry@andric.com> Approved by: delphij (mentor)
Diffstat (limited to 'usr.bin/grep/grep.h')
-rw-r--r--usr.bin/grep/grep.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/usr.bin/grep/grep.h b/usr.bin/grep/grep.h
index 2f743e4..cf4443d 100644
--- a/usr.bin/grep/grep.h
+++ b/usr.bin/grep/grep.h
@@ -77,12 +77,8 @@ extern const char *errstr[];
#define MAX_LINE_MATCHES 32
struct file {
- struct mmfile *mmf;
- BZFILE *bzf;
- FILE *f;
- gzFile *gzf;
+ int fd;
bool binary;
- bool stdin;
};
struct str {
@@ -150,11 +146,10 @@ void clearqueue(void);
/* file.c */
void grep_close(struct file *f);
-struct file *grep_stdin_open(void);
struct file *grep_open(const char *path);
char *grep_fgetln(struct file *f, size_t *len);
/* fastgrep.c */
int fastcomp(fastgrep_t *, const char *);
void fgrepcomp(fastgrep_t *, const char *);
-int grep_search(fastgrep_t *, unsigned char *, size_t, regmatch_t *);
+int grep_search(fastgrep_t *, const unsigned char *, size_t, regmatch_t *);
OpenPOWER on IntegriCloud