pcretest.c File Reference

#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <locale.h>
#include <errno.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "pcre.h"
#include "pcre_internal.h"
#include "pcre_tables.c"
#include "pcre_printint.src"
#include "pcreposix.h"

Go to the source code of this file.

Defines

#define INPUT_MODE   "rb"
#define OUTPUT_MODE   "wb"
#define _pcre_ucp_gentype   ucp_gentype
#define _pcre_utf8_table1   utf8_table1
#define _pcre_utf8_table1_size   utf8_table1_size
#define _pcre_utf8_table2   utf8_table2
#define _pcre_utf8_table3   utf8_table3
#define _pcre_utf8_table4   utf8_table4
#define _pcre_utt   utt
#define _pcre_utt_size   utt_size
#define _pcre_utt_names   utt_names
#define _pcre_OP_lengths   OP_lengths
#define PRINTHEX(c)   (locale_set? isprint(c) : PRINTABLE(c))
#define CLOCKS_PER_SEC   100
#define LOOPREPEAT   500000

Functions

static uscharextend_inputline (FILE *f, uschar *start, const char *prompt)
static int get_value (unsigned char *str, unsigned char **endptr)
static int pchars (unsigned char *p, int length, FILE *f)
static int callout (pcre_callout_block *cb)
static void * new_malloc (size_t size)
static void new_free (void *block)
static void * stack_malloc (size_t size)
static void stack_free (void *block)
static void new_info (pcre *re, pcre_extra *study, int option, void *ptr)
static unsigned long int byteflip (unsigned long int value, int n)
static int check_match_limit (pcre *re, pcre_extra *extra, uschar *bptr, int len, int start_offset, int options, int *use_offsets, int use_size_offsets, int flag, unsigned long int *limit, int errnumber, const char *msg)
static int strncmpic (uschar *s, uschar *t, int n)
static int check_newline (uschar *p, FILE *f)
static void usage (void)
int main (int argc, char **argv)

Variables

static FILE * outfile
static int log_store = 0
static int callout_count
static int callout_extra
static int callout_fail_count
static int callout_fail_id
static int debug_lengths
static int first_callout
static int locale_set = 0
static int show_malloc
static int use_utf8
static size_t gotten_store
static int buffer_size = 50000
static uscharbuffer = NULL
static uschardbuffer = NULL
static uscharpbuffer = NULL


Define Documentation

#define _pcre_OP_lengths   OP_lengths

Definition at line 110 of file pcretest.c.

Referenced by compile_branch(), could_be_empty_branch(), find_bracket(), find_fixedlength(), find_recurse(), first_significant_code(), is_anchored(), is_startline(), and match().

#define _pcre_ucp_gentype   ucp_gentype

Definition at line 101 of file pcretest.c.

Referenced by _pcre_xclass(), internal_dfa_exec(), and match().

#define _pcre_utf8_table1   utf8_table1

Definition at line 102 of file pcretest.c.

Referenced by _pcre_ord2utf8().

#define _pcre_utf8_table1_size   utf8_table1_size

Definition at line 103 of file pcretest.c.

Referenced by _pcre_ord2utf8().

#define _pcre_utf8_table2   utf8_table2

Definition at line 104 of file pcretest.c.

Referenced by _pcre_ord2utf8().

#define _pcre_utf8_table3   utf8_table3

Definition at line 105 of file pcretest.c.

#define _pcre_utf8_table4   utf8_table4

Definition at line 106 of file pcretest.c.

Referenced by _pcre_valid_utf8(), find_bracket(), find_recurse(), and set_start_bits().

#define _pcre_utt   utt

Definition at line 107 of file pcretest.c.

#define _pcre_utt_names   utt_names

Definition at line 109 of file pcretest.c.

#define _pcre_utt_size   utt_size

Definition at line 108 of file pcretest.c.

#define CLOCKS_PER_SEC   100

Definition at line 156 of file pcretest.c.

Referenced by get_time(), main(), TMVA::RuleFitParams::MakeGDPath(), and TMVA::RuleFitParams::MakeGradientVector().

#define INPUT_MODE   "rb"

Definition at line 80 of file pcretest.c.

Referenced by main().

#define LOOPREPEAT   500000

Definition at line 162 of file pcretest.c.

Referenced by main().

#define OUTPUT_MODE   "wb"

Definition at line 81 of file pcretest.c.

Referenced by main().

#define PRINTHEX ( c   )     (locale_set? isprint(c) : PRINTABLE(c))

Definition at line 126 of file pcretest.c.

Referenced by main(), and pchars().


Function Documentation

static unsigned long int byteflip ( unsigned long int  value,
int  n 
) [static]

Definition at line 645 of file pcretest.c.

static int callout ( pcre_callout_block cb  )  [static]

Definition at line 495 of file pcretest.c.

References callout_count, pcre_callout_block::callout_data, callout_extra, callout_fail_count, callout_fail_id, pcre_callout_block::callout_number, pcre_callout_block::capture_last, pcre_callout_block::capture_top, pcre_callout_block::current_position, first_callout, fprintf(), pcre_callout_block::next_item_length, NULL, pcre_callout_block::offset_vector, outfile, pcre_callout_block::pattern_position, pbuffer, pchars(), pcre_callout_block::start_match, pcre_callout_block::subject, pcre_callout_block::subject_length, and void.

Referenced by main().

static int check_match_limit ( pcre re,
pcre_extra extra,
uschar bptr,
int  len,
int  start_offset,
int  options,
int *  use_offsets,
int  use_size_offsets,
int  flag,
unsigned long int *  limit,
int  errnumber,
const char *  msg 
) [static]

Definition at line 662 of file pcretest.c.

References extra, fprintf(), max, min, outfile, PCRE_ERROR_NOMATCH, PCRE_ERROR_PARTIAL, and pcre_exec().

Referenced by main().

static int check_newline ( uschar p,
FILE *  f 
) [static]

Definition at line 750 of file pcretest.c.

References fprintf(), PCRE_BSR_ANYCRLF, PCRE_BSR_UNICODE, PCRE_NEWLINE_ANY, PCRE_NEWLINE_ANYCRLF, PCRE_NEWLINE_CR, PCRE_NEWLINE_CRLF, PCRE_NEWLINE_LF, and strncmpic().

Referenced by main().

static uschar* extend_inputline ( FILE *  f,
uschar start,
const char *  prompt 
) [static]

Definition at line 212 of file pcretest.c.

References add_history(), buffer, buffer_size, dbuffer, fprintf(), free(), int, len, malloc(), NULL, pbuffer, readline(), s, and size_t.

Referenced by main().

static int get_value ( unsigned char *  str,
unsigned char **  endptr 
) [static]

Definition at line 314 of file pcretest.c.

References int, and result().

Referenced by main().

int main ( int  argc,
char **  argv 
)

Definition at line 812 of file pcretest.c.

References buffer, buffer_size, byteflip(), callout(), callout_count, callout_extra, callout_fail_count, callout_fail_id, check_match_limit(), check_newline(), CLOCKS_PER_SEC, dbuffer, debug, debug_lengths, error, extend_inputline(), extra, FALSE, fclose(), fflush(), real_pcre::first_byte, first_callout, real_pcre::flags, fopen, for(), fprintf(), fread, free(), fwrite, GET2, get_value(), gotten_store, infile, INPUT_MODE, len, locale_set, log_store, LOOPREPEAT, MAGIC_NUMBER, real_pcre::magic_number, malloc(), memmove, n, real_pcre::name_count, real_pcre::name_entry_size, real_pcre::name_table_offset, new_free(), new_info(), new_malloc(), NULL, real_pcre::options, pcre_study_data::options, outfile, OUTPUT_MODE, p, pbuffer, pchars(), PCRE_ANCHORED, PCRE_AUTO_CALLOUT, PCRE_BSR_ANYCRLF, PCRE_BSR_UNICODE, pcre_callout, PCRE_CASELESS, pcre_compile(), pcre_config(), PCRE_CONFIG_BSR, PCRE_CONFIG_LINK_SIZE, PCRE_CONFIG_MATCH_LIMIT, PCRE_CONFIG_MATCH_LIMIT_RECURSION, PCRE_CONFIG_NEWLINE, PCRE_CONFIG_POSIX_MALLOC_THRESHOLD, PCRE_CONFIG_STACKRECURSE, PCRE_CONFIG_UNICODE_PROPERTIES, PCRE_CONFIG_UTF8, pcre_copy_named_substring(), pcre_copy_substring(), pcre_dfa_exec(), PCRE_DFA_RESTART, PCRE_DFA_SHORTEST, PCRE_DOLLAR_ENDONLY, PCRE_DOTALL, PCRE_DUPNAMES, PCRE_ERROR_MATCHLIMIT, PCRE_ERROR_NOMATCH, PCRE_ERROR_PARTIAL, PCRE_ERROR_RECURSIONLIMIT, pcre_exec(), PCRE_EXTENDED, PCRE_EXTRA, PCRE_EXTRA_CALLOUT_DATA, PCRE_EXTRA_MATCH_LIMIT, PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_STUDY_DATA, PCRE_FIRSTLINE, pcre_free, pcre_free_substring(), pcre_free_substring_list(), pcre_get_named_substring(), pcre_get_stringnumber(), pcre_get_substring(), pcre_get_substring_list(), pcre_info(), PCRE_INFO_BACKREFMAX, PCRE_INFO_CAPTURECOUNT, PCRE_INFO_FIRSTBYTE, PCRE_INFO_FIRSTTABLE, PCRE_INFO_HASCRORLF, PCRE_INFO_JCHANGED, PCRE_INFO_LASTLITERAL, PCRE_INFO_NAMECOUNT, PCRE_INFO_NAMEENTRYSIZE, PCRE_INFO_NAMETABLE, PCRE_INFO_OKPARTIAL, PCRE_INFO_OPTIONS, PCRE_INFO_SIZE, PCRE_JAVASCRIPT_COMPAT, pcre_maketables(), pcre_malloc, PCRE_MULTILINE, PCRE_NEWLINE_ANY, PCRE_NEWLINE_ANYCRLF, PCRE_NEWLINE_BITS, PCRE_NEWLINE_CR, PCRE_NEWLINE_CRLF, PCRE_NEWLINE_LF, PCRE_NO_AUTO_CAPTURE, PCRE_NO_UTF8_CHECK, PCRE_NOTBOL, PCRE_NOTEMPTY, PCRE_NOTEOL, PCRE_PARTIAL, pcre_stack_free, pcre_stack_malloc, pcre_study(), PCRE_UNGREEDY, PCRE_UTF8, pcre_version(), poffset, PRINTHEX, quiet, regex_t::re_pcre, REG_DOTALL, REG_ICASE, REG_NEWLINE, REG_NOSUB, REG_NOTBOL, REG_NOTEOL, REG_UTF8, regcomp(), regerror(), regexec(), regfree(), real_pcre::req_byte, REQ_CASELESS, show_malloc, RootCsg::sign(), pcre_study_data::size, real_pcre::size, size, size_t, stack_free(), stack_malloc(), strcpy(), strerror(), real_pcre::top_backref, real_pcre::top_bracket, usage, use_utf8, void, and x.

static void new_free ( void *  block  )  [static]

Definition at line 599 of file pcretest.c.

References fprintf(), free(), outfile, and show_malloc.

Referenced by main().

static void new_info ( pcre re,
pcre_extra study,
int  option,
void *  ptr 
) [static]

Definition at line 631 of file pcretest.c.

References fprintf(), outfile, and pcre_fullinfo().

Referenced by main().

static void* new_malloc ( size_t  size  )  [static]

Definition at line 590 of file pcretest.c.

References fprintf(), gotten_store, malloc(), outfile, and show_malloc.

Referenced by main().

static int pchars ( unsigned char *  p,
int  length,
FILE *  f 
) [static]

Definition at line 432 of file pcretest.c.

References fprintf(), n, NULL, PRINTHEX, and use_utf8.

Referenced by callout(), internal_dfa_exec(), main(), match(), and match_ref().

static void stack_free ( void *  block  )  [static]

Definition at line 617 of file pcretest.c.

References fprintf(), free(), outfile, and show_malloc.

Referenced by main().

static void* stack_malloc ( size_t  size  )  [static]

Definition at line 609 of file pcretest.c.

References fprintf(), malloc(), outfile, and show_malloc.

Referenced by main().

static int strncmpic ( uschar s,
uschar t,
int  n 
) [static]

Definition at line 722 of file pcretest.c.

Referenced by check_newline().

static void usage ( void   )  [static]

Definition at line 770 of file pcretest.c.


Variable Documentation

uschar* buffer = NULL [static]

Definition at line 182 of file pcretest.c.

Referenced by _gdk_pixmap_create_from_xpm(), TGLScenePad::AddObject(), TViewerX3D::AddObject(), TViewer3DPad::AddObject(), XrdXrootdProtocol::aio_Error(), TGText::Append(), RooMinuit::backProp(), TMVA::MethodMLP::BFGSMinimize(), TODBCStatement::BindParam(), TTable::Browse(), TRootBrowserLite::BrowseTextFile(), TProfile3D::BufferEmpty(), TProfile2D::BufferEmpty(), TProfile::BufferEmpty(), TH3::BufferEmpty(), TH2::BufferEmpty(), TH1::BufferEmpty(), TProfile3D::BufferFill(), TProfile2D::BufferFill(), TProfile::BufferFill(), TH3::BufferFill(), TH2::BufferFill(), TH1::BufferFill(), TTreeSQL::CheckBasket(), cid_parser_new(), CleanUp(), TDirectoryFile::CloneObject(), TDirectory::CloneObject(), compile_pattern(), compile_single_pattern(), compress_first_pass(), compress_output(), compress_stored_data(), TLimit::ComputeLimit(), consume_data(), RooStreamParser::convertToString(), copyfont(), TKey::Create(), create_lin_Nvar_weighted(), TGLScenePad::CreateNewLogical(), TGLScenePad::CreateNewPhysical(), TMapFile::CreateSemaphore(), decompress_data(), decompress_smooth_data(), decompress_stored_data(), TGTextEdit::DelChar(), do_flip_h_no_crop(), do_test(), TVolumeView::Draw(), TVolume::Draw(), StatDialogBDT::DrawNode(), TGTextView::DrawRegion(), XrdSfsNative::Emsg(), XrdOfs::Emsg(), XrdBwm::Emsg(), extend_inputline(), fetch_data_int(), TShape::FillBuffer3D(), TGeoShape::FillBuffer3D(), TGeoBBox::FillBuffer3D(), FindFonts(), RooRealVar::format(), ft_bitmap_assure_buffer(), TGeoTubeSeg::GetBuffer3D(), TTUBS::GetBuffer3D(), TBRIK::GetBuffer3D(), TSPHE::GetBuffer3D(), TGeoHype::GetBuffer3D(), TGeoCone::GetBuffer3D(), TGeoSphere::GetBuffer3D(), TGeoScaledShape::GetBuffer3D(), Box::GetBuffer3D(), TGeoXtru::GetBuffer3D(), TGeoPgon::GetBuffer3D(), TShape::GetBuffer3D(), TGeoTube::GetBuffer3D(), TGeoTorus::GetBuffer3D(), TGeoEltu::GetBuffer3D(), TGeoConeSeg::GetBuffer3D(), TPCON::GetBuffer3D(), TXTRU::GetBuffer3D(), TGeoPcon::GetBuffer3D(), TGeoParaboloid::GetBuffer3D(), SBPyramid::GetBuffer3D(), TGeoCtub::GetBuffer3D(), TGeoShape::GetBuffer3D(), TGeoBBox::GetBuffer3D(), TTUBE::GetBuffer3D(), Sphere::GetBuffer3D(), TFile::GetCompressionFactor(), TGQt::GetDoubleBuffer(), TFile::GetRecordHeader(), TFile::GetStreamerInfoList(), globus_l_gfs_posix_read_from_storage(), globus_l_gfs_posix_write_to_storage(), grep_or_recurse(), TGTextView::HandleSelectionRequest(), TGTextEntry::HandleSelectionRequest(), TFile::Init(), IsTextFile(), jinit_c_coef_controller(), jinit_d_coef_controller(), jpeg2ASImage(), TGText::Load(), load_X11_glyph_range(), TBasket::LoadBasketBuffers(), TGText::LoadBuffer(), main(), TFile::MakeFree(), MakeTrees(), TFile::Map(), TBasket::MoveEntries(), TGLScenePad::OpenComposite(), TStreamerInfoActions::TConfiguredAction::operator()(), ordin(), TShape::Paint(), TMarker3DBox::Paint(), TPolyMarker3D::Paint(), MyGeom::Paint(), TPolyLine3D::Paint(), TNode::Paint(), TGeoCompositeShape::PaintComposite(), TViewerX3D::PaintPolyMarker(), TVolume::PaintShape(), TGeoPainter::PaintShape(), TVolumeView::PaintShape(), TVolumeView::PathP(), pcregrep(), TUri::PctEncode(), png_handle_sCAL(), TQCanvasMenu::Popup(), ppm2ASImage(), read_lwfn(), TBasket::ReadBasketBuffers(), TBasket::ReadBasketBytes(), TFile::ReadFree(), TKeySQL::ReadKeyObject(), TDirectoryFile::ReadKeys(), RooStreamParser::readLine(), TGenCollectionStreamer::ReadMap(), TGenCollectionStreamer::ReadObjects(), TGenCollectionStreamer::ReadPairFromMap(), XrdMonSndDummyXrootd::readPaths(), TGenCollectionStreamer::ReadPrimitives(), TSQLFile::ReadSpecialObject(), RooStreamParser::readToken(), StatDialogBDT::ReadTree(), TFile::Recover(), TGText::ReTab(), RootdAccess(), RootdChdir(), RootdChmod(), RootdFreeDir(), RootdGetDirEntry(), RootdLsdir(), RootdMkdir(), RootdMv(), RootdOpenDir(), RootdPwd(), RootdRm(), RootdRmdir(), ROOT::RpdKrb5Auth(), TGText::Save(), TSpline5::SaveAs(), TSpline3::SaveAs(), SavePuk(), RooNameSet::select(), TPCON::SetSegsAndPols(), TGeoConeSeg::SetSegsAndPols(), TTUBE::SetSegsAndPols(), TGeoCone::SetSegsAndPols(), TGeoTube::SetSegsAndPols(), TUnixSystem::StackTrace(), store_data(), store_data_tinted(), TKeyXML::StoreObject(), TSQLFile::StoreObjectInTables(), XrdClientReadCache::SubmitXMessage(), TDirectoryFile::TDirectoryFile(), TestPct(), TGLCylinder::TGLCylinder(), TGLFaceSet::TGLFaceSet(), TGLLogicalShape::TGLLogicalShape(), TGLSphere::TGLSphere(), TGTextView::ToObjXCoord(), TGTextView::ToScrXCoord(), TMultiLayerPerceptron::Train(), transencode_coef_controller(), TSessionQueryFrame::UpdateInfos(), TGLScenePad::ValidateObjectBuffer(), W32ChangeProperty(), TDirectoryFile::WriteDirHeader(), TKey::WriteFile(), TKey::WriteFileKeepBuffer(), TFile::WriteFree(), TFile::WriteHeader(), TDirectoryFile::WriteKeys(), TGenCollectionStreamer::WritePrimitives(), writev(), TKeyXML::XmlReadAny(), and RooStreamParser::zapToEnd().

int buffer_size = 50000 [static]

Definition at line 181 of file pcretest.c.

Referenced by extend_inputline(), and main().

int callout_count [static]

Definition at line 168 of file pcretest.c.

Referenced by callout(), and main().

int callout_extra [static]

Definition at line 169 of file pcretest.c.

Referenced by callout(), and main().

int callout_fail_count [static]

Definition at line 170 of file pcretest.c.

Referenced by callout(), and main().

int callout_fail_id [static]

Definition at line 171 of file pcretest.c.

Referenced by callout(), and main().

uschar* dbuffer = NULL [static]

Definition at line 183 of file pcretest.c.

Referenced by extend_inputline(), and main().

int debug_lengths [static]

Definition at line 172 of file pcretest.c.

Referenced by main().

int first_callout [static]

Definition at line 173 of file pcretest.c.

Referenced by callout(), and main().

size_t gotten_store [static]

Definition at line 177 of file pcretest.c.

Referenced by main(), and new_malloc().

int locale_set = 0 [static]

Definition at line 174 of file pcretest.c.

Referenced by main().

int log_store = 0 [static]

Definition at line 167 of file pcretest.c.

Referenced by main().

FILE* outfile [static]

Definition at line 166 of file pcretest.c.

Referenced by ASImage2bmp(), ASImage2gif(), ASImage2jpeg(), ASImage2png(), ASImage2xpm(), callout(), check_match_limit(), TDocOutput::Convert(), TDocOutput::CreateClassTypeDefs(), exec_macro(), main(), new_free(), new_info(), new_malloc(), TMVA::CCPruner::Optimize(), TDocOutput::ProcessDocInDir(), ProcessFrame(), TFoam::RootPlot2dim(), TMVA::PDEFoam::RootPlot2dim(), rs603_HLFactoryElaborateExample(), stack_free(), stack_malloc(), TestReport1(), and TestReport2().

uschar* pbuffer = NULL [static]

Definition at line 184 of file pcretest.c.

Referenced by callout(), destroy_asimage_list_entry_buffer(), extend_inputline(), and main().

int show_malloc [static]

Definition at line 175 of file pcretest.c.

Referenced by main(), new_free(), new_malloc(), stack_free(), and stack_malloc().

int use_utf8 [static]

Definition at line 176 of file pcretest.c.

Referenced by main(), and pchars().


Generated on Tue Jul 5 15:57:31 2011 for ROOT_528-00b_version by  doxygen 1.5.1