IDZEBRA  2.1.2
Macros | Functions | Variables
agrep.c File Reference
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <idzebra/util.h>
#include <dfa.h>
#include "imalloc.h"

Go to the source code of this file.

Macros

#define O_BINARY   0
 
#define INF_BUF_SIZE   32768U
 

Functions

void error (const char *format,...)
 
int agrep_options (int argc, char **argv)
 
static int inf_flush (int fd)
 
static char * prline (char *p)
 
static int go (int fd, struct DFA_state **dfaar)
 
int agrep (struct DFA_state **dfas, int fd)
 
int main (int argc, char **argv)
 

Variables

static char * prog
 
static int show_lines = 0
 
static char * inf_buf
 
static char * inf_ptr
 
static char * inf_flsh
 
static int inf_eof
 
static int line_no
 

Macro Definition Documentation

#define INF_BUF_SIZE   32768U

Definition at line 108 of file agrep.c.

Referenced by agrep(), and inf_flush().

#define O_BINARY   0

Function Documentation

int agrep ( struct DFA_state **  dfas,
int  fd 
)

Definition at line 217 of file agrep.c.

References go(), ifree(), imalloc(), inf_buf, INF_BUF_SIZE, inf_eof, inf_flush(), inf_ptr, and line_no.

Referenced by main().

int agrep_options ( int  argc,
char **  argv 
)

Definition at line 63 of file agrep.c.

References debug_dfa_followpos, debug_dfa_tran, debug_dfa_trav, dfa_verbose, prog, and show_lines.

Referenced by main().

void error ( const char *  format,
  ... 
)

Definition at line 51 of file agrep.c.

Referenced by facet_fetch(), read_defs(), read_file(), read_rules(), sort_fetch(), and special_index_fetch().

static int go ( int  fd,
struct DFA_state **  dfaar 
)
static
static int inf_flush ( int  fd)
static

Definition at line 113 of file agrep.c.

References inf_buf, INF_BUF_SIZE, inf_eof, inf_flsh, and inf_ptr.

Referenced by agrep(), and go().

int main ( int  argc,
char **  argv 
)
static char* prline ( char *  p)
static

Definition at line 143 of file agrep.c.

References inf_buf, line_no, and show_lines.

Referenced by go().

Variable Documentation

char* inf_buf
static

Definition at line 109 of file agrep.c.

Referenced by agrep(), inf_flush(), and prline().

int inf_eof
static

Definition at line 111 of file agrep.c.

Referenced by agrep(), go(), and inf_flush().

char * inf_flsh
static

Definition at line 110 of file agrep.c.

Referenced by go(), and inf_flush().

char* inf_ptr
static

Definition at line 110 of file agrep.c.

Referenced by agrep(), go(), and inf_flush().

int line_no
static

Definition at line 111 of file agrep.c.

Referenced by agrep(), go(), and prline().

char* prog
static

Definition at line 49 of file agrep.c.

Referenced by agrep_options(), error(), go(), and main().

int show_lines = 0
static

Definition at line 61 of file agrep.c.

Referenced by agrep_options(), and prline().