IDZEBRA  2.2.7
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

◆ INF_BUF_SIZE

#define INF_BUF_SIZE   32768U

Definition at line 108 of file agrep.c.

◆ O_BINARY

#define O_BINARY   0

Definition at line 46 of file agrep.c.

Function Documentation

◆ agrep()

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

Definition at line 217 of file agrep.c.

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

Referenced by main().

◆ agrep_options()

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().

◆ error()

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

Definition at line 51 of file agrep.c.

References prog.

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

◆ go()

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

◆ inf_flush()

static int inf_flush ( int  fd)
static

Definition at line 113 of file agrep.c.

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

Referenced by agrep(), and go().

◆ main()

int main ( int  argc,
char **  argv 
)

◆ prline()

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

◆ inf_buf

char* inf_buf
static

Definition at line 109 of file agrep.c.

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

◆ inf_eof

int inf_eof
static

Definition at line 111 of file agrep.c.

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

◆ inf_flsh

char * inf_flsh
static

Definition at line 110 of file agrep.c.

Referenced by go(), and inf_flush().

◆ inf_ptr

char* inf_ptr
static

Definition at line 110 of file agrep.c.

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

◆ line_no

int line_no
static

Definition at line 111 of file agrep.c.

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

◆ prog

char* prog
static

Definition at line 49 of file agrep.c.

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

◆ show_lines

int show_lines = 0
static

Definition at line 61 of file agrep.c.

Referenced by agrep_options(), and prline().