git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@103 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-01-18 21:54:05 +00:00
commit 4dda9f6ce3
23 changed files with 419 additions and 419 deletions

View file

@ -13,7 +13,7 @@
* can be used and distributed.
*******************************************************************************/
#include "swig.h"
#include "swig11.h"
#include "ascii.h"
#include <ctype.h>

View file

@ -23,7 +23,7 @@ static char cvsroot[] = "$Header$";
* Definitions for adding functions to Guile 3.0
***********************************************************************/
#include "swig.h"
#include "swig11.h"
#include "guile.h"
static char *guile_usage = "\
@ -55,7 +55,7 @@ void GUILE::parse_args(int argc, char *argv[]) {
}
// Add a symbol for this module
SWIG_cpp_define((void *) "SWIGGUILE",0);
Preprocessor_define((void *) "SWIGGUILE",0);
// Set name of typemaps

View file

@ -15,7 +15,7 @@
static char cvsroot[] = "$Header$";
#include "swig.h"
#include "swig11.h"
#include "html.h"
/*******************************************************************************

View file

@ -23,7 +23,7 @@
#include <ctype.h>
#include "swig.h"
#include "swig11.h"
#include "java.h"
char bigbuf[1024];
@ -301,36 +301,36 @@ void JAVA::parse_args(int argc, char *argv[]) {
if (strcmp(argv[i],"-module") == 0) {
if (argv[i+1]) {
set_module(argv[i+1],0);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-package") == 0) {
if (argv[i+1]) {
package = new char[strlen(argv[i+1])+1];
strcpy(package, argv[i+1]);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-shadow") == 0) {
SWIG_mark_arg(i);
Swig_mark_arg(i);
shadow = 1;
} else if (strcmp(argv[i],"-jnic") == 0) {
SWIG_mark_arg(i);
Swig_mark_arg(i);
jnic = 1;
} else if (strcmp(argv[i],"-finalize") == 0) {
SWIG_mark_arg(i);
Swig_mark_arg(i);
finalize = 1;
} else if (strcmp(argv[i],"-rn") == 0) {
SWIG_mark_arg(i);
Swig_mark_arg(i);
useRegisterNatives = 1;
} else if (strcmp(argv[i],"-jnicpp") == 0) {
SWIG_mark_arg(i);
Swig_mark_arg(i);
jnic = 0;
} else if (strcmp(argv[i],"-help") == 0) {
fprintf(stderr,"%s\n", usage);
@ -346,7 +346,7 @@ void JAVA::parse_args(int argc, char *argv[]) {
// Add a symbol to the parser for conditional compilation
// cpp::define("SWIGJAVA");
SWIG_cpp_define((void *) "SWIGJAVA 1",0);
Preprocessor_define((void *) "SWIGJAVA 1",0);
// Add typemap definitions
typemap_lang = "java";

View file

@ -85,7 +85,7 @@ static char cvsroot[] = "$Header$";
* loading into Perl.
***********************************************************************/
#include "swig.h"
#include "swig11.h"
#include "perl5.h"
static String pragma_include;
@ -127,11 +127,11 @@ PERL5::parse_args(int argc, char *argv[]) {
if (argv[i+1]) {
package = new char[strlen(argv[i+1])+1];
strcpy(package, argv[i+1]);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-module") == 0) {
if (argv[i+1]) {
@ -139,21 +139,21 @@ PERL5::parse_args(int argc, char *argv[]) {
strcpy(module, argv[i+1]);
cmodule = module;
cmodule.replace(":","_");
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-exportall") == 0) {
export_all = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-static") == 0) {
is_static = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-shadow") == 0) {
blessed = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-hide") == 0) {
if (argv[i+1]) {
hide = new char[strlen(argv[i+1])+1];
@ -161,24 +161,24 @@ PERL5::parse_args(int argc, char *argv[]) {
chide = hide;
chide.replace(":","_");
hidden = 1;
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-alt-header") == 0) {
if (argv[i+1]) {
alt_header = copy_string(argv[i+1]);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-compat") == 0) {
compat = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-help") == 0) {
fputs(usage,stderr);
}
@ -186,8 +186,8 @@ PERL5::parse_args(int argc, char *argv[]) {
}
// Add a symbol for this module
SWIG_cpp_define((void *) "SWIGPERL 1", 0);
SWIG_cpp_define((void *) "SWIGPERL5 1", 0);
Preprocessor_define((void *) "SWIGPERL 1", 0);
Preprocessor_define((void *) "SWIGPERL5 1", 0);
// Set name of typemaps

View file

@ -25,7 +25,7 @@ static char cvsroot[] = "$Header$";
**************************************************************************/
#include "swig.h"
#include "swig11.h"
#include "python.h"
static String *setattr;

View file

@ -24,7 +24,7 @@ static char cvsroot[] = "$Header$";
**************************************************************************/
#include "swig.h"
#include "swig11.h"
#include "python.h"
// Structures for managing doc strings
@ -68,38 +68,38 @@ void PYTHON::parse_args(int argc, char *argv[]) {
if (argv[i+1]) {
module = new char[strlen(argv[i+1])+2];
strcpy(module, argv[i+1]);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i+=1;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-globals") == 0) {
if (argv[i+1]) {
global_name = new char[strlen(argv[i+1])+1];
strcpy(global_name, argv[i+1]);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-shadow") == 0) {
shadow = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-docstring") == 0) {
docstring = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-keyword") == 0) {
use_kw = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-help") == 0) {
fputs(usage,stderr);
}
}
}
// Create a symbol for this language
SWIG_cpp_define((void *) "SWIGPYTHON", 0);
Preprocessor_define((void *) "SWIGPYTHON", 0);
// Set name of typemaps

View file

@ -81,7 +81,7 @@ int Mac_main(int argc, char **argv) {
Documentation *dd = new SWIG_DOC;
extern int SWIG_main(int, char **, Language *, Documentation *);
SWIG_init_args(argc,argv);
Swig_init_args(argc,argv);
// Get options
for (i = 1; i < argc; i++) {
@ -89,34 +89,34 @@ int Mac_main(int argc, char **argv) {
if(strcmp(argv[i],"-tcl") == 0) {
fprintf(stderr,"swig: -tcl option now implies -tcl8\n");
dl = new TCL8;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-tcl8") == 0) {
dl = new TCL8;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-perl5") == 0) {
dl = new PERL5;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-python") == 0) {
dl = new PYTHON;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-guile") == 0) {
dl = new GUILE;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-java") == 0) {
dl = new JAVA;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-dascii") == 0) {
dd = new ASCII;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-dnone") == 0) {
dd = new NODOC;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-dhtml") == 0) {
dd = new HTML;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-help") == 0) {
fputs(usage,stderr);
SWIG_mark_arg(i);
Swig_mark_arg(i);
}
}
}

View file

@ -23,7 +23,7 @@ static char cvsroot[] = "$Header$";
* Module for creating Tcl 8.0 native wrapper functions.
***********************************************************************/
#include "swig.h"
#include "swig11.h"
#include "tcl8.h"
#include <ctype.h>
@ -62,30 +62,30 @@ void TCL8::parse_args(int argc, char *argv[]) {
if (argv[i+1]) {
prefix = new char[strlen(argv[i+1])+2];
strcpy(prefix, argv[i+1]);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-module") == 0) {
if (argv[i+1]) {
set_module(argv[i+1],0);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-namespace") == 0) {
nspace = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-old") == 0) {
shadow = 0;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-noobject") == 0) {
shadow = 0;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-help") == 0) {
fputs(usage,stderr);
}
@ -105,8 +105,8 @@ void TCL8::parse_args(int argc, char *argv[]) {
// Create a symbol SWIGTCL
SWIG_cpp_define((void *) "SWIGTCL 1",0);
SWIG_cpp_define((void *) "SWIGTCL8 1", 0);
Preprocessor_define((void *) "SWIGTCL 1",0);
Preprocessor_define((void *) "SWIGTCL8 1", 0);
// Set name of typemaps

View file

@ -18,7 +18,7 @@
* wrap.h
***********************************************************************/
#include "swig.h"
#include "swig11.h"
#ifndef SWIG_LIB
#define SWIG_LIB = "./swig_lib"

View file

@ -583,61 +583,61 @@ void CommentHandler::parse_args(int argc, char **argv) {
if (argv[i]) {
if (strcmp(argv[i],"-Sbefore") == 0) {
this->style("before",0);
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-Safter") == 0) {
this->style("after",0);
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-Schop_top") == 0) {
if (argv[i+1]) {
this->style("chop_top",argv[i+1]);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-Schop_bottom") == 0) {
if (argv[i+1]) {
this->style("chop_bottom",argv[i+1]);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-Schop_left") == 0) {
if (argv[i+1]) {
this->style("chop_left",argv[i+1]);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-Schop_right") == 0) {
if (argv[i+1]) {
this->style("chop_right",argv[i+1]);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-Sskip") == 0) {
if (argv[i+1]) {
this->style("skip",argv[i+1]);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-Suntabify") == 0) {
this->style("untabify",0);
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-Stabify") == 0) {
this->style("tabify",0);
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-Signore") == 0) {
this->style("ignore",0);
} else if (strcmp(argv[i],"-help") == 0) {

View file

@ -20,7 +20,7 @@ static char cvsroot[] = "$Header$";
#include <stdio.h>
#include <ctype.h>
extern "C" FILE *SWIG_open(void *);
extern "C" FILE *Swig_open(void *);
/*******************************************************************************
* $Header$
@ -105,7 +105,7 @@ void copy_data(FILE *f1, String &s2) {
// -----------------------------------------------------------------------------
int insert_file(char *name, FILE *f_out) {
FILE *f;
f = SWIG_open((void *) name);
f = Swig_open((void *) name);
if (f) {
copy_data(f,f_out);
return 0;
@ -136,7 +136,7 @@ void swig_append(char *filename, FILE *f) {
// -----------------------------------------------------------------------------
int get_file(char *name, String &str) {
FILE *f;
f = SWIG_open((void *) name);
f = Swig_open((void *) name);
if (!f) {
fprintf(stderr,"SWIG Error. Unable to find %s. Possible installation problem.\n",name);
FatalError();

View file

@ -23,7 +23,7 @@
*
***********************************************************************/
#include "swig.h"
#include "swig11.h"
// -------------------------------------------------------------------
// class DocTitle : public DocEntry

View file

@ -31,7 +31,7 @@ static char cvsroot[] = "$Header$";
#include <stdio.h>
#include <ctype.h>
#include "swigcpp.h"
#include "preprocessor.h"
class SwigException {};
@ -104,7 +104,7 @@ int SWIG_main(int argc, char *argv[], Language *l, Documentation *d) {
#endif
// Initialize the preprocessor
SWIG_cpp_init();
Preprocessor_init();
f_wrappers = 0;
f_init = 0;
@ -122,12 +122,12 @@ int SWIG_main(int argc, char *argv[], Language *l, Documentation *d) {
// Set up some default symbols (available in both SWIG interface files
// and C files)
SWIG_cpp_define((DOH *) "SWIG 1", 0);
Preprocessor_define((DOH *) "SWIG 1", 0);
#ifdef MACSWIG
SWIG_cpp_define((DOH *) "SWIGMAC 1", 0);
Preprocessor_define((DOH *) "SWIGMAC 1", 0);
#endif
#ifdef SWIGWIN32
SWIG_cpp_define((DOH *) "SWIGWIN32 1", 0);
Preprocessor_define((DOH *) "SWIGWIN32 1", 0);
#endif
// Check for SWIG_LIB environment variable
@ -149,10 +149,10 @@ int SWIG_main(int argc, char *argv[], Language *l, Documentation *d) {
#else
sprintf(temp,"%s/config", LibDir);
SWIG_add_directory((DOH *) temp);
SWIG_add_directory((DOH *) "./swig_lib/config");
SWIG_add_directory((DOH *) LibDir);
SWIG_add_directory((DOH *) "./swig_lib");
Swig_add_directory((DOH *) temp);
Swig_add_directory((DOH *) "./swig_lib/config");
Swig_add_directory((DOH *) LibDir);
Swig_add_directory((DOH *) "./swig_lib");
sprintf(InitName,"init_wrap");
#endif
@ -166,63 +166,63 @@ int SWIG_main(int argc, char *argv[], Language *l, Documentation *d) {
if (strncmp(argv[i],"-I",2) == 0) {
// Add a new directory search path
includefiles[includecount++] = copy_string(argv[i]+2);
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strncmp(argv[i],"-D",2) == 0) {
DOH *d = NewString(argv[i]+2);
Replace(d,(char*)"=",(char*)" ", DOH_REPLACE_ANY | DOH_REPLACE_FIRST);
SWIG_cpp_define((DOH *) d,0);
Preprocessor_define((DOH *) d,0);
// Create a symbol
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-strict") == 0) {
if (argv[i+1]) {
TypeStrict = atoi(argv[i+1]);
SWIG_mark_arg(i);
SWIG_mark_arg(i+1);
Swig_mark_arg(i);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-E") == 0) {
cpp_only = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if ((strcmp(argv[i],"-verbose") == 0) || (strcmp(argv[i],"-v") == 0)) {
Verbose = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-nocomment") == 0) {
ignorecomments = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-c++") == 0) {
CPlusPlus=1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-objc") == 0) {
ObjC = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-c") == 0) {
NoInclude=1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-make_default") == 0) {
GenerateDefault = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-swiglib") == 0) {
printf("%s\n", LibDir);
SWIG_exit(0);
} else if (strcmp(argv[i],"-o") == 0) {
SWIG_mark_arg(i);
Swig_mark_arg(i);
if (argv[i+1]) {
outfile_name = copy_string(argv[i+1]);
SWIG_mark_arg(i+1);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-d") == 0) {
SWIG_mark_arg(i);
Swig_mark_arg(i);
if (argv[i+1]) {
doc_file = copy_string(argv[i+1]);
SWIG_mark_arg(i+1);
Swig_mark_arg(i+1);
i++;
} else {
SWIG_arg_error();
Swig_arg_error();
}
} else if (strcmp(argv[i],"-version") == 0) {
fprintf(stderr,"\nSWIG Version %d.%d %s\n", SWIG_MAJOR_VERSION,
@ -234,23 +234,23 @@ int SWIG_main(int argc, char *argv[], Language *l, Documentation *d) {
} else if (strncmp(argv[i],"-l",2) == 0) {
// Add a new directory search path
Append(libfiles,argv[i]+2);
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-co") == 0) {
checkout = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-freeze") == 0) {
freeze = 1;
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-help") == 0) {
fputs(usage,stderr);
SWIG_mark_arg(i);
Swig_mark_arg(i);
help = 1;
}
}
}
while (includecount > 0) {
SWIG_add_directory((DOH *) includefiles[--includecount]);
Swig_add_directory((DOH *) includefiles[--includecount]);
}
// Open up a comment handler
@ -277,9 +277,9 @@ int SWIG_main(int argc, char *argv[], Language *l, Documentation *d) {
// Check all of the options to make sure we're cool.
SWIG_check_options();
Swig_check_options();
SWIG_set_library(LibDir);
Swig_set_library(LibDir);
// If we made it this far, looks good. go for it....
@ -297,7 +297,7 @@ int SWIG_main(int argc, char *argv[], Language *l, Documentation *d) {
if (outfile_name)
outfile = outfile_name;
s = SWIG_include(input_file);
s = Swig_include(input_file);
if (!s) {
fprintf(stderr,"Unable to locate '%s' in the SWIG library.\n", input_file);
} else {
@ -391,7 +391,7 @@ int SWIG_main(int argc, char *argv[], Language *l, Documentation *d) {
// Define the __cplusplus symbol
if (CPlusPlus)
SWIG_cpp_define((DOH *) "__cplusplus 1", 0);
Preprocessor_define((DOH *) "__cplusplus 1", 0);
// Open up files
@ -401,13 +401,13 @@ int SWIG_main(int argc, char *argv[], Language *l, Documentation *d) {
DOH *cpps;
FILE *f;
int i;
DOH *ds = SWIG_include(input_file);
DOH *ds = Swig_include(input_file);
Seek(ds,0,SEEK_END);
for (i = 0; i < Len(libfiles); i++) {
Printf(ds,"\n%%include \"%s\"\n", Getitem(libfiles,i));
}
Seek(ds,0,SEEK_SET);
cpps = SWIG_cpp_parse(ds);
cpps = Preprocessor_parse(ds);
if (cpp_only) {
Printf(stdout,"%s", cpps);
while (freeze);

View file

@ -269,22 +269,22 @@ void DocEntry::parse_args(int argc, char **argv) {
if (argv[i]) {
if (strcmp(argv[i],"-Ssort") == 0) {
this->style("sort",0);
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-Snosort") == 0) {
this->style("nosort",0);
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-Sinfo") == 0) {
this->style("info",0);
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-Snoinfo") == 0) {
this->style("noinfo",0);
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-Spre") == 0) {
this->style("pre",0);
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-Sformat") == 0) {
this->style("format",0);
SWIG_mark_arg(i);
Swig_mark_arg(i);
} else if (strcmp(argv[i],"-help") == 0) {
fputs(doc_usage,stderr);
}

View file

@ -25,7 +25,7 @@ static char cvsroot[] = "$Header$";
and proper cleanup of things.
------------------------------------------------------------------------ */
#include "swig.h"
#include "internal.h"
// ------------------------------------------------------------------------
// Parm::Parm(DataType *type, char *n)

View file

@ -565,12 +565,11 @@ extern void swig_append(char *filename, FILE *);
extern "C" {
/* Option processing */
extern void SWIG_init_args(int argc, char **);
extern void SWIG_mark_arg(int n);
extern void SWIG_check_options();
extern void SWIG_arg_error();
extern void *SWIG_cpp_define(void *, int);
extern void Swig_init_args(int argc, char **);
extern void Swig_mark_arg(int n);
extern void Swig_check_options();
extern void Swig_arg_error();
extern void *Preprocessor_define(void *, int);
}
// -----------------------------------------------------------------------

View file

@ -15,7 +15,7 @@
static char cvsroot[] = "$Header$";
#include "swigcore.h"
#include "swig.h"
/*******************************************************************************
* $Header$
@ -31,13 +31,13 @@ static int numargs;
static int *marked;
/* -----------------------------------------------------------------------------
* void SWIG_init_args(int argc, char **argv)
* void Swig_init_args(int argc, char **argv)
*
* Initializes the argument list.
* ----------------------------------------------------------------------------- */
void
SWIG_init_args(int argc, char **argv)
Swig_init_args(int argc, char **argv)
{
int i;
assert(argc > 0);
@ -53,26 +53,26 @@ SWIG_init_args(int argc, char **argv)
}
/* -----------------------------------------------------------------------------
* void SWIG_mark_arg(int n)
* void Swig_mark_arg(int n)
*
* Marks an argument as being parsed. All modules should do this whenever they
* parse a command line option.
* ----------------------------------------------------------------------------- */
void
SWIG_mark_arg(int n) {
Swig_mark_arg(int n) {
assert(marked);
assert((n >= 0) && (n < numargs));
marked[n] = 1;
}
/* -----------------------------------------------------------------------------
* void SWIG_check_options()
* void Swig_check_options()
*
* Checks for unparsed command line options. If so, issues an error and exits.
* ----------------------------------------------------------------------------- */
void SWIG_check_options() {
void Swig_check_options() {
int error = 0;
int i;
assert(marked);
@ -94,12 +94,12 @@ void SWIG_check_options() {
}
/* -----------------------------------------------------------------------------
* void SWIG_arg_error()
* void Swig_arg_error()
*
* Generates a generic error message and exits.
* ----------------------------------------------------------------------------- */
void SWIG_arg_error() {
void Swig_arg_error() {
Printf(stderr,"SWIG : Unable to parse command line options.\n");
Printf(stderr,"Use 'swig -help' for available options.\n");
exit(1);

View file

@ -15,7 +15,7 @@
static char cvsroot[] = "$Header$";
#include "swigcore.h"
#include "swig.h"
/*******************************************************************************
* $Header$
@ -33,13 +33,13 @@ static DOH *lastpath = 0; /* Last file that was included */
static int bytes_read = 0; /* Bytes read */
/* -----------------------------------------------------------------------------
* void SWIG_add_directory( DOH *dirname)
* void Swig_add_directory( DOH *dirname)
*
* Adds a directory to the SWIG search path.
* ----------------------------------------------------------------------------- */
void
SWIG_add_directory(DOH *dirname)
Swig_add_directory(DOH *dirname)
{
if (!directories) directories = NewList();
assert(directories);
@ -51,13 +51,13 @@ SWIG_add_directory(DOH *dirname)
}
/* -----------------------------------------------------------------------------
* void SWIG_set_library(DOH *libname)
* void Swig_set_library(DOH *libname)
*
* Sets the language specific library name like 'tcl', 'perl5', 'python', etc...
* ----------------------------------------------------------------------------- */
void
SWIG_set_library(DOH *libname)
Swig_set_library(DOH *libname)
{
Delete(libdir);
if (!String_check(libname)) {
@ -68,35 +68,35 @@ SWIG_set_library(DOH *libname)
}
/* -----------------------------------------------------------------------------
* DOH *SWIG_get_library()
* DOH *Swig_get_library()
*
* Gets the language specific name like 'tcl', 'perl5', etc...
* ----------------------------------------------------------------------------- */
DOH *
SWIG_get_library() {
Swig_get_library() {
assert(libdir);
return libdir;
}
/* -----------------------------------------------------------------------------
* DOH *SWIG_last_file()
* DOH *Swig_last_file()
*
* Returns the full pathname of the last file opened.
* ----------------------------------------------------------------------------- */
DOH *
SWIG_last_file() {
Swig_last_file() {
assert(lastpath);
return lastpath;
}
/* -----------------------------------------------------------------------------
* DOH *SWIG_search_path()
* DOH *Swig_search_path()
*
* Returns a list of the current search paths.
* ----------------------------------------------------------------------------- */
DOH *SWIG_search_path()
DOH *Swig_search_path()
{
DOH *filename;
DOH *dirname;
@ -107,32 +107,32 @@ DOH *SWIG_search_path()
assert(slist);
filename = NewString("");
assert(filename);
Printf(filename,".%s", FILE_DELIMETER);
Printf(filename,".%s", SWIG_FILE_DELIMETER);
Append(slist,filename);
for (i = 0; i < Len(directories); i++) {
dirname = Getitem(directories,i);
if (libdir) {
filename = NewString("");
assert(filename);
Printf(filename,"%s%s%s%s", dirname, FILE_DELIMETER, libdir, FILE_DELIMETER);
Printf(filename,"%s%s%s%s", dirname, SWIG_FILE_DELIMETER, libdir, SWIG_FILE_DELIMETER);
Append(slist,filename);
}
filename = NewString("");
assert(filename);
Printf(filename, "%s%s", dirname, FILE_DELIMETER);
Printf(filename, "%s%s", dirname, SWIG_FILE_DELIMETER);
Append(slist,filename);
}
return slist;
}
/* -----------------------------------------------------------------------------
* FILE *SWIG_open( DOH *name)
* FILE *Swig_open( DOH *name)
*
* Looks for a file and open it.
* ----------------------------------------------------------------------------- */
FILE *
SWIG_open(DOH *name)
Swig_open(DOH *name)
{
FILE *f;
DOH *filename;
@ -148,7 +148,7 @@ SWIG_open(DOH *name)
assert(filename);
f = fopen(Char(filename),"r");
if (!f) {
spath = SWIG_search_path();
spath = Swig_search_path();
for (i = 0; i < Len(spath); i++) {
Clear(filename);
Printf(filename,"%s%s", Getitem(spath,i), cname);
@ -166,12 +166,12 @@ SWIG_open(DOH *name)
}
/* -----------------------------------------------------------------------------
* DOH *SWIG_read_file(FILE *f)
* DOH *Swig_read_file(FILE *f)
*
* Reads data from f and returns as a new string
* ----------------------------------------------------------------------------- */
DOH *SWIG_read_file(FILE *f) {
DOH *Swig_read_file(FILE *f) {
char buffer[4096];
DOH *str = NewString("");
assert(str);
@ -183,19 +183,19 @@ DOH *SWIG_read_file(FILE *f) {
}
/* -----------------------------------------------------------------------------
* DOH *SWIG_include(DOH *name)
* DOH *Swig_include(DOH *name)
*
* Open a file and return it as a string.
* ----------------------------------------------------------------------------- */
DOH *
SWIG_include(DOH *name)
Swig_include(DOH *name)
{
FILE *f;
DOH *str;
f = SWIG_open(name);
f = Swig_open(name);
if (!f) return 0;
str = SWIG_read_file(f);
str = Swig_read_file(f);
bytes_read = bytes_read + Len(str);
fclose(f);
Seek(str,0,SEEK_SET);

View file

@ -15,7 +15,7 @@
static char cvsroot[] = "$Header$";
#include "swigcore.h"
#include "swig.h"
/* -----------------------------------------------------------------------------
* $Header$

View file

@ -15,9 +15,9 @@
static char cvsroot[] = "$Header$";
#include "swigcore.h"
#include "swig.h"
struct Scanner {
struct SwigScanner {
DOH *text; /* Current token value */
DOH *scanobjs; /* Objects being scanned */
DOH *str; /* Current object being scanned */
@ -41,12 +41,12 @@ struct Scanner {
* ----------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
* Scanner *NewScanner() - Create a new scanner object.
* SwigScanner *NewSwigScanner() - Create a new scanner object.
* ----------------------------------------------------------------------------- */
Scanner *NewScanner()
SwigScanner *NewSwigScanner()
{
Scanner *s;
s = (Scanner *) malloc(sizeof(Scanner));
SwigScanner *s;
s = (SwigScanner *) malloc(sizeof(SwigScanner));
s->line = 1;
s->file = 0;
s->nexttoken = -1;
@ -61,9 +61,9 @@ Scanner *NewScanner()
}
/* -----------------------------------------------------------------------------
* DelScanner(Scanner *s) - Delete a Scanner object
* DelSwigScanner(SwigScanner *s) - Delete a SwigScanner object
* ----------------------------------------------------------------------------- */
void DelScanner(Scanner *s)
void DelSwigScanner(SwigScanner *s)
{
assert(s);
Delete(s->scanobjs);
@ -73,9 +73,9 @@ void DelScanner(Scanner *s)
}
/* -----------------------------------------------------------------------------
* Scanner_clear(Scanner *s) - Clear a scanner object
* SwigScanner_clear(SwigScanner *s) - Clear a scanner object
* ----------------------------------------------------------------------------- */
void Scanner_clear(Scanner *s) {
void SwigScanner_clear(SwigScanner *s) {
assert(s);
Delete(s->str);
Clear(s->text);
@ -88,10 +88,10 @@ void Scanner_clear(Scanner *s) {
}
/* -----------------------------------------------------------------------------
* Scanner_push(Scanner *s, DOH *txt) - Push text into the scanner
* SwigScanner_push(SwigScanner *s, DOH *txt) - Push text into the scanner
* ----------------------------------------------------------------------------- */
void Scanner_push(Scanner *s, DOH *txt)
void SwigScanner_push(SwigScanner *s, DOH *txt)
{
assert(s && txt);
Push(s->scanobjs,txt);
@ -101,48 +101,48 @@ void Scanner_push(Scanner *s, DOH *txt)
s->line = Getline(txt);
}
/* -----------------------------------------------------------------------------
* Scanner_pushtoken(Scanner *s, int nt)
* SwigScanner_pushtoken(SwigScanner *s, int nt)
*
* Set the next processing token.
* ----------------------------------------------------------------------------- */
void Scanner_pushtoken(Scanner *s, int nt) {
void SwigScanner_pushtoken(SwigScanner *s, int nt) {
assert(s);
assert((nt >= 0) && (nt < MAXTOKENS));
assert((nt >= 0) && (nt < SWIG_MAXTOKENS));
s->nexttoken = nt;
}
/* -----------------------------------------------------------------------------
* Scanner_set_location(Scanner *s, DOH *file, int line)
* SwigScanner_set_location(SwigScanner *s, DOH *file, int line)
* ----------------------------------------------------------------------------- */
void
Scanner_set_location(Scanner *s, DOH *file, int line)
SwigScanner_set_location(SwigScanner *s, DOH *file, int line)
{
Setline(s->str,line);
Setfile(s->str,file);
}
/* -----------------------------------------------------------------------------
* Scanner_get_file(Scanner *s) - Get current file
* SwigScanner_get_file(SwigScanner *s) - Get current file
* ----------------------------------------------------------------------------- */
DOH *
Scanner_get_file(Scanner *s) {
SwigScanner_get_file(SwigScanner *s) {
return Getfile(s->str);
}
int
Scanner_get_line(Scanner *s) {
SwigScanner_get_line(SwigScanner *s) {
return Getline(s->str);
}
/* -----------------------------------------------------------------------------
* char nextchar(Scanner *s)
* char nextchar(SwigScanner *s)
*
* Returns the next character from the scanner or 0 if end of the string.
* ----------------------------------------------------------------------------- */
static char
nextchar(Scanner *s)
nextchar(SwigScanner *s)
{
char c[2] = {0,0};
int nc;
@ -165,12 +165,12 @@ nextchar(Scanner *s)
}
/* -----------------------------------------------------------------------------
* void retract(Scanner *s, int n)
* void retract(SwigScanner *s, int n)
*
* Retract n characters
* ----------------------------------------------------------------------------- */
static void
retract(Scanner *s, int n) {
retract(SwigScanner *s, int n) {
int i, l;
char *str;
@ -188,13 +188,13 @@ retract(Scanner *s, int n) {
}
/* -----------------------------------------------------------------------------
* int look(Scanner *s)
* int look(SwigScanner *s)
*
* Get the next token.
* ----------------------------------------------------------------------------- */
static int
look(Scanner *s)
look(SwigScanner *s)
{
int state;
char c = 0;
@ -211,7 +211,7 @@ look(Scanner *s)
/* Process delimeters */
if (c == '\n') {
return TOKEN_ENDLINE;
return SWIG_TOKEN_ENDLINE;
} else if (!isspace(c)) {
retract(s,1);
state = 1000;
@ -231,29 +231,29 @@ look(Scanner *s)
/* Look for single character symbols */
else if (c == '(') return TOKEN_LPAREN;
else if (c == ')') return TOKEN_RPAREN;
else if (c == ';') return TOKEN_SEMI;
else if (c == ',') return TOKEN_COMMA;
else if (c == '*') return TOKEN_STAR;
else if (c == '}') return TOKEN_RBRACE;
else if (c == '{') return TOKEN_LBRACE;
else if (c == '(') return SWIG_TOKEN_LPAREN;
else if (c == ')') return SWIG_TOKEN_RPAREN;
else if (c == ';') return SWIG_TOKEN_SEMI;
else if (c == ',') return SWIG_TOKEN_COMMA;
else if (c == '*') return SWIG_TOKEN_STAR;
else if (c == '}') return SWIG_TOKEN_RBRACE;
else if (c == '{') return SWIG_TOKEN_LBRACE;
else if (c == '=') state = 33;
else if (c == '+') return TOKEN_PLUS;
else if (c == '-') return TOKEN_MINUS;
else if (c == '+') return SWIG_TOKEN_PLUS;
else if (c == '-') return SWIG_TOKEN_MINUS;
else if (c == '&') state = 31;
else if (c == '|') state = 32;
else if (c == '^') return TOKEN_XOR;
else if (c == '^') return SWIG_TOKEN_XOR;
else if (c == '<') state = 60;
else if (c == '>') state = 61;
else if (c == '~') return TOKEN_NOT;
else if (c == '~') return SWIG_TOKEN_NOT;
else if (c == '!') state = 3;
else if (c == '\\') return TOKEN_BACKSLASH;
else if (c == '[') return TOKEN_LBRACKET;
else if (c == ']') return TOKEN_RBRACKET;
else if (c == '@') return TOKEN_AT;
else if (c == '$') return TOKEN_DOLLAR;
else if (c == '#') return TOKEN_POUND;
else if (c == '\\') return SWIG_TOKEN_BACKSLASH;
else if (c == '[') return SWIG_TOKEN_LBRACKET;
else if (c == ']') return SWIG_TOKEN_RBRACKET;
else if (c == '@') return SWIG_TOKEN_AT;
else if (c == '$') return SWIG_TOKEN_DOLLAR;
else if (c == '#') return SWIG_TOKEN_POUND;
/* Look for multi-character sequences */
@ -291,7 +291,7 @@ look(Scanner *s)
Append(s->text," ");
} else {
retract(s,1);
return TOKEN_SLASH;
return SWIG_TOKEN_SLASH;
}
break;
case 10: /* C++ style comment */
@ -300,7 +300,7 @@ look(Scanner *s)
return 0;
}
if (c == '\n') {
return TOKEN_ENDLINE;
return SWIG_TOKEN_ENDLINE;
} else {
state = 10;
}
@ -337,7 +337,7 @@ look(Scanner *s)
return 0;
}
if (c == '\"') {
return TOKEN_STRING;
return SWIG_TOKEN_STRING;
} else if (c == '\\') {
state = 21; /* Possibly an escape sequence. */
break;
@ -350,43 +350,43 @@ look(Scanner *s)
break;
case 3: /* Maybe a not equals */
if ((c = nextchar(s)) == 0) return TOKEN_LNOT;
else if (c == '=') return TOKEN_NOTEQUAL;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_LNOT;
else if (c == '=') return SWIG_TOKEN_NOTEQUAL;
else {
retract(s,1);
return TOKEN_LNOT;
return SWIG_TOKEN_LNOT;
}
break;
case 31: /* AND or Logical AND */
if ((c = nextchar(s)) == 0) return TOKEN_AND;
else if (c == '&') return TOKEN_LAND;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_AND;
else if (c == '&') return SWIG_TOKEN_LAND;
else {
retract(s,1);
return TOKEN_AND;
return SWIG_TOKEN_AND;
}
break;
case 32: /* OR or Logical OR */
if ((c = nextchar(s)) == 0) return TOKEN_OR;
else if (c == '|') return TOKEN_LOR;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_OR;
else if (c == '|') return SWIG_TOKEN_LOR;
else {
retract(s,1);
return TOKEN_OR;
return SWIG_TOKEN_OR;
}
break;
case 33: /* EQUAL or EQUALTO */
if ((c = nextchar(s)) == 0) return TOKEN_EQUAL;
else if (c == '=') return TOKEN_EQUALTO;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_EQUAL;
else if (c == '=') return SWIG_TOKEN_EQUALTO;
else {
retract(s,1);
return TOKEN_EQUAL;
return SWIG_TOKEN_EQUAL;
}
break;
case 4: /* A wrapper generator directive (maybe) */
if (( c= nextchar(s)) == 0) return TOKEN_PERCENT;
if (( c= nextchar(s)) == 0) return SWIG_TOKEN_PERCENT;
if (c == '{') {
state = 40; /* Include block */
Clear(s->text);
@ -397,7 +397,7 @@ look(Scanner *s)
else if (strchr(s->idstart,'%') && ((isalpha(c)) || (c == '_'))) state = 7;
else {
retract(s,1);
return TOKEN_PERCENT;
return SWIG_TOKEN_PERCENT;
}
break;
@ -416,7 +416,7 @@ look(Scanner *s)
if (c == '}') {
Delitem(s->text,DOH_END);
Delitem(s->text,DOH_END);
return TOKEN_CODEBLOCK;
return SWIG_TOKEN_CODEBLOCK;
} else {
state = 40;
}
@ -424,48 +424,48 @@ look(Scanner *s)
case 5: /* Maybe a double colon */
if (( c = nextchar(s)) == 0) return TOKEN_COLON;
if ( c == ':') return TOKEN_DCOLON;
if (( c = nextchar(s)) == 0) return SWIG_TOKEN_COLON;
if ( c == ':') return SWIG_TOKEN_DCOLON;
else {
retract(s,1);
return TOKEN_COLON;
return SWIG_TOKEN_COLON;
}
break;
case 60: /* shift operators */
if ((c = nextchar(s)) == 0) return TOKEN_LESSTHAN;
if (c == '<') return TOKEN_LSHIFT;
else if (c == '=') return TOKEN_LTEQUAL;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_LESSTHAN;
if (c == '<') return SWIG_TOKEN_LSHIFT;
else if (c == '=') return SWIG_TOKEN_LTEQUAL;
else {
retract(s,1);
return TOKEN_LESSTHAN;
return SWIG_TOKEN_LESSTHAN;
}
break;
case 61:
if ((c = nextchar(s)) == 0) return TOKEN_GREATERTHAN;
if (c == '>') return TOKEN_RSHIFT;
else if (c == '=') return TOKEN_GTEQUAL;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_GREATERTHAN;
if (c == '>') return SWIG_TOKEN_RSHIFT;
else if (c == '=') return SWIG_TOKEN_GTEQUAL;
else {
retract(s,1);
return TOKEN_GREATERTHAN;
return SWIG_TOKEN_GREATERTHAN;
}
break;
case 7: /* Identifier */
if ((c = nextchar(s)) == 0) return TOKEN_ID;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_ID;
if (isalnum(c) || (c == '_') || (c == '$')) {
state = 7;
} else {
retract(s,1);
return TOKEN_ID;
return SWIG_TOKEN_ID;
}
break;
case 8: /* A numerical digit */
if ((c = nextchar(s)) == 0) return TOKEN_INT;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_INT;
if (c == '.') {state = 81;}
else if ((c == 'e') || (c == 'E')) {state = 86;}
else if ((c == 'f') || (c == 'F')) {
Delitem(s->text,DOH_END);
return TOKEN_FLOAT;
return SWIG_TOKEN_FLOAT;
} else if (isdigit(c)) { state = 8;}
else if ((c == 'l') || (c == 'L')) {
state = 87;
@ -473,35 +473,35 @@ look(Scanner *s)
state = 88;
} else {
retract(s,1);
return TOKEN_INT;
return SWIG_TOKEN_INT;
}
break;
case 81: /* A floating pointer number of some sort */
if ((c = nextchar(s)) == 0) return TOKEN_DOUBLE;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_DOUBLE;
if (isdigit(c)) state = 81;
else if ((c == 'e') || (c == 'E')) state = 82;
else if ((c == 'f') || (c == 'F') || (c == 'l') || (c == 'L')) {
Delitem(s->text,DOH_END);
return TOKEN_FLOAT;
return SWIG_TOKEN_FLOAT;
} else {
retract(s,1);
return(TOKEN_DOUBLE);
return(SWIG_TOKEN_DOUBLE);
}
break;
case 82:
if ((c = nextchar(s)) == 0) {
retract(s,1);
return TOKEN_INT;
return SWIG_TOKEN_INT;
}
if ((isdigit(c)) || (c == '-') || (c == '+')) state = 86;
else {
retract(s,2);
return(TOKEN_INT);
return(SWIG_TOKEN_INT);
}
break;
case 83:
/* Might be a hexidecimal or octal number */
if ((c = nextchar(s)) == 0) return TOKEN_INT;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_INT;
if (isdigit(c)) state = 84;
else if ((c == 'x') || (c == 'X')) state = 85;
else if (c == '.') state = 81;
@ -511,12 +511,12 @@ look(Scanner *s)
state = 88;
} else {
retract(s,1);
return TOKEN_INT;
return SWIG_TOKEN_INT;
}
break;
case 84:
/* This is an octal number */
if ((c = nextchar(s)) == 0) return TOKEN_INT;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_INT;
if (isdigit(c)) state = 84;
else if ((c == 'l') || (c == 'L')) {
state = 87;
@ -524,12 +524,12 @@ look(Scanner *s)
state = 88;
} else {
retract(s,1);
return TOKEN_INT;
return SWIG_TOKEN_INT;
}
break;
case 85:
/* This is an hex number */
if ((c = nextchar(s)) == 0) return TOKEN_INT;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_INT;
if ((isdigit(c)) || (c=='a') || (c=='b') || (c=='c') ||
(c=='d') || (c=='e') || (c=='f') || (c=='A') ||
(c=='B') || (c=='C') || (c=='D') || (c=='E') ||
@ -541,46 +541,46 @@ look(Scanner *s)
state = 88;
} else {
retract(s,1);
return TOKEN_INT;
return SWIG_TOKEN_INT;
}
break;
case 86:
/* Rest of floating point number */
if ((c = nextchar(s)) == 0) return TOKEN_DOUBLE;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_DOUBLE;
if (isdigit(c)) state = 86;
else if ((c == 'f') || (c == 'F')) {
Delitem(s->text,DOH_END);
return TOKEN_FLOAT;
return SWIG_TOKEN_FLOAT;
} else if ((c == 'l') || (c == 'L')) {
Delitem(s->text,DOH_END);
return TOKEN_DOUBLE;
return SWIG_TOKEN_DOUBLE;
} else {
retract(s,1);
return TOKEN_DOUBLE;
return SWIG_TOKEN_DOUBLE;
}
break;
case 87 :
/* A long integer of some sort */
if ((c = nextchar(s)) == 0) return TOKEN_LONG;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_LONG;
if ((c == 'u') || (c == 'U')) {
return TOKEN_ULONG;
return SWIG_TOKEN_ULONG;
} else {
retract(s,1);
return TOKEN_LONG;
return SWIG_TOKEN_LONG;
}
/* An unsigned number */
case 88:
if ((c = nextchar(s)) == 0) return TOKEN_UINT;
if ((c = nextchar(s)) == 0) return SWIG_TOKEN_UINT;
if ((c == 'l') || (c == 'L')) {
return TOKEN_ULONG;
return SWIG_TOKEN_ULONG;
} else {
retract(s,1);
return TOKEN_UINT;
return SWIG_TOKEN_UINT;
}
/* A character constant */
@ -590,7 +590,7 @@ look(Scanner *s)
return 0;
}
if (c == '\'') {
return(TOKEN_CHAR);
return(SWIG_TOKEN_CHAR);
} else if (c == '\\') state = 91;
break;
@ -609,25 +609,25 @@ look(Scanner *s)
if (isdigit(c)) state = 81;
else {
retract(s,1);
return TOKEN_PERIOD;
return SWIG_TOKEN_PERIOD;
}
break;
/* An illegal character */
default:
return TOKEN_ILLEGAL;
return SWIG_TOKEN_ILLEGAL;
}
}
}
/* -----------------------------------------------------------------------------
* int Scanner_token(Scanner *s)
* int SwigScanner_token(SwigScanner *s)
*
* Return the next token or 0 if at the end of the string
* ----------------------------------------------------------------------------- */
int
Scanner_token(Scanner *s)
SwigScanner_token(SwigScanner *s)
{
int t;
Clear(s->text);
@ -641,24 +641,24 @@ Scanner_token(Scanner *s)
}
/* -----------------------------------------------------------------------------
* DOH *Scanner_text(Scanner *s)
* DOH *SwigScanner_text(SwigScanner *s)
*
* Return the text associated with the last token returned.
* ----------------------------------------------------------------------------- */
DOH *
Scanner_text(Scanner *s)
SwigScanner_text(SwigScanner *s)
{
return s->text;
}
/* -----------------------------------------------------------------------------
* void Scanner_skip_line(Scanner *s)
* void SwigScanner_skip_line(SwigScanner *s)
*
* Skips to the end of a line
* ----------------------------------------------------------------------------- */
void
Scanner_skip_line(Scanner *s)
SwigScanner_skip_line(SwigScanner *s)
{
char c;
int done = 0;
@ -674,14 +674,14 @@ Scanner_skip_line(Scanner *s)
}
/* -----------------------------------------------------------------------------
* void Scanner_skip_balanced(Scanner *s, int start, int end)
* void SwigScanner_skip_balanced(SwigScanner *s, int start, int end)
*
* Skips a piece of code enclosed in begin/end symbols such as '{...}' or
* (...). Ignores symbols inside comments or strings.
* ----------------------------------------------------------------------------- */
int
Scanner_skip_balanced(Scanner *s, int startchar, int endchar)
SwigScanner_skip_balanced(SwigScanner *s, int startchar, int endchar)
{
char c;
int num_levels = 1;

130
SWIG/Source/Swig/swig.h Normal file
View file

@ -0,0 +1,130 @@
/****************************************************************************
* Simplified Wrapper and Interface Generator (SWIG)
*
* Author : David Beazley
*
* Department of Computer Science
* University of Chicago
* 1100 E 58th Street
* Chicago, IL 60637
* beazley@cs.uchicago.edu
*
* Please read the file LICENSE for the copyright and terms by which Swig
* can be used and distributed.
****************************************************************************/
#ifndef _SWIGCORE_H
#define _SWIGCORE_H
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "doh.h"
#ifdef __cplusplus
extern "C" {
#endif
/* --- File interface --- */
extern void Swig_add_directory(DOH *dirname);
extern void Swig_set_library(DOH *libname);
extern DOH *Swig_get_library();
extern DOH *Swig_last_file();
extern DOH *Swig_search_path();
extern FILE *Swig_open(DOH *name);
extern DOH *Swig_read_file(FILE *f);
extern DOH *Swig_include(DOH *name);
#define SWIG_FILE_DELIMETER "/"
/* --- Command line parsing --- */
extern void Swig_init_args(int argc, char **argv);
extern void Swig_mark_arg(int n);
extern void Swig_check_options();
extern void Swig_arg_error();
/* --- Scanner Interface --- */
typedef struct SwigScanner SwigScanner;
extern SwigScanner *NewSwigScanner();
extern void DelSwigScanner(SwigScanner *);
extern void SwigScanner_clear(SwigScanner *);
extern void SwigScanner_push(SwigScanner *, DOH *);
extern void SwigScanner_pushtoken(SwigScanner *, int);
extern int SwigScanner_token(SwigScanner *);
extern DOH *SwigScanner_text(SwigScanner *);
extern void SwigScanner_skip_line(SwigScanner *);
extern int SwigScanner_skip_balanced(SwigScanner *, int startchar, int endchar);
extern void SwigScanner_set_location(SwigScanner *, DOH *file, int line);
extern DOH *SwigScanner_get_file(SwigScanner *);
extern int SwigScanner_get_line(SwigScanner *);
#define SWIG_MAXTOKENS 512
#define SWIG_TOKEN_LPAREN 1
#define SWIG_TOKEN_RPAREN 2
#define SWIG_TOKEN_SEMI 3
#define SWIG_TOKEN_COMMA 4
#define SWIG_TOKEN_STAR 5
#define SWIG_TOKEN_LBRACE 6
#define SWIG_TOKEN_RBRACE 7
#define SWIG_TOKEN_EQUAL 8
#define SWIG_TOKEN_EQUALTO 9
#define SWIG_TOKEN_NOTEQUAL 10
#define SWIG_TOKEN_PLUS 11
#define SWIG_TOKEN_MINUS 12
#define SWIG_TOKEN_AND 13
#define SWIG_TOKEN_LAND 14
#define SWIG_TOKEN_OR 15
#define SWIG_TOKEN_LOR 16
#define SWIG_TOKEN_XOR 17
#define SWIG_TOKEN_LESSTHAN 18
#define SWIG_TOKEN_GREATERTHAN 19
#define SWIG_TOKEN_LTEQUAL 20
#define SWIG_TOKEN_GTEQUAL 21
#define SWIG_TOKEN_NOT 22
#define SWIG_TOKEN_LNOT 23
#define SWIG_TOKEN_LBRACKET 24
#define SWIG_TOKEN_RBRACKET 25
#define SWIG_TOKEN_SLASH 26
#define SWIG_TOKEN_BACKSLASH 27
#define SWIG_TOKEN_ENDLINE 28
#define SWIG_TOKEN_STRING 29
#define SWIG_TOKEN_POUND 30
#define SWIG_TOKEN_PERCENT 31
#define SWIG_TOKEN_COLON 32
#define SWIG_TOKEN_DCOLON 33
#define SWIG_TOKEN_LSHIFT 34
#define SWIG_TOKEN_RSHIFT 35
#define SWIG_TOKEN_ID 36
#define SWIG_TOKEN_FLOAT 37
#define SWIG_TOKEN_DOUBLE 38
#define SWIG_TOKEN_INT 39
#define SWIG_TOKEN_UINT 40
#define SWIG_TOKEN_LONG 41
#define SWIG_TOKEN_ULONG 42
#define SWIG_TOKEN_CHAR 43
#define SWIG_TOKEN_PERIOD 44
#define SWIG_TOKEN_AT 45
#define SWIG_TOKEN_DOLLAR 46
#define SWIG_TOKEN_CODEBLOCK 47
#define SWIG_TOKEN_ILLEGAL 98
#define SWIG_TOKEN_LAST 99
/* --- Misc --- */
extern char *copy_string(const char *c);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,129 +0,0 @@
/****************************************************************************
* Simplified Wrapper and Interface Generator (SWIG)
*
* Author : David Beazley
*
* Department of Computer Science
* University of Chicago
* 1100 E 58th Street
* Chicago, IL 60637
* beazley@cs.uchicago.edu
*
* Please read the file LICENSE for the copyright and terms by which SWIG
* can be used and distributed.
****************************************************************************/
#ifndef _SWIGCORE_H
#define _SWIGCORE_H
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "doh.h"
#ifdef __cplusplus
extern "C" {
#endif
/* --- File interface --- */
extern void SWIG_add_directory(DOH *dirname);
extern void SWIG_set_library(DOH *libname);
extern DOH *SWIG_get_library();
extern DOH *SWIG_last_file();
extern DOH *SWIG_search_path();
extern FILE *SWIG_open(DOH *name);
extern DOH *SWIG_read_file(FILE *f);
extern DOH *SWIG_include(DOH *name);
#define FILE_DELIMETER "/"
/* --- Command line parsing --- */
extern void SWIG_init_args(int argc, char **argv);
extern void SWIG_mark_arg(int n);
extern void SWIG_check_options();
extern void SWIG_arg_error();
/* --- Scanner Interface --- */
typedef struct Scanner Scanner;
extern Scanner *NewScanner();
extern void DelScanner(Scanner *);
extern void Scanner_clear(Scanner *);
extern void Scanner_push(Scanner *, DOH *);
extern void Scanner_pushtoken(Scanner *, int);
extern int Scanner_token(Scanner *);
extern DOH *Scanner_text(Scanner *);
extern void Scanner_skip_line(Scanner *);
extern int Scanner_skip_balanced(Scanner *, int startchar, int endchar);
extern void Scanner_set_location(Scanner *, DOH *file, int line);
extern DOH *Scanner_get_file(Scanner *);
extern int Scanner_get_line(Scanner *);
#define MAXTOKENS 512
#define TOKEN_LPAREN 1
#define TOKEN_RPAREN 2
#define TOKEN_SEMI 3
#define TOKEN_COMMA 4
#define TOKEN_STAR 5
#define TOKEN_LBRACE 6
#define TOKEN_RBRACE 7
#define TOKEN_EQUAL 8
#define TOKEN_EQUALTO 9
#define TOKEN_NOTEQUAL 10
#define TOKEN_PLUS 11
#define TOKEN_MINUS 12
#define TOKEN_AND 13
#define TOKEN_LAND 14
#define TOKEN_OR 15
#define TOKEN_LOR 16
#define TOKEN_XOR 17
#define TOKEN_LESSTHAN 18
#define TOKEN_GREATERTHAN 19
#define TOKEN_LTEQUAL 20
#define TOKEN_GTEQUAL 21
#define TOKEN_NOT 22
#define TOKEN_LNOT 23
#define TOKEN_LBRACKET 24
#define TOKEN_RBRACKET 25
#define TOKEN_SLASH 26
#define TOKEN_BACKSLASH 27
#define TOKEN_ENDLINE 28
#define TOKEN_STRING 29
#define TOKEN_POUND 30
#define TOKEN_PERCENT 31
#define TOKEN_COLON 32
#define TOKEN_DCOLON 33
#define TOKEN_LSHIFT 34
#define TOKEN_RSHIFT 35
#define TOKEN_ID 36
#define TOKEN_FLOAT 37
#define TOKEN_DOUBLE 38
#define TOKEN_INT 39
#define TOKEN_UINT 40
#define TOKEN_LONG 41
#define TOKEN_ULONG 42
#define TOKEN_CHAR 43
#define TOKEN_PERIOD 44
#define TOKEN_AT 45
#define TOKEN_DOLLAR 46
#define TOKEN_CODEBLOCK 47
#define TOKEN_ILLEGAL 98
#define TOKEN_LAST 99
/* --- Misc --- */
extern char *copy_string(const char *c);
#ifdef __cplusplus
}
#endif
#endif