mirror of https://github.com/swig/swig
Moved non static function declarations from source files into header files
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5602 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
379bff84e4
commit
c00aaf0f5b
|
@ -19,6 +19,7 @@
|
|||
|
||||
char cvsroot_parser_y[] = "$Header$";
|
||||
|
||||
#include "swig.h"
|
||||
#include "cparse.h"
|
||||
#include "preprocessor.h"
|
||||
#include <ctype.h>
|
||||
|
@ -31,28 +32,10 @@ char cvsroot_parser_y[] = "$Header$";
|
|||
* Externals
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
extern int yylex();
|
||||
extern void yyerror (const char *e);
|
||||
|
||||
/* scanner.cxx */
|
||||
|
||||
extern int cparse_line;
|
||||
extern int cparse_start_line;
|
||||
extern void skip_balanced(int startchar, int endchar);
|
||||
extern void skip_decl(void);
|
||||
extern void scanner_check_typedef(void);
|
||||
extern void scanner_ignore_typedef(void);
|
||||
extern void scanner_last_id(int);
|
||||
extern void scanner_clear_rename(void);
|
||||
extern void start_inline(char *, int);
|
||||
extern String *scanner_ccode;
|
||||
extern int Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms);
|
||||
extern Node *Swig_cparse_template_locate(String *name, ParmList *tparms);
|
||||
int yyparse();
|
||||
|
||||
/* NEW Variables */
|
||||
|
||||
extern void generate_all(Node *);
|
||||
|
||||
static Node *top = 0; /* Top of the generated parse tree */
|
||||
static int unnamed = 0; /* Unnamed datatype counter */
|
||||
static Hash *extendhash = 0; /* Hash table of added methods */
|
||||
|
@ -75,7 +58,7 @@ static int dirprot_mode = 0;
|
|||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
/* Called by the parser (yyparse) when an error is found.*/
|
||||
void yyerror (const char *e) {
|
||||
static void yyerror (const char *e) {
|
||||
}
|
||||
|
||||
static Node *new_node(const String_or_char *tag) {
|
||||
|
@ -302,9 +285,6 @@ static String *name_warning(String *name,SwigType *decl) {
|
|||
/* Add declaration list to symbol table */
|
||||
static int add_only_one = 0;
|
||||
|
||||
extern void cparse_normalize_void(Node *);
|
||||
extern int need_protected(Node *n, int dirprot_mode);
|
||||
|
||||
static void add_symbols(Node *n) {
|
||||
String *decl;
|
||||
String *wrn = 0;
|
||||
|
@ -791,8 +771,6 @@ static Node *dump_nested(char *parent) {
|
|||
}
|
||||
|
||||
Node *Swig_cparse(File *f) {
|
||||
extern void scanner_file(File *);
|
||||
extern int yyparse();
|
||||
scanner_file(f);
|
||||
top = 0;
|
||||
yyparse();
|
||||
|
@ -4778,9 +4756,6 @@ empty : ;
|
|||
|
||||
SwigType *Swig_cparse_type(String *s) {
|
||||
String *ns;
|
||||
extern void scanner_file(File *);
|
||||
extern int yyparse();
|
||||
extern void scanner_next_token(int);
|
||||
ns = NewStringf("%s;",s);
|
||||
Seek(ns,0,SEEK_SET);
|
||||
scanner_file(ns);
|
||||
|
@ -4794,9 +4769,6 @@ SwigType *Swig_cparse_type(String *s) {
|
|||
|
||||
Parm *Swig_cparse_parm(String *s) {
|
||||
String *ns;
|
||||
extern void scanner_file(File *);
|
||||
extern int yyparse();
|
||||
extern void scanner_next_token(int);
|
||||
ns = NewStringf("%s;",s);
|
||||
Seek(ns,0,SEEK_SET);
|
||||
scanner_file(ns);
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
char cvsroot_util_c[] = "$Header$";
|
||||
|
||||
#include "swig.h"
|
||||
|
||||
extern SwigType *Swig_cparse_type(String *);
|
||||
#include "cparse.h"
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Swig_cparse_replace_descriptor()
|
||||
|
@ -94,7 +93,6 @@ void cparse_normalize_void(Node *n) {
|
|||
* Detects when we need to fully register the protected member.
|
||||
*
|
||||
* ----------------------------------------------------------------------------- */
|
||||
extern int Swig_need_protected();
|
||||
|
||||
int need_protected(Node* n, int dirprot_mode)
|
||||
{
|
||||
|
|
|
@ -17,12 +17,7 @@ AM_CFLAGS = -I$(BUILD_SOURCE_DIR)/Include \
|
|||
-I$(SOURCE_DIR)/Swig \
|
||||
-I$(SOURCE_DIR)/Modules
|
||||
|
||||
AM_CXXFLAGS = -I$(BUILD_SOURCE_DIR)/Include \
|
||||
-I$(SOURCE_DIR)/Include \
|
||||
-I$(SOURCE_DIR)/DOH \
|
||||
-I$(SOURCE_DIR)/Preprocessor \
|
||||
-I$(SOURCE_DIR)/Swig \
|
||||
-I$(SOURCE_DIR)/Modules \
|
||||
AM_CXXFLAGS = $(AM_CFLAGS) \
|
||||
$(SWIG_CXX_DEFS)
|
||||
|
||||
AM_YFLAGS = -d
|
||||
|
|
|
@ -56,10 +56,6 @@ public:
|
|||
virtual int top(Node *n);
|
||||
};
|
||||
|
||||
extern void Swig_contracts(Node *n);
|
||||
extern void Swig_contract_mode_set(int flag);
|
||||
extern int Swig_contract_mode_get();
|
||||
|
||||
static int Contract_Mode = 0; /* contract option */
|
||||
static int InClass = 0; /* Parsing C++ or not */
|
||||
static int InConstructor = 0;
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
char cvsroot_emit_cxx[] = "$Header$";
|
||||
|
||||
extern int Swig_contract_mode_get();
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* emit_args()
|
||||
*
|
||||
|
|
|
@ -25,11 +25,7 @@ char cvsroot_main_cxx[] = "$Header$";
|
|||
#endif
|
||||
|
||||
#include "swigwarn.h"
|
||||
|
||||
extern "C" {
|
||||
#include "preprocessor.h"
|
||||
}
|
||||
|
||||
#include "cparse.h"
|
||||
#include <ctype.h>
|
||||
|
||||
// Global variables
|
||||
|
@ -102,8 +98,7 @@ static String *outdir = 0;
|
|||
// Checks the suffix of a file to see if we should emit extern declarations.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
int
|
||||
check_suffix(char *name) {
|
||||
static int check_suffix(char *name) {
|
||||
char *c;
|
||||
if (!name) return 0;
|
||||
c = Swig_file_suffix(name);
|
||||
|
@ -123,8 +118,7 @@ check_suffix(char *name) {
|
|||
// Install all command line options as preprocessor symbols
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
static void
|
||||
install_opts(int argc, char *argv[]) {
|
||||
static void install_opts(int argc, char *argv[]) {
|
||||
int i;
|
||||
int noopt = 0;
|
||||
char *c;
|
||||
|
@ -201,16 +195,6 @@ void SWIG_config_cppext(const char *ext) {
|
|||
cpp_extension = (char *) ext;
|
||||
}
|
||||
|
||||
extern "C" Node *Swig_cparse(File *);
|
||||
extern "C" void Swig_cparse_cplusplus(int);
|
||||
extern "C" void Swig_cparse_debug_templates(int);
|
||||
extern void Wrapper_virtual_elimination_mode_set(int);
|
||||
extern void Wrapper_director_protected_mode_set(int);
|
||||
|
||||
extern void Swig_contracts(Node *n);
|
||||
extern void Swig_contract_mode_set(int flag);
|
||||
extern int Swig_contract_mode_get();
|
||||
|
||||
int SWIG_main(int argc, char *argv[], Language *l) {
|
||||
int i;
|
||||
char *c;
|
||||
|
@ -222,7 +206,6 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
|||
int tm_debug = 0;
|
||||
char *includefiles[256];
|
||||
int includecount = 0;
|
||||
extern int check_suffix(char *);
|
||||
int dump_tags = 0;
|
||||
int dump_tree = 0;
|
||||
int browse = 0;
|
||||
|
@ -232,13 +215,8 @@ int SWIG_main(int argc, char *argv[], Language *l) {
|
|||
int depend = 0;
|
||||
int memory_debug = 0;
|
||||
int allkw = 0;
|
||||
|
||||
DOH *libfiles = 0;
|
||||
DOH *cpps = 0 ;
|
||||
extern void Swig_browser(Node *n, int);
|
||||
extern void Swig_default_allocators(Node *n);
|
||||
extern void Swig_process_types(Node *n);
|
||||
|
||||
|
||||
/* Initialize the SWIG core */
|
||||
Swig_init();
|
||||
|
|
|
@ -406,10 +406,7 @@ public:
|
|||
};
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
Language * swig_sexp( void )
|
||||
{
|
||||
return new Sexp();
|
||||
}
|
||||
extern "C" Language *
|
||||
swig_sexp( void ) {
|
||||
return new Sexp();
|
||||
}
|
||||
|
|
|
@ -21,11 +21,8 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
extern "C" {
|
||||
#include "swig.h"
|
||||
Hash *Preprocessor_define(const String_or_char *str, int swigmacro);
|
||||
}
|
||||
|
||||
#include "preprocessor.h"
|
||||
#include "swigwarn.h"
|
||||
|
||||
#define NOT_VIRTUAL 0
|
||||
|
@ -309,11 +306,27 @@ ModuleFactory Swig_find_module(const char *name);
|
|||
|
||||
/* Utilities */
|
||||
|
||||
extern int is_public(Node* n);
|
||||
extern int is_private(Node* n);
|
||||
extern int is_protected(Node* n);
|
||||
extern int is_member_director(Node* parentnode, Node* member);
|
||||
extern int is_member_director(Node* member);
|
||||
int is_public(Node* n);
|
||||
int is_private(Node* n);
|
||||
int is_protected(Node* n);
|
||||
int is_member_director(Node* parentnode, Node* member);
|
||||
int is_member_director(Node* member);
|
||||
void Wrapper_virtual_elimination_mode_set(int);
|
||||
void Wrapper_director_protected_mode_set(int);
|
||||
|
||||
|
||||
/* Contracts */
|
||||
|
||||
void Swig_contracts(Node *n);
|
||||
void Swig_contract_mode_set(int flag);
|
||||
int Swig_contract_mode_get();
|
||||
|
||||
/* Browser */
|
||||
|
||||
void Swig_browser(Node *n, int);
|
||||
void Swig_default_allocators(Node *n);
|
||||
void Swig_process_types(Node *n);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -332,10 +332,7 @@ public:
|
|||
};
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
Language * swig_xml( void )
|
||||
{
|
||||
return new XML();
|
||||
}
|
||||
extern "C" Language *
|
||||
swig_xml( void ) {
|
||||
return new XML();
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
char cvsroot_cpp_c[] = "$Header$";
|
||||
|
||||
#include "swig.h"
|
||||
#include "preprocessor.h"
|
||||
#include <ctype.h>
|
||||
|
||||
|
@ -112,7 +113,6 @@ List *Preprocessor_depend(void) {
|
|||
* void Preprocessor_cpp_init() - Initialize the preprocessor
|
||||
* ----------------------------------------------------------------------------- */
|
||||
void Preprocessor_init() {
|
||||
extern void Preprocessor_expr_init(void);
|
||||
Hash *s;
|
||||
cpp = NewHash();
|
||||
s = NewHash();
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
char cvsroot_expr_c[] = "$Header$";
|
||||
|
||||
#include "swig.h"
|
||||
#include "preprocessor.h"
|
||||
|
||||
static SwigScanner *scan = 0;
|
||||
|
|
|
@ -11,10 +11,9 @@
|
|||
* $Header$
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
#ifndef _PREPROCESSOR_H
|
||||
#define _PREPROCESSOR_H
|
||||
#ifndef PREPROCESSOR_H_
|
||||
#define PREPROCESSOR_H_
|
||||
|
||||
#include "swig.h"
|
||||
#include "swigwarn.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -30,6 +29,7 @@ extern void Preprocessor_include_all(int);
|
|||
extern void Preprocessor_import_all(int);
|
||||
extern void Preprocessor_ignore_missing(int);
|
||||
extern List *Preprocessor_depend(void);
|
||||
extern void Preprocessor_expr_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -12,14 +12,18 @@
|
|||
* $Header$
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
#ifndef _SWIGCORE_H
|
||||
#define _SWIGCORE_H
|
||||
#ifndef SWIGCORE_H_
|
||||
#define SWIGCORE_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "doh.h"
|
||||
|
||||
/* Status codes */
|
||||
|
@ -486,13 +490,13 @@ extern void Swig_typemap_attach_parms(const String_or_char *op, ParmList *parm
|
|||
|
||||
extern void Swig_fragment_register(String *name, String *section, String *code);
|
||||
extern void Swig_fragment_emit(String *name);
|
||||
|
||||
|
||||
/* hacks defined in C++ ! */
|
||||
extern int Swig_need_protected();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -12,9 +12,10 @@
|
|||
char cvsroot_typemap_c[] = "$Header$";
|
||||
|
||||
#include "swig.h"
|
||||
#include "cparse.h"
|
||||
#include <ctype.h>
|
||||
|
||||
void replace_embedded_typemap(String *s, Wrapper *f);
|
||||
static void replace_embedded_typemap(String *s, Wrapper *f);
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Typemaps are stored in a collection of nested hash tables. Something like
|
||||
|
@ -1437,7 +1438,6 @@ static List *split_embedded(String *s) {
|
|||
static void split_var(String *s, String **name, String **value) {
|
||||
char *eq;
|
||||
char *c;
|
||||
extern Parm *Swig_cparse_parm(String *s);
|
||||
|
||||
eq = Strstr(s,"=");
|
||||
if (!eq) {
|
||||
|
@ -1462,7 +1462,7 @@ static void split_var(String *s, String **name, String **value) {
|
|||
}
|
||||
}
|
||||
|
||||
void replace_embedded_typemap(String *s, Wrapper *f) {
|
||||
static void replace_embedded_typemap(String *s, Wrapper *f) {
|
||||
while (Strstr(s,"$TYPEMAP(")) {
|
||||
|
||||
/* Gather the argument */
|
||||
|
|
Loading…
Reference in New Issue