IDZEBRA 2.2.11
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 <idzebra/version.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 111 of file agrep.c.

Referenced by agrep(), and inf_flush().

◆ O_BINARY

Function Documentation

◆ agrep()

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

Definition at line 220 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 64 of file agrep.c.

References debug_dfa_followpos, debug_dfa_tran, debug_dfa_trav, dfa_verbose, prog, show_lines, and zebra_get_version().

Referenced by main().

◆ error()

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

Definition at line 52 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()

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

◆ inf_flush()

int inf_flush ( int fd)
static

Definition at line 116 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()

char * prline ( char * p)
static

Definition at line 146 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 112 of file agrep.c.

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

◆ inf_eof

int inf_eof
static

Definition at line 114 of file agrep.c.

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

◆ inf_flsh

char * inf_flsh
static

Definition at line 113 of file agrep.c.

Referenced by go(), and inf_flush().

◆ inf_ptr

char* inf_ptr
static

Definition at line 113 of file agrep.c.

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

◆ line_no

int line_no
static

Definition at line 114 of file agrep.c.

Referenced by agrep(), go(), prline(), read_file(), read_line(), and read_rules().

◆ prog

char* prog
static

Definition at line 50 of file agrep.c.

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

◆ show_lines

int show_lines = 0
static

Definition at line 62 of file agrep.c.

Referenced by agrep_options(), and prline().