Back to index

glibc  2.9
Classes | Defines | Functions | Variables
bug-regex28.c File Reference
#include <regex.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.

Classes

struct  tests

Defines

#define EGREP   RE_SYNTAX_EGREP
#define EGREP_NL   (RE_SYNTAX_EGREP | RE_DOT_NEWLINE) & ~RE_HAT_LISTS_NOT_NEWLINE

Functions

int main (void)

Variables

struct tests tests []

Class Documentation

struct tests

Definition at line 25 of file bug-regex27.c.

Class Members
int cflags
const char * input
const char * regex
uint32_t result
int retval
const char * string
reg_syntax_t syntax
int valid

Define Documentation

#define EGREP   RE_SYNTAX_EGREP
#define EGREP_NL   (RE_SYNTAX_EGREP | RE_DOT_NEWLINE) & ~RE_HAT_LISTS_NOT_NEWLINE

Function Documentation

int main ( void  )

Definition at line 48 of file bug-regex28.c.

{
  struct re_pattern_buffer r;
  size_t i;
  int ret = 0;

  for (i = 0; i < sizeof (tests) / sizeof (tests[i]); ++i)
    {
      re_set_syntax (tests[i].syntax);
      memset (&r, 0, sizeof (r));
      if (re_compile_pattern (tests[i].regex, strlen (tests[i].regex), &r))
       {
         printf ("re_compile_pattern %zd failed\n", i);
         ret = 1;
         continue;
       }
      size_t len = strlen (tests[i].string);
      int rv = re_search (&r, tests[i].string, len, 0, len, NULL);
      if (rv != tests[i].retval)
       {
         printf ("re_search %zd unexpected value %d != %d\n",
                i, rv, tests[i].retval);
         ret = 1;
       }
      regfree (&r);
    }
  return ret;
}

Here is the call graph for this function:


Variable Documentation

struct tests tests[]