Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
strmatch.c File Reference
#include <ast/ast.h>
#include <cgraph/gv_ctype.h>
#include <cgraph/strview.h>
#include <ctype.h>
#include <stddef.h>
#include <string.h>
Include dependency graph for strmatch.c:

Go to the source code of this file.

Data Structures

struct  Group_t
 
struct  Match_t
 

Macros

#define MAXGROUP   10
 
#define mbgetchar(p)   (*p++)
 
#define getsource(s, e)   (((s)>=(e))?0:mbgetchar(s))
 
#define RETURN(v)   {return (v);}
 

Functions

static char * gobble (Match_t *mp, char *s, int sub, int *g, int clear)
 
static int grpmatch (Match_t *, int, char *, char *, char *, int)
 
static int onematch (Match_t *mp, int g, char *s, char *p, char *e, char *r, int flags)
 
int strgrpmatch (char *b, char *p, size_t *sub, int n, int flags)
 
int strmatch (char *s, char *p)
 

Macro Definition Documentation

◆ getsource

#define getsource (   s,
 
)    (((s)>=(e))?0:mbgetchar(s))

Definition at line 75 of file strmatch.c.

◆ MAXGROUP

#define MAXGROUP   10

Definition at line 57 of file strmatch.c.

◆ mbgetchar

#define mbgetchar (   p)    (*p++)

Definition at line 73 of file strmatch.c.

◆ RETURN

#define RETURN (   v)    {return (v);}

Definition at line 144 of file strmatch.c.

Function Documentation

◆ gobble()

static char * gobble ( Match_t mp,
char *  s,
int  sub,
int *  g,
int  clear 
)
static

Definition at line 83 of file strmatch.c.

References Group_t::beg, clear(), Match_t::current, Group_t::end, MAXGROUP, mbgetchar, and sub.

Referenced by grpmatch(), and onematch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grpmatch()

static int grpmatch ( Match_t mp,
int  g,
char *  s,
char *  p,
char *  e,
int  flags 
)
static

Definition at line 477 of file strmatch.c.

References error(), error_info, flags, gobble(), Error_info_s::indent, Match_t::next_p, NULL, onematch(), and RETURN.

Referenced by onematch(), and strgrpmatch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onematch()

static int onematch ( Match_t mp,
int  g,
char *  s,
char *  p,
char *  e,
char *  r,
int  flags 
)
static

Definition at line 154 of file strmatch.c.

References Group_t::beg, Match_t::best, Match_t::current, strview_t::data, Group_t::end, error(), error_info, flags, getsource, gobble(), Group_t::groups, grpmatch(), gv_isalnum(), gv_isalpha(), gv_isblank(), gv_iscntrl(), gv_isdigit(), gv_isgraph(), gv_islower(), gv_isprint(), gv_ispunct(), gv_isspace(), gv_isupper(), gv_isxdigit(), Error_info_s::indent, MAXGROUP, mbgetchar, Match_t::next_p, Group_t::next_s, NULL, ok(), onematch(), RETURN, strview_t::size, and strview_str_eq().

Referenced by grpmatch(), and onematch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ strgrpmatch()

int strgrpmatch ( char *  b,
char *  p,
size_t *  sub,
int  n,
int  flags 
)

Definition at line 505 of file strmatch.c.

References error(), flags, grpmatch(), match(), STR_LEFT, STR_RIGHT, and sub.

Referenced by exsub(), match(), and strmatch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ strmatch()

int strmatch ( char *  s,
char *  p 
)

Definition at line 554 of file strmatch.c.

References NULL, STR_LEFT, STR_RIGHT, and strgrpmatch().

Referenced by eval().

Here is the call graph for this function:
Here is the caller graph for this function: