Add -pcreversion option to display PCRE version information

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12239 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2010-10-01 23:52:46 +00:00
commit 766ed8db37
5 changed files with 20 additions and 0 deletions

View file

@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 2.0.1 (in progress)
===========================
2010-10-01: wsfulton
Add -pcreversion option to display PCRE version information.
2010-10-01: olly
[Ruby] Avoid segfault when a method node has no parentNode
(SF#3034054).

View file

@ -147,6 +147,7 @@ can be obtained by typing <tt>swig -help</tt> or <tt>swig
-o <em>outfile</em> Name of output file
-outcurrentdir Set default output dir to current dir instead of input file's path
-outdir <em>dir</em> Set language specific files output directory
-pcreversion Display PCRE version information
-swiglib Show location of SWIG library
-version Show SWIG version number

View file

@ -129,6 +129,7 @@ static const char *usage3 = (const char *) "\
-oh <headfile> - Set name of the output header file to <headfile>\n\
-outcurrentdir - Set default output dir to current dir instead of input file's path\n\
-outdir <dir> - Set language specific files output directory to <dir>\n\
-pcreversion - Display PCRE version information\n\
-small - Compile in virtual elimination & compact mode\n\
-swiglib - Report location of SWIG library and exit\n\
-templatereduce - Reduce all the typedefs in templates\n\
@ -515,6 +516,12 @@ void SWIG_getoptions(int argc, char *argv[]) {
} else if (strcmp(argv[i], "-nodirprot") == 0) {
Wrapper_director_protected_mode_set(0);
Swig_mark_arg(i);
} else if (strcmp(argv[i], "-pcreversion") == 0) {
String *version = Swig_pcre_version();
Printf(stdout, "%s\n", version);
Delete(version);
Swig_mark_arg(i);
SWIG_exit(EXIT_SUCCESS);
} else if (strcmp(argv[i], "-small") == 0) {
Wrapper_compact_print_mode_set(1);
Wrapper_virtual_elimination_mode_set(1);

View file

@ -1213,6 +1213,10 @@ String *Swig_string_regex(String *s) {
return res ? res : NewStringEmpty();
}
String *Swig_pcre_version(void) {
return NewStringf("PCRE Version: %s", pcre_version());
}
#else
String *Swig_string_regex(String *s) {
@ -1220,6 +1224,10 @@ String *Swig_string_regex(String *s) {
exit(1);
}
String *Swig_pcre_version(void) {
return NewStringf("PCRE not used");
}
#endif
/* -----------------------------------------------------------------------------

View file

@ -319,6 +319,7 @@ extern int ParmList_is_compactdefargs(ParmList *p);
extern String *Swig_string_lower(String *s);
extern String *Swig_string_upper(String *s);
extern String *Swig_string_title(String *s);
extern String *Swig_pcre_version(void);
extern void Swig_init(void);
extern int Swig_value_wrapper_mode(int mode);