bsd-interf.c

来自「正则表达式库」· C语言 代码 · 共 39 行

C
39
字号
/* bsd-interf.c: test BSD interface.  */#ifndef _POSIX_SOURCE /* whole file */#include "test.h"voidtest_berk_search (pattern, string)    const char *pattern;    char *string;{  const char *return_value = re_comp (pattern);    if (return_value != 0)    {      printf ("This didn't compile: `%s'.\n", pattern);      printf ("  The error message was: `%s'.\n", return_value);    }  else    if (test_should_match && re_exec (string) != strlen (string))      {        printf ("Should have matched but didn't:\n");        printf ("  The pattern was: %s.\n", pattern);        if (string)          printf ("  The string was: `%s'.'n", string);        else          printf ("  The string was empty.\n");      }}voidtest_bsd_interface (){  test_berk_search ("a", "ab");}#endif /* _POSIX_SOURCE */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?