├── .gitignore
├── AMBuildScript
├── AMBuilder
├── LICENSE.txt
├── Makefile
├── PackageScript
├── buildbot
├── Versioning
├── bootstrap.pl
├── build_type
├── generate_headers.py
├── helpers.pm
├── package.pl
├── startbuild.pl
└── symstore.pl
├── configure.py
├── de_dust.cfg
├── gameshim
├── AMBuilder
├── Makefile
├── gameshim.sln
├── gameshim.vcproj
├── intercom.h
├── stripper_mm.cpp
└── stripper_mm.h
├── global_filters.cfg
├── loader
├── AMBuilder
├── Makefile
├── loader.sln
├── loader.vcproj
└── stripper_loader.cpp
├── parser.cpp
├── parser.h
├── pcre.h
├── pcre
├── 132html
├── AUTHORS
├── CMakeLists.txt
├── COPYING
├── ChangeLog
├── CleanTxt
├── Detrail
├── HACKING
├── INSTALL
├── LICENCE
├── Makefile.am
├── Makefile.in
├── NEWS
├── NON-UNIX-USE
├── PrepareRelease
├── README
├── RunGrepTest
├── RunTest
├── RunTest.bat
├── aclocal.m4
├── cmake
│ ├── COPYING-CMAKE-SCRIPTS
│ ├── FindPackageHandleStandardArgs.cmake
│ └── FindReadline.cmake
├── config-cmake.h.in
├── config.guess
├── config.h.generic
├── config.h.in
├── config.sub
├── configure
├── configure.ac
├── depcomp
├── dftables.c
├── doc
│ ├── html
│ │ ├── index.html
│ │ ├── pcre-config.html
│ │ ├── pcre.html
│ │ ├── pcre_compile.html
│ │ ├── pcre_compile2.html
│ │ ├── pcre_config.html
│ │ ├── pcre_copy_named_substring.html
│ │ ├── pcre_copy_substring.html
│ │ ├── pcre_dfa_exec.html
│ │ ├── pcre_exec.html
│ │ ├── pcre_free_substring.html
│ │ ├── pcre_free_substring_list.html
│ │ ├── pcre_fullinfo.html
│ │ ├── pcre_get_named_substring.html
│ │ ├── pcre_get_stringnumber.html
│ │ ├── pcre_get_stringtable_entries.html
│ │ ├── pcre_get_substring.html
│ │ ├── pcre_get_substring_list.html
│ │ ├── pcre_info.html
│ │ ├── pcre_maketables.html
│ │ ├── pcre_refcount.html
│ │ ├── pcre_study.html
│ │ ├── pcre_version.html
│ │ ├── pcreapi.html
│ │ ├── pcrebuild.html
│ │ ├── pcrecallout.html
│ │ ├── pcrecompat.html
│ │ ├── pcrecpp.html
│ │ ├── pcregrep.html
│ │ ├── pcrematching.html
│ │ ├── pcrepartial.html
│ │ ├── pcrepattern.html
│ │ ├── pcreperform.html
│ │ ├── pcreposix.html
│ │ ├── pcreprecompile.html
│ │ ├── pcresample.html
│ │ ├── pcrestack.html
│ │ ├── pcresyntax.html
│ │ └── pcretest.html
│ ├── index.html.src
│ ├── pcre-config.1
│ ├── pcre-config.txt
│ ├── pcre.3
│ ├── pcre.txt
│ ├── pcre_compile.3
│ ├── pcre_compile2.3
│ ├── pcre_config.3
│ ├── pcre_copy_named_substring.3
│ ├── pcre_copy_substring.3
│ ├── pcre_dfa_exec.3
│ ├── pcre_exec.3
│ ├── pcre_free_substring.3
│ ├── pcre_free_substring_list.3
│ ├── pcre_fullinfo.3
│ ├── pcre_get_named_substring.3
│ ├── pcre_get_stringnumber.3
│ ├── pcre_get_stringtable_entries.3
│ ├── pcre_get_substring.3
│ ├── pcre_get_substring_list.3
│ ├── pcre_info.3
│ ├── pcre_maketables.3
│ ├── pcre_refcount.3
│ ├── pcre_study.3
│ ├── pcre_version.3
│ ├── pcreapi.3
│ ├── pcrebuild.3
│ ├── pcrecallout.3
│ ├── pcrecompat.3
│ ├── pcrecpp.3
│ ├── pcregrep.1
│ ├── pcregrep.txt
│ ├── pcrematching.3
│ ├── pcrepartial.3
│ ├── pcrepattern.3
│ ├── pcreperform.3
│ ├── pcreposix.3
│ ├── pcreprecompile.3
│ ├── pcresample.3
│ ├── pcrestack.3
│ ├── pcresyntax.3
│ ├── pcretest.1
│ ├── pcretest.txt
│ └── perltest.txt
├── install-sh
├── libpcre-darwin.a
├── libpcre-linux.a
├── libpcre-windows.lib
├── libpcre.pc.in
├── libpcrecpp.pc.in
├── ltmain.sh
├── makevp.bat
├── makevp_c.txt
├── makevp_l.txt
├── missing
├── pcre-config.in
├── pcre.h.generic
├── pcre.h.in
├── pcre_chartables.c.dist
├── pcre_compile.c
├── pcre_config.c
├── pcre_dfa_exec.c
├── pcre_exec.c
├── pcre_fullinfo.c
├── pcre_get.c
├── pcre_globals.c
├── pcre_info.c
├── pcre_internal.h
├── pcre_maketables.c
├── pcre_newline.c
├── pcre_ord2utf8.c
├── pcre_printint.src
├── pcre_refcount.c
├── pcre_scanner.cc
├── pcre_scanner.h
├── pcre_scanner_unittest.cc
├── pcre_stringpiece.cc
├── pcre_stringpiece.h.in
├── pcre_stringpiece_unittest.cc
├── pcre_study.c
├── pcre_tables.c
├── pcre_try_flipped.c
├── pcre_ucd.c
├── pcre_valid_utf8.c
├── pcre_version.c
├── pcre_xclass.c
├── pcrecpp.cc
├── pcrecpp.h
├── pcrecpp_internal.h
├── pcrecpp_unittest.cc
├── pcrecpparg.h.in
├── pcredemo.c
├── pcregexp.pas
├── pcregrep.c
├── pcreposix.c
├── pcreposix.h
├── pcretest.c
├── perltest.pl
├── testdata
│ ├── grepinput
│ ├── grepinput8
│ ├── grepinputv
│ ├── grepinputx
│ ├── greplist
│ ├── grepoutput
│ ├── grepoutput8
│ ├── grepoutputN
│ ├── testinput1
│ ├── testinput10
│ ├── testinput2
│ ├── testinput3
│ ├── testinput4
│ ├── testinput5
│ ├── testinput6
│ ├── testinput7
│ ├── testinput8
│ ├── testinput9
│ ├── testoutput1
│ ├── testoutput10
│ ├── testoutput2
│ ├── testoutput3
│ ├── testoutput4
│ ├── testoutput5
│ ├── testoutput6
│ ├── testoutput7
│ ├── testoutput8
│ ├── testoutput9
│ ├── wintestinput3
│ └── wintestoutput3
├── ucp.h
└── version
├── product.version
├── pushbuild.txt
├── stripper.vdf
├── stripper_core.sln
├── stripper_core.vcproj
├── support.cpp
└── support.h
/.gitignore:
--------------------------------------------------------------------------------
1 | # Binaries
2 | *.dll
3 | *.dylib
4 | *.exe
5 | *.so
6 |
7 | # Files generated by Visual Studio
8 | *.aps
9 | *.ipch
10 | *.ncb
11 | *.opensdf
12 | *.sdf
13 | *.suo
14 | *.user
15 |
16 | # Build directories
17 | CrazyDebug*/
18 | Debug*/
19 | Release*/
20 | LIB-Release/
21 | LIB-Debug/
22 |
23 | # Files generated by Mac OS X Finder
24 | .DS_Store
25 |
26 | # Files generated by Windows Explorer
27 | [Dd]esktop.ini
28 | [Tt]humbs.db
29 |
30 | # AMBuild build directories
31 | build/
32 | obj-*/
33 | *~
34 | *.rej
35 | *.orig
36 | *.smx
37 | *.swp
38 |
--------------------------------------------------------------------------------
/AMBuilder:
--------------------------------------------------------------------------------
1 | # vim: set ts=2 sw=2 tw=99 noet ft=python:
2 | import os.path
3 |
4 | name = 'stripper.core'
5 |
6 | for cxx in MMS.all_targets:
7 |
8 | binary = MMS.Library(cxx, name)
9 |
10 | binary.sources = [
11 | 'parser.cpp',
12 | 'support.cpp'
13 | ]
14 | binary.compiler.cxxincludes += [os.path.join(MMS.mms_root, 'core', 'sourcehook')]
15 |
16 | if binary.compiler.target.arch == 'x86':
17 | if cxx.target.platform == 'linux':
18 | binary.compiler.postlink += [os.path.join(builder.sourcePath, 'pcre', 'libpcre-linux.a')]
19 | elif cxx.target.platform == 'windows':
20 | binary.compiler.postlink += [os.path.join(builder.sourcePath, 'pcre', 'libpcre-windows.lib')]
21 | elif cxx.target.platform == 'mac':
22 | binary.compiler.postlink += [os.path.join(builder.sourcePath, 'pcre', 'libpcre-darwin.a')]
23 |
24 | nodes = builder.Add(binary)
25 | MMS.binaries += [nodes]
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # (C)2004-2008 SourceMod Development Team
2 | # Makefile written by David "BAILOPAN" Anderson
3 | #
4 |
5 | MMSOURCE = ../mmsource-1.8/core
6 |
7 | #####################################
8 | ### EDIT BELOW FOR OTHER PROJECTS ###
9 | #####################################
10 |
11 | PROJECT = stripper.core
12 |
13 | #Uncomment for Metamod: Source enabled extension
14 | #USEMETA = true
15 |
16 | OBJECTS = parser.cpp support.cpp
17 |
18 | ##############################################
19 | ### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
20 | ##############################################
21 |
22 | C_OPT_FLAGS = -DNDEBUG -O3 -funroll-loops -pipe -fno-strict-aliasing
23 | C_DEBUG_FLAGS = -D_DEBUG -DDEBUG -g -ggdb3
24 | C_GCC4_FLAGS = -fvisibility=hidden
25 | CPP_GCC4_FLAGS = -fvisibility-inlines-hidden
26 | CPP = gcc
27 |
28 | override ENGSET = false
29 | ifeq "$(ENGINE)" "original"
30 | HL2SDK = $(HL2SDK_ORIG)
31 | HL2PUB = $(HL2SDK)/public
32 | HL2LIB = $(HL2SDK)/linux_sdk
33 | CFLAGS += -DSOURCE_ENGINE=1
34 | METAMOD = $(MMSOURCE17)/core-legacy
35 | INCLUDE += -I$(HL2SDK)/public/dlls
36 | SRCDS = $(SRCDS_BASE)
37 | override ENGSET = true
38 | endif
39 | ifeq "$(ENGINE)" "orangebox"
40 | HL2SDK = $(HL2SDK_OB)
41 | HL2PUB = $(HL2SDK)/public
42 | HL2LIB = $(HL2SDK)/lib/linux
43 | CFLAGS += -DSOURCE_ENGINE=3
44 | METAMOD = $(MMSOURCE17)/core
45 | INCLUDE += -I$(HL2SDK)/public/game/server
46 | SRCDS = $(SRCDS_BASE)/orangebox
47 | override ENGSET = true
48 | endif
49 | ifeq "$(ENGINE)" "left4dead"
50 | HL2SDK = $(HL2SDK_L4D)
51 | HL2PUB = $(HL2SDK)/public
52 | HL2LIB = $(HL2SDK)/lib/linux
53 | CFLAGS += -DSOURCE_ENGINE=4
54 | METAMOD = $(MMSOURCE17)/core
55 | INCLUDE += -I$(HL2SDK)/public/game/server
56 | SRCDS = $(SRCDS_BASE)/l4d
57 | override ENGSET = true
58 | endif
59 |
60 | ifeq "$(USEMETA)" "true"
61 | LINK_HL2 = $(HL2LIB)/tier1_i486.a vstdlib_i486.so tier0_i486.so
62 |
63 | LINK += $(LINK_HL2)
64 |
65 | INCLUDE += -I. -I.. -Isdk -I$(HL2PUB) -I$(HL2PUB)/engine -I$(HL2PUB)/tier0 -I$(HL2PUB)/tier1 \
66 | -I$(METAMOD) -I$(METAMOD)/sourcehook -I$(SMSDK)/public -I$(SMSDK)/public/sourcepawn
67 | CFLAGS += -DSE_EPISODEONE=1 -DSE_DARKMESSIAH=2 -DSE_ORANGEBOX=3 -DSE_LEFT4DEAD=4
68 | else
69 | INCLUDE += -I.
70 | endif
71 |
72 | INCLUDE += -Ipcre -I$(MMSOURCE)/sourcehook
73 |
74 | LINK += -m32 -lm -ldl pcre/.libs/libpcre.a
75 |
76 | CFLAGS += -D_LINUX -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \
77 | -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Werror -Wno-switch \
78 | -Wno-unused -mfpmath=sse -msse -DSOURCEMOD_BUILD -DHAVE_STDINT_H -m32
79 | CPPFLAGS += -Wno-non-virtual-dtor -fno-exceptions -fno-rtti
80 |
81 | ################################################
82 | ### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
83 | ################################################
84 |
85 | ifeq "$(DEBUG)" "true"
86 | BIN_DIR = Debug
87 | CFLAGS += $(C_DEBUG_FLAGS)
88 | else
89 | BIN_DIR = Release
90 | CFLAGS += $(C_OPT_FLAGS)
91 | endif
92 |
93 | ifeq "$(USEMETA)" "true"
94 | BIN_DIR := $(BIN_DIR).$(ENGINE)
95 | endif
96 |
97 | OS := $(shell uname -s)
98 | ifeq "$(OS)" "Darwin"
99 | LINK += -dynamiclib
100 | BINARY = $(PROJECT).dylib
101 | else
102 | LINK += -static-libgcc -shared
103 | BINARY = $(PROJECT).so
104 | endif
105 |
106 | GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
107 | ifeq "$(GCC_VERSION)" "4"
108 | CFLAGS += $(C_GCC4_FLAGS)
109 | CPPFLAGS += $(CPP_GCC4_FLAGS)
110 | endif
111 |
112 | OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
113 |
114 | $(BIN_DIR)/%.o: %.cpp
115 | $(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
116 |
117 | all: check
118 | mkdir -p $(BIN_DIR)/sdk
119 | if [ "$(USEMETA)" = "true" ]; then \
120 | ln -sf $(SRCDS)/bin/vstdlib_i486.so vstdlib_i486.so; \
121 | ln -sf $(SRCDS)/bin/tier0_i486.so tier0_i486.so; \
122 | fi
123 | $(MAKE) -f Makefile extension
124 |
125 | check:
126 | if [ "$(USEMETA)" = "true" ] && [ "$(ENGSET)" = "false" ]; then \
127 | echo "You must supply ENGINE=left4dead or ENGINE=orangebox or ENGINE=original"; \
128 | exit 1; \
129 | fi
130 |
131 | extension: check $(OBJ_LINUX)
132 | $(CPP) $(INCLUDE) $(OBJ_LINUX) $(LINK) -o $(BIN_DIR)/$(BINARY)
133 |
134 | debug:
135 | $(MAKE) -f Makefile all DEBUG=true
136 |
137 | default: all
138 |
139 | clean: check
140 | rm -rf $(BIN_DIR)/*.o
141 | rm -rf $(BIN_DIR)/sdk/*.o
142 | rm -rf $(BIN_DIR)/$(BINARY)
143 |
--------------------------------------------------------------------------------
/PackageScript:
--------------------------------------------------------------------------------
1 | # vim: set ts=2 sw=2 tw=99 noet ft=python:
2 | import os
3 |
4 | builder.SetBuildFolder('package')
5 |
6 | addons_folder = builder.AddFolder('addons')
7 | metamod_folder = builder.AddFolder(os.path.join('addons', 'metamod'))
8 | stripper_folder = builder.AddFolder(os.path.join('addons', 'stripper'))
9 | bin_folder = builder.AddFolder(os.path.join('addons', 'stripper', 'bin'))
10 | dumps_folder = builder.AddFolder(os.path.join('addons', 'stripper', 'dumps'))
11 | maps_folder = builder.AddFolder(os.path.join('addons', 'stripper', 'maps'))
12 |
13 | for cxx in MMS.all_targets:
14 | if cxx.target.arch == 'x86_64':
15 | if cxx.target.platform == 'windows':
16 | bin64_folder = builder.AddFolder(os.path.join('addons', 'stripper', 'bin', 'win64'))
17 | elif cxx.target.platform == 'linux':
18 | bin64_folder = builder.AddFolder(os.path.join('addons', 'stripper', 'bin', 'linux64'))
19 | elif cxx.target.platform == 'mac':
20 | bin64_folder = builder.AddFolder(os.path.join('addons', 'stripper', 'bin', 'osx64'))
21 |
22 | builder.AddCopy(os.path.join(builder.sourcePath, 'stripper.vdf'), metamod_folder)
23 | builder.AddCopy(os.path.join(builder.sourcePath, 'global_filters.cfg'), stripper_folder)
24 | builder.AddCopy(os.path.join(builder.sourcePath, 'de_dust.cfg'), maps_folder)
25 |
26 | pdb_list = []
27 | for task in MMS.binaries:
28 | if task.target.arch == 'x86_64':
29 | builder.AddCopy(task.binary, bin64_folder)
30 | else:
31 | builder.AddCopy(task.binary, bin_folder)
32 |
33 | if task.debug:
34 | pdb_list.append(task.debug)
35 |
36 | # Generate PDB info.
37 | with open(os.path.join(builder.buildPath, 'pdblog.txt'), 'wt') as fp:
38 | for line in pdb_list:
39 | fp.write(line.path + '\n')
--------------------------------------------------------------------------------
/buildbot/Versioning:
--------------------------------------------------------------------------------
1 | # vim: set ts=8 sts=2 sw=2 tw=99 et ft=python:
2 | import os, sys
3 | import re
4 |
5 | builder.SetBuildFolder('/')
6 |
7 | includes = builder.AddFolder('includes')
8 |
9 | argv = [
10 | sys.executable,
11 | os.path.join(builder.sourcePath, 'buildbot', 'generate_headers.py'),
12 | os.path.join(builder.sourcePath),
13 | os.path.join(builder.buildPath, 'includes')
14 | ]
15 | outputs = [
16 | os.path.join(builder.buildFolder, 'includes', 'stripper_version_auto.h')
17 | ]
18 |
19 | with open(os.path.join(builder.sourcePath, '.git', 'HEAD')) as fp:
20 | head_contents = fp.read().strip()
21 | if re.search('^[a-fA-F0-9]{40}$', head_contents):
22 | git_head_path = os.path.join(builder.sourcePath, '.git', 'HEAD')
23 | else:
24 | git_state = head_contents.split(':')[1].strip()
25 | git_head_path = os.path.join(builder.sourcePath, '.git', git_state)
26 | if not os.path.exists(git_head_path):
27 | git_head_path = os.path.join(builder.sourcePath, '.git', 'HEAD')
28 |
29 | sources = [
30 | os.path.join(builder.sourcePath, 'product.version'),
31 |
32 | # This is a hack, but we need some way to only run this script when Git changes.
33 | git_head_path,
34 |
35 | # The script source is a dependency, of course...
36 | argv[1]
37 | ]
38 |
39 | output_nodes = builder.AddCommand(
40 | inputs=sources,
41 | argv=argv,
42 | outputs=outputs
43 | )
44 |
45 | rvalue = output_nodes
--------------------------------------------------------------------------------
/buildbot/bootstrap.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 | # vim: set ts=2 sw=2 tw=99 noet:
3 |
4 | use strict;
5 | use Cwd;
6 | use File::Basename;
7 | use File::Path;
8 |
9 | my ($myself, $path) = fileparse($0);
10 | chdir($path);
11 |
12 | require 'helpers.pm';
13 |
14 | #Go back above build dir
15 | chdir(Build::PathFormat('../..'));
16 |
17 | #Get the source path.
18 | our ($root) = getcwd();
19 |
20 | my $reconf = 0;
21 |
22 | if ($^O eq "darwin") {
23 | $ENV{'HL2SDKND'} = '/Volumes/hgshare/hl2sdk-nucleardawn';
24 | $ENV{'HL2SDK2013'} = '/Volumes/hgshare/hl2sdk-sdk2013';
25 | $ENV{'HL2SDKINSURGENCY'} = '/Volumes/hgshare/hl2sdk-insurgency';
26 | $ENV{'HL2SDKBMS'} = '/Volumes/hgshare/hl2sdk-bms';
27 | }
28 | elsif ($^O eq "linux") {
29 | $ENV{'HL2SDKBMS'} = '/hgshare/hl2sdk-bms';
30 | }
31 | else {
32 | $ENV{'HL2SDKBMS'} = 'H:\hl2sdk-bms';
33 | }
34 | #Create output folder if it doesn't exist.
35 | if (!(-d 'OUTPUT')) {
36 | $reconf = 1;
37 | } else {
38 | if (-f 'OUTPUT/sentinel') {
39 | my @s = stat('OUTPUT/sentinel');
40 | my $mtime = $s[9];
41 | my @files = ('build/pushbuild.txt', 'build/AMBuildScript', 'build/product.version');
42 | my ($i);
43 | for ($i = 0; $i <= $#files; $i++) {
44 | if (IsNewer($files[$i], $mtime)) {
45 | $reconf = 1;
46 | last;
47 | }
48 | }
49 | } else {
50 | $reconf = 1;
51 | }
52 | }
53 |
54 | if ($reconf) {
55 | rmtree('OUTPUT');
56 | mkdir('OUTPUT') or die("Failed to create output folder: $!\n");
57 | chdir('OUTPUT');
58 | my ($result);
59 | print "Attempting to reconfigure...\n";
60 | if ($^O eq "linux") {
61 | $result = `CC=clang-3.8 CXX=clang-3.8 python3 ../build/configure.py --enable-optimize`;
62 | } elsif ($^O eq "darwin") {
63 | $result = `CC=clang CXX=clang python3 ../build/configure.py --enable-optimize`;
64 | } else {
65 | $result = `C:\\Python31\\Python.exe ..\\build\\configure.py --enable-optimize`;
66 | }
67 | print "$result\n";
68 | if ($? != 0) {
69 | die('Could not configure!');
70 | }
71 | open(FILE, '>sentinel');
72 | print FILE "this is nothing.\n";
73 | close(FILE);
74 | }
75 |
76 | sub IsNewer
77 | {
78 | my ($file, $time) = (@_);
79 |
80 | my @s = stat($file);
81 | my $mtime = $s[9];
82 | return $mtime > $time;
83 | }
84 |
85 | exit(0);
86 |
87 |
88 |
--------------------------------------------------------------------------------
/buildbot/build_type:
--------------------------------------------------------------------------------
1 | dev
2 |
--------------------------------------------------------------------------------
/buildbot/generate_headers.py:
--------------------------------------------------------------------------------
1 | import re
2 | import os, sys
3 | import subprocess
4 |
5 | argv = sys.argv[1:]
6 | if len(argv) < 2:
7 | sys.stderr.write('Usage: generate_headers.py \n')
8 | sys.exit(1)
9 |
10 | SourceFolder = os.path.abspath(os.path.normpath(argv[0]))
11 | OutputFolder = os.path.normpath(argv[1])
12 |
13 | class FolderChanger:
14 | def __init__(self, folder):
15 | self.old = os.getcwd()
16 | self.new = folder
17 |
18 | def __enter__(self):
19 | if self.new:
20 | os.chdir(self.new)
21 |
22 | def __exit__(self, type, value, traceback):
23 | os.chdir(self.old)
24 |
25 | def run_and_return(argv):
26 | # Python 2.6 doesn't have check_output.
27 | if hasattr(subprocess, 'check_output'):
28 | text = subprocess.check_output(argv)
29 | if str != bytes:
30 | text = str(text, 'utf-8')
31 | else:
32 | p = subprocess.Popen(argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
33 | output, ignored = p.communicate()
34 | rval = p.poll()
35 | if rval:
36 | raise subprocess.CalledProcessError(rval, argv)
37 | text = output.decode('utf8')
38 | return text.strip()
39 |
40 | def get_git_version():
41 | revision_count = run_and_return(['git', 'rev-list', '--count', 'HEAD'])
42 | revision_hash = run_and_return(['git', 'log', '--pretty=format:%h:%H', '-n', '1'])
43 | shorthash, longhash = revision_hash.split(':')
44 |
45 | return revision_count, shorthash, longhash
46 |
47 | def output_version_header():
48 | with FolderChanger(SourceFolder):
49 | count, shorthash, longhash = get_git_version()
50 |
51 | with open(os.path.join(SourceFolder, 'product.version')) as fp:
52 | contents = fp.read()
53 | m = re.match('(\d+)\.(\d+)\.(\d+)(.*)', contents)
54 | if m == None:
55 | raise Exception('Could not detremine product version')
56 | major, minor, release, tag = m.groups()
57 | product = "{0}.{1}.{2}".format(major, minor, release)
58 |
59 | with open(os.path.join(OutputFolder, 'stripper_version_auto.h'), 'w') as fp:
60 | fp.write("""
61 | #ifndef _STRIPPER_AUTO_VERSION_INFORMATION_H_
62 | #define _STRIPPER_AUTO_VERSION_INFORMATION_H_
63 |
64 | #define STRIPPER_BUILD_STRING \"{0}\"
65 | #define STRIPPER_BUILD_UNIQUEID \"{1}:{2}\" STRIPPER_BUILD_STRING
66 | #define STRIPPER_FULL_VERSION \"{3}.{4}.{5}\" STRIPPER_BUILD_STRING
67 | #define STRIPPER_FILE_VERSION {3},{4},{5},0
68 |
69 | #endif /* _STRIPPER_AUTO_VERSION_INFORMATION_H_ */
70 | """.format(tag, count, shorthash, major, minor, release))
71 |
72 | output_version_header()
--------------------------------------------------------------------------------
/buildbot/helpers.pm:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | use strict;
4 | use Cwd;
5 |
6 | package Build;
7 |
8 | our $SVN = "/usr/bin/svn";
9 | our $SVN_USER = 'dvander';
10 | our $SVN_ARGS = '';
11 |
12 | sub GitRevNum
13 | {
14 | my ($path) = (@_);
15 | my ($cd, $text, $rev);
16 |
17 | $cd = Cwd::cwd();
18 | chdir($path);
19 | $text = `git rev-list --count HEAD`;
20 | chdir($cd);
21 |
22 | chomp $text;
23 | if ($text =~ /^(\d+)/) {
24 | return $1;
25 | }
26 |
27 | return 0;
28 | }
29 |
30 | sub HgRevNum
31 | {
32 | my ($path) = (@_);
33 | my ($cd, $text, $rev);
34 |
35 | $cd = Cwd::cwd();
36 | chdir($path);
37 | $text = `hg identify -n`;
38 | chdir($cd);
39 |
40 | chomp $text;
41 | if ($text =~ /^(\d+)/)
42 | {
43 | return $1;
44 | }
45 |
46 | return 0;
47 | }
48 |
49 | sub SvnRevNum
50 | {
51 | my ($str)=(@_);
52 |
53 | my $data = Command('svnversion -c ' . $str);
54 | if ($data =~ /(\d+):(\d+)/)
55 | {
56 | return $2;
57 | } elsif ($data =~ /(\d+)/) {
58 | return $1;
59 | } else {
60 | return 0;
61 | }
62 | }
63 |
64 | sub ProductVersion
65 | {
66 | my ($file) = (@_);
67 | my ($version);
68 | open(FILE, $file) or die "Could not open $file: $!\n";
69 | $version = ;
70 | close(FILE);
71 | chomp $version;
72 | return $version;
73 | }
74 |
75 | sub Delete
76 | {
77 | my ($str)=(@_);
78 | if ($^O =~ /MSWin/)
79 | {
80 | Command("del /S /F /Q \"$str\"");
81 | Command("rmdir /S /Q \"$str\"");
82 | } else {
83 | Command("rm -rf $str");
84 | }
85 | return !(-e $str);
86 | }
87 |
88 | sub Copy
89 | {
90 | my ($src,$dest)=(@_);
91 | if ($^O =~ /MSWin/)
92 | {
93 | Command("copy \"$src\" \"$dest\" /y");
94 | } else {
95 | Command("cp \"$src\" \"$dest\"");
96 | }
97 | return (-e $dest);
98 | }
99 |
100 | sub Move
101 | {
102 | my ($src,$dest)=(@_);
103 | if ($^O =~ /MSWin/)
104 | {
105 | Command("move \"$src\" \"$dest\"");
106 | } else {
107 | Command("mv \"$src\" \"$dest\"");
108 | }
109 | return (-e $dest);
110 | }
111 |
112 | sub Command
113 | {
114 | my($cmd)=(@_);
115 | print "$cmd\n";
116 | return `$cmd`;
117 | }
118 |
119 | sub PathFormat
120 | {
121 | my ($str)=(@_);
122 | if ($^O =~ /MSWin/)
123 | {
124 | $str =~ s#/#\\#g;
125 | } else {
126 | $str =~ s#\\#/#g;
127 | }
128 | return $str;
129 | }
130 |
131 | sub SVN_Remove
132 | {
133 | my ($file)=(@_);
134 | my ($path, $name);
135 | if ($^O =~ /MSWin/)
136 | {
137 | ($path, $name) = ($file =~ /(.+)\/([^\/]+)$/);
138 | } else {
139 | ($path, $name) = ($file =~ /(.+)\\([^\\]+)$/);
140 | }
141 | my $dir = Cwd::cwd();
142 | chdir($path);
143 | Command($SVN . ' ' . $SVN_ARGS . ' delete ' . $name);
144 | chdir($dir);
145 | }
146 |
147 | sub SVN_Add
148 | {
149 | my ($file)=(@_);
150 | my ($path, $name);
151 | if ($^O =~ /MSWin/)
152 | {
153 | ($path, $name) = ($file =~ /(.+)\/([^\/]+)$/);
154 | } else {
155 | ($path, $name) = ($file =~ /(.+)\\([^\\]+)$/);
156 | }
157 | my $dir = Cwd::cwd();
158 | chdir($path);
159 | Command($SVN . ' ' . $SVN_ARGS . ' add ' . $name);
160 | chdir($dir);
161 | }
162 |
163 | sub GetBuildType
164 | {
165 | my ($file)=(@_);
166 | my ($type);
167 | open(TYPE, $file) or die("Could not open file: $!\n");
168 | $type = ;
169 | close(TYPE);
170 | chomp $type;
171 | return $type;
172 | }
173 |
174 | return 1;
175 |
--------------------------------------------------------------------------------
/buildbot/package.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | use strict;
4 | use Cwd;
5 | use File::Basename;
6 | use Net::FTP;
7 |
8 | my ($ftp_file, $ftp_host, $ftp_user, $ftp_pass, $ftp_path);
9 |
10 | $ftp_file = shift;
11 |
12 | open(FTP, $ftp_file) or die "Unable to read FTP config file $ftp_file: $!\n";
13 | $ftp_host = ;
14 | $ftp_user = ;
15 | $ftp_pass = ;
16 | $ftp_path = ;
17 | close(FTP);
18 |
19 | chomp $ftp_host;
20 | chomp $ftp_user;
21 | chomp $ftp_pass;
22 | chomp $ftp_path;
23 |
24 | my ($myself, $path) = fileparse($0);
25 | chdir($path);
26 |
27 | require 'helpers.pm';
28 |
29 | #Switch to the output folder.
30 | chdir(Build::PathFormat('../../OUTPUT/package'));
31 |
32 | my ($version);
33 |
34 | $version = Build::ProductVersion(Build::PathFormat('../../build/product.version'));
35 | $version =~ s/-dev//g;
36 | $version .= '-git' . Build::GitRevNum('../../build');
37 |
38 | # Append OS to package version
39 | if ($^O eq "darwin")
40 | {
41 | $version .= '-mac';
42 | }
43 | elsif ($^O =~ /MSWin/)
44 | {
45 | $version .= '-windows';
46 | }
47 | else
48 | {
49 | $version .= '-' . $^O;
50 | }
51 |
52 | my ($filename);
53 | $filename = 'stripper-' . $version;
54 | if ($^O eq "linux")
55 | {
56 | $filename .= '.tar.gz';
57 | print "tar zcvf $filename addons\n";
58 | system("tar zcvf $filename addons");
59 | }
60 | else
61 | {
62 | $filename .= '.zip';
63 | print "zip -r $filename addons\n";
64 | system("zip -r $filename addons");
65 | }
66 |
67 | my ($major,$minor) = ($version =~ /^(\d+)\.(\d+)/);
68 | $ftp_path .= "/stripper/$major.$minor";
69 |
70 | my ($ftp);
71 |
72 | $ftp = Net::FTP->new($ftp_host, Debug => 0, Passive => 1)
73 | or die "Cannot connect to host $ftp_host: $@";
74 |
75 | $ftp->login($ftp_user, $ftp_pass)
76 | or die "Cannot connect to host $ftp_host as $ftp_user: " . $ftp->message . "\n";
77 |
78 | if ($ftp_path ne '')
79 | {
80 | $ftp->cwd($ftp_path)
81 | or die "Cannot change to folder $ftp_path: " . $ftp->message . "\n";
82 | }
83 |
84 | $ftp->binary();
85 | $ftp->put($filename)
86 | or die "Cannot drop file $filename ($ftp_path): " . $ftp->message . "\n";
87 |
88 | $ftp->close();
89 |
90 | print "File sent to drop site as $filename -- build succeeded.\n";
91 |
92 | exit(0);
93 |
94 |
--------------------------------------------------------------------------------
/buildbot/startbuild.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 | # vim: set ts=2 sw=2 tw=99 noet:
3 |
4 | use File::Basename;
5 |
6 | my ($myself, $path) = fileparse($0);
7 | chdir($path);
8 |
9 | use FindBin;
10 | use lib $FindBin::Bin;
11 | require 'helpers.pm';
12 |
13 | chdir('../../OUTPUT');
14 |
15 | if ($^O eq "linux" || $^O eq "darwin") {
16 | system("ambuild --no-color 2>&1");
17 | } else {
18 | system("C:\\Python38\\scripts\\ambuild --no-color 2>&1");
19 | }
20 |
21 | if ($? != 0)
22 | {
23 | die "Build failed: $!\n";
24 | }
25 | else
26 | {
27 | exit(0);
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/buildbot/symstore.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | use File::Basename;
4 |
5 | my ($myself, $path) = fileparse($0);
6 | chdir($path);
7 |
8 | require 'helpers.pm';
9 |
10 | chdir('..');
11 |
12 | open(PDBLOG, '../OUTPUT/pdblog.txt') or die "Could not open pdblog.txt: $!\n";
13 |
14 | #Get version info
15 | my ($version);
16 | $version = Build::ProductVersion(Build::PathFormat('product.version'));
17 | $version =~ s/-dev//g;
18 | $version .= '-hg' . Build::HgRevNum('.');
19 |
20 | my ($build_type);
21 | $build_type = Build::GetBuildType(Build::PathFormat('buildbot/build_type'));
22 |
23 | if ($build_type eq "dev")
24 | {
25 | $build_type = "buildbot";
26 | }
27 | elsif ($build_type eq "rel")
28 | {
29 | $build_type = "release";
30 | }
31 |
32 | my ($line);
33 | while ()
34 | {
35 | $line = $_;
36 | $line =~ s/\.pdb/\*/;
37 | chomp $line;
38 | Build::Command("symstore add /r /f \"..\\OUTPUT\\$line\" /s \"S:\\stripper\" /t \"Stripper\" /v \"$version\" /c \"$build_type\"");
39 | }
40 |
41 | close(PDBLOG);
42 |
43 | #Lowercase DLLs. Sigh.
44 | my (@files);
45 | opendir(DIR, "S:\\stripper");
46 | @files = readdir(DIR);
47 | closedir(DIR);
48 |
49 | my ($i, $j, $file, @subdirs);
50 | for ($i = 0; $i <= $#files; $i++)
51 | {
52 | $file = $files[$i];
53 | next unless ($file =~ /\.dll$/);
54 | next unless (-d "S:\\stripper\\$file");
55 | opendir(DIR, "S:\\stripper\\$file");
56 | @subdirs = readdir(DIR);
57 | closedir(DIR);
58 | for ($j = 0; $j <= $#subdirs; $j++)
59 | {
60 | next unless ($subdirs[$j] =~ /[A-Z]/);
61 | Build::Command("rename S:\\stripper\\$file\\" . $subdirs[$j] . " " . lc($subdirs[$j]));
62 | }
63 | }
64 |
65 |
--------------------------------------------------------------------------------
/configure.py:
--------------------------------------------------------------------------------
1 | # vim: set sts=2 ts=8 sw=2 tw=99 et:
2 | import sys
3 | try:
4 | from ambuild2 import run, util
5 | except:
6 | try:
7 | import ambuild
8 | sys.stderr.write('It looks like you have AMBuild 1 installed, but this project uses AMBuild 2.\n')
9 | sys.stderr.write('Upgrade to the latest version of AMBuild to continue.\n')
10 | except:
11 | sys.stderr.write('AMBuild must be installed to build this project.\n')
12 | sys.stderr.write('http://www.alliedmods.net/ambuild\n')
13 | sys.exit(1)
14 |
15 | # Hack to show a decent upgrade message, which wasn't done until 2.2.
16 | ambuild_version = getattr(run, 'CURRENT_API', '2.1')
17 | if ambuild_version.startswith('2.1'):
18 | sys.stderr.write("AMBuild 2.2 or higher is required; please update\n")
19 | sys.exit(1)
20 |
21 | parser = run.BuildParser(sourcePath=sys.path[0], api='2.2')
22 | parser.options.add_argument('--hl2sdk-root', type=str, dest='hl2sdk_root', default=None,
23 | help='Root search folder for HL2SDKs')
24 | parser.options.add_argument('--mms-path', type=str, dest='mms_path', default=None,
25 | help='Path to Metamod:Source')
26 | parser.options.add_argument('--enable-debug', action='store_const', const='1', dest='debug',
27 | help='Enable debugging symbols')
28 | parser.options.add_argument('--enable-optimize', action='store_const', const='1', dest='opt',
29 | help='Enable optimization')
30 | parser.options.add_argument('-s', '--sdks', default='present', dest='sdks',
31 | help='Build against specified SDKs; valid args are "all", "present", or '
32 | 'comma-delimited list of engine names')
33 | parser.options.add_argument('--targets', type=str, dest='targets', default=None,
34 | help="Override the target architecture (use commas to separate multiple targets).")
35 | parser.Configure()
--------------------------------------------------------------------------------
/de_dust.cfg:
--------------------------------------------------------------------------------
1 | ;;Example - filtering out bomb zones
2 | filter:
3 | ;{
4 | ;"classname" "/.*bomb.*/"
5 | ;}
6 |
7 | ;;Example - adding a hostage in the T spawn
8 | add:
9 | ;{
10 | ;"origin" "1376 3168 -112"
11 | ;"HostageType" "0"
12 | ;"angles" "0 111 0"
13 | ;"classname" "hostage_entity"
14 | ;}
15 |
--------------------------------------------------------------------------------
/gameshim/AMBuilder:
--------------------------------------------------------------------------------
1 | # vim: set ts=2 sw=2 tw=99 noet ft=python:
2 | import os
3 |
4 | for sdk_name in MMS.sdks:
5 | for cxx in MMS.all_targets:
6 | sdk = MMS.sdks[sdk_name]
7 |
8 | if not cxx.target.arch in sdk.platformSpec[cxx.target.platform]:
9 | continue
10 |
11 | name = 'stripper.' + sdk.ext
12 |
13 | binary = MMS.HL2Library(builder, cxx, name, sdk)
14 |
15 | binary.sources = [
16 | 'stripper_mm.cpp',
17 | ]
18 |
19 | nodes = builder.Add(binary)
20 | MMS.binaries += [nodes]
--------------------------------------------------------------------------------
/gameshim/gameshim.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 10.00
3 | # Visual C++ Express 2008
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gameshim", "gameshim.vcproj", "{B3E797CF-4E77-4C9D-B8A8-7589B6902206}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug - Dark Messiah|Win32 = Debug - Dark Messiah|Win32
9 | Debug - Episode 1|Win32 = Debug - Episode 1|Win32
10 | Debug - Left 4 Dead|Win32 = Debug - Left 4 Dead|Win32
11 | Debug - Old Metamod|Win32 = Debug - Old Metamod|Win32
12 | Debug - Orange Box|Win32 = Debug - Orange Box|Win32
13 | Debug|Win32 = Debug|Win32
14 | Release - CSGO|Win32 = Release - CSGO|Win32
15 | Release - CSS|Win32 = Release - CSS|Win32
16 | Release - Dark Messiah|Win32 = Release - Dark Messiah|Win32
17 | Release - Episode 1|Win32 = Release - Episode 1|Win32
18 | Release - Left 4 Dead 2|Win32 = Release - Left 4 Dead 2|Win32
19 | Release - Left 4 Dead|Win32 = Release - Left 4 Dead|Win32
20 | Release - Old Metamod|Win32 = Release - Old Metamod|Win32
21 | Release - Orange Box|Win32 = Release - Orange Box|Win32
22 | Release|Win32 = Release|Win32
23 | EndGlobalSection
24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
25 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Dark Messiah|Win32.ActiveCfg = Debug - Dark Messiah|Win32
26 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Dark Messiah|Win32.Build.0 = Debug - Dark Messiah|Win32
27 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Episode 1|Win32.ActiveCfg = Debug - Episode 1|Win32
28 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Episode 1|Win32.Build.0 = Debug - Episode 1|Win32
29 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Left 4 Dead|Win32.ActiveCfg = Debug - Left 4 Dead|Win32
30 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Left 4 Dead|Win32.Build.0 = Debug - Left 4 Dead|Win32
31 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Old Metamod|Win32.ActiveCfg = Debug - Old Metamod|Win32
32 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Old Metamod|Win32.Build.0 = Debug - Old Metamod|Win32
33 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Orange Box|Win32.ActiveCfg = Debug - Orange Box|Win32
34 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug - Orange Box|Win32.Build.0 = Debug - Orange Box|Win32
35 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug|Win32.ActiveCfg = Debug|Win32
36 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Debug|Win32.Build.0 = Debug|Win32
37 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - CSGO|Win32.ActiveCfg = Release - CSGO|Win32
38 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - CSGO|Win32.Build.0 = Release - CSGO|Win32
39 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - CSS|Win32.ActiveCfg = Release - CSS|Win32
40 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - CSS|Win32.Build.0 = Release - CSS|Win32
41 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Dark Messiah|Win32.ActiveCfg = Release - Dark Messiah|Win32
42 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Dark Messiah|Win32.Build.0 = Release - Dark Messiah|Win32
43 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Episode 1|Win32.ActiveCfg = Release - Episode 1|Win32
44 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Episode 1|Win32.Build.0 = Release - Episode 1|Win32
45 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Left 4 Dead 2|Win32.ActiveCfg = Release - Left 4 Dead 2|Win32
46 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Left 4 Dead 2|Win32.Build.0 = Release - Left 4 Dead 2|Win32
47 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Left 4 Dead|Win32.ActiveCfg = Release - Left 4 Dead|Win32
48 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Left 4 Dead|Win32.Build.0 = Release - Left 4 Dead|Win32
49 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Old Metamod|Win32.ActiveCfg = Release - Old Metamod|Win32
50 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Old Metamod|Win32.Build.0 = Release - Old Metamod|Win32
51 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Orange Box|Win32.ActiveCfg = Release - Orange Box|Win32
52 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release - Orange Box|Win32.Build.0 = Release - Orange Box|Win32
53 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release|Win32.ActiveCfg = Release|Win32
54 | {B3E797CF-4E77-4C9D-B8A8-7589B6902206}.Release|Win32.Build.0 = Release|Win32
55 | EndGlobalSection
56 | GlobalSection(SolutionProperties) = preSolution
57 | HideSolutionNode = FALSE
58 | EndGlobalSection
59 | EndGlobal
60 |
--------------------------------------------------------------------------------
/gameshim/intercom.h:
--------------------------------------------------------------------------------
1 | /** vim: set ts=4 sw=4 et tw=99:
2 | *
3 | * === Stripper for Metamod:Source ===
4 | * Copyright (C) 2005-2009 David "BAILOPAN" Anderson
5 | * No warranties of any kind.
6 | * Based on the original concept of Stripper2 by botman
7 | *
8 | * License: see LICENSE.TXT
9 | * ===================================
10 | */
11 | #ifndef _INCLUDE_STRIPPER_INTERCOM_H_
12 | #define _INCLUDE_STRIPPER_INTERCOM_H_
13 |
14 | struct stripper_game_t
15 | {
16 | const char* game_path;
17 | const char* stripper_path;
18 | const char* stripper_cfg_path;
19 | void (*log_message)(const char *fmt, ...);
20 | void (*path_format)(char* buffer, size_t maxlength, const char* fmt, ...);
21 | const char* (*get_map_name)();
22 | };
23 |
24 | struct stripper_core_t
25 | {
26 | const char* (*parse_map)(const char* map, const char* entities);
27 | const char* (*ent_string)();
28 | void (*command_dump)();
29 | void (*unload)();
30 | };
31 |
32 | typedef void (*STRIPPER_LOAD)(const stripper_game_t* game, stripper_core_t* core);
33 |
34 | #endif /* _INCLUDE_STRIPPER_INTERCOM_H_ */
35 |
36 |
--------------------------------------------------------------------------------
/gameshim/stripper_mm.h:
--------------------------------------------------------------------------------
1 | /** vim: set ts=4 sw=4 et tw=99:
2 | *
3 | * === Stripper for Metamod:Source ===
4 | * Copyright (C) 2005-2009 David "BAILOPAN" Anderson
5 | * No warranties of any kind.
6 | * Based on the original concept of Stripper2 by botman
7 | *
8 | * License: see LICENSE.TXT
9 | * ===================================
10 | */
11 | #ifndef _INCLUDE_SAMPLEPLUGIN_H
12 | #define _INCLUDE_SAMPLEPLUGIN_H
13 |
14 | #include
15 | #include
16 | #include
17 | #include
18 |
19 | class StripperPlugin :
20 | public ISmmPlugin,
21 | public IConCommandBaseAccessor
22 | {
23 | public:
24 | bool Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late);
25 | bool Unload(char *error, size_t maxlen);
26 | bool Pause(char *error, size_t maxlen);
27 | bool Unpause(char *error, size_t maxlen);
28 | void AllPluginsLoaded();
29 | public:
30 | const char *GetAuthor();
31 | const char *GetName();
32 | const char *GetDescription();
33 | const char *GetURL();
34 | const char *GetLicense();
35 | const char *GetVersion();
36 | const char *GetDate();
37 | const char *GetLogTag();
38 | public: //IConCommandBaseAccessor
39 | bool RegisterConCommandBase(ConCommandBase *pVar);
40 | };
41 |
42 | PLUGIN_GLOBALVARS();
43 |
44 | #define FIND_IFACE(func, assn_var, num_var, name, type) \
45 | do { \
46 | if ( (assn_var=(type)((ismm->func())(name, NULL))) != NULL ) { \
47 | num_var = 0; \
48 | break; \
49 | } \
50 | if (num_var >= 999) \
51 | break; \
52 | } while ( num_var=ismm->FormatIface(name, sizeof(name)-1) ); \
53 | if (!assn_var) { \
54 | if (error) \
55 | snprintf(error, maxlen, "Could not find interface %s", name); \
56 | return false; \
57 | }
58 |
59 |
60 | const char *GetMapEntitiesString_handler();
61 | bool LevelInit_handler(char const *pMapName, char const *pMapEntities, char const *c, char const *d, bool e, bool f);
62 | char *UTIL_ToLowerCase(const char *str);
63 |
64 | #endif //_INCLUDE_SAMPLEPLUGIN_H
65 |
--------------------------------------------------------------------------------
/global_filters.cfg:
--------------------------------------------------------------------------------
1 | ;;EXAMPLE - remove all physics props
2 | ;remove:
3 | ;{
4 | ;"classname" "/prop_physics.*/"
5 | ;}
6 |
7 | ;;EXAMPLE - replace all garbage cans with a hostage
8 | ;modify:
9 | ;{
10 | ; match:
11 | ; {
12 | ; "model" "models/props_junk/garbage_metalcan002a.mdl"
13 | ; "classname" "prop_physics_multiplayer"
14 | ; }
15 | ; replace:
16 | ; {
17 | ; "classname" "hostage_entity"
18 | ; }
19 | ; delete:
20 | ; {
21 | ; "model" "models/props_junk/garbage_metalcan002a.mdl"
22 | ; }
23 | ; insert:
24 | ; {
25 | ; "scale" "0.99"
26 | ; }
27 | ;}
--------------------------------------------------------------------------------
/loader/AMBuilder:
--------------------------------------------------------------------------------
1 | # vim: set ts=2 sw=2 tw=99 noet ft=python:
2 | import os.path
3 |
4 | for cxx in MMS.all_targets:
5 |
6 | if cxx.target.platform != 'linux':
7 | name = 'stripper_mm'
8 | else:
9 | name = 'stripper_mm_i486'
10 |
11 | binary = MMS.Library(cxx, name)
12 |
13 | binary.sources = [
14 | 'stripper_loader.cpp',
15 | ]
16 |
17 | binary.compiler.cxxincludes += [os.path.join(MMS.mms_root, 'core')]
18 |
19 | nodes = builder.Add(binary)
20 | MMS.binaries += [nodes]
--------------------------------------------------------------------------------
/loader/Makefile:
--------------------------------------------------------------------------------
1 | #(C)2004-2006 SourceMM Development Team
2 | # Makefile written by David "BAILOPAN" Anderson
3 |
4 | MMSOURCE = ../../mmsource-1.8
5 |
6 | ### EDIT BELOW FOR OTHER PROJECTS ###
7 |
8 | OPT_FLAGS = -O3 -funroll-loops -pipe -fvisibility=hidden -fvisibility-inlines-hidden
9 | GCC4_FLAGS =
10 | DEBUG_FLAGS = -g -ggdb3
11 | CPP = gcc
12 | PROJECT = stripper_mm
13 |
14 | OBJECTS = stripper_loader.cpp
15 |
16 | LINK = -static-libgcc -m32
17 |
18 | HL2PUB = $(HL2SDK)/public
19 |
20 | INCLUDE = -I. -I.. -I$(MMSOURCE)/core
21 |
22 | ifeq "$(DEBUG)" "true"
23 | BIN_DIR = Debug
24 | CFLAGS = $(DEBUG_FLAGS)
25 | else
26 | BIN_DIR = Release
27 | CFLAGS = $(OPT_FLAGS)
28 | endif
29 |
30 | GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1)
31 |
32 | CFLAGS += -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -Wall -Wno-non-virtual-dtor -Werror -fPIC -fno-exceptions -fno-rtti -msse -m32
33 |
34 | ifeq "$(GCC_VERSION)" "4"
35 | CFLAGS += $(GCC4_FLAGS)
36 | endif
37 |
38 | OS := $(shell uname -s)
39 | ifeq "$(OS)" "Darwin"
40 | LINK += -dynamiclib
41 | BINARY = $(PROJECT).dylib
42 | else
43 | LINK += -static-libgcc -shared
44 | BINARY = $(PROJECT)_i486.so
45 | endif
46 |
47 | OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
48 |
49 | $(BIN_DIR)/%.o: %.cpp
50 | $(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
51 |
52 | all:
53 | mkdir -p $(BIN_DIR)
54 | $(MAKE) sourcemm
55 | rm -rf $(BINARY)
56 | ln -sf $(BIN_DIR)/$(BINARY) $(BINARY)
57 |
58 | sourcemm: $(OBJ_LINUX)
59 | $(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -ldl -lm -o $(BIN_DIR)/$(BINARY)
60 |
61 | debug:
62 | $(MAKE) all DEBUG=true
63 |
64 | default: all
65 |
66 | clean:
67 | rm -rf Release/*.o
68 | rm -rf Release/$(BINARY)
69 | rm -rf Debug/*.o
70 | rm -rf Debug/$(BINARY)
71 |
72 |
--------------------------------------------------------------------------------
/loader/loader.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 10.00
3 | # Visual C++ Express 2008
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loader", "loader.vcproj", "{D0789DE2-C3C1-450B-B213-96B3EDCD9D60}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {D0789DE2-C3C1-450B-B213-96B3EDCD9D60}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {D0789DE2-C3C1-450B-B213-96B3EDCD9D60}.Debug|Win32.Build.0 = Debug|Win32
14 | {D0789DE2-C3C1-450B-B213-96B3EDCD9D60}.Release|Win32.ActiveCfg = Release|Win32
15 | {D0789DE2-C3C1-450B-B213-96B3EDCD9D60}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/loader/loader.vcproj:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
26 |
29 |
32 |
35 |
38 |
41 |
54 |
57 |
60 |
63 |
73 |
76 |
79 |
82 |
85 |
88 |
91 |
94 |
95 |
103 |
106 |
109 |
112 |
115 |
118 |
128 |
131 |
134 |
137 |
149 |
152 |
155 |
158 |
161 |
164 |
167 |
170 |
171 |
172 |
173 |
174 |
175 |
180 |
183 |
184 |
185 |
190 |
191 |
196 |
197 |
198 |
199 |
200 |
201 |
--------------------------------------------------------------------------------
/parser.h:
--------------------------------------------------------------------------------
1 | /** vim: set ts=4 sw=4 et tw=99:
2 | *
3 | * === Stripper for Metamod:Source ===
4 | * Copyright (C) 2005-2009 David "BAILOPAN" Anderson
5 | * No warranties of any kind.
6 | * Based on the original concept of Stripper2 by botman
7 | *
8 | * License: see LICENSE.TXT
9 | * ===================================
10 | */
11 | #ifndef _INCLUDE_STRIP_PARSER_H
12 | #define _INCLUDE_STRIP_PARSER_H
13 |
14 | #include
15 | #include
16 | #include
17 | #include "pcre.h"
18 |
19 | struct CACHEABLE
20 | {
21 | #if defined _DEBUG
22 | CACHEABLE() : marked(true), last_alloc(0), last_free(0) { };
23 | bool marked;
24 | int last_alloc;
25 | int last_free;
26 | #endif
27 | };
28 |
29 | struct parse_pair
30 | {
31 | SourceHook::String key;
32 | SourceHook::String val;
33 | pcre *re;
34 | };
35 |
36 | struct ent_prop : public CACHEABLE
37 | {
38 | SourceHook::String key;
39 | SourceHook::String val;
40 | };
41 |
42 | struct replace_prop
43 | {
44 | SourceHook::List match;
45 | SourceHook::List to_replace;
46 | SourceHook::List to_remove;
47 | SourceHook::List to_insert;
48 | };
49 |
50 | class Stripper
51 | {
52 | public:
53 | Stripper();
54 | ~Stripper();
55 | public:
56 | void SetEntityList(const char *ents);
57 | void ApplyFileFilter(const char *file);
58 | const char *ToString();
59 | private:
60 | void RunRemoveFilter(SourceHook::List &filters);
61 | void RunAddFilter(SourceHook::List &list);
62 | void RunReplaceFilter(replace_prop &replace, SourceHook::List &props);
63 | void Clear();
64 | void _BuildPropList();
65 | private:
66 | SourceHook::String *AllocString();
67 | void FreeString(SourceHook::String *str);
68 | ent_prop *AllocProp();
69 | void FreeProp(ent_prop *prop);
70 | private:
71 | SourceHook::CStack m_StringCache;
72 | SourceHook::CStack m_PropCache;
73 | void AppendToString(const char* buf, size_t len);
74 | private:
75 | char* m_tostring;
76 | size_t m_tostring_len;
77 | size_t m_tostring_maxlen;
78 | SourceHook::List *> m_props;
79 | SourceHook::List m_lines;
80 | bool m_resync;
81 | pcre *brk_re;
82 | pcre_extra *brk_re_extra;
83 | };
84 |
85 | #endif /* _INCLUDE_STRIP_PARSER_H */
86 |
87 |
--------------------------------------------------------------------------------
/pcre/AUTHORS:
--------------------------------------------------------------------------------
1 | THE MAIN PCRE LIBRARY
2 | ---------------------
3 |
4 | Written by: Philip Hazel
5 | Email local part: ph10
6 | Email domain: cam.ac.uk
7 |
8 | University of Cambridge Computing Service,
9 | Cambridge, England.
10 |
11 | Copyright (c) 1997-2009 University of Cambridge
12 | All rights reserved
13 |
14 |
15 | THE C++ WRAPPER LIBRARY
16 | -----------------------
17 |
18 | Written by: Google Inc.
19 |
20 | Copyright (c) 2007-2008 Google Inc
21 | All rights reserved
22 |
23 | ####
24 |
--------------------------------------------------------------------------------
/pcre/COPYING:
--------------------------------------------------------------------------------
1 | PCRE LICENCE
2 |
3 | Please see the file LICENCE in the PCRE distribution for licensing details.
4 |
5 | End
6 |
--------------------------------------------------------------------------------
/pcre/ChangeLog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alliedmodders/stripper-source/2a08843241f1858d0727a91fa9dcb2382526f8cb/pcre/ChangeLog
--------------------------------------------------------------------------------
/pcre/CleanTxt:
--------------------------------------------------------------------------------
1 | #! /usr/bin/perl -w
2 |
3 | # Script to take the output of nroff -man and remove all the backspacing and
4 | # the page footers and the screen commands etc so that it is more usefully
5 | # readable online. In fact, in the latest nroff, intermediate footers don't
6 | # seem to be generated any more.
7 |
8 | $blankcount = 0;
9 | $lastwascut = 0;
10 | $firstheader = 1;
11 |
12 | # Input on STDIN; output to STDOUT.
13 |
14 | while ()
15 | {
16 | s/\x1b\[\d+m//g; # Remove screen controls "ESC [ number m"
17 | s/.\x8//g; # Remove "char, backspace"
18 |
19 | # Handle header lines. Retain only the first one we encounter, but remove
20 | # the blank line that follows. Any others (e.g. at end of document) and the
21 | # following blank line are dropped.
22 |
23 | if (/^PCRE(\w*)\(([13])\)\s+PCRE\1\(\2\)$/)
24 | {
25 | if ($firstheader)
26 | {
27 | $firstheader = 0;
28 | print;
29 | $lastprinted = $_;
30 | $lastwascut = 0;
31 | }
32 | $_=; # Remove a blank that follows
33 | next;
34 | }
35 |
36 | # Count runs of empty lines
37 |
38 | if (/^\s*$/)
39 | {
40 | $blankcount++;
41 | $lastwascut = 0;
42 | next;
43 | }
44 |
45 | # If a chunk of lines has been cut out (page footer) and the next line
46 | # has a different indentation, put back one blank line.
47 |
48 | if ($lastwascut && $blankcount < 1 && defined($lastprinted))
49 | {
50 | ($a) = $lastprinted =~ /^(\s*)/;
51 | ($b) = $_ =~ /^(\s*)/;
52 | $blankcount++ if ($a ne $b);
53 | }
54 |
55 | # We get here only when we have a non-blank line in hand. If it was preceded
56 | # by 3 or more blank lines, read the next 3 lines and see if they are blank.
57 | # If so, remove all 7 lines, and remember that we have just done a cut.
58 |
59 | if ($blankcount >= 3)
60 | {
61 | for ($i = 0; $i < 3; $i++)
62 | {
63 | $next[$i] = ;
64 | $next[$i] = "" if !defined $next[$i];
65 | $next[$i] =~ s/\x1b\[\d+m//g; # Remove screen controls "ESC [ number m"
66 | $next[$i] =~ s/.\x8//g; # Remove "char, backspace"
67 | }
68 |
69 | # Cut out chunks of the form <3 blanks><3 blanks>
70 |
71 | if ($next[0] =~ /^\s*$/ &&
72 | $next[1] =~ /^\s*$/ &&
73 | $next[2] =~ /^\s*$/)
74 | {
75 | $blankcount -= 3;
76 | $lastwascut = 1;
77 | }
78 |
79 | # Otherwise output the saved blanks, the current, and the next three
80 | # lines. Remember the last printed line.
81 |
82 | else
83 | {
84 | for ($i = 0; $i < $blankcount; $i++) { print "\n"; }
85 | print;
86 | for ($i = 0; $i < 3; $i++)
87 | {
88 | $next[$i] =~ s/.\x8//g;
89 | print $next[$i];
90 | $lastprinted = $_;
91 | }
92 | $lastwascut = 0;
93 | $blankcount = 0;
94 | }
95 | }
96 |
97 | # This non-blank line is not preceded by 3 or more blank lines. Output
98 | # any blanks there are, and the line. Remember it. Force two blank lines
99 | # before headings.
100 |
101 | else
102 | {
103 | $blankcount = 2 if /^\S/ && !/^Last updated/ && !/^Copyright/ &&
104 | defined($lastprinted);
105 | for ($i = 0; $i < $blankcount; $i++) { print "\n"; }
106 | print;
107 | $lastprinted = $_;
108 | $lastwascut = 0;
109 | $blankcount = 0;
110 | }
111 | }
112 |
113 | # End
114 |
--------------------------------------------------------------------------------
/pcre/Detrail:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl
2 |
3 | # This is a script for removing trailing whitespace from lines in files that
4 | # are listed on the command line.
5 |
6 | # This subroutine does the work for one file.
7 |
8 | sub detrail {
9 | my($file) = $_[0];
10 | my($changed) = 0;
11 | open(IN, "$file") || die "Can't open $file for input";
12 | @lines = ;
13 | close(IN);
14 | foreach (@lines)
15 | {
16 | if (/\s+\n$/)
17 | {
18 | s/\s+\n$/\n/;
19 | $changed = 1;
20 | }
21 | }
22 | if ($changed)
23 | {
24 | open(OUT, ">$file") || die "Can't open $file for output";
25 | print OUT @lines;
26 | close(OUT);
27 | }
28 | }
29 |
30 | # This is the main program
31 |
32 | $, = ""; # Output field separator
33 | for ($i = 0; $i < @ARGV; $i++) { &detrail($ARGV[$i]); }
34 |
35 | # End
36 |
--------------------------------------------------------------------------------
/pcre/LICENCE:
--------------------------------------------------------------------------------
1 | PCRE LICENCE
2 | ------------
3 |
4 | PCRE is a library of functions to support regular expressions whose syntax
5 | and semantics are as close as possible to those of the Perl 5 language.
6 |
7 | Release 7 of PCRE is distributed under the terms of the "BSD" licence, as
8 | specified below. The documentation for PCRE, supplied in the "doc"
9 | directory, is distributed under the same terms as the software itself.
10 |
11 | The basic library functions are written in C and are freestanding. Also
12 | included in the distribution is a set of C++ wrapper functions.
13 |
14 |
15 | THE BASIC LIBRARY FUNCTIONS
16 | ---------------------------
17 |
18 | Written by: Philip Hazel
19 | Email local part: ph10
20 | Email domain: cam.ac.uk
21 |
22 | University of Cambridge Computing Service,
23 | Cambridge, England.
24 |
25 | Copyright (c) 1997-2009 University of Cambridge
26 | All rights reserved.
27 |
28 |
29 | THE C++ WRAPPER FUNCTIONS
30 | -------------------------
31 |
32 | Contributed by: Google Inc.
33 |
34 | Copyright (c) 2007-2008, Google Inc.
35 | All rights reserved.
36 |
37 |
38 | THE "BSD" LICENCE
39 | -----------------
40 |
41 | Redistribution and use in source and binary forms, with or without
42 | modification, are permitted provided that the following conditions are met:
43 |
44 | * Redistributions of source code must retain the above copyright notice,
45 | this list of conditions and the following disclaimer.
46 |
47 | * Redistributions in binary form must reproduce the above copyright
48 | notice, this list of conditions and the following disclaimer in the
49 | documentation and/or other materials provided with the distribution.
50 |
51 | * Neither the name of the University of Cambridge nor the name of Google
52 | Inc. nor the names of their contributors may be used to endorse or
53 | promote products derived from this software without specific prior
54 | written permission.
55 |
56 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
57 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
58 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
59 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
60 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
61 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
62 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
63 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
64 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
66 | POSSIBILITY OF SUCH DAMAGE.
67 |
68 | End
69 |
--------------------------------------------------------------------------------
/pcre/RunTest.bat:
--------------------------------------------------------------------------------
1 | @rem This file was contributed by Ralf Junker, and touched up by
2 | @rem Daniel Richard G. Test 10 added by Philip H.
3 | @rem Philip H also changed test 3 to use "wintest" files.
4 | @rem
5 | @rem MS Windows batch file to run pcretest on testfiles with the correct
6 | @rem options.
7 | @rem
8 | @rem Output is written to a newly created subfolder named "testdata".
9 |
10 | setlocal
11 |
12 | if [%srcdir%]==[] set srcdir=.
13 | if [%pcretest%]==[] set pcretest=pcretest
14 |
15 | if not exist testout md testout
16 |
17 | %pcretest% -q %srcdir%\testdata\testinput1 > testout\testoutput1
18 | %pcretest% -q %srcdir%\testdata\testinput2 > testout\testoutput2
19 | @rem %pcretest% -q %srcdir%\testdata\testinput3 > testout\testoutput3
20 | %pcretest% -q %srcdir%\testdata\wintestinput3 > testout\wintestoutput3
21 | %pcretest% -q %srcdir%\testdata\testinput4 > testout\testoutput4
22 | %pcretest% -q %srcdir%\testdata\testinput5 > testout\testoutput5
23 | %pcretest% -q %srcdir%\testdata\testinput6 > testout\testoutput6
24 | %pcretest% -q -dfa %srcdir%\testdata\testinput7 > testout\testoutput7
25 | %pcretest% -q -dfa %srcdir%\testdata\testinput8 > testout\testoutput8
26 | %pcretest% -q -dfa %srcdir%\testdata\testinput9 > testout\testoutput9
27 | %pcretest% -q %srcdir%\testdata\testinput10 > testout\testoutput10
28 |
29 | fc /n %srcdir%\testdata\testoutput1 testout\testoutput1
30 | fc /n %srcdir%\testdata\testoutput2 testout\testoutput2
31 | rem fc /n %srcdir%\testdata\testoutput3 testout\testoutput3
32 | fc /n %srcdir%\testdata\wintestoutput3 testout\wintestoutput3
33 | fc /n %srcdir%\testdata\testoutput4 testout\testoutput4
34 | fc /n %srcdir%\testdata\testoutput5 testout\testoutput5
35 | fc /n %srcdir%\testdata\testoutput6 testout\testoutput6
36 | fc /n %srcdir%\testdata\testoutput7 testout\testoutput7
37 | fc /n %srcdir%\testdata\testoutput8 testout\testoutput8
38 | fc /n %srcdir%\testdata\testoutput9 testout\testoutput9
39 | fc /n %srcdir%\testdata\testoutput10 testout\testoutput10
40 |
--------------------------------------------------------------------------------
/pcre/cmake/COPYING-CMAKE-SCRIPTS:
--------------------------------------------------------------------------------
1 | Redistribution and use in source and binary forms, with or without
2 | modification, are permitted provided that the following conditions
3 | are met:
4 |
5 | 1. Redistributions of source code must retain the copyright
6 | notice, this list of conditions and the following disclaimer.
7 | 2. Redistributions in binary form must reproduce the copyright
8 | notice, this list of conditions and the following disclaimer in the
9 | documentation and/or other materials provided with the distribution.
10 | 3. The name of the author may not be used to endorse or promote products
11 | derived from this software without specific prior written permission.
12 |
13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 |
--------------------------------------------------------------------------------
/pcre/cmake/FindPackageHandleStandardArgs.cmake:
--------------------------------------------------------------------------------
1 | # FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... )
2 | # This macro is intended to be used in FindXXX.cmake modules files.
3 | # It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and
4 | # it also sets the _FOUND variable.
5 | # The package is found if all variables listed are TRUE.
6 | # Example:
7 | #
8 | # FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
9 | #
10 | # LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and
11 | # LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
12 | # If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
13 | # independent whether QUIET was used or not.
14 | # If it is found, the location is reported using the VAR1 argument, so
15 | # here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out.
16 | # If the second argument is DEFAULT_MSG, the message in the failure case will
17 | # be "Could NOT find LibXml2", if you don't like this message you can specify
18 | # your own custom failure message there.
19 |
20 | MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 )
21 |
22 | IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
23 | IF (${_NAME}_FIND_REQUIRED)
24 | SET(_FAIL_MESSAGE "Could not find REQUIRED package ${_NAME}")
25 | ELSE (${_NAME}_FIND_REQUIRED)
26 | SET(_FAIL_MESSAGE "Could not find OPTIONAL package ${_NAME}")
27 | ENDIF (${_NAME}_FIND_REQUIRED)
28 | ELSE("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
29 | SET(_FAIL_MESSAGE "${_FAIL_MSG}")
30 | ENDIF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG")
31 |
32 | STRING(TOUPPER ${_NAME} _NAME_UPPER)
33 |
34 | SET(${_NAME_UPPER}_FOUND TRUE)
35 | IF(NOT ${_VAR1})
36 | SET(${_NAME_UPPER}_FOUND FALSE)
37 | ENDIF(NOT ${_VAR1})
38 |
39 | FOREACH(_CURRENT_VAR ${ARGN})
40 | IF(NOT ${_CURRENT_VAR})
41 | SET(${_NAME_UPPER}_FOUND FALSE)
42 | ENDIF(NOT ${_CURRENT_VAR})
43 | ENDFOREACH(_CURRENT_VAR)
44 |
45 | IF (${_NAME_UPPER}_FOUND)
46 | IF (NOT ${_NAME}_FIND_QUIETLY)
47 | MESSAGE(STATUS "Found ${_NAME}: ${${_VAR1}}")
48 | ENDIF (NOT ${_NAME}_FIND_QUIETLY)
49 | ELSE (${_NAME_UPPER}_FOUND)
50 | IF (${_NAME}_FIND_REQUIRED)
51 | MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE}")
52 | ELSE (${_NAME}_FIND_REQUIRED)
53 | IF (NOT ${_NAME}_FIND_QUIETLY)
54 | MESSAGE(STATUS "${_FAIL_MESSAGE}")
55 | ENDIF (NOT ${_NAME}_FIND_QUIETLY)
56 | ENDIF (${_NAME}_FIND_REQUIRED)
57 | ENDIF (${_NAME_UPPER}_FOUND)
58 | ENDMACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
59 |
--------------------------------------------------------------------------------
/pcre/cmake/FindReadline.cmake:
--------------------------------------------------------------------------------
1 | # from http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/FindReadline.cmake
2 | # http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/COPYING-CMAKE-SCRIPTS
3 | # --> BSD licensed
4 | #
5 | # GNU Readline library finder
6 | if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
7 | set(READLINE_FOUND TRUE)
8 | else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
9 | FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h
10 | /usr/include/readline
11 | )
12 |
13 | # 2008-04-22 The next clause used to read like this:
14 | #
15 | # FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
16 | # FIND_LIBRARY(NCURSES_LIBRARY NAMES ncurses )
17 | # include(FindPackageHandleStandardArgs)
18 | # FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG NCURSES_LIBRARY READLINE_INCLUDE_DIR READLINE_LIBRARY )
19 | #
20 | # I was advised to modify it such that it will find an ncurses library if
21 | # required, but not if one was explicitly given, that is, it allows the
22 | # default to be overridden. PH
23 |
24 | FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
25 | include(FindPackageHandleStandardArgs)
26 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG READLINE_INCLUDE_DIR READLINE_LIBRARY )
27 |
28 | MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY)
29 | endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
30 |
--------------------------------------------------------------------------------
/pcre/config-cmake.h.in:
--------------------------------------------------------------------------------
1 | /* config.h for CMake builds */
2 |
3 | #cmakedefine HAVE_DIRENT_H 1
4 | #cmakedefine HAVE_SYS_STAT_H 1
5 | #cmakedefine HAVE_SYS_TYPES_H 1
6 | #cmakedefine HAVE_UNISTD_H 1
7 | #cmakedefine HAVE_WINDOWS_H 1
8 |
9 | #cmakedefine HAVE_TYPE_TRAITS_H 1
10 | #cmakedefine HAVE_BITS_TYPE_TRAITS_H 1
11 |
12 | #cmakedefine HAVE_BCOPY 1
13 | #cmakedefine HAVE_MEMMOVE 1
14 | #cmakedefine HAVE_STRERROR 1
15 | #cmakedefine HAVE_STRTOLL 1
16 | #cmakedefine HAVE_STRTOQ 1
17 | #cmakedefine HAVE__STRTOI64 1
18 |
19 | #cmakedefine PCRE_STATIC 1
20 |
21 | #cmakedefine SUPPORT_UTF8 1
22 | #cmakedefine SUPPORT_UCP 1
23 | #cmakedefine EBCDIC 1
24 | #cmakedefine BSR_ANYCRLF 1
25 | #cmakedefine NO_RECURSE 1
26 |
27 | #cmakedefine HAVE_LONG_LONG 1
28 | #cmakedefine HAVE_UNSIGNED_LONG_LONG 1
29 |
30 | #cmakedefine SUPPORT_LIBBZ2 1
31 | #cmakedefine SUPPORT_LIBZ 1
32 | #cmakedefine SUPPORT_LIBREADLINE 1
33 |
34 | #define NEWLINE @NEWLINE@
35 | #define POSIX_MALLOC_THRESHOLD @PCRE_POSIX_MALLOC_THRESHOLD@
36 | #define LINK_SIZE @PCRE_LINK_SIZE@
37 | #define MATCH_LIMIT @PCRE_MATCH_LIMIT@
38 | #define MATCH_LIMIT_RECURSION @PCRE_MATCH_LIMIT_RECURSION@
39 |
40 |
41 | #define MAX_NAME_SIZE 32
42 | #define MAX_NAME_COUNT 10000
43 |
44 | /* end config.h for CMake builds */
45 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre-config.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre-config specification
4 |
5 |
6 | pcre-config man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
23 |
SYNOPSIS
24 |
25 | pcre-config [--prefix] [--exec-prefix] [--version] [--libs]
26 | [--libs-posix] [--cflags] [--cflags-posix]
27 |
28 |
DESCRIPTION
29 |
30 | pcre-config returns the configuration of the installed PCRE
31 | libraries and the options required to compile a program to use them.
32 |
33 |
OPTIONS
34 |
35 | --prefix
36 | Writes the directory prefix used in the PCRE installation for architecture
37 | independent files (/usr on many systems, /usr/local on some
38 | systems) to the standard output.
39 |
40 |
41 | --exec-prefix
42 | Writes the directory prefix used in the PCRE installation for architecture
43 | dependent files (normally the same as --prefix) to the standard output.
44 |
45 |
46 | --version
47 | Writes the version number of the installed PCRE libraries to the standard
48 | output.
49 |
50 |
51 | --libs
52 | Writes to the standard output the command line options required to link
53 | with PCRE (-lpcre on many systems).
54 |
55 |
56 | --libs-posix
57 | Writes to the standard output the command line options required to link with
58 | the PCRE posix emulation library (-lpcreposix -lpcre on many
59 | systems).
60 |
61 |
62 | --cflags
63 | Writes to the standard output the command line options required to compile
64 | files that use PCRE (this may include some -I options, but is blank on
65 | many systems).
66 |
67 |
68 | --cflags-posix
69 | Writes to the standard output the command line options required to compile
70 | files that use the PCRE posix emulation library (this may include some -I
71 | options, but is blank on many systems).
72 |
73 |
SEE ALSO
74 |
75 | pcre(3)
76 |
77 |
AUTHOR
78 |
79 | This manual page was originally written by Mark Baker for the Debian GNU/Linux
80 | system. It has been slightly revised as a generic PCRE man page.
81 |
82 |
REVISION
83 |
84 | Last updated: 18 April 2007
85 |
86 |
87 | Return to the PCRE index page.
88 |
89 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_compile.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_compile specification
4 |
5 |
6 | pcre_compile man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | pcre *pcre_compile(const char *pattern, int options,
23 | const char **errptr, int *erroffset,
24 | const unsigned char *tableptr);
25 |
26 |
27 | DESCRIPTION
28 |
29 |
30 | This function compiles a regular expression into an internal form. It is the
31 | same as pcre_compile2(), except for the absence of the errorcodeptr
32 | argument. Its arguments are:
33 |
34 | pattern A zero-terminated string containing the
35 | regular expression to be compiled
36 | options Zero or more option bits
37 | errptr Where to put an error message
38 | erroffset Offset in pattern where error was found
39 | tableptr Pointer to character tables, or NULL to
40 | use the built-in default
41 |
42 | The option bits are:
43 |
44 | PCRE_ANCHORED Force pattern anchoring
45 | PCRE_AUTO_CALLOUT Compile automatic callouts
46 | PCRE_BSR_ANYCRLF \R matches only CR, LF, or CRLF
47 | PCRE_BSR_UNICODE \R matches all Unicode line endings
48 | PCRE_CASELESS Do caseless matching
49 | PCRE_DOLLAR_ENDONLY $ not to match newline at end
50 | PCRE_DOTALL . matches anything including NL
51 | PCRE_DUPNAMES Allow duplicate names for subpatterns
52 | PCRE_EXTENDED Ignore whitespace and # comments
53 | PCRE_EXTRA PCRE extra features
54 | (not much use currently)
55 | PCRE_FIRSTLINE Force matching to be before newline
56 | PCRE_JAVASCRIPT_COMPAT JavaScript compatibility
57 | PCRE_MULTILINE ^ and $ match newlines within data
58 | PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
59 | PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline
60 | sequences
61 | PCRE_NEWLINE_CR Set CR as the newline sequence
62 | PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
63 | PCRE_NEWLINE_LF Set LF as the newline sequence
64 | PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren-
65 | theses (named ones available)
66 | PCRE_UNGREEDY Invert greediness of quantifiers
67 | PCRE_UTF8 Run in UTF-8 mode
68 | PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8
69 | validity (only relevant if
70 | PCRE_UTF8 is set)
71 |
72 | PCRE must be built with UTF-8 support in order to use PCRE_UTF8 and
73 | PCRE_NO_UTF8_CHECK.
74 |
75 |
76 | The yield of the function is a pointer to a private data structure that
77 | contains the compiled pattern, or NULL if an error was detected. Note that
78 | compiling regular expressions with one version of PCRE for use with a different
79 | version is not guaranteed to work and may cause crashes.
80 |
81 |
82 | There is a complete description of the PCRE native API in the
83 | pcreapi
84 | page and a description of the POSIX API in the
85 | pcreposix
86 | page.
87 |
88 | Return to the PCRE index page.
89 |
90 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_compile2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_compile2 specification
4 |
5 |
6 | pcre_compile2 man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | pcre *pcre_compile2(const char *pattern, int options,
23 | int *errorcodeptr,
24 | const char **errptr, int *erroffset,
25 | const unsigned char *tableptr);
26 |
27 |
28 | DESCRIPTION
29 |
30 |
31 | This function compiles a regular expression into an internal form. It is the
32 | same as pcre_compile(), except for the addition of the errorcodeptr
33 | argument. The arguments are:
34 |
35 |
36 |
37 | pattern A zero-terminated string containing the
38 | regular expression to be compiled
39 | options Zero or more option bits
40 | errorcodeptr Where to put an error code
41 | errptr Where to put an error message
42 | erroffset Offset in pattern where error was found
43 | tableptr Pointer to character tables, or NULL to
44 | use the built-in default
45 |
46 | The option bits are:
47 |
48 | PCRE_ANCHORED Force pattern anchoring
49 | PCRE_AUTO_CALLOUT Compile automatic callouts
50 | PCRE_CASELESS Do caseless matching
51 | PCRE_DOLLAR_ENDONLY $ not to match newline at end
52 | PCRE_DOTALL . matches anything including NL
53 | PCRE_DUPNAMES Allow duplicate names for subpatterns
54 | PCRE_EXTENDED Ignore whitespace and # comments
55 | PCRE_EXTRA PCRE extra features
56 | (not much use currently)
57 | PCRE_FIRSTLINE Force matching to be before newline
58 | PCRE_MULTILINE ^ and $ match newlines within data
59 | PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
60 | PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline sequences
61 | PCRE_NEWLINE_CR Set CR as the newline sequence
62 | PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
63 | PCRE_NEWLINE_LF Set LF as the newline sequence
64 | PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren-
65 | theses (named ones available)
66 | PCRE_UNGREEDY Invert greediness of quantifiers
67 | PCRE_UTF8 Run in UTF-8 mode
68 | PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8
69 | validity (only relevant if
70 | PCRE_UTF8 is set)
71 |
72 | PCRE must be built with UTF-8 support in order to use PCRE_UTF8 and
73 | PCRE_NO_UTF8_CHECK.
74 |
75 |
76 | The yield of the function is a pointer to a private data structure that
77 | contains the compiled pattern, or NULL if an error was detected. Note that
78 | compiling regular expressions with one version of PCRE for use with a different
79 | version is not guaranteed to work and may cause crashes.
80 |
81 |
82 | There is a complete description of the PCRE native API in the
83 | pcreapi
84 | page and a description of the POSIX API in the
85 | pcreposix
86 | page.
87 |
88 | Return to the PCRE index page.
89 |
90 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_config.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_config specification
4 |
5 |
6 | pcre_config man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_config(int what, void *where);
23 |
24 |
25 | DESCRIPTION
26 |
27 |
28 | This function makes it possible for a client program to find out which optional
29 | features are available in the version of the PCRE library it is using. Its
30 | arguments are as follows:
31 |
32 | what A code specifying what information is required
33 | where Points to where to put the data
34 |
35 | The available codes are:
36 |
37 | PCRE_CONFIG_LINK_SIZE Internal link size: 2, 3, or 4
38 | PCRE_CONFIG_MATCH_LIMIT Internal resource limit
39 | PCRE_CONFIG_MATCH_LIMIT_RECURSION
40 | Internal recursion depth limit
41 | PCRE_CONFIG_NEWLINE Value of the default newline sequence:
42 | 13 (0x000d) for CR
43 | 10 (0x000a) for LF
44 | 3338 (0x0d0a) for CRLF
45 | -2 for ANYCRLF
46 | -1 for ANY
47 | PCRE_CONFIG_BSR Indicates what \R matches by default:
48 | 0 all Unicode line endings
49 | 1 CR, LF, or CRLF only
50 | PCRE_CONFIG_POSIX_MALLOC_THRESHOLD
51 | Threshold of return slots, above
52 | which malloc() is used by
53 | the POSIX API
54 | PCRE_CONFIG_STACKRECURSE Recursion implementation (1=stack 0=heap)
55 | PCRE_CONFIG_UTF8 Availability of UTF-8 support (1=yes 0=no)
56 | PCRE_CONFIG_UNICODE_PROPERTIES
57 | Availability of Unicode property support
58 | (1=yes 0=no)
59 |
60 | The function yields 0 on success or PCRE_ERROR_BADOPTION otherwise.
61 |
62 |
63 | There is a complete description of the PCRE native API in the
64 | pcreapi
65 | page and a description of the POSIX API in the
66 | pcreposix
67 | page.
68 |
69 | Return to the PCRE index page.
70 |
71 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_copy_named_substring.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_copy_named_substring specification
4 |
5 |
6 | pcre_copy_named_substring man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_copy_named_substring(const pcre *code,
23 | const char *subject, int *ovector,
24 | int stringcount, const char *stringname,
25 | char *buffer, int buffersize);
26 |
27 |
28 | DESCRIPTION
29 |
30 |
31 | This is a convenience function for extracting a captured substring, identified
32 | by name, into a given buffer. The arguments are:
33 |
34 | code Pattern that was successfully matched
35 | subject Subject that has been successfully matched
36 | ovector Offset vector that pcre_exec() used
37 | stringcount Value returned by pcre_exec()
38 | stringname Name of the required substring
39 | buffer Buffer to receive the string
40 | buffersize Size of buffer
41 |
42 | The yield is the length of the substring, PCRE_ERROR_NOMEMORY if the buffer was
43 | too small, or PCRE_ERROR_NOSUBSTRING if the string name is invalid.
44 |
45 |
46 | There is a complete description of the PCRE native API in the
47 | pcreapi
48 | page and a description of the POSIX API in the
49 | pcreposix
50 | page.
51 |
52 | Return to the PCRE index page.
53 |
54 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_copy_substring.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_copy_substring specification
4 |
5 |
6 | pcre_copy_substring man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_copy_substring(const char *subject, int *ovector,
23 | int stringcount, int stringnumber, char *buffer,
24 | int buffersize);
25 |
26 |
27 | DESCRIPTION
28 |
29 |
30 | This is a convenience function for extracting a captured substring into a given
31 | buffer. The arguments are:
32 |
33 | subject Subject that has been successfully matched
34 | ovector Offset vector that pcre_exec() used
35 | stringcount Value returned by pcre_exec()
36 | stringnumber Number of the required substring
37 | buffer Buffer to receive the string
38 | buffersize Size of buffer
39 |
40 | The yield is the length of the string, PCRE_ERROR_NOMEMORY if the buffer was
41 | too small, or PCRE_ERROR_NOSUBSTRING if the string number is invalid.
42 |
43 |
44 | There is a complete description of the PCRE native API in the
45 | pcreapi
46 | page and a description of the POSIX API in the
47 | pcreposix
48 | page.
49 |
50 | Return to the PCRE index page.
51 |
52 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_dfa_exec.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_dfa_exec specification
4 |
5 |
6 | pcre_dfa_exec man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_dfa_exec(const pcre *code, const pcre_extra *extra,
23 | const char *subject, int length, int startoffset,
24 | int options, int *ovector, int ovecsize,
25 | int *workspace, int wscount);
26 |
27 |
28 | DESCRIPTION
29 |
30 |
31 | This function matches a compiled regular expression against a given subject
32 | string, using an alternative matching algorithm that scans the subject string
33 | just once (not Perl-compatible). Note that the main, Perl-compatible,
34 | matching function is pcre_exec(). The arguments for this function are:
35 |
36 | code Points to the compiled pattern
37 | extra Points to an associated pcre_extra structure,
38 | or is NULL
39 | subject Points to the subject string
40 | length Length of the subject string, in bytes
41 | startoffset Offset in bytes in the subject at which to
42 | start matching
43 | options Option bits
44 | ovector Points to a vector of ints for result offsets
45 | ovecsize Number of elements in the vector
46 | workspace Points to a vector of ints used as working space
47 | wscount Number of elements in the vector
48 |
49 | The options are:
50 |
51 | PCRE_ANCHORED Match only at the first position
52 | PCRE_BSR_ANYCRLF \R matches only CR, LF, or CRLF
53 | PCRE_BSR_UNICODE \R matches all Unicode line endings
54 | PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
55 | PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline sequences
56 | PCRE_NEWLINE_CR Set CR as the newline sequence
57 | PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
58 | PCRE_NEWLINE_LF Set LF as the newline sequence
59 | PCRE_NOTBOL Subject is not the beginning of a line
60 | PCRE_NOTEOL Subject is not the end of a line
61 | PCRE_NOTEMPTY An empty string is not a valid match
62 | PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations
63 | PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8
64 | validity (only relevant if PCRE_UTF8
65 | was set at compile time)
66 | PCRE_PARTIAL Return PCRE_ERROR_PARTIAL for a partial match
67 | PCRE_DFA_SHORTEST Return only the shortest match
68 | PCRE_DFA_RESTART This is a restart after a partial match
69 |
70 | There are restrictions on what may appear in a pattern when using this matching
71 | function. Details are given in the
72 | pcrematching
73 | documentation.
74 |
75 |
76 | A pcre_extra structure contains the following fields:
77 |
78 | flags Bits indicating which fields are set
79 | study_data Opaque data from pcre_study()
80 | match_limit Limit on internal resource use
81 | match_limit_recursion Limit on internal recursion depth
82 | callout_data Opaque data passed back to callouts
83 | tables Points to character tables or is NULL
84 |
85 | The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT,
86 | PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, and
87 | PCRE_EXTRA_TABLES. For this matching function, the match_limit and
88 | match_limit_recursion fields are not used, and must not be set.
89 |
90 |
91 | There is a complete description of the PCRE native API in the
92 | pcreapi
93 | page and a description of the POSIX API in the
94 | pcreposix
95 | page.
96 |
97 | Return to the PCRE index page.
98 |
99 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_exec.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_exec specification
4 |
5 |
6 | pcre_exec man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_exec(const pcre *code, const pcre_extra *extra,
23 | const char *subject, int length, int startoffset,
24 | int options, int *ovector, int ovecsize);
25 |
26 |
27 | DESCRIPTION
28 |
29 |
30 | This function matches a compiled regular expression against a given subject
31 | string, using a matching algorithm that is similar to Perl's. It returns
32 | offsets to captured substrings. Its arguments are:
33 |
34 | code Points to the compiled pattern
35 | extra Points to an associated pcre_extra structure,
36 | or is NULL
37 | subject Points to the subject string
38 | length Length of the subject string, in bytes
39 | startoffset Offset in bytes in the subject at which to
40 | start matching
41 | options Option bits
42 | ovector Points to a vector of ints for result offsets
43 | ovecsize Number of elements in the vector (a multiple of 3)
44 |
45 | The options are:
46 |
47 | PCRE_ANCHORED Match only at the first position
48 | PCRE_BSR_ANYCRLF \R matches only CR, LF, or CRLF
49 | PCRE_BSR_UNICODE \R matches all Unicode line endings
50 | PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
51 | PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline sequences
52 | PCRE_NEWLINE_CR Set CR as the newline sequence
53 | PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
54 | PCRE_NEWLINE_LF Set LF as the newline sequence
55 | PCRE_NOTBOL Subject is not the beginning of a line
56 | PCRE_NOTEOL Subject is not the end of a line
57 | PCRE_NOTEMPTY An empty string is not a valid match
58 | PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations
59 | PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8
60 | validity (only relevant if PCRE_UTF8
61 | was set at compile time)
62 | PCRE_PARTIAL Return PCRE_ERROR_PARTIAL for a partial match
63 |
64 | There are restrictions on what may appear in a pattern when partial matching is
65 | requested. For details, see the
66 | pcrepartial
67 | page.
68 |
69 |
70 | A pcre_extra structure contains the following fields:
71 |
72 | flags Bits indicating which fields are set
73 | study_data Opaque data from pcre_study()
74 | match_limit Limit on internal resource use
75 | match_limit_recursion Limit on internal recursion depth
76 | callout_data Opaque data passed back to callouts
77 | tables Points to character tables or is NULL
78 |
79 | The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT,
80 | PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, and
81 | PCRE_EXTRA_TABLES.
82 |
83 |
84 | There is a complete description of the PCRE native API in the
85 | pcreapi
86 | page and a description of the POSIX API in the
87 | pcreposix
88 | page.
89 |
90 | Return to the PCRE index page.
91 |
92 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_free_substring.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_free_substring specification
4 |
5 |
6 | pcre_free_substring man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | void pcre_free_substring(const char *stringptr);
23 |
24 |
25 | DESCRIPTION
26 |
27 |
28 | This is a convenience function for freeing the store obtained by a previous
29 | call to pcre_get_substring() or pcre_get_named_substring(). Its
30 | only argument is a pointer to the string.
31 |
32 |
33 | There is a complete description of the PCRE native API in the
34 | pcreapi
35 | page and a description of the POSIX API in the
36 | pcreposix
37 | page.
38 |
39 | Return to the PCRE index page.
40 |
41 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_free_substring_list.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_free_substring_list specification
4 |
5 |
6 | pcre_free_substring_list man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | void pcre_free_substring_list(const char **stringptr);
23 |
24 |
25 | DESCRIPTION
26 |
27 |
28 | This is a convenience function for freeing the store obtained by a previous
29 | call to pcre_get_substring_list(). Its only argument is a pointer to the
30 | list of string pointers.
31 |
32 |
33 | There is a complete description of the PCRE native API in the
34 | pcreapi
35 | page and a description of the POSIX API in the
36 | pcreposix
37 | page.
38 |
39 | Return to the PCRE index page.
40 |
41 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_fullinfo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_fullinfo specification
4 |
5 |
6 | pcre_fullinfo man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_fullinfo(const pcre *code, const pcre_extra *extra,
23 | int what, void *where);
24 |
25 |
26 | DESCRIPTION
27 |
28 |
29 | This function returns information about a compiled pattern. Its arguments are:
30 |
31 | code Compiled regular expression
32 | extra Result of pcre_study() or NULL
33 | what What information is required
34 | where Where to put the information
35 |
36 | The following information is available:
37 |
38 | PCRE_INFO_BACKREFMAX Number of highest back reference
39 | PCRE_INFO_CAPTURECOUNT Number of capturing subpatterns
40 | PCRE_INFO_DEFAULT_TABLES Pointer to default tables
41 | PCRE_INFO_FIRSTBYTE Fixed first byte for a match, or
42 | -1 for start of string
43 | or after newline, or
44 | -2 otherwise
45 | PCRE_INFO_FIRSTTABLE Table of first bytes (after studying)
46 | PCRE_INFO_JCHANGED Return 1 if (?J) or (?-J) was used
47 | PCRE_INFO_LASTLITERAL Literal last byte required
48 | PCRE_INFO_NAMECOUNT Number of named subpatterns
49 | PCRE_INFO_NAMEENTRYSIZE Size of name table entry
50 | PCRE_INFO_NAMETABLE Pointer to name table
51 | PCRE_INFO_OKPARTIAL Return 1 if partial matching can be tried
52 | PCRE_INFO_OPTIONS Option bits used for compilation
53 | PCRE_INFO_SIZE Size of compiled pattern
54 | PCRE_INFO_STUDYSIZE Size of study data
55 |
56 | The yield of the function is zero on success or:
57 |
58 | PCRE_ERROR_NULL the argument code was NULL
59 | the argument where was NULL
60 | PCRE_ERROR_BADMAGIC the "magic number" was not found
61 | PCRE_ERROR_BADOPTION the value of what was invalid
62 |
63 |
64 |
65 | There is a complete description of the PCRE native API in the
66 | pcreapi
67 | page and a description of the POSIX API in the
68 | pcreposix
69 | page.
70 |
71 | Return to the PCRE index page.
72 |
73 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_get_named_substring.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_get_named_substring specification
4 |
5 |
6 | pcre_get_named_substring man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_get_named_substring(const pcre *code,
23 | const char *subject, int *ovector,
24 | int stringcount, const char *stringname,
25 | const char **stringptr);
26 |
27 |
28 | DESCRIPTION
29 |
30 |
31 | This is a convenience function for extracting a captured substring by name. The
32 | arguments are:
33 |
34 | code Compiled pattern
35 | subject Subject that has been successfully matched
36 | ovector Offset vector that pcre_exec() used
37 | stringcount Value returned by pcre_exec()
38 | stringname Name of the required substring
39 | stringptr Where to put the string pointer
40 |
41 | The memory in which the substring is placed is obtained by calling
42 | pcre_malloc(). The convenience function pcre_free_substring() can
43 | be used to free it when it is no longer needed. The yield of the function is
44 | the length of the extracted substring, PCRE_ERROR_NOMEMORY if sufficient memory
45 | could not be obtained, or PCRE_ERROR_NOSUBSTRING if the string name is invalid.
46 |
47 |
48 | There is a complete description of the PCRE native API in the
49 | pcreapi
50 | page and a description of the POSIX API in the
51 | pcreposix
52 | page.
53 |
54 | Return to the PCRE index page.
55 |
56 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_get_stringnumber.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_get_stringnumber specification
4 |
5 |
6 | pcre_get_stringnumber man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_get_stringnumber(const pcre *code,
23 | const char *name);
24 |
25 |
26 | DESCRIPTION
27 |
28 |
29 | This convenience function finds the number of a named substring capturing
30 | parenthesis in a compiled pattern. Its arguments are:
31 |
32 | code Compiled regular expression
33 | name Name whose number is required
34 |
35 | The yield of the function is the number of the parenthesis if the name is
36 | found, or PCRE_ERROR_NOSUBSTRING otherwise. When duplicate names are allowed
37 | (PCRE_DUPNAMES is set), it is not defined which of the numbers is returned by
38 | pcre_get_stringnumber(). You can obtain the complete list by calling
39 | pcre_get_stringtable_entries().
40 |
41 |
42 | There is a complete description of the PCRE native API in the
43 | pcreapi
44 | page and a description of the POSIX API in the
45 | pcreposix
46 | page.
47 |
48 | Return to the PCRE index page.
49 |
50 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_get_stringtable_entries.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_get_stringtable_entries specification
4 |
5 |
6 | pcre_get_stringtable_entries man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_get_stringtable_entries(const pcre *code,
23 | const char *name, char **first, char **last);
24 |
25 |
26 | DESCRIPTION
27 |
28 |
29 | This convenience function finds, for a compiled pattern, the first and last
30 | entries for a given name in the table that translates capturing parenthesis
31 | names into numbers. When names are required to be unique (PCRE_DUPNAMES is
32 | not set), it is usually easier to use pcre_get_stringnumber()
33 | instead.
34 |
35 | code Compiled regular expression
36 | name Name whose entries required
37 | first Where to return a pointer to the first entry
38 | last Where to return a pointer to the last entry
39 |
40 | The yield of the function is the length of each entry, or
41 | PCRE_ERROR_NOSUBSTRING if none are found.
42 |
43 |
44 | There is a complete description of the PCRE native API, including the format of
45 | the table entries, in the
46 | pcreapi
47 | page, and a description of the POSIX API in the
48 | pcreposix
49 | page.
50 |
51 | Return to the PCRE index page.
52 |
53 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_get_substring.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_get_substring specification
4 |
5 |
6 | pcre_get_substring man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_get_substring(const char *subject, int *ovector,
23 | int stringcount, int stringnumber,
24 | const char **stringptr);
25 |
26 |
27 | DESCRIPTION
28 |
29 |
30 | This is a convenience function for extracting a captured substring. The
31 | arguments are:
32 |
33 | subject Subject that has been successfully matched
34 | ovector Offset vector that pcre_exec() used
35 | stringcount Value returned by pcre_exec()
36 | stringnumber Number of the required substring
37 | stringptr Where to put the string pointer
38 |
39 | The memory in which the substring is placed is obtained by calling
40 | pcre_malloc(). The convenience function pcre_free_substring() can
41 | be used to free it when it is no longer needed. The yield of the function is
42 | the length of the substring, PCRE_ERROR_NOMEMORY if sufficient memory could not
43 | be obtained, or PCRE_ERROR_NOSUBSTRING if the string number is invalid.
44 |
45 |
46 | There is a complete description of the PCRE native API in the
47 | pcreapi
48 | page and a description of the POSIX API in the
49 | pcreposix
50 | page.
51 |
52 | Return to the PCRE index page.
53 |
54 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_get_substring_list.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_get_substring_list specification
4 |
5 |
6 | pcre_get_substring_list man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_get_substring_list(const char *subject,
23 | int *ovector, int stringcount, const char ***listptr);
24 |
25 |
26 | DESCRIPTION
27 |
28 |
29 | This is a convenience function for extracting a list of all the captured
30 | substrings. The arguments are:
31 |
32 | subject Subject that has been successfully matched
33 | ovector Offset vector that pcre_exec used
34 | stringcount Value returned by pcre_exec
35 | listptr Where to put a pointer to the list
36 |
37 | The memory in which the substrings and the list are placed is obtained by
38 | calling pcre_malloc(). The convenience function
39 | pcre_free_substring_list() can be used to free it when it is no longer
40 | needed. A pointer to a list of pointers is put in the variable whose address is
41 | in listptr. The list is terminated by a NULL pointer. The yield of the
42 | function is zero on success or PCRE_ERROR_NOMEMORY if sufficient memory could
43 | not be obtained.
44 |
45 |
46 | There is a complete description of the PCRE native API in the
47 | pcreapi
48 | page and a description of the POSIX API in the
49 | pcreposix
50 | page.
51 |
52 | Return to the PCRE index page.
53 |
54 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_info.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_info specification
4 |
5 |
6 | pcre_info man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_info(const pcre *code, int *optptr, int
23 | *firstcharptr);
24 |
25 |
26 | DESCRIPTION
27 |
28 |
29 | This function is obsolete. You should be using pcre_fullinfo() instead.
30 |
31 |
32 | There is a complete description of the PCRE native API in the
33 | pcreapi
34 | page and a description of the POSIX API in the
35 | pcreposix
36 | page.
37 |
38 | Return to the PCRE index page.
39 |
40 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_maketables.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_maketables specification
4 |
5 |
6 | pcre_maketables man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | const unsigned char *pcre_maketables(void);
23 |
24 |
25 | DESCRIPTION
26 |
27 |
28 | This function builds a set of character tables for character values less than
29 | 256. These can be passed to pcre_compile() to override PCRE's internal,
30 | built-in tables (which were made by pcre_maketables() when PCRE was
31 | compiled). You might want to do this if you are using a non-standard locale.
32 | The function yields a pointer to the tables.
33 |
34 |
35 | There is a complete description of the PCRE native API in the
36 | pcreapi
37 | page and a description of the POSIX API in the
38 | pcreposix
39 | page.
40 |
41 | Return to the PCRE index page.
42 |
43 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_refcount.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_refcount specification
4 |
5 |
6 | pcre_refcount man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | int pcre_refcount(pcre *code, int adjust);
23 |
24 |
25 | DESCRIPTION
26 |
27 |
28 | This function is used to maintain a reference count inside a data block that
29 | contains a compiled pattern. Its arguments are:
30 |
31 | code Compiled regular expression
32 | adjust Adjustment to reference value
33 |
34 | The yield of the function is the adjusted reference value, which is constrained
35 | to lie between 0 and 65535.
36 |
37 |
38 | There is a complete description of the PCRE native API in the
39 | pcreapi
40 | page and a description of the POSIX API in the
41 | pcreposix
42 | page.
43 |
44 | Return to the PCRE index page.
45 |
46 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_study.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_study specification
4 |
5 |
6 | pcre_study man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | pcre_extra *pcre_study(const pcre *code, int options,
23 | const char **errptr);
24 |
25 |
26 | DESCRIPTION
27 |
28 |
29 | This function studies a compiled pattern, to see if additional information can
30 | be extracted that might speed up matching. Its arguments are:
31 |
32 | code A compiled regular expression
33 | options Options for pcre_study()
34 | errptr Where to put an error message
35 |
36 | If the function succeeds, it returns a value that can be passed to
37 | pcre_exec() via its extra argument.
38 |
39 |
40 | If the function returns NULL, either it could not find any additional
41 | information, or there was an error. You can tell the difference by looking at
42 | the error value. It is NULL in first case.
43 |
44 |
45 | There are currently no options defined; the value of the second argument should
46 | always be zero.
47 |
48 |
49 | There is a complete description of the PCRE native API in the
50 | pcreapi
51 | page and a description of the POSIX API in the
52 | pcreposix
53 | page.
54 |
55 | Return to the PCRE index page.
56 |
57 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcre_version.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcre_version specification
4 |
5 |
6 | pcre_version man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | SYNOPSIS
17 |
18 |
19 | #include <pcre.h>
20 |
21 |
22 | char *pcre_version(void);
23 |
24 |
25 | DESCRIPTION
26 |
27 |
28 | This function returns a character string that gives the version number of the
29 | PCRE library and the date of its release.
30 |
31 |
32 | There is a complete description of the PCRE native API in the
33 | pcreapi
34 | page and a description of the POSIX API in the
35 | pcreposix
36 | page.
37 |
38 | Return to the PCRE index page.
39 |
40 |
--------------------------------------------------------------------------------
/pcre/doc/html/pcresample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | pcresample specification
4 |
5 |
6 | pcresample man page
7 |
8 | Return to the PCRE index page.
9 |
10 |
11 | This page is part of the PCRE HTML documentation. It was generated automatically
12 | from the original man page. If there is any nonsense in it, please consult the
13 | man page, in case the conversion went wrong.
14 |
15 |
16 | PCRE SAMPLE PROGRAM
17 |
18 |
19 | A simple, complete demonstration program, to get you started with using PCRE,
20 | is supplied in the file pcredemo.c in the PCRE distribution.
21 |
22 |
23 | The program compiles the regular expression that is its first argument, and
24 | matches it against the subject string in its second argument. No PCRE options
25 | are set, and default character tables are used. If matching succeeds, the
26 | program outputs the portion of the subject that matched, together with the
27 | contents of any captured substrings.
28 |
29 |
30 | If the -g option is given on the command line, the program then goes on to
31 | check for further matches of the same regular expression in the same subject
32 | string. The logic is a little bit tricky because of the possibility of matching
33 | an empty string. Comments in the code explain what is going on.
34 |
35 |
36 | If PCRE is installed in the standard include and library directories for your
37 | system, you should be able to compile the demonstration program using this
38 | command:
39 |
40 | gcc -o pcredemo pcredemo.c -lpcre
41 |
42 | If PCRE is installed elsewhere, you may need to add additional options to the
43 | command line. For example, on a Unix-like system that has PCRE installed in
44 | /usr/local, you can compile the demonstration program using a command
45 | like this:
46 |
47 | gcc -o pcredemo -I/usr/local/include pcredemo.c -L/usr/local/lib -lpcre
48 |
49 | Once you have compiled the demonstration program, you can run simple tests like
50 | this:
51 |
52 | ./pcredemo 'cat|dog' 'the cat sat on the mat'
53 | ./pcredemo -g 'cat|dog' 'the dog sat on the cat'
54 |
55 | Note that there is a much more comprehensive test program, called
56 | pcretest,
57 | which supports many more facilities for testing regular expressions and the
58 | PCRE library. The pcredemo program is provided as a simple coding
59 | example.
60 |
61 |
62 | On some operating systems (e.g. Solaris), when PCRE is not installed in the
63 | standard library directory, you may get an error like this when you try to run
64 | pcredemo:
65 |
66 | ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory
67 |
68 | This is caused by the way shared library support works on those systems. You
69 | need to add
70 |
71 | -R/usr/local/lib
72 |
73 | (for example) to the compile command to get round this problem.
74 |
75 |
76 | AUTHOR
77 |
78 |
79 | Philip Hazel
80 |
81 | University Computing Service
82 |
83 | Cambridge CB2 3QH, England.
84 |
85 |
86 |
87 | REVISION
88 |
89 |
90 | Last updated: 23 January 2008
91 |
92 | Copyright © 1997-2008 University of Cambridge.
93 |
94 |
95 | Return to the PCRE index page.
96 |
97 |
--------------------------------------------------------------------------------
/pcre/doc/pcre-config.1:
--------------------------------------------------------------------------------
1 | .TH PCRE-CONFIG 1
2 | .SH NAME
3 | pcre-config - program to return PCRE configuration
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B pcre-config [--prefix] [--exec-prefix] [--version] [--libs]
8 | .ti +5n
9 | .B [--libs-posix] [--cflags] [--cflags-posix]
10 | .
11 | .
12 | .SH DESCRIPTION
13 | .rs
14 | .sp
15 | \fBpcre-config\fP returns the configuration of the installed PCRE
16 | libraries and the options required to compile a program to use them.
17 | .
18 | .
19 | .SH OPTIONS
20 | .rs
21 | .TP 10
22 | \fB--prefix\fP
23 | Writes the directory prefix used in the PCRE installation for architecture
24 | independent files (\fI/usr\fP on many systems, \fI/usr/local\fP on some
25 | systems) to the standard output.
26 | .TP 10
27 | \fB--exec-prefix\fP
28 | Writes the directory prefix used in the PCRE installation for architecture
29 | dependent files (normally the same as \fB--prefix\fP) to the standard output.
30 | .TP 10
31 | \fB--version\fP
32 | Writes the version number of the installed PCRE libraries to the standard
33 | output.
34 | .TP 10
35 | \fB--libs\fP
36 | Writes to the standard output the command line options required to link
37 | with PCRE (\fB-lpcre\fP on many systems).
38 | .TP 10
39 | \fB--libs-posix\fP
40 | Writes to the standard output the command line options required to link with
41 | the PCRE posix emulation library (\fB-lpcreposix\fP \fB-lpcre\fP on many
42 | systems).
43 | .TP 10
44 | \fB--cflags\fP
45 | Writes to the standard output the command line options required to compile
46 | files that use PCRE (this may include some \fB-I\fP options, but is blank on
47 | many systems).
48 | .TP 10
49 | \fB--cflags-posix\fP
50 | Writes to the standard output the command line options required to compile
51 | files that use the PCRE posix emulation library (this may include some \fB-I\fP
52 | options, but is blank on many systems).
53 | .
54 | .
55 | .SH "SEE ALSO"
56 | .rs
57 | .sp
58 | \fBpcre(3)\fP
59 | .
60 | .
61 | .SH AUTHOR
62 | .rs
63 | .sp
64 | This manual page was originally written by Mark Baker for the Debian GNU/Linux
65 | system. It has been slightly revised as a generic PCRE man page.
66 | .
67 | .
68 | .SH REVISION
69 | .rs
70 | .sp
71 | .nf
72 | Last updated: 18 April 2007
73 | .fi
74 |
--------------------------------------------------------------------------------
/pcre/doc/pcre-config.txt:
--------------------------------------------------------------------------------
1 | PCRE-CONFIG(1) PCRE-CONFIG(1)
2 |
3 |
4 |
5 | NAME
6 | pcre-config - program to return PCRE configuration
7 |
8 | SYNOPSIS
9 |
10 | pcre-config [--prefix] [--exec-prefix] [--version] [--libs]
11 | [--libs-posix] [--cflags] [--cflags-posix]
12 |
13 |
14 | DESCRIPTION
15 |
16 | pcre-config returns the configuration of the installed PCRE libraries
17 | and the options required to compile a program to use them.
18 |
19 |
20 | OPTIONS
21 |
22 | --prefix Writes the directory prefix used in the PCRE installation for
23 | architecture independent files (/usr on many systems,
24 | /usr/local on some systems) to the standard output.
25 |
26 | --exec-prefix
27 | Writes the directory prefix used in the PCRE installation for
28 | architecture dependent files (normally the same as --prefix)
29 | to the standard output.
30 |
31 | --version Writes the version number of the installed PCRE libraries to
32 | the standard output.
33 |
34 | --libs Writes to the standard output the command line options
35 | required to link with PCRE (-lpcre on many systems).
36 |
37 | --libs-posix
38 | Writes to the standard output the command line options
39 | required to link with the PCRE posix emulation library
40 | (-lpcreposix -lpcre on many systems).
41 |
42 | --cflags Writes to the standard output the command line options
43 | required to compile files that use PCRE (this may include
44 | some -I options, but is blank on many systems).
45 |
46 | --cflags-posix
47 | Writes to the standard output the command line options
48 | required to compile files that use the PCRE posix emulation
49 | library (this may include some -I options, but is blank on
50 | many systems).
51 |
52 |
53 | SEE ALSO
54 |
55 | pcre(3)
56 |
57 |
58 | AUTHOR
59 |
60 | This manual page was originally written by Mark Baker for the Debian
61 | GNU/Linux system. It has been slightly revised as a generic PCRE man
62 | page.
63 |
64 |
65 | REVISION
66 |
67 | Last updated: 18 April 2007
68 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_compile.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_COMPILE 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B pcre *pcre_compile(const char *\fIpattern\fP, int \fIoptions\fP,
11 | .ti +5n
12 | .B const char **\fIerrptr\fP, int *\fIerroffset\fP,
13 | .ti +5n
14 | .B const unsigned char *\fItableptr\fP);
15 | .
16 | .SH DESCRIPTION
17 | .rs
18 | .sp
19 | This function compiles a regular expression into an internal form. It is the
20 | same as \fBpcre_compile2()\fP, except for the absence of the \fIerrorcodeptr\fP
21 | argument. Its arguments are:
22 | .sp
23 | \fIpattern\fR A zero-terminated string containing the
24 | regular expression to be compiled
25 | \fIoptions\fR Zero or more option bits
26 | \fIerrptr\fR Where to put an error message
27 | \fIerroffset\fR Offset in pattern where error was found
28 | \fItableptr\fR Pointer to character tables, or NULL to
29 | use the built-in default
30 | .sp
31 | The option bits are:
32 | .sp
33 | PCRE_ANCHORED Force pattern anchoring
34 | PCRE_AUTO_CALLOUT Compile automatic callouts
35 | PCRE_BSR_ANYCRLF \eR matches only CR, LF, or CRLF
36 | PCRE_BSR_UNICODE \eR matches all Unicode line endings
37 | PCRE_CASELESS Do caseless matching
38 | PCRE_DOLLAR_ENDONLY $ not to match newline at end
39 | PCRE_DOTALL . matches anything including NL
40 | PCRE_DUPNAMES Allow duplicate names for subpatterns
41 | PCRE_EXTENDED Ignore whitespace and # comments
42 | PCRE_EXTRA PCRE extra features
43 | (not much use currently)
44 | PCRE_FIRSTLINE Force matching to be before newline
45 | PCRE_JAVASCRIPT_COMPAT JavaScript compatibility
46 | PCRE_MULTILINE ^ and $ match newlines within data
47 | PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
48 | PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline
49 | sequences
50 | PCRE_NEWLINE_CR Set CR as the newline sequence
51 | PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
52 | PCRE_NEWLINE_LF Set LF as the newline sequence
53 | PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren-
54 | theses (named ones available)
55 | PCRE_UNGREEDY Invert greediness of quantifiers
56 | PCRE_UTF8 Run in UTF-8 mode
57 | PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8
58 | validity (only relevant if
59 | PCRE_UTF8 is set)
60 | .sp
61 | PCRE must be built with UTF-8 support in order to use PCRE_UTF8 and
62 | PCRE_NO_UTF8_CHECK.
63 | .P
64 | The yield of the function is a pointer to a private data structure that
65 | contains the compiled pattern, or NULL if an error was detected. Note that
66 | compiling regular expressions with one version of PCRE for use with a different
67 | version is not guaranteed to work and may cause crashes.
68 | .P
69 | There is a complete description of the PCRE native API in the
70 | .\" HREF
71 | \fBpcreapi\fR
72 | .\"
73 | page and a description of the POSIX API in the
74 | .\" HREF
75 | \fBpcreposix\fR
76 | .\"
77 | page.
78 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_compile2.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_COMPILE2 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B pcre *pcre_compile2(const char *\fIpattern\fP, int \fIoptions\fP,
11 | .ti +5n
12 | .B int *\fIerrorcodeptr\fP,
13 | .ti +5n
14 | .B const char **\fIerrptr\fP, int *\fIerroffset\fP,
15 | .ti +5n
16 | .B const unsigned char *\fItableptr\fP);
17 | .
18 | .SH DESCRIPTION
19 | .rs
20 | .sp
21 | This function compiles a regular expression into an internal form. It is the
22 | same as \fBpcre_compile()\fP, except for the addition of the \fIerrorcodeptr\fP
23 | argument. The arguments are:
24 |
25 | .sp
26 | \fIpattern\fR A zero-terminated string containing the
27 | regular expression to be compiled
28 | \fIoptions\fR Zero or more option bits
29 | \fIerrorcodeptr\fP Where to put an error code
30 | \fIerrptr\fR Where to put an error message
31 | \fIerroffset\fR Offset in pattern where error was found
32 | \fItableptr\fR Pointer to character tables, or NULL to
33 | use the built-in default
34 | .sp
35 | The option bits are:
36 | .sp
37 | PCRE_ANCHORED Force pattern anchoring
38 | PCRE_AUTO_CALLOUT Compile automatic callouts
39 | PCRE_CASELESS Do caseless matching
40 | PCRE_DOLLAR_ENDONLY $ not to match newline at end
41 | PCRE_DOTALL . matches anything including NL
42 | PCRE_DUPNAMES Allow duplicate names for subpatterns
43 | PCRE_EXTENDED Ignore whitespace and # comments
44 | PCRE_EXTRA PCRE extra features
45 | (not much use currently)
46 | PCRE_FIRSTLINE Force matching to be before newline
47 | PCRE_MULTILINE ^ and $ match newlines within data
48 | PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
49 | PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline sequences
50 | PCRE_NEWLINE_CR Set CR as the newline sequence
51 | PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
52 | PCRE_NEWLINE_LF Set LF as the newline sequence
53 | PCRE_NO_AUTO_CAPTURE Disable numbered capturing paren-
54 | theses (named ones available)
55 | PCRE_UNGREEDY Invert greediness of quantifiers
56 | PCRE_UTF8 Run in UTF-8 mode
57 | PCRE_NO_UTF8_CHECK Do not check the pattern for UTF-8
58 | validity (only relevant if
59 | PCRE_UTF8 is set)
60 | .sp
61 | PCRE must be built with UTF-8 support in order to use PCRE_UTF8 and
62 | PCRE_NO_UTF8_CHECK.
63 | .P
64 | The yield of the function is a pointer to a private data structure that
65 | contains the compiled pattern, or NULL if an error was detected. Note that
66 | compiling regular expressions with one version of PCRE for use with a different
67 | version is not guaranteed to work and may cause crashes.
68 | .P
69 | There is a complete description of the PCRE native API in the
70 | .\" HREF
71 | \fBpcreapi\fR
72 | .\"
73 | page and a description of the POSIX API in the
74 | .\" HREF
75 | \fBpcreposix\fR
76 | .\"
77 | page.
78 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_config.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_CONFIG 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_config(int \fIwhat\fP, void *\fIwhere\fP);
11 | .
12 | .SH DESCRIPTION
13 | .rs
14 | .sp
15 | This function makes it possible for a client program to find out which optional
16 | features are available in the version of the PCRE library it is using. Its
17 | arguments are as follows:
18 | .sp
19 | \fIwhat\fR A code specifying what information is required
20 | \fIwhere\fR Points to where to put the data
21 | .sp
22 | The available codes are:
23 | .sp
24 | PCRE_CONFIG_LINK_SIZE Internal link size: 2, 3, or 4
25 | PCRE_CONFIG_MATCH_LIMIT Internal resource limit
26 | PCRE_CONFIG_MATCH_LIMIT_RECURSION
27 | Internal recursion depth limit
28 | PCRE_CONFIG_NEWLINE Value of the default newline sequence:
29 | 13 (0x000d) for CR
30 | 10 (0x000a) for LF
31 | 3338 (0x0d0a) for CRLF
32 | -2 for ANYCRLF
33 | -1 for ANY
34 | PCRE_CONFIG_BSR Indicates what \eR matches by default:
35 | 0 all Unicode line endings
36 | 1 CR, LF, or CRLF only
37 | PCRE_CONFIG_POSIX_MALLOC_THRESHOLD
38 | Threshold of return slots, above
39 | which \fBmalloc()\fR is used by
40 | the POSIX API
41 | PCRE_CONFIG_STACKRECURSE Recursion implementation (1=stack 0=heap)
42 | PCRE_CONFIG_UTF8 Availability of UTF-8 support (1=yes 0=no)
43 | PCRE_CONFIG_UNICODE_PROPERTIES
44 | Availability of Unicode property support
45 | (1=yes 0=no)
46 | .sp
47 | The function yields 0 on success or PCRE_ERROR_BADOPTION otherwise.
48 | .P
49 | There is a complete description of the PCRE native API in the
50 | .\" HREF
51 | \fBpcreapi\fR
52 | .\"
53 | page and a description of the POSIX API in the
54 | .\" HREF
55 | \fBpcreposix\fR
56 | .\"
57 | page.
58 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_copy_named_substring.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_COPY_NAMED_SUBSTRING 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_copy_named_substring(const pcre *\fIcode\fP,
11 | .ti +5n
12 | .B const char *\fIsubject\fP, int *\fIovector\fP,
13 | .ti +5n
14 | .B int \fIstringcount\fP, const char *\fIstringname\fP,
15 | .ti +5n
16 | .B char *\fIbuffer\fP, int \fIbuffersize\fP);
17 | .
18 | .SH DESCRIPTION
19 | .rs
20 | .sp
21 | This is a convenience function for extracting a captured substring, identified
22 | by name, into a given buffer. The arguments are:
23 | .sp
24 | \fIcode\fP Pattern that was successfully matched
25 | \fIsubject\fP Subject that has been successfully matched
26 | \fIovector\fP Offset vector that \fBpcre_exec()\fP used
27 | \fIstringcount\fP Value returned by \fBpcre_exec()\fP
28 | \fIstringname\fP Name of the required substring
29 | \fIbuffer\fP Buffer to receive the string
30 | \fIbuffersize\fP Size of buffer
31 | .sp
32 | The yield is the length of the substring, PCRE_ERROR_NOMEMORY if the buffer was
33 | too small, or PCRE_ERROR_NOSUBSTRING if the string name is invalid.
34 | .P
35 | There is a complete description of the PCRE native API in the
36 | .\" HREF
37 | \fBpcreapi\fP
38 | .\"
39 | page and a description of the POSIX API in the
40 | .\" HREF
41 | \fBpcreposix\fP
42 | .\"
43 | page.
44 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_copy_substring.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_COPY_SUBSTRING 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_copy_substring(const char *\fIsubject\fP, int *\fIovector\fP,
11 | .ti +5n
12 | .B int \fIstringcount\fP, int \fIstringnumber\fP, char *\fIbuffer\fP,
13 | .ti +5n
14 | .B int \fIbuffersize\fP);
15 | .
16 | .SH DESCRIPTION
17 | .rs
18 | .sp
19 | This is a convenience function for extracting a captured substring into a given
20 | buffer. The arguments are:
21 | .sp
22 | \fIsubject\fP Subject that has been successfully matched
23 | \fIovector\fP Offset vector that \fBpcre_exec()\fP used
24 | \fIstringcount\fP Value returned by \fBpcre_exec()\fP
25 | \fIstringnumber\fP Number of the required substring
26 | \fIbuffer\fP Buffer to receive the string
27 | \fIbuffersize\fP Size of buffer
28 | .sp
29 | The yield is the length of the string, PCRE_ERROR_NOMEMORY if the buffer was
30 | too small, or PCRE_ERROR_NOSUBSTRING if the string number is invalid.
31 | .P
32 | There is a complete description of the PCRE native API in the
33 | .\" HREF
34 | \fBpcreapi\fP
35 | .\"
36 | page and a description of the POSIX API in the
37 | .\" HREF
38 | \fBpcreposix\fP
39 | .\"
40 | page.
41 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_dfa_exec.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_DFA_EXEC 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_dfa_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP,"
11 | .ti +5n
12 | .B "const char *\fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP,
13 | .ti +5n
14 | .B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP,
15 | .ti +5n
16 | .B int *\fIworkspace\fP, int \fIwscount\fP);
17 | .
18 | .SH DESCRIPTION
19 | .rs
20 | .sp
21 | This function matches a compiled regular expression against a given subject
22 | string, using an alternative matching algorithm that scans the subject string
23 | just once (\fInot\fP Perl-compatible). Note that the main, Perl-compatible,
24 | matching function is \fBpcre_exec()\fP. The arguments for this function are:
25 | .sp
26 | \fIcode\fP Points to the compiled pattern
27 | \fIextra\fP Points to an associated \fBpcre_extra\fP structure,
28 | or is NULL
29 | \fIsubject\fP Points to the subject string
30 | \fIlength\fP Length of the subject string, in bytes
31 | \fIstartoffset\fP Offset in bytes in the subject at which to
32 | start matching
33 | \fIoptions\fP Option bits
34 | \fIovector\fP Points to a vector of ints for result offsets
35 | \fIovecsize\fP Number of elements in the vector
36 | \fIworkspace\fP Points to a vector of ints used as working space
37 | \fIwscount\fP Number of elements in the vector
38 | .sp
39 | The options are:
40 | .sp
41 | PCRE_ANCHORED Match only at the first position
42 | PCRE_BSR_ANYCRLF \eR matches only CR, LF, or CRLF
43 | PCRE_BSR_UNICODE \eR matches all Unicode line endings
44 | PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
45 | PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline sequences
46 | PCRE_NEWLINE_CR Set CR as the newline sequence
47 | PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
48 | PCRE_NEWLINE_LF Set LF as the newline sequence
49 | PCRE_NOTBOL Subject is not the beginning of a line
50 | PCRE_NOTEOL Subject is not the end of a line
51 | PCRE_NOTEMPTY An empty string is not a valid match
52 | PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations
53 | PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8
54 | validity (only relevant if PCRE_UTF8
55 | was set at compile time)
56 | PCRE_PARTIAL Return PCRE_ERROR_PARTIAL for a partial match
57 | PCRE_DFA_SHORTEST Return only the shortest match
58 | PCRE_DFA_RESTART This is a restart after a partial match
59 | .sp
60 | There are restrictions on what may appear in a pattern when using this matching
61 | function. Details are given in the
62 | .\" HREF
63 | \fBpcrematching\fP
64 | .\"
65 | documentation.
66 | .P
67 | A \fBpcre_extra\fP structure contains the following fields:
68 | .sp
69 | \fIflags\fP Bits indicating which fields are set
70 | \fIstudy_data\fP Opaque data from \fBpcre_study()\fP
71 | \fImatch_limit\fP Limit on internal resource use
72 | \fImatch_limit_recursion\fP Limit on internal recursion depth
73 | \fIcallout_data\fP Opaque data passed back to callouts
74 | \fItables\fP Points to character tables or is NULL
75 | .sp
76 | The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT,
77 | PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, and
78 | PCRE_EXTRA_TABLES. For this matching function, the \fImatch_limit\fP and
79 | \fImatch_limit_recursion\fP fields are not used, and must not be set.
80 | .P
81 | There is a complete description of the PCRE native API in the
82 | .\" HREF
83 | \fBpcreapi\fP
84 | .\"
85 | page and a description of the POSIX API in the
86 | .\" HREF
87 | \fBpcreposix\fP
88 | .\"
89 | page.
90 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_exec.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_EXEC 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_exec(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP,"
11 | .ti +5n
12 | .B "const char *\fIsubject\fP," int \fIlength\fP, int \fIstartoffset\fP,
13 | .ti +5n
14 | .B int \fIoptions\fP, int *\fIovector\fP, int \fIovecsize\fP);
15 | .
16 | .SH DESCRIPTION
17 | .rs
18 | .sp
19 | This function matches a compiled regular expression against a given subject
20 | string, using a matching algorithm that is similar to Perl's. It returns
21 | offsets to captured substrings. Its arguments are:
22 | .sp
23 | \fIcode\fP Points to the compiled pattern
24 | \fIextra\fP Points to an associated \fBpcre_extra\fP structure,
25 | or is NULL
26 | \fIsubject\fP Points to the subject string
27 | \fIlength\fP Length of the subject string, in bytes
28 | \fIstartoffset\fP Offset in bytes in the subject at which to
29 | start matching
30 | \fIoptions\fP Option bits
31 | \fIovector\fP Points to a vector of ints for result offsets
32 | \fIovecsize\fP Number of elements in the vector (a multiple of 3)
33 | .sp
34 | The options are:
35 | .sp
36 | PCRE_ANCHORED Match only at the first position
37 | PCRE_BSR_ANYCRLF \eR matches only CR, LF, or CRLF
38 | PCRE_BSR_UNICODE \eR matches all Unicode line endings
39 | PCRE_NEWLINE_ANY Recognize any Unicode newline sequence
40 | PCRE_NEWLINE_ANYCRLF Recognize CR, LF, and CRLF as newline sequences
41 | PCRE_NEWLINE_CR Set CR as the newline sequence
42 | PCRE_NEWLINE_CRLF Set CRLF as the newline sequence
43 | PCRE_NEWLINE_LF Set LF as the newline sequence
44 | PCRE_NOTBOL Subject is not the beginning of a line
45 | PCRE_NOTEOL Subject is not the end of a line
46 | PCRE_NOTEMPTY An empty string is not a valid match
47 | PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations
48 | PCRE_NO_UTF8_CHECK Do not check the subject for UTF-8
49 | validity (only relevant if PCRE_UTF8
50 | was set at compile time)
51 | PCRE_PARTIAL Return PCRE_ERROR_PARTIAL for a partial match
52 | .sp
53 | There are restrictions on what may appear in a pattern when partial matching is
54 | requested. For details, see the
55 | .\" HREF
56 | \fBpcrepartial\fP
57 | .\"
58 | page.
59 | .P
60 | A \fBpcre_extra\fP structure contains the following fields:
61 | .sp
62 | \fIflags\fP Bits indicating which fields are set
63 | \fIstudy_data\fP Opaque data from \fBpcre_study()\fP
64 | \fImatch_limit\fP Limit on internal resource use
65 | \fImatch_limit_recursion\fP Limit on internal recursion depth
66 | \fIcallout_data\fP Opaque data passed back to callouts
67 | \fItables\fP Points to character tables or is NULL
68 | .sp
69 | The flag bits are PCRE_EXTRA_STUDY_DATA, PCRE_EXTRA_MATCH_LIMIT,
70 | PCRE_EXTRA_MATCH_LIMIT_RECURSION, PCRE_EXTRA_CALLOUT_DATA, and
71 | PCRE_EXTRA_TABLES.
72 | .P
73 | There is a complete description of the PCRE native API in the
74 | .\" HREF
75 | \fBpcreapi\fP
76 | .\"
77 | page and a description of the POSIX API in the
78 | .\" HREF
79 | \fBpcreposix\fP
80 | .\"
81 | page.
82 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_free_substring.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_FREE_SUBSTRING 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B void pcre_free_substring(const char *\fIstringptr\fP);
11 | .
12 | .SH DESCRIPTION
13 | .rs
14 | .sp
15 | This is a convenience function for freeing the store obtained by a previous
16 | call to \fBpcre_get_substring()\fP or \fBpcre_get_named_substring()\fP. Its
17 | only argument is a pointer to the string.
18 | .P
19 | There is a complete description of the PCRE native API in the
20 | .\" HREF
21 | \fBpcreapi\fP
22 | .\"
23 | page and a description of the POSIX API in the
24 | .\" HREF
25 | \fBpcreposix\fP
26 | .\"
27 | page.
28 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_free_substring_list.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_FREE_SUBSTRING_LIST 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B void pcre_free_substring_list(const char **\fIstringptr\fP);
11 | .
12 | .SH DESCRIPTION
13 | .rs
14 | .sp
15 | This is a convenience function for freeing the store obtained by a previous
16 | call to \fBpcre_get_substring_list()\fP. Its only argument is a pointer to the
17 | list of string pointers.
18 | .P
19 | There is a complete description of the PCRE native API in the
20 | .\" HREF
21 | \fBpcreapi\fP
22 | .\"
23 | page and a description of the POSIX API in the
24 | .\" HREF
25 | \fBpcreposix\fP
26 | .\"
27 | page.
28 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_fullinfo.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_FULLINFO 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_fullinfo(const pcre *\fIcode\fP, "const pcre_extra *\fIextra\fP,"
11 | .ti +5n
12 | .B int \fIwhat\fP, void *\fIwhere\fP);
13 | .
14 | .SH DESCRIPTION
15 | .rs
16 | .sp
17 | This function returns information about a compiled pattern. Its arguments are:
18 | .sp
19 | \fIcode\fP Compiled regular expression
20 | \fIextra\fP Result of \fBpcre_study()\fP or NULL
21 | \fIwhat\fP What information is required
22 | \fIwhere\fP Where to put the information
23 | .sp
24 | The following information is available:
25 | .sp
26 | PCRE_INFO_BACKREFMAX Number of highest back reference
27 | PCRE_INFO_CAPTURECOUNT Number of capturing subpatterns
28 | PCRE_INFO_DEFAULT_TABLES Pointer to default tables
29 | PCRE_INFO_FIRSTBYTE Fixed first byte for a match, or
30 | -1 for start of string
31 | or after newline, or
32 | -2 otherwise
33 | PCRE_INFO_FIRSTTABLE Table of first bytes (after studying)
34 | PCRE_INFO_JCHANGED Return 1 if (?J) or (?-J) was used
35 | PCRE_INFO_LASTLITERAL Literal last byte required
36 | PCRE_INFO_NAMECOUNT Number of named subpatterns
37 | PCRE_INFO_NAMEENTRYSIZE Size of name table entry
38 | PCRE_INFO_NAMETABLE Pointer to name table
39 | PCRE_INFO_OKPARTIAL Return 1 if partial matching can be tried
40 | PCRE_INFO_OPTIONS Option bits used for compilation
41 | PCRE_INFO_SIZE Size of compiled pattern
42 | PCRE_INFO_STUDYSIZE Size of study data
43 | .sp
44 | The yield of the function is zero on success or:
45 | .sp
46 | PCRE_ERROR_NULL the argument \fIcode\fP was NULL
47 | the argument \fIwhere\fP was NULL
48 | PCRE_ERROR_BADMAGIC the "magic number" was not found
49 | PCRE_ERROR_BADOPTION the value of \fIwhat\fP was invalid
50 | .P
51 | There is a complete description of the PCRE native API in the
52 | .\" HREF
53 | \fBpcreapi\fP
54 | .\"
55 | page and a description of the POSIX API in the
56 | .\" HREF
57 | \fBpcreposix\fP
58 | .\"
59 | page.
60 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_get_named_substring.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_GET_NAMED_SUBSTRING 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_get_named_substring(const pcre *\fIcode\fP,
11 | .ti +5n
12 | .B const char *\fIsubject\fP, int *\fIovector\fP,
13 | .ti +5n
14 | .B int \fIstringcount\fP, const char *\fIstringname\fP,
15 | .ti +5n
16 | .B const char **\fIstringptr\fP);
17 | .
18 | .SH DESCRIPTION
19 | .rs
20 | .sp
21 | This is a convenience function for extracting a captured substring by name. The
22 | arguments are:
23 | .sp
24 | \fIcode\fP Compiled pattern
25 | \fIsubject\fP Subject that has been successfully matched
26 | \fIovector\fP Offset vector that \fBpcre_exec()\fP used
27 | \fIstringcount\fP Value returned by \fBpcre_exec()\fP
28 | \fIstringname\fP Name of the required substring
29 | \fIstringptr\fP Where to put the string pointer
30 | .sp
31 | The memory in which the substring is placed is obtained by calling
32 | \fBpcre_malloc()\fP. The convenience function \fBpcre_free_substring()\fP can
33 | be used to free it when it is no longer needed. The yield of the function is
34 | the length of the extracted substring, PCRE_ERROR_NOMEMORY if sufficient memory
35 | could not be obtained, or PCRE_ERROR_NOSUBSTRING if the string name is invalid.
36 | .P
37 | There is a complete description of the PCRE native API in the
38 | .\" HREF
39 | \fBpcreapi\fP
40 | .\"
41 | page and a description of the POSIX API in the
42 | .\" HREF
43 | \fBpcreposix\fP
44 | .\"
45 | page.
46 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_get_stringnumber.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_GET_STRINGNUMBER 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_get_stringnumber(const pcre *\fIcode\fP,
11 | .ti +5n
12 | .B const char *\fIname\fP);
13 | .
14 | .SH DESCRIPTION
15 | .rs
16 | .sp
17 | This convenience function finds the number of a named substring capturing
18 | parenthesis in a compiled pattern. Its arguments are:
19 | .sp
20 | \fIcode\fP Compiled regular expression
21 | \fIname\fP Name whose number is required
22 | .sp
23 | The yield of the function is the number of the parenthesis if the name is
24 | found, or PCRE_ERROR_NOSUBSTRING otherwise. When duplicate names are allowed
25 | (PCRE_DUPNAMES is set), it is not defined which of the numbers is returned by
26 | \fBpcre_get_stringnumber()\fP. You can obtain the complete list by calling
27 | \fBpcre_get_stringtable_entries()\fP.
28 | .P
29 | There is a complete description of the PCRE native API in the
30 | .\" HREF
31 | \fBpcreapi\fP
32 | .\"
33 | page and a description of the POSIX API in the
34 | .\" HREF
35 | \fBpcreposix\fP
36 | .\"
37 | page.
38 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_get_stringtable_entries.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_GET_STRINGTABLE_ENTRIES 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_get_stringtable_entries(const pcre *\fIcode\fP,
11 | .ti +5n
12 | .B const char *\fIname\fP, char **\fIfirst\fP, char **\fIlast\fP);
13 | .
14 | .SH DESCRIPTION
15 | .rs
16 | .sp
17 | This convenience function finds, for a compiled pattern, the first and last
18 | entries for a given name in the table that translates capturing parenthesis
19 | names into numbers. When names are required to be unique (PCRE_DUPNAMES is
20 | \fInot\fP set), it is usually easier to use \fBpcre_get_stringnumber()\fP
21 | instead.
22 | .sp
23 | \fIcode\fP Compiled regular expression
24 | \fIname\fP Name whose entries required
25 | \fIfirst\fP Where to return a pointer to the first entry
26 | \fIlast\fP Where to return a pointer to the last entry
27 | .sp
28 | The yield of the function is the length of each entry, or
29 | PCRE_ERROR_NOSUBSTRING if none are found.
30 | .P
31 | There is a complete description of the PCRE native API, including the format of
32 | the table entries, in the
33 | .\" HREF
34 | \fBpcreapi\fP
35 | .\"
36 | page, and a description of the POSIX API in the
37 | .\" HREF
38 | \fBpcreposix\fP
39 | .\"
40 | page.
41 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_get_substring.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_GET_SUBSTRING 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_get_substring(const char *\fIsubject\fP, int *\fIovector\fP,
11 | .ti +5n
12 | .B int \fIstringcount\fP, int \fIstringnumber\fP,
13 | .ti +5n
14 | .B const char **\fIstringptr\fP);
15 | .
16 | .SH DESCRIPTION
17 | .rs
18 | .sp
19 | This is a convenience function for extracting a captured substring. The
20 | arguments are:
21 | .sp
22 | \fIsubject\fP Subject that has been successfully matched
23 | \fIovector\fP Offset vector that \fBpcre_exec()\fP used
24 | \fIstringcount\fP Value returned by \fBpcre_exec()\fP
25 | \fIstringnumber\fP Number of the required substring
26 | \fIstringptr\fP Where to put the string pointer
27 | .sp
28 | The memory in which the substring is placed is obtained by calling
29 | \fBpcre_malloc()\fP. The convenience function \fBpcre_free_substring()\fP can
30 | be used to free it when it is no longer needed. The yield of the function is
31 | the length of the substring, PCRE_ERROR_NOMEMORY if sufficient memory could not
32 | be obtained, or PCRE_ERROR_NOSUBSTRING if the string number is invalid.
33 | .P
34 | There is a complete description of the PCRE native API in the
35 | .\" HREF
36 | \fBpcreapi\fP
37 | .\"
38 | page and a description of the POSIX API in the
39 | .\" HREF
40 | \fBpcreposix\fP
41 | .\"
42 | page.
43 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_get_substring_list.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_GET_SUBSTRING_LIST 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_get_substring_list(const char *\fIsubject\fP,
11 | .ti +5n
12 | .B int *\fIovector\fP, int \fIstringcount\fP, "const char ***\fIlistptr\fP);"
13 | .
14 | .SH DESCRIPTION
15 | .rs
16 | .sp
17 | This is a convenience function for extracting a list of all the captured
18 | substrings. The arguments are:
19 | .sp
20 | \fIsubject\fP Subject that has been successfully matched
21 | \fIovector\fP Offset vector that \fBpcre_exec\fP used
22 | \fIstringcount\fP Value returned by \fBpcre_exec\fP
23 | \fIlistptr\fP Where to put a pointer to the list
24 | .sp
25 | The memory in which the substrings and the list are placed is obtained by
26 | calling \fBpcre_malloc()\fP. The convenience function
27 | \fBpcre_free_substring_list()\fP can be used to free it when it is no longer
28 | needed. A pointer to a list of pointers is put in the variable whose address is
29 | in \fIlistptr\fP. The list is terminated by a NULL pointer. The yield of the
30 | function is zero on success or PCRE_ERROR_NOMEMORY if sufficient memory could
31 | not be obtained.
32 | .P
33 | There is a complete description of the PCRE native API in the
34 | .\" HREF
35 | \fBpcreapi\fP
36 | .\"
37 | page and a description of the POSIX API in the
38 | .\" HREF
39 | \fBpcreposix\fP
40 | .\"
41 | page.
42 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_info.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_INFO 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_info(const pcre *\fIcode\fP, int *\fIoptptr\fP, int
11 | .B *\fIfirstcharptr\fP);
12 | .
13 | .SH DESCRIPTION
14 | .rs
15 | .sp
16 | This function is obsolete. You should be using \fBpcre_fullinfo()\fP instead.
17 | .P
18 | There is a complete description of the PCRE native API in the
19 | .\" HREF
20 | \fBpcreapi\fP
21 | .\"
22 | page and a description of the POSIX API in the
23 | .\" HREF
24 | \fBpcreposix\fP
25 | .\"
26 | page.
27 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_maketables.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_MAKETABLES 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B const unsigned char *pcre_maketables(void);
11 | .
12 | .SH DESCRIPTION
13 | .rs
14 | .sp
15 | This function builds a set of character tables for character values less than
16 | 256. These can be passed to \fBpcre_compile()\fP to override PCRE's internal,
17 | built-in tables (which were made by \fBpcre_maketables()\fP when PCRE was
18 | compiled). You might want to do this if you are using a non-standard locale.
19 | The function yields a pointer to the tables.
20 | .P
21 | There is a complete description of the PCRE native API in the
22 | .\" HREF
23 | \fBpcreapi\fP
24 | .\"
25 | page and a description of the POSIX API in the
26 | .\" HREF
27 | \fBpcreposix\fP
28 | .\"
29 | page.
30 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_refcount.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_REFCOUNT 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B int pcre_refcount(pcre *\fIcode\fP, int \fIadjust\fP);
11 | .
12 | .SH DESCRIPTION
13 | .rs
14 | .sp
15 | This function is used to maintain a reference count inside a data block that
16 | contains a compiled pattern. Its arguments are:
17 | .sp
18 | \fIcode\fP Compiled regular expression
19 | \fIadjust\fP Adjustment to reference value
20 | .sp
21 | The yield of the function is the adjusted reference value, which is constrained
22 | to lie between 0 and 65535.
23 | .P
24 | There is a complete description of the PCRE native API in the
25 | .\" HREF
26 | \fBpcreapi\fP
27 | .\"
28 | page and a description of the POSIX API in the
29 | .\" HREF
30 | \fBpcreposix\fP
31 | .\"
32 | page.
33 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_study.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_STUDY 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B pcre_extra *pcre_study(const pcre *\fIcode\fP, int \fIoptions\fP,
11 | .ti +5n
12 | .B const char **\fIerrptr\fP);
13 | .
14 | .SH DESCRIPTION
15 | .rs
16 | .sp
17 | This function studies a compiled pattern, to see if additional information can
18 | be extracted that might speed up matching. Its arguments are:
19 | .sp
20 | \fIcode\fP A compiled regular expression
21 | \fIoptions\fP Options for \fBpcre_study()\fP
22 | \fIerrptr\fP Where to put an error message
23 | .sp
24 | If the function succeeds, it returns a value that can be passed to
25 | \fBpcre_exec()\fP via its \fIextra\fP argument.
26 | .P
27 | If the function returns NULL, either it could not find any additional
28 | information, or there was an error. You can tell the difference by looking at
29 | the error value. It is NULL in first case.
30 | .P
31 | There are currently no options defined; the value of the second argument should
32 | always be zero.
33 | .P
34 | There is a complete description of the PCRE native API in the
35 | .\" HREF
36 | \fBpcreapi\fP
37 | .\"
38 | page and a description of the POSIX API in the
39 | .\" HREF
40 | \fBpcreposix\fP
41 | .\"
42 | page.
43 |
--------------------------------------------------------------------------------
/pcre/doc/pcre_version.3:
--------------------------------------------------------------------------------
1 | .TH PCRE_VERSION 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH SYNOPSIS
5 | .rs
6 | .sp
7 | .B #include
8 | .PP
9 | .SM
10 | .B char *pcre_version(void);
11 | .
12 | .SH DESCRIPTION
13 | .rs
14 | .sp
15 | This function returns a character string that gives the version number of the
16 | PCRE library and the date of its release.
17 | .P
18 | There is a complete description of the PCRE native API in the
19 | .\" HREF
20 | \fBpcreapi\fP
21 | .\"
22 | page and a description of the POSIX API in the
23 | .\" HREF
24 | \fBpcreposix\fP
25 | .\"
26 | page.
27 |
--------------------------------------------------------------------------------
/pcre/doc/pcresample.3:
--------------------------------------------------------------------------------
1 | .TH PCRESAMPLE 3
2 | .SH NAME
3 | PCRE - Perl-compatible regular expressions
4 | .SH "PCRE SAMPLE PROGRAM"
5 | .rs
6 | .sp
7 | A simple, complete demonstration program, to get you started with using PCRE,
8 | is supplied in the file \fIpcredemo.c\fP in the PCRE distribution.
9 | .P
10 | The program compiles the regular expression that is its first argument, and
11 | matches it against the subject string in its second argument. No PCRE options
12 | are set, and default character tables are used. If matching succeeds, the
13 | program outputs the portion of the subject that matched, together with the
14 | contents of any captured substrings.
15 | .P
16 | If the -g option is given on the command line, the program then goes on to
17 | check for further matches of the same regular expression in the same subject
18 | string. The logic is a little bit tricky because of the possibility of matching
19 | an empty string. Comments in the code explain what is going on.
20 | .P
21 | If PCRE is installed in the standard include and library directories for your
22 | system, you should be able to compile the demonstration program using this
23 | command:
24 | .sp
25 | gcc -o pcredemo pcredemo.c -lpcre
26 | .sp
27 | If PCRE is installed elsewhere, you may need to add additional options to the
28 | command line. For example, on a Unix-like system that has PCRE installed in
29 | \fI/usr/local\fP, you can compile the demonstration program using a command
30 | like this:
31 | .sp
32 | .\" JOINSH
33 | gcc -o pcredemo -I/usr/local/include pcredemo.c \e
34 | -L/usr/local/lib -lpcre
35 | .sp
36 | Once you have compiled the demonstration program, you can run simple tests like
37 | this:
38 | .sp
39 | ./pcredemo 'cat|dog' 'the cat sat on the mat'
40 | ./pcredemo -g 'cat|dog' 'the dog sat on the cat'
41 | .sp
42 | Note that there is a much more comprehensive test program, called
43 | .\" HREF
44 | \fBpcretest\fP,
45 | .\"
46 | which supports many more facilities for testing regular expressions and the
47 | PCRE library. The \fBpcredemo\fP program is provided as a simple coding
48 | example.
49 | .P
50 | On some operating systems (e.g. Solaris), when PCRE is not installed in the
51 | standard library directory, you may get an error like this when you try to run
52 | \fBpcredemo\fP:
53 | .sp
54 | ld.so.1: a.out: fatal: libpcre.so.0: open failed: No such file or directory
55 | .sp
56 | This is caused by the way shared library support works on those systems. You
57 | need to add
58 | .sp
59 | -R/usr/local/lib
60 | .sp
61 | (for example) to the compile command to get round this problem.
62 | .
63 | .
64 | .SH AUTHOR
65 | .rs
66 | .sp
67 | .nf
68 | Philip Hazel
69 | University Computing Service
70 | Cambridge CB2 3QH, England.
71 | .fi
72 | .
73 | .
74 | .SH REVISION
75 | .rs
76 | .sp
77 | .nf
78 | Last updated: 23 January 2008
79 | Copyright (c) 1997-2008 University of Cambridge.
80 | .fi
81 |
--------------------------------------------------------------------------------
/pcre/doc/perltest.txt:
--------------------------------------------------------------------------------
1 | The perltest program
2 | --------------------
3 |
4 | The perltest program tests Perl's regular expressions; it has the same
5 | specification as pcretest, and so can be given identical input, except that
6 | input patterns can be followed only by Perl's lower case modifiers and /+ (as
7 | used by pcretest), which is recognized and handled by the program.
8 |
9 | The data lines are processed as Perl double-quoted strings, so if they contain
10 | " $ or @ characters, these have to be escaped. For this reason, all such
11 | characters in testinput1 and testinput4 are escaped so that they can be used
12 | for perltest as well as for pcretest. The special upper case pattern
13 | modifiers such as /A that pcretest recognizes, and its special data line
14 | escapes, are not used in these files. The output should be identical, apart
15 | from the initial identifying banner.
16 |
17 | The perltest script can also test UTF-8 features. It works as is for Perl 5.8
18 | or higher. It recognizes the special modifier /8 that pcretest uses to invoke
19 | UTF-8 functionality. The testinput4 file can be fed to perltest to run
20 | compatible UTF-8 tests.
21 |
22 | For Perl 5.6, perltest won't work unmodified for the UTF-8 tests. You need to
23 | uncomment the "use utf8" lines that it contains. It is best to do this on a
24 | copy of the script, because for non-UTF-8 tests, these lines should remain
25 | commented out.
26 |
27 | The other testinput files are not suitable for feeding to perltest, since they
28 | make use of the special upper case modifiers and escapes that pcretest uses to
29 | test some features of PCRE. Some of these files also contains malformed regular
30 | expressions, in order to check that PCRE diagnoses them correctly.
31 |
32 | Philip Hazel
33 | September 2004
34 |
--------------------------------------------------------------------------------
/pcre/libpcre-darwin.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alliedmodders/stripper-source/2a08843241f1858d0727a91fa9dcb2382526f8cb/pcre/libpcre-darwin.a
--------------------------------------------------------------------------------
/pcre/libpcre-linux.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alliedmodders/stripper-source/2a08843241f1858d0727a91fa9dcb2382526f8cb/pcre/libpcre-linux.a
--------------------------------------------------------------------------------
/pcre/libpcre-windows.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alliedmodders/stripper-source/2a08843241f1858d0727a91fa9dcb2382526f8cb/pcre/libpcre-windows.lib
--------------------------------------------------------------------------------
/pcre/libpcre.pc.in:
--------------------------------------------------------------------------------
1 | # Package Information for pkg-config
2 |
3 | prefix=@prefix@
4 | exec_prefix=@exec_prefix@
5 | libdir=@libdir@
6 | includedir=@includedir@
7 |
8 | Name: libpcre
9 | Description: PCRE - Perl compatible regular expressions C library
10 | Version: @PACKAGE_VERSION@
11 | Libs: -L${libdir} -lpcre
12 | Cflags: -I${includedir}
13 |
--------------------------------------------------------------------------------
/pcre/libpcrecpp.pc.in:
--------------------------------------------------------------------------------
1 | # Package Information for pkg-config
2 |
3 | prefix=@prefix@
4 | exec_prefix=@exec_prefix@
5 | libdir=@libdir@
6 | includedir=@includedir@
7 |
8 | Name: libpcrecpp
9 | Description: PCRECPP - C++ wrapper for PCRE
10 | Version: @PACKAGE_VERSION@
11 | Libs: -L${libdir} -lpcre -lpcrecpp
12 | Cflags: -I${includedir}
13 |
--------------------------------------------------------------------------------
/pcre/makevp.bat:
--------------------------------------------------------------------------------
1 | :: AH 20-12-06 modified for new PCRE-7.0 and VP/BCC
2 | :: PH 19-03-07 renamed !compile.txt and !linklib.txt as makevp-compile.txt and
3 | :: makevp-linklib.txt
4 | :: PH 26-03-07 re-renamed !compile.txt and !linklib.txt as makevp-c.txt and
5 | :: makevp-l.txt
6 | :: PH 29-03-07 hopefully the final rename to makevp_c and makevp_l
7 | :: AH 27.08.08 updated for new PCRE-7.7
8 | :: required PCRE.H and CONFIG.H will be generated if not existing
9 |
10 | @echo off
11 | echo.
12 | echo Compiling PCRE with BORLAND C++ for VIRTUAL PASCAL
13 | echo.
14 |
15 | REM This file was contributed by Alexander Tokarev for building PCRE for use
16 | REM with Virtual Pascal. It has not been tested with the latest PCRE release.
17 |
18 | REM This file has been modified and extended to compile with newer PCRE releases
19 | REM by Stefan Weber (Angels Holocaust).
20 |
21 | REM CHANGE THIS FOR YOUR BORLAND C++ COMPILER PATH
22 | SET BORLAND=f:\bcc
23 | REM location of the TASM binaries, if compiling with the -B BCC switch
24 | SET TASM=f:\tasm
25 |
26 | SET PATH=%PATH%;%BORLAND%\bin;%TASM%\bin
27 | SET PCRE_VER=77
28 | SET COMPILE_DEFAULTS=-DHAVE_CONFIG_H -DPCRE_STATIC -I%BORLAND%\include
29 |
30 | del pcre%PCRE_VER%.lib >nul 2>nul
31 |
32 | :: sh configure
33 |
34 | :: check for needed header files
35 | if not exist pcre.h copy pcre.h.generic pcre.h
36 | if not exist config.h copy config.h.generic config.h
37 |
38 | bcc32 -DDFTABLES %COMPILE_DEFAULTS% -L%BORLAND%\lib dftables.c
39 | IF ERRORLEVEL 1 GOTO ERROR
40 |
41 | :: dftables > chartables.c
42 | dftables pcre_chartables.c
43 |
44 | REM compile and link the PCRE library into lib: option -B for ASM compile works too
45 | bcc32 -a4 -c -RT- -y- -v- -u- -R- -Q- -X -d -fp -ff -P- -O2 -Oc -Ov -3 -w-8004 -w-8064 -w-8065 -w-8012 -UDFTABLES -DVPCOMPAT %COMPILE_DEFAULTS% @makevp_c.txt
46 | IF ERRORLEVEL 1 GOTO ERROR
47 |
48 | tlib %BORLAND%\lib\cw32.lib *calloc *del *strncmp *memcpy *memmove *memset *memcmp *strlen
49 | IF ERRORLEVEL 1 GOTO ERROR
50 | tlib pcre%PCRE_VER%.lib @makevp_l.txt +calloc.obj +del.obj +strncmp.obj +memcpy.obj +memmove.obj +memset.obj +memcmp.obj +strlen.obj
51 | IF ERRORLEVEL 1 GOTO ERROR
52 |
53 | del *.obj *.tds *.bak >nul 2>nul
54 |
55 | echo ---
56 | echo Now the library should be complete. Please check all messages above.
57 | echo Don't care for warnings, it's OK.
58 | goto END
59 |
60 | :ERROR
61 | echo ---
62 | echo Error while compiling PCRE. Aborting...
63 | pause
64 | goto END
65 |
66 | :END
67 |
--------------------------------------------------------------------------------
/pcre/makevp_c.txt:
--------------------------------------------------------------------------------
1 | pcre_chartables.c
2 | pcre_compile.c
3 | pcre_config.c
4 | pcre_dfa_exec.c
5 | pcre_exec.c
6 | pcre_fullinfo.c
7 | pcre_get.c
8 | pcre_globals.c
9 | pcre_info.c
10 | pcre_maketables.c
11 | pcre_newline.c
12 | pcre_ord2utf8.c
13 | pcre_refcount.c
14 | pcre_study.c
15 | pcre_tables.c
16 | pcre_try_flipped.c
17 | pcre_ucd.c
18 | pcre_valid_utf8.c
19 | pcre_version.c
20 | pcre_xclass.c
21 |
--------------------------------------------------------------------------------
/pcre/makevp_l.txt:
--------------------------------------------------------------------------------
1 | +pcre_chartables.obj &
2 | +pcre_compile.obj &
3 | +pcre_config.obj &
4 | +pcre_dfa_exec.obj &
5 | +pcre_exec.obj &
6 | +pcre_fullinfo.obj &
7 | +pcre_get.obj &
8 | +pcre_globals.obj &
9 | +pcre_info.obj &
10 | +pcre_maketables.obj &
11 | +pcre_newline.obj &
12 | +pcre_ord2utf8.obj &
13 | +pcre_refcount.obj &
14 | +pcre_study.obj &
15 | +pcre_tables.obj &
16 | +pcre_try_flipped.obj &
17 | +pcre_ucd.obj &
18 | +pcre_valid_utf8.obj &
19 | +pcre_version.obj &
20 | +pcre_xclass.obj
21 |
--------------------------------------------------------------------------------
/pcre/pcre-config.in:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | prefix=@prefix@
4 | exec_prefix=@exec_prefix@
5 | exec_prefix_set=no
6 |
7 | usage="\
8 | Usage: pcre-config [--prefix] [--exec-prefix] [--version] [--libs] [--libs-posix] [--cflags] [--cflags-posix]"
9 |
10 | if test $# -eq 0; then
11 | echo "${usage}" 1>&2
12 | exit 1
13 | fi
14 |
15 | libR=
16 | case `uname -s` in
17 | *SunOS*)
18 | libR=" -R@libdir@"
19 | ;;
20 | *BSD*)
21 | libR=" -Wl,-R@libdir@"
22 | ;;
23 | esac
24 |
25 | while test $# -gt 0; do
26 | case "$1" in
27 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
28 | *) optarg= ;;
29 | esac
30 |
31 | case $1 in
32 | --prefix=*)
33 | prefix=$optarg
34 | if test $exec_prefix_set = no ; then
35 | exec_prefix=$optarg
36 | fi
37 | ;;
38 | --prefix)
39 | echo $prefix
40 | ;;
41 | --exec-prefix=*)
42 | exec_prefix=$optarg
43 | exec_prefix_set=yes
44 | ;;
45 | --exec-prefix)
46 | echo $exec_prefix
47 | ;;
48 | --version)
49 | echo @PACKAGE_VERSION@
50 | ;;
51 | --cflags | --cflags-posix)
52 | if test @includedir@ != /usr/include ; then
53 | includes=-I@includedir@
54 | fi
55 | echo $includes
56 | ;;
57 | --libs-posix)
58 | echo -L@libdir@$libR -lpcreposix -lpcre
59 | ;;
60 | --libs)
61 | echo -L@libdir@$libR -lpcre
62 | ;;
63 | *)
64 | echo "${usage}" 1>&2
65 | exit 1
66 | ;;
67 | esac
68 | shift
69 | done
70 |
--------------------------------------------------------------------------------
/pcre/pcre_config.c:
--------------------------------------------------------------------------------
1 | /*************************************************
2 | * Perl-Compatible Regular Expressions *
3 | *************************************************/
4 |
5 | /* PCRE is a library of functions to support regular expressions whose syntax
6 | and semantics are as close as possible to those of the Perl 5 language.
7 |
8 | Written by Philip Hazel
9 | Copyright (c) 1997-2009 University of Cambridge
10 |
11 | -----------------------------------------------------------------------------
12 | Redistribution and use in source and binary forms, with or without
13 | modification, are permitted provided that the following conditions are met:
14 |
15 | * Redistributions of source code must retain the above copyright notice,
16 | this list of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright
19 | notice, this list of conditions and the following disclaimer in the
20 | documentation and/or other materials provided with the distribution.
21 |
22 | * Neither the name of the University of Cambridge nor the names of its
23 | contributors may be used to endorse or promote products derived from
24 | this software without specific prior written permission.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 | POSSIBILITY OF SUCH DAMAGE.
37 | -----------------------------------------------------------------------------
38 | */
39 |
40 |
41 | /* This module contains the external function pcre_config(). */
42 |
43 |
44 | #ifdef HAVE_CONFIG_H
45 | #include "config.h"
46 | #endif
47 |
48 | #include "pcre_internal.h"
49 |
50 |
51 | /*************************************************
52 | * Return info about what features are configured *
53 | *************************************************/
54 |
55 | /* This function has an extensible interface so that additional items can be
56 | added compatibly.
57 |
58 | Arguments:
59 | what what information is required
60 | where where to put the information
61 |
62 | Returns: 0 if data returned, negative on error
63 | */
64 |
65 | PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
66 | pcre_config(int what, void *where)
67 | {
68 | switch (what)
69 | {
70 | case PCRE_CONFIG_UTF8:
71 | #ifdef SUPPORT_UTF8
72 | *((int *)where) = 1;
73 | #else
74 | *((int *)where) = 0;
75 | #endif
76 | break;
77 |
78 | case PCRE_CONFIG_UNICODE_PROPERTIES:
79 | #ifdef SUPPORT_UCP
80 | *((int *)where) = 1;
81 | #else
82 | *((int *)where) = 0;
83 | #endif
84 | break;
85 |
86 | case PCRE_CONFIG_NEWLINE:
87 | *((int *)where) = NEWLINE;
88 | break;
89 |
90 | case PCRE_CONFIG_BSR:
91 | #ifdef BSR_ANYCRLF
92 | *((int *)where) = 1;
93 | #else
94 | *((int *)where) = 0;
95 | #endif
96 | break;
97 |
98 | case PCRE_CONFIG_LINK_SIZE:
99 | *((int *)where) = LINK_SIZE;
100 | break;
101 |
102 | case PCRE_CONFIG_POSIX_MALLOC_THRESHOLD:
103 | *((int *)where) = POSIX_MALLOC_THRESHOLD;
104 | break;
105 |
106 | case PCRE_CONFIG_MATCH_LIMIT:
107 | *((unsigned long int *)where) = MATCH_LIMIT;
108 | break;
109 |
110 | case PCRE_CONFIG_MATCH_LIMIT_RECURSION:
111 | *((unsigned long int *)where) = MATCH_LIMIT_RECURSION;
112 | break;
113 |
114 | case PCRE_CONFIG_STACKRECURSE:
115 | #ifdef NO_RECURSE
116 | *((int *)where) = 0;
117 | #else
118 | *((int *)where) = 1;
119 | #endif
120 | break;
121 |
122 | default: return PCRE_ERROR_BADOPTION;
123 | }
124 |
125 | return 0;
126 | }
127 |
128 | /* End of pcre_config.c */
129 |
--------------------------------------------------------------------------------
/pcre/pcre_globals.c:
--------------------------------------------------------------------------------
1 | /*************************************************
2 | * Perl-Compatible Regular Expressions *
3 | *************************************************/
4 |
5 | /* PCRE is a library of functions to support regular expressions whose syntax
6 | and semantics are as close as possible to those of the Perl 5 language.
7 |
8 | Written by Philip Hazel
9 | Copyright (c) 1997-2008 University of Cambridge
10 |
11 | -----------------------------------------------------------------------------
12 | Redistribution and use in source and binary forms, with or without
13 | modification, are permitted provided that the following conditions are met:
14 |
15 | * Redistributions of source code must retain the above copyright notice,
16 | this list of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright
19 | notice, this list of conditions and the following disclaimer in the
20 | documentation and/or other materials provided with the distribution.
21 |
22 | * Neither the name of the University of Cambridge nor the names of its
23 | contributors may be used to endorse or promote products derived from
24 | this software without specific prior written permission.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 | POSSIBILITY OF SUCH DAMAGE.
37 | -----------------------------------------------------------------------------
38 | */
39 |
40 |
41 | /* This module contains global variables that are exported by the PCRE library.
42 | PCRE is thread-clean and doesn't use any global variables in the normal sense.
43 | However, it calls memory allocation and freeing functions via the four
44 | indirections below, and it can optionally do callouts, using the fifth
45 | indirection. These values can be changed by the caller, but are shared between
46 | all threads. However, when compiling for Virtual Pascal, things are done
47 | differently, and global variables are not used (see pcre.in). */
48 |
49 | #ifdef HAVE_CONFIG_H
50 | #include "config.h"
51 | #endif
52 |
53 | #include "pcre_internal.h"
54 |
55 | #ifndef VPCOMPAT
56 | PCRE_EXP_DATA_DEFN void *(*pcre_malloc)(size_t) = malloc;
57 | PCRE_EXP_DATA_DEFN void (*pcre_free)(void *) = free;
58 | PCRE_EXP_DATA_DEFN void *(*pcre_stack_malloc)(size_t) = malloc;
59 | PCRE_EXP_DATA_DEFN void (*pcre_stack_free)(void *) = free;
60 | PCRE_EXP_DATA_DEFN int (*pcre_callout)(pcre_callout_block *) = NULL;
61 | #endif
62 |
63 | /* End of pcre_globals.c */
64 |
--------------------------------------------------------------------------------
/pcre/pcre_info.c:
--------------------------------------------------------------------------------
1 | /*************************************************
2 | * Perl-Compatible Regular Expressions *
3 | *************************************************/
4 |
5 | /* PCRE is a library of functions to support regular expressions whose syntax
6 | and semantics are as close as possible to those of the Perl 5 language.
7 |
8 | Written by Philip Hazel
9 | Copyright (c) 1997-2009 University of Cambridge
10 |
11 | -----------------------------------------------------------------------------
12 | Redistribution and use in source and binary forms, with or without
13 | modification, are permitted provided that the following conditions are met:
14 |
15 | * Redistributions of source code must retain the above copyright notice,
16 | this list of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright
19 | notice, this list of conditions and the following disclaimer in the
20 | documentation and/or other materials provided with the distribution.
21 |
22 | * Neither the name of the University of Cambridge nor the names of its
23 | contributors may be used to endorse or promote products derived from
24 | this software without specific prior written permission.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 | POSSIBILITY OF SUCH DAMAGE.
37 | -----------------------------------------------------------------------------
38 | */
39 |
40 |
41 | /* This module contains the external function pcre_info(), which gives some
42 | information about a compiled pattern. However, use of this function is now
43 | deprecated, as it has been superseded by pcre_fullinfo(). */
44 |
45 |
46 | #ifdef HAVE_CONFIG_H
47 | #include "config.h"
48 | #endif
49 |
50 | #include "pcre_internal.h"
51 |
52 |
53 | /*************************************************
54 | * (Obsolete) Return info about compiled pattern *
55 | *************************************************/
56 |
57 | /* This is the original "info" function. It picks potentially useful data out
58 | of the private structure, but its interface was too rigid. It remains for
59 | backwards compatibility. The public options are passed back in an int - though
60 | the re->options field has been expanded to a long int, all the public options
61 | at the low end of it, and so even on 16-bit systems this will still be OK.
62 | Therefore, I haven't changed the API for pcre_info().
63 |
64 | Arguments:
65 | argument_re points to compiled code
66 | optptr where to pass back the options
67 | first_byte where to pass back the first character,
68 | or -1 if multiline and all branches start ^,
69 | or -2 otherwise
70 |
71 | Returns: number of capturing subpatterns
72 | or negative values on error
73 | */
74 |
75 | PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
76 | pcre_info(const pcre *argument_re, int *optptr, int *first_byte)
77 | {
78 | real_pcre internal_re;
79 | const real_pcre *re = (const real_pcre *)argument_re;
80 | if (re == NULL) return PCRE_ERROR_NULL;
81 | if (re->magic_number != MAGIC_NUMBER)
82 | {
83 | re = _pcre_try_flipped(re, &internal_re, NULL, NULL);
84 | if (re == NULL) return PCRE_ERROR_BADMAGIC;
85 | }
86 | if (optptr != NULL) *optptr = (int)(re->options & PUBLIC_COMPILE_OPTIONS);
87 | if (first_byte != NULL)
88 | *first_byte = ((re->flags & PCRE_FIRSTSET) != 0)? re->first_byte :
89 | ((re->flags & PCRE_STARTLINE) != 0)? -1 : -2;
90 | return re->top_bracket;
91 | }
92 |
93 | /* End of pcre_info.c */
94 |
--------------------------------------------------------------------------------
/pcre/pcre_ord2utf8.c:
--------------------------------------------------------------------------------
1 | /*************************************************
2 | * Perl-Compatible Regular Expressions *
3 | *************************************************/
4 |
5 | /* PCRE is a library of functions to support regular expressions whose syntax
6 | and semantics are as close as possible to those of the Perl 5 language.
7 |
8 | Written by Philip Hazel
9 | Copyright (c) 1997-2008 University of Cambridge
10 |
11 | -----------------------------------------------------------------------------
12 | Redistribution and use in source and binary forms, with or without
13 | modification, are permitted provided that the following conditions are met:
14 |
15 | * Redistributions of source code must retain the above copyright notice,
16 | this list of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright
19 | notice, this list of conditions and the following disclaimer in the
20 | documentation and/or other materials provided with the distribution.
21 |
22 | * Neither the name of the University of Cambridge nor the names of its
23 | contributors may be used to endorse or promote products derived from
24 | this software without specific prior written permission.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 | POSSIBILITY OF SUCH DAMAGE.
37 | -----------------------------------------------------------------------------
38 | */
39 |
40 |
41 | /* This file contains a private PCRE function that converts an ordinal
42 | character value into a UTF8 string. */
43 |
44 | #ifdef HAVE_CONFIG_H
45 | #include "config.h"
46 | #endif
47 |
48 | #include "pcre_internal.h"
49 |
50 |
51 | /*************************************************
52 | * Convert character value to UTF-8 *
53 | *************************************************/
54 |
55 | /* This function takes an integer value in the range 0 - 0x7fffffff
56 | and encodes it as a UTF-8 character in 0 to 6 bytes.
57 |
58 | Arguments:
59 | cvalue the character value
60 | buffer pointer to buffer for result - at least 6 bytes long
61 |
62 | Returns: number of characters placed in the buffer
63 | */
64 |
65 | int
66 | _pcre_ord2utf8(int cvalue, uschar *buffer)
67 | {
68 | #ifdef SUPPORT_UTF8
69 | register int i, j;
70 | for (i = 0; i < _pcre_utf8_table1_size; i++)
71 | if (cvalue <= _pcre_utf8_table1[i]) break;
72 | buffer += i;
73 | for (j = i; j > 0; j--)
74 | {
75 | *buffer-- = 0x80 | (cvalue & 0x3f);
76 | cvalue >>= 6;
77 | }
78 | *buffer = _pcre_utf8_table2[i] | cvalue;
79 | return i + 1;
80 | #else
81 | (void)(cvalue); /* Keep compiler happy; this function won't ever be */
82 | (void)(buffer); /* called when SUPPORT_UTF8 is not defined. */
83 | return 0;
84 | #endif
85 | }
86 |
87 | /* End of pcre_ord2utf8.c */
88 |
--------------------------------------------------------------------------------
/pcre/pcre_refcount.c:
--------------------------------------------------------------------------------
1 | /*************************************************
2 | * Perl-Compatible Regular Expressions *
3 | *************************************************/
4 |
5 | /* PCRE is a library of functions to support regular expressions whose syntax
6 | and semantics are as close as possible to those of the Perl 5 language.
7 |
8 | Written by Philip Hazel
9 | Copyright (c) 1997-2008 University of Cambridge
10 |
11 | -----------------------------------------------------------------------------
12 | Redistribution and use in source and binary forms, with or without
13 | modification, are permitted provided that the following conditions are met:
14 |
15 | * Redistributions of source code must retain the above copyright notice,
16 | this list of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright
19 | notice, this list of conditions and the following disclaimer in the
20 | documentation and/or other materials provided with the distribution.
21 |
22 | * Neither the name of the University of Cambridge nor the names of its
23 | contributors may be used to endorse or promote products derived from
24 | this software without specific prior written permission.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 | POSSIBILITY OF SUCH DAMAGE.
37 | -----------------------------------------------------------------------------
38 | */
39 |
40 |
41 | /* This module contains the external function pcre_refcount(), which is an
42 | auxiliary function that can be used to maintain a reference count in a compiled
43 | pattern data block. This might be helpful in applications where the block is
44 | shared by different users. */
45 |
46 |
47 | #ifdef HAVE_CONFIG_H
48 | #include "config.h"
49 | #endif
50 |
51 | #include "pcre_internal.h"
52 |
53 |
54 | /*************************************************
55 | * Maintain reference count *
56 | *************************************************/
57 |
58 | /* The reference count is a 16-bit field, initialized to zero. It is not
59 | possible to transfer a non-zero count from one host to a different host that
60 | has a different byte order - though I can't see why anyone in their right mind
61 | would ever want to do that!
62 |
63 | Arguments:
64 | argument_re points to compiled code
65 | adjust value to add to the count
66 |
67 | Returns: the (possibly updated) count value (a non-negative number), or
68 | a negative error number
69 | */
70 |
71 | PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
72 | pcre_refcount(pcre *argument_re, int adjust)
73 | {
74 | real_pcre *re = (real_pcre *)argument_re;
75 | if (re == NULL) return PCRE_ERROR_NULL;
76 | re->ref_count = (-adjust > re->ref_count)? 0 :
77 | (adjust + re->ref_count > 65535)? 65535 :
78 | re->ref_count + adjust;
79 | return re->ref_count;
80 | }
81 |
82 | /* End of pcre_refcount.c */
83 |
--------------------------------------------------------------------------------
/pcre/pcre_stringpiece.cc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2005, Google Inc.
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above
11 | // copyright notice, this list of conditions and the following disclaimer
12 | // in the documentation and/or other materials provided with the
13 | // distribution.
14 | // * Neither the name of Google Inc. nor the names of its
15 | // contributors may be used to endorse or promote products derived from
16 | // this software without specific prior written permission.
17 | //
18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 | //
30 | // Author: wilsonh@google.com (Wilson Hsieh)
31 | //
32 |
33 | #ifdef HAVE_CONFIG_H
34 | #include "config.h"
35 | #endif
36 |
37 | #include
38 | #include "pcrecpp_internal.h"
39 | #include "pcre_stringpiece.h"
40 |
41 | std::ostream& operator<<(std::ostream& o, const pcrecpp::StringPiece& piece) {
42 | return (o << piece.as_string());
43 | }
44 |
--------------------------------------------------------------------------------
/pcre/pcre_stringpiece_unittest.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2003 and onwards Google Inc.
2 | // Author: Sanjay Ghemawat
3 |
4 | #ifdef HAVE_CONFIG_H
5 | #include "config.h"
6 | #endif
7 |
8 | #include
9 | #include