grep.h (cfe30d02adda7c3b5c76156ac52d50d8cab325d9) | grep.h (b1a409863f4784ab8a7a9fa04b3e9b3c92e7fd72) |
---|---|
1/* $NetBSD: grep.h,v 1.5 2011/02/27 17:33:37 joerg Exp $ */ 2/* $OpenBSD: grep.h,v 1.15 2010/04/05 03:03:55 tedu Exp $ */ 3/* $FreeBSD$ */ 4 5/*- 6 * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav 7 * Copyright (c) 2008-2009 Gabor Kovesdan <gabor@FreeBSD.org> 8 * All rights reserved. --- 25 unchanged lines hidden (view full) --- 34#include <regex.h> 35#include <stdbool.h> 36#include <stdio.h> 37#include <zlib.h> 38 39#include "fastmatch.h" 40 41#ifdef WITHOUT_NLS | 1/* $NetBSD: grep.h,v 1.5 2011/02/27 17:33:37 joerg Exp $ */ 2/* $OpenBSD: grep.h,v 1.15 2010/04/05 03:03:55 tedu Exp $ */ 3/* $FreeBSD$ */ 4 5/*- 6 * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav 7 * Copyright (c) 2008-2009 Gabor Kovesdan <gabor@FreeBSD.org> 8 * All rights reserved. --- 25 unchanged lines hidden (view full) --- 34#include <regex.h> 35#include <stdbool.h> 36#include <stdio.h> 37#include <zlib.h> 38 39#include "fastmatch.h" 40 41#ifdef WITHOUT_NLS |
42#define getstr(n) errstr[n] | 42#define getstr(n) errstr[n] |
43#else 44#include <nl_types.h> 45 46extern nl_catd catalog; | 43#else 44#include <nl_types.h> 45 46extern nl_catd catalog; |
47#define getstr(n) catgets(catalog, 1, n, errstr[n]) | 47#define getstr(n) catgets(catalog, 1, n, errstr[n]) |
48#endif 49 50extern const char *errstr[]; 51 | 48#endif 49 50extern const char *errstr[]; 51 |
52#define VERSION "2.5.1-FreeBSD" | 52#define VERSION "2.5.1-FreeBSD" |
53 | 53 |
54#define GREP_FIXED 0 55#define GREP_BASIC 1 56#define GREP_EXTENDED 2 | 54#define GREP_FIXED 0 55#define GREP_BASIC 1 56#define GREP_EXTENDED 2 |
57 | 57 |
58#define BINFILE_BIN 0 59#define BINFILE_SKIP 1 60#define BINFILE_TEXT 2 | 58#define BINFILE_BIN 0 59#define BINFILE_SKIP 1 60#define BINFILE_TEXT 2 |
61 | 61 |
62#define FILE_STDIO 0 63#define FILE_MMAP 1 64#define FILE_GZIP 2 65#define FILE_BZIP 3 66#define FILE_XZ 4 67#define FILE_LZMA 5 | 62#define FILE_STDIO 0 63#define FILE_MMAP 1 64#define FILE_GZIP 2 65#define FILE_BZIP 3 66#define FILE_XZ 4 67#define FILE_LZMA 5 |
68 | 68 |
69#define DIR_READ 0 70#define DIR_SKIP 1 71#define DIR_RECURSE 2 | 69#define DIR_READ 0 70#define DIR_SKIP 1 71#define DIR_RECURSE 2 |
72 | 72 |
73#define DEV_READ 0 74#define DEV_SKIP 1 | 73#define DEV_READ 0 74#define DEV_SKIP 1 |
75 | 75 |
76#define LINK_READ 0 77#define LINK_EXPLICIT 1 78#define LINK_SKIP 2 | 76#define LINK_READ 0 77#define LINK_EXPLICIT 1 78#define LINK_SKIP 2 |
79 | 79 |
80#define EXCL_PAT 0 81#define INCL_PAT 1 | 80#define EXCL_PAT 0 81#define INCL_PAT 1 |
82 | 82 |
83#define MAX_LINE_MATCHES 32 | 83#define MAX_LINE_MATCHES 32 |
84 85struct file { 86 int fd; 87 bool binary; 88}; 89 90struct str { 91 off_t off; --- 32 unchanged lines hidden (view full) --- 124extern int tail; 125extern unsigned int dpatterns, fpatterns, patterns; 126extern struct pat *pattern; 127extern struct epat *dpattern, *fpattern; 128extern regex_t *er_pattern, *r_pattern; 129extern fastmatch_t *fg_pattern; 130 131/* For regex errors */ | 84 85struct file { 86 int fd; 87 bool binary; 88}; 89 90struct str { 91 off_t off; --- 32 unchanged lines hidden (view full) --- 124extern int tail; 125extern unsigned int dpatterns, fpatterns, patterns; 126extern struct pat *pattern; 127extern struct epat *dpattern, *fpattern; 128extern regex_t *er_pattern, *r_pattern; 129extern fastmatch_t *fg_pattern; 130 131/* For regex errors */ |
132#define RE_ERROR_BUF 512 | 132#define RE_ERROR_BUF 512 |
133extern char re_error[RE_ERROR_BUF + 1]; /* Seems big enough */ 134 135/* util.c */ 136bool file_matching(const char *fname); 137int procfile(const char *fn); 138int grep_tree(char **argv); 139void *grep_malloc(size_t size); 140void *grep_calloc(size_t nmemb, size_t size); --- 13 unchanged lines hidden --- | 133extern char re_error[RE_ERROR_BUF + 1]; /* Seems big enough */ 134 135/* util.c */ 136bool file_matching(const char *fname); 137int procfile(const char *fn); 138int grep_tree(char **argv); 139void *grep_malloc(size_t size); 140void *grep_calloc(size_t nmemb, size_t size); --- 13 unchanged lines hidden --- |