A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/pcre2grep_8c.html below:

NCBI C++ ToolKit: src/util/regexp/pcre2grep.c File Reference

#include <ctype.h>
#include <locale.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "pcre2.h"

Go to the source code of this file.

Go to the SVN repository for this file.

#define  PCRE2_CODE_UNIT_WIDTH   8   #define  SIZ_FORM   "lu"   #define  FALSE   0   #define  TRUE   1   #define  DEFAULT_CAPTURE_MAX   50   #define  MAXPATLEN   8192   #define  FNBUFSIZ   2048   #define  ERRBUFSIZ   256   #define  PO_WORD_MATCH   0x0001   #define  PO_LINE_MATCH   0x0002   #define  PO_FIXED_STRINGS   0x0004   #define  FWRITE_IGNORE(a, b, c, d)   if (fwrite(a,b,c,d)) {}   #define  STDOUT_NL   "\n"   #define  STDOUT_NL_LEN   1   #define  QUOT   "'"   #define  STDOUT_NL_CODE   0x7fffffffu   #define  N_COLOUR   (-1)   #define  N_EXCLUDE   (-2)   #define  N_EXCLUDE_DIR   (-3)   #define  N_HELP   (-4)   #define  N_INCLUDE   (-5)   #define  N_INCLUDE_DIR   (-6)   #define  N_LABEL   (-7)   #define  N_LOCALE   (-8)   #define  N_NULL   (-9)   #define  N_LOFFSETS   (-10)   #define  N_FOFFSETS   (-11)   #define  N_LBUFFER   (-12)   #define  N_H_LIMIT   (-13)   #define  N_M_LIMIT   (-14)   #define  N_M_LIMIT_DEP   (-15)   #define  N_BUFSIZE   (-16)   #define  N_NOJIT   (-17)   #define  N_FILE_LIST   (-18)   #define  N_BINARY_FILES   (-19)   #define  N_EXCLUDE_FROM   (-20)   #define  N_INCLUDE_FROM   (-21)   #define  N_OM_SEPARATOR   (-22)   #define  N_MAX_BUFSIZE   (-23)   #define  N_OM_CAPTURE   (-24)   #define  N_ALLABSK   (-25)   #define  N_POSIX_DIGIT   (-26)   #define  N_GROUP_SEPARATOR   (-27)   #define  N_NO_GROUP_SEPARATOR   (-28)   #define  memmove(d, s, n)   emulated_memmove(d,s,n)   #define  FILESEP   0   enum   {
  FN_NONE , FN_DEFAULT , FN_MATCH_ONLY , FN_NOMATCH_ONLY ,
  FN_FORCE
}   enum   { FR_PLAIN , FR_LIBZ , FR_LIBBZ2 }   enum   { dee_READ , dee_SKIP , dee_RECURSE }   enum   { DEE_READ , DEE_SKIP }   enum   { BIN_BINARY , BIN_NOMATCH , BIN_TEXT }   enum   { DDE_ERROR , DDE_CAPTURE , DDE_CHAR }   enum   {
  OP_NODATA , OP_STRING , OP_OP_STRING , OP_NUMBER ,
  OP_U32NUMBER , OP_SIZE , OP_OP_NUMBER , OP_OP_NUMBERS ,
  OP_PATLIST , OP_FILELIST , OP_BINFILES
}   static void *  emulated_memmove (void *d, const void *s, size_t n)   static int  ord2utf8 (uint32_t value)   static int  strcmpic (const char *str1, const char *str2)   static char *  parse_grep_colors (const char *gc)   static void  pcre2grep_exit (int rc)   static patstradd_pattern (char *s, PCRE2_SIZE patlen, patstr *after)   static void  free_pattern_chain (patstr *pc)   static void  free_file_chain (fnstr *fn)   int  isdirectory (char *filename)   directory_typeopendirectory (char *filename)   char *  readdirectory (directory_type *dir)   void  closedirectory (directory_type *dir)   int  isregfile (char *filename)   static BOOL  is_stdout_tty (void)   static BOOL  is_file_tty (FILE *f)   static void  print_match (const void *buf, int length)   char *  strerror (int n)   static int  usage (int rc)   static void  help (void)   static BOOL  test_incexc (char *path, patstr *ip, patstr *ep)   static long int  decode_number (char *option_data, option_item *op, BOOL longop)   static omstradd_number (int n, omstr *after)   static PCRE2_SIZE  read_one_line (char *buffer, PCRE2_SIZE length, FILE *f)   static char *  end_of_line (char *p, char *endptr, int *lenptr)   static char *  previous_line (char *p, char *startptr)   static void  write_final_newline (void)   static void  do_after_lines (unsigned long int lastmatchnumber, char *lastmatchrestart, char *endptr, const char *printname)   static BOOL  match_patterns (char *matchptr, PCRE2_SIZE length, unsigned int options, PCRE2_SIZE startoffset, int *mrc)   static int  decode_dollar_escape (PCRE2_SPTR begin, PCRE2_SPTR string, BOOL callout, uint32_t *value, PCRE2_SPTR *last)   static BOOL  syntax_check_output_text (PCRE2_SPTR string, BOOL callout)   static BOOL  display_output_text (PCRE2_SPTR string, BOOL callout, PCRE2_SPTR subject, PCRE2_SIZE *ovector, PCRE2_SIZE capture_top)   static PCRE2_SIZE  fill_buffer (void *handle, int frtype, char *buffer, PCRE2_SIZE length, BOOL input_line_buffered)   static int  pcre2grep (void *handle, int frtype, const char *filename, const char *printname)   static int  grep_or_recurse (char *pathname, BOOL dir_recurse, BOOL only_one_at_top)   static int  handle_option (int letter, int options)   static char *  ordin (int n)   static BOOL  compile_pattern (patstr *p, int options, int fromfile, const char *fromtext, int count)   static BOOL  read_pattern_file (char *name, patstr **patptr, patstr **patlastptr)   int  main (int argc, char **argv)   static const char *  colour_string = "1;31"   static const char *  colour_option = NULL   static const char *  dee_option = NULL   static const char *  DEE_option = NULL   static const char *  locale = NULL   static const char *  newline_arg = NULL   static const char *  group_separator = "--"   static const char *  om_separator = NULL   static const char *  stdin_name = "(standard input)"   static const char *  output_text = NULL   static char *  main_buffer = NULL   static const char *  printname_nl = "\n"   static int  printname_colon = ':'   static int  printname_hyphen = '-'   static int  after_context = 0   static int  before_context = 0   static int  binary_files = BIN_BINARY   static int  both_context = 0   static int  endlinetype   static int  count_limit = -1   static unsigned long int  counts_printed = 0   static unsigned long int  total_count = 0   static PCRE2_SIZE  bufthird = PCRE2GREP_BUFSIZE   static PCRE2_SIZE  max_bufthird = PCRE2GREP_MAX_BUFSIZE   static PCRE2_SIZE  bufsize = 3*PCRE2GREP_BUFSIZE   static int  dee_action = dee_READ   static int  DEE_action = DEE_READ   static int  error_count = 0   static int  filenames = FN_DEFAULT   static BOOL  use_jit = 0   static const uint8_tcharacter_tables = NULL   static uint32_t  pcre2_options = 0   static uint32_t  extra_options = 0   static PCRE2_SIZE  heap_limit = PCRE2_UNSET   static uint32_t  match_limit = 0   static uint32_t  depth_limit = 0   static pcre2_compile_contextcompile_context   static pcre2_match_contextmatch_context   static pcre2_match_datamatch_data   static pcre2_match_datamatch_data_pair [2]   static PCRE2_SIZEoffsets   static PCRE2_SIZEoffsets_pair [2]   static int  match_data_toggle   static uint32_t  offset_size   static uint32_t  capture_max = 50   static BOOL  all_matches = 0   static BOOL  case_restrict = 0   static BOOL  count_only = 0   static BOOL  do_colour = 0   static BOOL  file_offsets = 0   static BOOL  hyphenpending = 0   static BOOL  invert = 0   static BOOL  line_buffered = 0   static BOOL  line_offsets = 0   static BOOL  multiline = 0   static BOOL  no_ucp = 0   static BOOL  number = 0   static BOOL  omit_zero_count = 0   static BOOL  resource_error = 0   static BOOL  quiet = 0   static BOOL  show_total_count = 0   static BOOL  silent = 0   static BOOL  utf = 0   static BOOL  posix_digit = 0   static uint8_t  utf8_buffer [8]   static omstronly_matching = NULL   static omstronly_matching_last = NULL   static int  only_matching_count   static omdatastr  only_matching_data = { &only_matching, &only_matching_last }   static fnstrexclude_from = NULL   static fnstrexclude_from_last = NULL   static fnstrinclude_from = NULL   static fnstrinclude_from_last = NULL   static fnstrfile_lists = NULL   static fnstrfile_lists_last = NULL   static fnstrpattern_files = NULL   static fnstrpattern_files_last = NULL   static fndatastr  exclude_from_data = { &exclude_from, &exclude_from_last }   static fndatastr  include_from_data = { &include_from, &include_from_last }   static fndatastr  file_lists_data = { &file_lists, &file_lists_last }   static fndatastr  pattern_files_data = { &pattern_files, &pattern_files_last }   static patstrpatterns = NULL   static patstrpatterns_last = NULL   static patstrinclude_patterns = NULL   static patstrinclude_patterns_last = NULL   static patstrexclude_patterns = NULL   static patstrexclude_patterns_last = NULL   static patstrinclude_dir_patterns = NULL   static patstrinclude_dir_patterns_last = NULL   static patstrexclude_dir_patterns = NULL   static patstrexclude_dir_patterns_last = NULL   static patdatastr  match_patdata = { &patterns, &patterns_last }   static patdatastr  include_patdata = { &include_patterns, &include_patterns_last }   static patdatastr  exclude_patdata = { &exclude_patterns, &exclude_patterns_last }   static patdatastr  include_dir_patdata = { &include_dir_patterns, &include_dir_patterns_last }   static patdatastr  exclude_dir_patdata = { &exclude_dir_patterns, &exclude_dir_patterns_last }   static patstr **  incexlist [4]   static const char *  incexname [4]   static option_item  optionlist []   static const char *  newlines []   const int  utf8_table1 []   const int  utf8_table1_size = sizeof(utf8_table1) / sizeof(int)   const int  utf8_table2 [] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc}   const int  utf8_table3 [] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01}   const char  utf8_table4 []   int  sys_nerr   char *  sys_errlist []   ◆ DEFAULT_CAPTURE_MAX #define DEFAULT_CAPTURE_MAX   50

Definition at line 132 of file pcre2grep.c.

◆ ERRBUFSIZ ◆ FALSE ◆ FILESEP ◆ FNBUFSIZ ◆ FWRITE_IGNORE #define FWRITE_IGNORE (   a,   b,   c,   d  )    if (fwrite(a,b,c,d)) {}

Definition at line 178 of file pcre2grep.c.

◆ MAXPATLEN ◆ memmove ◆ N_ALLABSK ◆ N_BINARY_FILES #define N_BINARY_FILES   (-19)

Definition at line 421 of file pcre2grep.c.

◆ N_BUFSIZE ◆ N_COLOUR ◆ N_EXCLUDE ◆ N_EXCLUDE_DIR #define N_EXCLUDE_DIR   (-3)

Definition at line 405 of file pcre2grep.c.

◆ N_EXCLUDE_FROM #define N_EXCLUDE_FROM   (-20)

Definition at line 422 of file pcre2grep.c.

◆ N_FILE_LIST ◆ N_FOFFSETS ◆ N_GROUP_SEPARATOR #define N_GROUP_SEPARATOR   (-27)

Definition at line 429 of file pcre2grep.c.

◆ N_H_LIMIT ◆ N_HELP ◆ N_INCLUDE ◆ N_INCLUDE_DIR #define N_INCLUDE_DIR   (-6)

Definition at line 408 of file pcre2grep.c.

◆ N_INCLUDE_FROM #define N_INCLUDE_FROM   (-21)

Definition at line 423 of file pcre2grep.c.

◆ N_LABEL ◆ N_LBUFFER ◆ N_LOCALE ◆ N_LOFFSETS ◆ N_M_LIMIT ◆ N_M_LIMIT_DEP #define N_M_LIMIT_DEP   (-15)

Definition at line 417 of file pcre2grep.c.

◆ N_MAX_BUFSIZE #define N_MAX_BUFSIZE   (-23)

Definition at line 425 of file pcre2grep.c.

◆ N_NO_GROUP_SEPARATOR #define N_NO_GROUP_SEPARATOR   (-28)

Definition at line 430 of file pcre2grep.c.

◆ N_NOJIT ◆ N_NULL ◆ N_OM_CAPTURE #define N_OM_CAPTURE   (-24)

Definition at line 426 of file pcre2grep.c.

◆ N_OM_SEPARATOR #define N_OM_SEPARATOR   (-22)

Definition at line 424 of file pcre2grep.c.

◆ N_POSIX_DIGIT #define N_POSIX_DIGIT   (-26)

Definition at line 428 of file pcre2grep.c.

◆ PCRE2_CODE_UNIT_WIDTH #define PCRE2_CODE_UNIT_WIDTH   8

Definition at line 102 of file pcre2grep.c.

◆ PO_FIXED_STRINGS #define PO_FIXED_STRINGS   0x0004

Definition at line 162 of file pcre2grep.c.

◆ PO_LINE_MATCH #define PO_LINE_MATCH   0x0002

Definition at line 161 of file pcre2grep.c.

◆ PO_WORD_MATCH #define PO_WORD_MATCH   0x0001

Definition at line 160 of file pcre2grep.c.

◆ QUOT ◆ SIZ_FORM ◆ STDOUT_NL ◆ STDOUT_NL_CODE #define STDOUT_NL_CODE   0x7fffffffu

Definition at line 200 of file pcre2grep.c.

◆ STDOUT_NL_LEN ◆ TRUE ◆ BOOL ◆ directory_type ◆ fndatastr ◆ fnstr ◆ omdatastr ◆ omstr ◆ option_item ◆ patdatastr ◆ patstr ◆ anonymous enum Enumerator FN_NONE  FN_DEFAULT  FN_MATCH_ONLY  FN_NOMATCH_ONLY  FN_FORCE 

Definition at line 147 of file pcre2grep.c.

◆ anonymous enum Enumerator FR_PLAIN  FR_LIBZ  FR_LIBBZ2 

Definition at line 151 of file pcre2grep.c.

◆ anonymous enum Enumerator dee_READ  dee_SKIP  dee_RECURSE 

Definition at line 155 of file pcre2grep.c.

◆ anonymous enum Enumerator DEE_READ  DEE_SKIP 

Definition at line 156 of file pcre2grep.c.

◆ anonymous enum Enumerator BIN_BINARY  BIN_NOMATCH  BIN_TEXT 

Definition at line 166 of file pcre2grep.c.

◆ anonymous enum Enumerator DDE_ERROR  DDE_CAPTURE  DDE_CHAR 

Definition at line 170 of file pcre2grep.c.

◆ anonymous enum Enumerator OP_NODATA  OP_STRING  OP_OP_STRING  OP_NUMBER  OP_U32NUMBER  OP_SIZE  OP_OP_NUMBER  OP_OP_NUMBERS  OP_PATLIST  OP_FILELIST  OP_BINFILES 

Definition at line 389 of file pcre2grep.c.

◆ add_number() ◆ add_pattern()

Definition at line 692 of file pcre2grep.c.

References patstr::compiled, free(), patstr::length, malloc(), MAXPATLEN, patstr::next, NULL, pcre2grep_exit(), and patstr::string.

Referenced by compile_pattern(), main(), and read_pattern_file().

◆ closedirectory() ◆ compile_pattern()

Definition at line 3707 of file pcre2grep.c.

References add_pattern(), compile_context, patstr::compiled, count, end_of_line(), ERRBUFSIZ, FALSE, patstr::length, NULL, ordin(), pcre2_compile(), pcre2_get_error_message(), pcre2_jit_compile(), PCRE2_JIT_COMPLETE, PCRE2_LITERAL, PCRE2_SIZE, PCRE2_SPTR, PCRE2_UCHAR, patstr::string, TRUE, and use_jit.

Referenced by main(), and read_pattern_file().

◆ decode_dollar_escape()

Definition at line 1976 of file pcre2grep.c.

References DDE_CAPTURE, DDE_CHAR, DDE_ERROR, FALSE, isdigit(), isxdigit(), last(), max(), STDOUT_NL_CODE, string, TRUE, utf, and rapidjson::value.

Referenced by display_output_text(), and syntax_check_output_text().

◆ decode_number() ◆ display_output_text()

Definition at line 2194 of file pcre2grep.c.

References DDE_CAPTURE, DDE_CHAR, decode_dollar_escape(), FALSE, i, n, ord2utf8(), PCRE2_SIZE, PCRE2_SPTR, print_match(), STDOUT_NL, STDOUT_NL_CODE, string, subject, TRUE, utf, utf8_buffer, and rapidjson::value.

Referenced by pcre2grep().

◆ do_after_lines() static void do_after_lines ( unsigned long int  lastmatchnumber, char *  lastmatchrestart, char *  endptr, const char *  printname  ) static

Definition at line 1792 of file pcre2grep.c.

References after_context, bufsize, count, end_of_line(), FWRITE_IGNORE, hyphenpending, main_buffer, NULL, number, printname_hyphen, TRUE, and write_final_newline().

Referenced by pcre2grep().

◆ emulated_memmove() static void* emulated_memmove ( void *  d, const void *  s, size_t  n  ) static ◆ end_of_line() static char* end_of_line ( char *  p, char *  endptr, intlenptr  ) static

Definition at line 1470 of file pcre2grep.c.

References endlinetype, PCRE2_NEWLINE_ANY, PCRE2_NEWLINE_ANYCRLF, PCRE2_NEWLINE_CR, PCRE2_NEWLINE_CRLF, PCRE2_NEWLINE_LF, PCRE2_NEWLINE_NUL, utf, utf8_table3, and utf8_table4.

Referenced by compile_pattern(), do_after_lines(), and pcre2grep().

◆ fill_buffer() ◆ free_file_chain() ◆ free_pattern_chain() ◆ grep_or_recurse() static int grep_or_recurse ( char *  pathname, BOOL  dir_recurse, BOOL  only_one_at_top  ) static

Definition at line 3259 of file pcre2grep.c.

References buffer, BZ2_bzclose(), BZ2_bzerror(), BZ2_bzopen(), BZ_DATA_ERROR_MAGIC, closedirectory(), count_limit, dee_action, DEE_action, dee_RECURSE, dee_SKIP, DEE_SKIP, exclude_dir_patterns, exclude_patterns, FALSE, filenames, FILESEP, FN_DEFAULT, FNBUFSIZ, FR_LIBBZ2, FR_LIBZ, FR_PLAIN, gzclose, gzopen, in(), include_dir_patterns, include_patterns, int, isdirectory(), isregfile(), NULL, opendirectory(), PATH_MAX, pcre2grep(), readdirectory(), silent, stdin_name, strcat, util::strcmp(), strerror(), util::strncmp(), and test_incexc().

Referenced by main().

◆ handle_option()

Definition at line 3590 of file pcre2grep.c.

References add_number(), BIN_NOMATCH, BIN_TEXT, binary_files, buffer, case_restrict, count_only, dee_action, dee_RECURSE, extra_options, FALSE, file_offsets, filenames, FN_FORCE, FN_MATCH_ONLY, FN_NOMATCH_ONLY, FN_NONE, group_separator, help(), invert, letter(), line_buffered, line_offsets, multiline, N_ALLABSK, N_FOFFSETS, N_HELP, N_LBUFFER, N_LOFFSETS, N_NO_GROUP_SEPARATOR, N_NOJIT, N_POSIX_DIGIT, no_ucp, NULL, number, omit_zero_count, only_matching, only_matching_last, PCRE2_CASELESS, pcre2_config(), PCRE2_CONFIG_VERSION, PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK, PCRE2_EXTRA_MATCH_LINE, PCRE2_EXTRA_MATCH_WORD, PCRE2_FIRSTLINE, PCRE2_LITERAL, PCRE2_MATCH_INVALID_UTF, PCRE2_MULTILINE, PCRE2_UCP, PCRE2_UTF, pcre2grep_exit(), posix_digit, printname_colon, printname_hyphen, printname_nl, quiet, show_total_count, silent, STDOUT_NL, TRUE, usage(), use_jit, and utf.

Referenced by main().

◆ help()

Definition at line 1212 of file pcre2grep.c.

References option_item::help_text, option_item::long_name, MAXPATLEN, n, option_item::one_char, optionlist, PCRE2GREP_BUFSIZE, PCRE2GREP_MAX_BUFSIZE, QUOT, and STDOUT_NL.

Referenced by CTrackConfigUtils::CreateCategory(), CTrackConfigUtils::CreateChoice(), CTrackConfigUtils::CreateChoiceItem(), CTrackConfigUtils::CreateRangeControl(), CSixFramesTransTrackFactory::GetSettings(), handle_option(), NAutomation::CArgument::Help(), SSimpleCommandImpl::Help(), SVariadicCommandImpl::Help(), SCommandGroupImpl::Help(), NAutomation::CAutomationProc::ProcessMessage(), and CTempTrackProxy::SetHelp().

◆ is_file_tty() ◆ is_stdout_tty() ◆ isdirectory() int isdirectory ( char *  filename ) ◆ isregfile() int isregfile ( char *  filename ) ◆ main() int main ( int  argc, char **  argv  )

Definition at line 3865 of file pcre2grep.c.

References add_number(), add_pattern(), after_context, all_matches, omdatastr::anchor, fndatastr::anchor, patdatastr::anchor, before_context, BIN_BINARY, BIN_NOMATCH, BIN_TEXT, binary_files, both_context, buffer, bufsize, bufthird, capture_max, case_restrict, character_tables, colour_option, colour_string, compile_context, compile_pattern(), count_limit, counts_printed, option_item::dataptr, decode_number(), dee_action, DEE_action, dee_option, DEE_option, dee_READ, DEE_READ, dee_RECURSE, dee_SKIP, DEE_SKIP, depth_limit, do_colour, endlinetype, exclude_dir_patterns, exclude_from, exclude_patterns, exclude_patterns_last, extra_options, FALSE, file_lists, file_offsets, filenames, FN_DEFAULT, FN_NOMATCH_ONLY, FNBUFSIZ, FR_PLAIN, free(), free_file_chain(), free_pattern_chain(), grep_or_recurse(), handle_option(), heap_limit, i, incexlist, incexname, include_dir_patterns, include_from, include_patterns, include_patterns_last, int, is_stdout_tty(), isdigit(), isspace(), jit_stack, omdatastr::lastptr, fndatastr::lastptr, patdatastr::lastptr, line_offsets, locale, option_item::long_name, main_buffer, malloc(), match_context, match_data, match_data_pair, match_data_toggle, match_limit, n, N_COLOUR, fnstr::name, newline_arg, newlines, next(), fnstr::next, patstr::next, no_ucp, NULL, offset_size, offsets, offsets_pair, om, option_item::one_char, only_matching, only_matching_count, only_matching_last, OP_BINFILES, OP_FILELIST, OP_NODATA, OP_NUMBER, OP_OP_NUMBER, OP_OP_NUMBERS, OP_OP_STRING, OP_PATLIST, OP_SIZE, OP_U32NUMBER, optionlist, output_text, parse_grep_colors(), pattern_files, patterns, patterns_last, pcre2_compile_context_create(), pcre2_compile_context_free(), pcre2_config(), PCRE2_CONFIG_JIT, PCRE2_CONFIG_NEWLINE, PCRE2_EXTRA_ASCII_BSD, PCRE2_EXTRA_ASCII_DIGIT, PCRE2_EXTRA_CASELESS_RESTRICT, pcre2_get_ovector_pointer(), pcre2_jit_free_unused_memory(), pcre2_jit_stack, pcre2_jit_stack_assign(), pcre2_jit_stack_create(), pcre2_jit_stack_free(), PCRE2_LITERAL, pcre2_maketables(), pcre2_maketables_free(), pcre2_match_context_create(), pcre2_match_context_free(), pcre2_match_data_create(), pcre2_match_data_free(), pcre2_options, pcre2_set_callout(), pcre2_set_character_tables(), pcre2_set_compile_extra_options(), pcre2_set_depth_limit(), pcre2_set_heap_limit(), pcre2_set_match_limit(), pcre2_set_newline(), PCRE2_SIZE, PCRE2_SPTR, PCRE2_UCP, PCRE2_UNSET, pcre2grep(), pcre2grep_exit(), posix_digit, read_pattern_file(), show_total_count, stdin_name, STDOUT_NL, util::strcmp(), strcmpic(), strerror(), util::strncmp(), syntax_check_output_text(), total_count, TRUE, option_item::type, usage(), and use_jit.

◆ match_patterns()

Definition at line 1847 of file pcre2grep.c.

References all_matches, patstr::compiled, error_count, FALSE, first(), FWRITE_IGNORE, i, invert, match_context, match_data, match_data_pair, match_data_toggle, msg(), patstr::next, NULL, offsets, offsets_pair, patterns, PCRE2_ERROR_DEPTHLIMIT, PCRE2_ERROR_HEAPLIMIT, PCRE2_ERROR_JIT_STACKLIMIT, PCRE2_ERROR_MATCHLIMIT, PCRE2_ERROR_NOMATCH, PCRE2_ERROR_UTF8_ERR1, PCRE2_ERROR_UTF8_ERR21, pcre2_get_error_message(), pcre2_get_startchar(), pcre2_match(), PCRE2_SIZE, PCRE2_SPTR, pcre2grep_exit(), resource_error, SIZ_FORM, and TRUE.

Referenced by pcre2grep().

◆ opendirectory() ◆ ord2utf8() ◆ ordin() ◆ parse_grep_colors() ◆ pcre2grep()

Definition at line 2591 of file pcre2grep.c.

References after_context, before_context, BIN_NOMATCH, BIN_TEXT, binary_files, bufsize, bufthird, count, count_limit, count_only, counts_printed, display_output_text(), do_after_lines(), do_colour, end_of_line(), endlinetype, FALSE, file_offsets, filenames, fill_buffer(), FN_MATCH_ONLY, FN_NOMATCH_ONLY, FN_NONE, FR_LIBBZ2, FR_LIBZ, free(), fseek, FWRITE_IGNORE, group_separator, hyphenpending, in(), int, invert, is_file_tty(), line_buffered, line_offsets, main_buffer, malloc(), match(), match_data, match_patterns(), max_bufthird, memmove, multiline, n, NULL, number, offsets, om, om_separator, omit_zero_count, only_matching, only_matching_count, output_text, pcre2_get_startchar(), PCRE2_NEWLINE_NUL, PCRE2_NOTEMPTY, PCRE2_SIZE, PCRE2_SPTR, previous_line(), print_match(), printname_colon, printname_hyphen, printname_nl, quiet, read_one_line(), SEEK_SET, show_total_count, SIZ_FORM, stdin_name, STDOUT_NL, t, total_count, TRUE, utf, and write_final_newline().

Referenced by grep_or_recurse(), and main().

◆ pcre2grep_exit()

Definition at line 649 of file pcre2grep.c.

References exit(), PCRE2_ERROR_DEPTHLIMIT, PCRE2_ERROR_HEAPLIMIT, PCRE2_ERROR_JIT_STACKLIMIT, PCRE2_ERROR_MATCHLIMIT, and resource_error.

Referenced by add_number(), add_pattern(), decode_number(), handle_option(), main(), and match_patterns().

◆ previous_line() static char* previous_line ( char *  p, char *  startptr  ) static ◆ print_match() ◆ read_one_line() ◆ read_pattern_file()

Definition at line 3787 of file pcre2grep.c.

References add_pattern(), buffer, compile_pattern(), f, FALSE, isspace(), MAXPATLEN, patstr::next, NULL, pcre2_options, PCRE2_SIZE, read_one_line(), stdin_name, util::strcmp(), strerror(), and TRUE.

Referenced by main().

◆ readdirectory() ◆ strcmpic() ◆ strerror()

Definition at line 1177 of file pcre2grep.c.

References n, sys_errlist, and sys_nerr.

Referenced by compress(), COutputFileHelper::CreateTemporaryFile(), dbperror(), CRandomSupplier::GetRand(), GiDataIndex_New(), grep_or_recurse(), CInterProcessLock::Lock(), main(), mdb_page_flush(), mdb_strerror(), mdb_txn_begin(), NcbiErrnoStr(), NcbiMessagePlusError(), CPubseqGatewayCacheBase::Open(), SJobDumpHeader::Read(), SOneStructDumpHeader::Read(), SAffinityDictDump::Read(), SGroupDictDump::Read(), SQueueDescriptionDump::Read(), SLinkedSectionDump::Read(), SJobEventsDump::Read(), SJobIODump::Read(), SJobDump::Read(), read_pattern_file(), CGridCommandLineInterfaceApp::Run(), CComponentIDToolApp::Run(), s_ApplyMap(), s_ErrnoToString(), s_LogWithErrno(), s_OpenPipeOrPty(), s_OSReason(), s_Run(), s_Tee(), tds_process_info(), testf(), uncompress(), SJobDumpHeader::Write(), SOneStructDumpHeader::Write(), SAffinityDictDump::Write(), SGroupDictDump::Write(), SQueueDescriptionDump::Write(), SLinkedSectionDump::Write(), SJobEventsDump::Write(), SJobIODump::Write(), SJobDump::Write(), CQueueDataBase::x_CreateSpaceReserveFile(), and x_ReadChunkHead().

◆ syntax_check_output_text() ◆ test_incexc() ◆ usage() ◆ write_final_newline() static void write_final_newline ( void  ) static ◆ after_context ◆ all_matches ◆ before_context ◆ binary_files ◆ both_context ◆ bufsize

Definition at line 237 of file pcre2grep.c.

Referenced by blk_gettext(), CNcbiApplogApp::Cmd_Generate(), CORE_GetUsername(), CORE_GetUsernameEx(), dbreadtext(), dbstrbuild(), do_after_lines(), DSOCK_RecvMsg(), DSOCK_RecvMsg6(), CCookieAffinity_Plain::GetHostIP(), LSOCK_GetListeningAddressString(), LSOCK_GetListeningAddressStringEx(), main(), MIME_ComposeContentTypeEx(), NcbiAddrToDNS(), NcbiAddrToString(), NcbiDumpIPRange(), NcbiGetHostIP(), NcbiIPv4ToString(), NcbiIPv6ToString(), CHttpGetParser::Parse(), pcre2grep(), readBlobAsChar(), s_AddrToString(), s_CP(), s_CPListening(), s_gethostbyaddr(), s_gethostbyaddr_(), s_gethostname(), s_HostPortToStringEx(), s_RecvMsg(), SERV_PrintFirewallPorts(), SOCK_gethostbyaddr(), SOCK_gethostbyaddr6(), SOCK_gethostbyaddrEx(), SOCK_gethostbyaddrEx6(), SOCK_gethostname(), SOCK_gethostnameEx(), SOCK_GetPeerAddressString(), SOCK_GetPeerAddressStringEx(), SOCK_ntoa(), tds_alloc_socket(), tds_init_connection(), tds_init_socket(), tds_realloc_socket(), x_IPv4ToString(), x_IPv6ToString(), x_SaveStr(), and x_UpdateDtabInArgs().

◆ bufthird ◆ capture_max ◆ case_restrict ◆ character_tables ◆ colour_option ◆ colour_string const char* colour_string = "1;31" static ◆ compile_context ◆ count_limit ◆ count_only ◆ counts_printed unsigned long int counts_printed = 0 static ◆ dee_action ◆ DEE_action ◆ dee_option ◆ DEE_option ◆ depth_limit ◆ do_colour ◆ endlinetype ◆ error_count ◆ exclude_dir_patdata ◆ exclude_dir_patterns ◆ exclude_dir_patterns_last ◆ exclude_from ◆ exclude_from_data ◆ exclude_from_last ◆ exclude_patdata ◆ exclude_patterns ◆ exclude_patterns_last ◆ extra_options ◆ file_lists ◆ file_lists_data ◆ file_lists_last ◆ file_offsets ◆ filenames

Definition at line 247 of file pcre2grep.c.

Referenced by CBamLoadOptionPanel::AddFilenames(), CMacroLib::AppendToLibrary(), chooseSettings(), CAppDialogs::COpenDialog(), CProjectTask::CProjectTask(), CTableObjectLoader::CTableObjectLoader(), CFileLoadManager::DoTransition(), CTableImportWizard::GetExecuteUnit(), CASNFormatLoadManager::GetFilenames(), CFileAutoLoader::GetFilenames(), CFileLoadOptionPanel::GetFilenames(), CTableFileLoadManager::GetFilenames(), CProjectFormatLoadManager::GetFilenames(), CGBFlatFileLoadManager::GetFilenames(), CQualTableLoadManager::GetFilenames(), CMultiFileInput::GetFilenames(), CPhyLoader::GetFilenames(), CPslLoadManager::GetFilenames(), CRMLoader::GetFilenames(), CTextAlignLoaderManager::GetFilenames(), C5ColLoadManager::GetFilenames(), CAgpLoader::GetFilenames(), CBedLoadManager::GetFilenames(), CColumnarVCFLoaderManager::GetFilenames(), CFASTAFormatLoadManager::GetFilenames(), CGffLoadManager::GetFilenames(), CVCFLoaderManager::GetFilenames(), CWigLoadManager::GetFilenames(), CFileLoadPanel::GetFilenames(), CProjectLoadOptionPanel::GetProjectFilenames(), CFileLoadManager::GetTask(), CProjectLoadManager::GetTask(), grep_or_recurse(), handle_option(), CSeqEditPackage::Init(), CEditingBtnsPanel::LoadSettings(), main(), NcbiFileBrowser(), CBamLoadOptionPanel::OnButtonClick(), CProjectTreeViewDropTarget::OnData(), CBamLoadOptionPanel::CDropTarget::OnData(), CMultiFileInput::CDropTarget::OnData(), CFrameworkDemoGUIDropTarget::OnData(), CProjectLoadOptionPanel::OnFinish(), CMacroFlowEditor::OnInputFile(), pcre2grep(), CEditingBtnsPanel::RemoveStaticButtons(), CAgpValidateApplication::Run(), CEditingBtnsPanel::SaveSettings(), CASNFormatLoadManager::SetFilenames(), CFileAutoLoader::SetFilenames(), CFileLoadOptionPanel::SetFilenames(), COpenDlg::SetFilenames(), CTableFileLoadManager::SetFilenames(), CProjectFormatLoadManager::SetFilenames(), CGBFlatFileLoadManager::SetFilenames(), CQualTableLoadManager::SetFilenames(), CMultiFileInput::SetFilenames(), CPhyLoader::SetFilenames(), CPslLoadManager::SetFilenames(), CRMLoader::SetFilenames(), CTextAlignLoaderManager::SetFilenames(), C5ColLoadManager::SetFilenames(), CAgpLoader::SetFilenames(), CBedLoadManager::SetFilenames(), CColumnarVCFLoaderManager::SetFilenames(), CFASTAFormatLoadManager::SetFilenames(), CGffLoadManager::SetFilenames(), CVCFLoaderManager::SetFilenames(), CWigLoadManager::SetFilenames(), CFileLoadPanel::SetFilenames(), CBamLoadOptionPanel::SetFilenames(), CFileLoadManager::SetFilenames(), CFileLoadWizard::SetFilenames(), CAttribTableColumnIdPanel::SetFileNames(), CFileAutoLoader::SetFormatManager(), sFilenameSetToString(), CFileAutoLoader::ValidateFilenames(), CTableFileLoadManager::ValidateFilenames(), CProjectFormatLoadManager::ValidateFilenames(), CQualTableLoadManager::ValidateFilenames(), CTableImportWizard::ValidateFilenames(), CFileLoadWizard::x_CanLeavePage(), CFileLoadManager::x_CanLeavePage(), CFileLoadWizard::x_CheckFormatConflict(), CFileLoadManager::x_CheckFormatConflict(), CProjectLoadOptionPanel::x_Finish(), CProjectLoadOptionPanel::x_GetSelectedMRUFilenames(), CMakeProfileDBApp::x_GetSMPFilenames(), CMultiFileInput::x_OnAddFilenames(), and CMakeBlastDBApp::x_VerifyInputFilesType().

◆ group_separator const char* group_separator = "--" static ◆ heap_limit ◆ hyphenpending ◆ incexlist Initial value:

static patstr * exclude_dir_patterns

static patstr * include_patterns

static patstr * include_dir_patterns

static patstr * exclude_patterns

Definition at line 381 of file pcre2grep.c.

Referenced by main().

◆ incexname Initial value:

= { "--include", "--exclude",

"--include-dir", "--exclude-dir" }

Definition at line 384 of file pcre2grep.c.

Referenced by main().

◆ include_dir_patdata ◆ include_dir_patterns ◆ include_dir_patterns_last ◆ include_from ◆ include_from_data ◆ include_from_last ◆ include_patdata ◆ include_patterns ◆ include_patterns_last ◆ invert

Definition at line 280 of file pcre2grep.c.

Referenced by bm::blocks_manager< Alloc >::clone_assign_block(), CStringConstraint::DoesListMatch(), bm::serializer< BV >::encode_gap_block(), ErfImpl(), bm::sparse_vector_scanner< SV, S_FACTOR >::find_le(), bm::sparse_vector_scanner< SV, S_FACTOR >::find_lt(), bm::sparse_vector_scanner< SV, S_FACTOR >::find_zero(), bm::gap_convert_to_arr(), handle_option(), match_patterns(), pcre2grep(), sljit_emit_fselect(), and sljit_emit_op_flags().

◆ line_buffered ◆ line_offsets ◆ locale
Examples
/home/coremake/doxygen/cxx/include/corelib/ncbistr.hpp.

Definition at line 212 of file pcre2grep.c.

Referenced by _cs_locale_free(), _cs_locale_free_contents(), CTempXStr< _TChar >::CompareNocase(), cs_dt_info(), cs_loc_drop(), cs_locale(), cs_strcmp(), cs_time(), ct_connect(), get_ctype_facet(), main(), NormalizeStatKeyName(), s_ExtractKey(), s_FormatNum(), s_SetPubLocale(), s_ToLower(), s_ToUpper(), mu::Parser::SetDecSep(), mu::ParserBase::SetExpr(), mu::Parser::SetThousandsSep(), tds_alloc_context(), tds_alloc_locale(), tds_free_locale(), tds_get_locale(), tds_init_login(), tds_parse_locale(), tds_read_config_info(), test_common(), SLocaleEncoder::ToUnicode(), and CPublicationTypePanel::x_CollectDetails().

◆ main_buffer ◆ match_context ◆ match_data

Definition at line 265 of file pcre2grep.c.

Referenced by check_match_limit(), copy_and_get(), LLVMFuzzerTestOneInput(), main(), match(), match_patterns(), pcre2_dfa_match(), pcre2_get_mark(), pcre2_get_match_data_heapframes_size(), pcre2_get_match_data_size(), pcre2_get_ovector_count(), pcre2_get_ovector_pointer(), pcre2_get_startchar(), pcre2_jit_match(), pcre2_match(), pcre2_match_data_free(), pcre2_substitute(), pcre2_substring_copy_byname(), pcre2_substring_copy_bynumber(), pcre2_substring_get_byname(), pcre2_substring_get_bynumber(), pcre2_substring_length_byname(), pcre2_substring_length_bynumber(), pcre2_substring_list_get(), pcre2grep(), process_data(), show_heapframes_size(), test_incexc(), and CRegexp::x_Match().

◆ match_data_pair ◆ match_data_toggle ◆ match_limit ◆ match_patdata ◆ max_bufthird ◆ multiline ◆ newline_arg ◆ newlines Initial value:

= {

"DEFAULT", "CR", "LF", "CRLF", "ANY", "ANYCRLF", "NUL" }

Definition at line 508 of file pcre2grep.c.

Referenced by main().

◆ no_ucp ◆ number

Definition at line 285 of file pcre2grep.c.

Referenced by _cs_get_msgstr(), _csclient_msg(), _ct_get_msgstr(), _ctclient_msg(), _pcre2_find_bracket(), AddExon(), CIDs::AddID(), CPagerView::AddImageString(), CPagerView::AddInactiveImageString(), CAlignFormatUtil::AddSpace(), BlastNumber2Program(), BlastProgram2Number(), SSeqIdRange::const_iterator::const_iterator(), do_after_lines(), CAlignCollapser::FilterAlignments(), CSubSource::FixAltitude(), get_pat(), GetSeqFeatLabel(), GetStringOfFeatQual(), CAlignFormatUtil::GetSubjectsNumber(), CAltitudePanel::GetValue(), handle_option(), CSubSource::IsAltitudeValid(), CAltitudePanel::IsWellFormatted(), longlong_to_numeric(), match(), CRangeListImpl::Parse(), parse_number_value(), CCSRABlobId::ParseReadId(), pcre2grep(), CAlignFormatUtil::PruneSeqalign(), CAlignFormatUtil::PruneSeqalignAll(), CAlnVwrApp::Run(), s_CollectNumberAndUnits(), s_GetRoundNumber(), s_MultiplyByte(), s_ParseNumber(), s_RestoreNumber(), s_RestoreNumberAndCaseVariant(), CUTTPWriter::SendChunk(), CUTTPWriter::SendNumber(), CStatusBar::SetFieldsCount(), COligoSpecificityTemplate::SetMaxTargetPerSequence(), COligoSpecificityTemplate::SetNumNonSpecificTargets(), CShowBlastDefline::SetPSIIteration(), CDisplaySeqalign::SetQueryNumber(), CShowBlastDefline::SetQueryNumber(), CStatusBar::SetStatusWidths(), CAltitudePanel::SetValue(), CLatLonPanel::SetValue(), tds_numeric_to_string(), CId1FetchApp::WriteHistoryTable(), CPageList::x_AddImageString(), CPageList::x_AddInactiveImageString(), CSeq_id_Patent_Tree::x_FindInfo(), CFeatureItem::x_FormatQuals(), CAltitudePanel::x_GetNumber(), CFeatureItem::x_ImportQuals(), x_json_array_append_number(), x_json_array_replace_number(), x_json_object_dotset_number(), x_json_object_set_number(), x_json_value_init_number(), CCompoundIDDumpParser::x_ReadIPv4Address(), CMQueryFunctionOps::x_Validate(), and CMQueryFunctionOps::x_ValidateAll().

◆ offset_size ◆ offsets

Definition at line 266 of file pcre2grep.c.

Referenced by CInt_fuzz::Add(), CWriteDB_GiMaskOffset::AddGIs(), CWriteDB_GiMaskIndex::AddGIs(), CSplitCDSwithTooManyXs::AdjustSingleCDS(), BLAST_GetGappedScore(), Blast_TracebackFromHSPList(), BlastHashLookupIndexQueryExactMatches(), BlastNaHashLookupTableNew(), call_with_args(), CSRSearch_Impl< index_t >::copyOffsets(), do_callout_dfa(), CSeqDBColumn::GetBlob(), CSeqDBLMDB::GetOidsForTaxIds(), internal_dfa_match(), main(), match_patterns(), CSRSearch_Impl< index_t >::mergeOffsets(), pcre2grep(), CAlignFormatUtil::PrintPhiInfo(), CBlastFormat::PrintPhiResult(), s_AddWordHit(), s_BlastNaHashLookupFinalize(), s_ChainingAlignment(), s_RPSComputeTraceback(), s_SeqDB_FindOffsets(), s_SequenceGetProteinRange(), CSRSearch_Impl< index_t >::searchExact(), CSRSearch_Impl< index_t >::searchOneMismatch(), sSetLocusLineOffsets(), tdefl_radix_sort_syms(), tds5_bcp_add_variable_columns(), tds_bcp_add_variable_columns(), CWriteDB_LMDB::x_CreateOidToSeqidsLookupFile(), CWriteDB_TaxID::x_CreateOidToTaxIdsLookupFile(), CCddInputData::CHitSegment::x_FillObservations(), CSeqDBAliasSets::x_ReadAliasSetFile(), x_TestGetSeqLocInfoVector(), and CAlnFormatGuesser::xSampleIsSequin().

◆ offsets_pair ◆ om_separator ◆ omit_zero_count ◆ only_matching ◆ only_matching_count ◆ only_matching_data ◆ only_matching_last ◆ optionlist ◆ output_text ◆ pattern_files ◆ pattern_files_data ◆ pattern_files_last ◆ patterns

Definition at line 356 of file pcre2grep.c.

Referenced by CMultipatternSearch::AddPatterns(), AssignDefaultPatterns(), BOOST_AUTO_TEST_CASE(), main(), match_patterns(), CTestTranscript_PolyA::RunTest(), s_AfrpProcessFastaGap(), CSuspect_rule_set::Screen(), CTraversalPatternMatchCallback::x_AnyPatternMatches(), CCgiUserAgent::x_CheckPattern(), CMultiAligner::x_FindPatternHits(), x_FindRSite(), x_LoadPatterns(), CSequenceSearchForm::x_UpdateFileList(), COrfSearchForm::x_UpdateKozak(), and xTryProductRules().

◆ patterns_last ◆ pcre2_options ◆ posix_digit ◆ printname_colon int printname_colon = ':' static ◆ printname_hyphen int printname_hyphen = '-' static ◆ printname_nl const char* printname_nl = "\n" static ◆ quiet ◆ resource_error ◆ show_total_count BOOL show_total_count = 0 static ◆ silent ◆ stdin_name ◆ sys_errlist ◆ sys_nerr ◆ total_count unsigned long int total_count = 0 static ◆ use_jit ◆ utf

Definition at line 291 of file pcre2grep.c.

Referenced by _pcre2_auto_possessify(), _pcre2_check_escape(), _pcre2_extuni(), _pcre2_find_bracket(), _pcre2_is_newline(), _pcre2_script_run(), _pcre2_study(), _pcre2_was_newline(), _pcre2_xclass(), add_not_list_to_class(), pythonpp::CString::AsStdSring(), callout_callback(), callout_function(), compare_opcodes(), compile_branch(), convert_glob(), convert_glob_parse_range(), convert_posix(), copy_and_get(), decode_dollar_escape(), display_output_text(), end_of_line(), find_minlength(), find_recurse(), get_chr_property_list(), handle_option(), internal_dfa_match(), match(), match_ref(), parse_regex(), pchar(), pcre2_callout_enumerate(), pcre2_compile(), pcre2_dfa_match(), pcre2_match(), pcre2_pattern_convert(), pcre2_printint_(), pcre2_substitute(), pcre2grep(), previous_line(), print_char_(), process_data(), process_pattern(), read_name(), regression_tests(), set_start_bits(), set_table_bit(), pythonpp::bind::CString::SetInternal(), show_pattern_info(), and substitute_callout_function().

◆ utf8_buffer ◆ utf8_table1 ◆ utf8_table1_size ◆ utf8_table2 const int utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc} ◆ utf8_table3 const int utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01} ◆ utf8_table4 Initial value:

= {

1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,

3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }

Definition at line 520 of file pcre2grep.c.

Referenced by end_of_line(), previous_line(), and print_char_().


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4