PageRenderTime 55ms CodeModel.GetById 20ms app.highlight 29ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-30rc1-b4beautify/SWIG/Source/Swig/swig.h

#
C++ Header | 560 lines | 522 code | 20 blank | 18 comment | 0 complexity | d0b64e83f87f9f0a007f87464495aabb MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1/* ----------------------------------------------------------------------------- 
  2 * See the LICENSE file for information on copyright, usage and redistribution
  3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
  4 *
  5 * swig.h
  6 *
  7 * Header file for the SWIG core.
  8 * ----------------------------------------------------------------------------- */
  9
 10/* $Header$ */
 11
 12#ifndef SWIGCORE_H_
 13#define SWIGCORE_H_
 14
 15#ifndef MACSWIG
 16#include "swigconfig.h"
 17#endif
 18
 19#include <stdio.h>
 20#include <string.h>
 21#include <stdlib.h>
 22#include <assert.h>
 23
 24#ifdef __cplusplus
 25extern "C" {
 26#endif
 27
 28#include "doh.h"
 29
 30/* Status codes */
 31
 32#define SWIG_OK         1
 33#define SWIG_ERROR      0
 34#define SWIG_NOWRAP     0
 35
 36/* Short names for common data types */
 37
 38typedef  DOH     String;
 39typedef  DOH     Hash;
 40typedef  DOH     List;
 41typedef  DOH     String_or_char;
 42typedef  DOH     File;
 43typedef  DOH     Parm;
 44typedef  DOH     ParmList;
 45typedef  DOH     Node;
 46typedef  DOH     Symtab;
 47typedef  DOH     Typetab;
 48typedef  DOH     SwigType;
 49
 50/* --- Legacy DataType interface.  These type codes are provided solely 
 51       for backwards compatibility with older modules --- */
 52
 53/* --- The ordering of type values is used to determine type-promotion 
 54       in the parser.  Do not change */
 55
 56/* Numeric types */
 57
 58#define   T_BOOL       1
 59#define   T_SCHAR      2
 60#define   T_UCHAR      3
 61#define   T_SHORT      4
 62#define   T_USHORT     5
 63#define   T_ENUM       6
 64#define   T_INT        7
 65#define   T_UINT       8
 66#define   T_LONG       9
 67#define   T_ULONG      10
 68#define   T_LONGLONG   11
 69#define   T_ULONGLONG  12
 70#define   T_FLOAT      20
 71#define   T_DOUBLE     21
 72#define   T_LONGDOUBLE 22
 73#define   T_FLTCPLX    23
 74#define   T_DBLCPLX    24
 75#define   T_NUMERIC    25
 76
 77#define   T_COMPLEX    T_DBLCPLX
 78
 79/* non-numeric */
 80
 81#define   T_CHAR       29
 82#define   T_WCHAR      30
 83#define   T_USER       31
 84#define   T_VOID       32
 85#define   T_STRING     33
 86#define   T_POINTER    34
 87#define   T_REFERENCE  35
 88#define   T_ARRAY      36
 89#define   T_FUNCTION   37
 90#define   T_MPOINTER   38
 91#define   T_VARARGS    39
 92#define   T_SYMBOL     98
 93#define   T_ERROR      99
 94
 95/* --- File interface --- */
 96
 97extern List    *Swig_add_directory(const String_or_char *dirname);
 98extern void     Swig_push_directory(const String_or_char *dirname);
 99extern void     Swig_pop_directory();
100extern String  *Swig_last_file();
101extern List    *Swig_search_path();
102extern FILE    *Swig_open(const String_or_char *name);
103extern String  *Swig_read_file(FILE *f);
104extern String  *Swig_include(const String_or_char *name);
105extern String  *Swig_include_sys(const String_or_char *name);
106extern int      Swig_insert_file(const String_or_char *name, File *outfile);
107extern void     Swig_set_config_file(const String_or_char *filename);
108extern String  *Swig_get_config_file(void);
109extern void     Swig_set_push_dir(int dopush);
110extern int      Swig_get_push_dir(void);
111extern void     Swig_swiglib_set(const String_or_char *);
112extern String  *Swig_swiglib_get();
113extern void     Swig_register_filebyname(const String_or_char *filename, File *outfile);
114extern File    *Swig_filebyname(const String_or_char *filename);
115extern char    *Swig_file_suffix(const String_or_char *filename);
116extern char    *Swig_file_basename(const String_or_char *filename);
117extern char    *Swig_file_filename(const String_or_char *filename);
118extern char    *Swig_file_dirname(const String_or_char *filename);
119
120#if defined(MACSWIG)
121#  define SWIG_FILE_DELIMETER  ":"
122#elif defined(_WIN32)
123#  define  SWIG_FILE_DELIMETER "\\"
124#else
125#  define  SWIG_FILE_DELIMETER "/"
126#endif
127
128/* --- Command line parsing --- */
129
130extern void     Swig_init_args(int argc, char **argv);
131extern void     Swig_mark_arg(int n);
132extern int      Swig_check_marked(int n);
133extern void     Swig_check_options(int check_input);
134extern void     Swig_arg_error();
135
136/* --- Scanner Interface --- */
137
138typedef struct SwigScanner SwigScanner;
139
140extern SwigScanner *NewSwigScanner();
141extern void         DelSwigScanner(SwigScanner *);
142extern void         SwigScanner_clear(SwigScanner *);
143extern void         SwigScanner_push(SwigScanner *, String *);
144extern void         SwigScanner_pushtoken(SwigScanner *, int);
145extern int          SwigScanner_token(SwigScanner *);
146extern String      *SwigScanner_text(SwigScanner *);
147extern void         SwigScanner_skip_line(SwigScanner *);
148extern int          SwigScanner_skip_balanced(SwigScanner *, int startchar, int endchar);
149extern void         SwigScanner_set_location(SwigScanner *, String *file, int line);
150extern String      *SwigScanner_get_file(SwigScanner *);
151extern int          SwigScanner_get_line(SwigScanner *);
152extern void         SwigScanner_idstart(SwigScanner *, char *idchar);
153
154#define   SWIG_MAXTOKENS          512
155#define   SWIG_TOKEN_LPAREN        1  
156#define   SWIG_TOKEN_RPAREN        2
157#define   SWIG_TOKEN_SEMI          3
158#define   SWIG_TOKEN_COMMA         4
159#define   SWIG_TOKEN_STAR          5
160#define   SWIG_TOKEN_LBRACE        6
161#define   SWIG_TOKEN_RBRACE        7
162#define   SWIG_TOKEN_EQUAL         8
163#define   SWIG_TOKEN_EQUALTO       9
164#define   SWIG_TOKEN_NOTEQUAL     10
165#define   SWIG_TOKEN_PLUS         11
166#define   SWIG_TOKEN_MINUS        12
167#define   SWIG_TOKEN_AND          13
168#define   SWIG_TOKEN_LAND         14
169#define   SWIG_TOKEN_OR           15
170#define   SWIG_TOKEN_LOR          16
171#define   SWIG_TOKEN_XOR          17
172#define   SWIG_TOKEN_LESSTHAN     18
173#define   SWIG_TOKEN_GREATERTHAN  19
174#define   SWIG_TOKEN_LTEQUAL      20
175#define   SWIG_TOKEN_GTEQUAL      21
176#define   SWIG_TOKEN_NOT          22
177#define   SWIG_TOKEN_LNOT         23
178#define   SWIG_TOKEN_LBRACKET     24
179#define   SWIG_TOKEN_RBRACKET     25
180#define   SWIG_TOKEN_SLASH        26
181#define   SWIG_TOKEN_BACKSLASH    27
182#define   SWIG_TOKEN_ENDLINE      28
183#define   SWIG_TOKEN_STRING       29
184#define   SWIG_TOKEN_POUND        30
185#define   SWIG_TOKEN_PERCENT      31
186#define   SWIG_TOKEN_COLON        32
187#define   SWIG_TOKEN_DCOLON       33
188#define   SWIG_TOKEN_LSHIFT       34
189#define   SWIG_TOKEN_RSHIFT       35
190#define   SWIG_TOKEN_ID           36
191#define   SWIG_TOKEN_FLOAT        37
192#define   SWIG_TOKEN_DOUBLE       38
193#define   SWIG_TOKEN_INT          39
194#define   SWIG_TOKEN_UINT         40
195#define   SWIG_TOKEN_LONG         41
196#define   SWIG_TOKEN_ULONG        42
197#define   SWIG_TOKEN_CHAR         43
198#define   SWIG_TOKEN_PERIOD       44
199#define   SWIG_TOKEN_AT           45
200#define   SWIG_TOKEN_DOLLAR       46
201#define   SWIG_TOKEN_CODEBLOCK    47
202#define   SWIG_TOKEN_RSTRING      48
203#define   SWIG_TOKEN_LONGLONG     49
204#define   SWIG_TOKEN_ULONGLONG    50
205#define   SWIG_TOKEN_ILLEGAL      98
206#define   SWIG_TOKEN_LAST         99 
207
208/* --- Functions for manipulating the string-based type encoding --- */
209
210extern SwigType   *NewSwigType(int typecode);
211extern SwigType    *SwigType_del_element(SwigType *t);
212extern SwigType   *SwigType_add_pointer(SwigType *t);
213extern SwigType   *SwigType_add_memberpointer(SwigType *t, const String_or_char *qual);
214extern SwigType   *SwigType_del_pointer(SwigType *t);
215extern SwigType   *SwigType_add_array(SwigType *t, const String_or_char *size);
216extern SwigType   *SwigType_del_array(SwigType *t);
217extern SwigType   *SwigType_pop_arrays(SwigType *t);
218extern SwigType   *SwigType_add_reference(SwigType *t);
219extern SwigType   *SwigType_del_reference(SwigType *t);
220extern SwigType   *SwigType_add_qualifier(SwigType *t, const String_or_char *qual);
221extern SwigType   *SwigType_del_qualifier(SwigType *t);
222extern SwigType   *SwigType_add_function(SwigType *t, ParmList *parms);
223extern SwigType   *SwigType_add_template(SwigType *t, ParmList *parms);
224extern SwigType   *SwigType_pop_function(SwigType *t);
225extern ParmList   *SwigType_function_parms(SwigType *t);
226extern List       *SwigType_split(const SwigType *t);
227extern String     *SwigType_pop(SwigType *t);
228extern void        SwigType_push(SwigType *t, SwigType *s);
229extern List       *SwigType_parmlist(const SwigType *p);
230extern String     *SwigType_parm(String *p);
231extern String     *SwigType_str(SwigType *s, const String_or_char *id);
232extern String     *SwigType_lstr(SwigType *s, const String_or_char *id);
233extern String     *SwigType_rcaststr(SwigType *s, const String_or_char *id);
234extern String     *SwigType_lcaststr(SwigType *s, const String_or_char *id);
235extern String     *SwigType_manglestr(SwigType *t);
236extern SwigType   *SwigType_ltype(SwigType *t);
237extern int         SwigType_ispointer(SwigType *t);
238extern int         SwigType_ispointer_return(SwigType *t);
239extern int         SwigType_ismemberpointer(SwigType *t);
240extern int         SwigType_isreference(SwigType *t);
241extern int         SwigType_isreference_return(SwigType *t);
242extern int         SwigType_isarray(SwigType *t);
243extern int         SwigType_isfunction(SwigType *t);
244extern int         SwigType_isqualifier(SwigType *t);
245extern int         SwigType_isconst(SwigType *t);
246extern int         SwigType_issimple(SwigType *t);
247extern int         SwigType_ismutable(SwigType *t);
248extern int         SwigType_isvarargs(const SwigType *t);
249extern int         SwigType_istemplate(const SwigType *t);
250extern int         SwigType_isenum(SwigType *t);
251extern int         SwigType_check_decl(SwigType *t, const String_or_char *decl);
252extern SwigType   *SwigType_strip_qualifiers(SwigType *t);
253extern String     *SwigType_base(const SwigType *t);
254extern String     *SwigType_namestr(const SwigType *t);
255extern String     *SwigType_templateprefix(const SwigType *t);
256extern String     *SwigType_templatesuffix(const SwigType *t);
257extern String     *SwigType_templateargs(const SwigType *t);
258extern String     *SwigType_prefix(const SwigType *t);
259extern int         SwigType_array_ndim(SwigType *t);
260extern String     *SwigType_array_getdim(SwigType *t, int n);
261extern void        SwigType_array_setdim(SwigType *t, int n, const String_or_char *rep);
262extern SwigType   *SwigType_array_type(SwigType *t);
263extern String     *SwigType_default(SwigType *t);
264extern void        SwigType_typename_replace(SwigType *t, String *pat, String *rep);
265extern SwigType   *SwigType_alttype(SwigType *t, int ltmap);
266
267extern void     SwigType_template_defargs(Parm *parms, Parm *targs, Symtab *tscope, Symtab *tsdecl);
268extern SwigType*  SwigType_template_deftype(const SwigType *type, Symtab *tscope);
269
270/* --- Type-system managment --- */
271extern void        SwigType_typesystem_init();
272extern int         SwigType_typedef(SwigType *type, String_or_char *name);
273extern int         SwigType_typedef_class(String_or_char *name);
274extern int         SwigType_typedef_using(String_or_char *qname);
275extern void        SwigType_inherit(String *subclass, String *baseclass, String *cast);
276extern int         SwigType_issubtype(SwigType *subtype, SwigType *basetype);
277extern void        SwigType_scope_alias(String *aliasname, Typetab *t);
278extern void        SwigType_using_scope(Typetab *t);
279extern void        SwigType_new_scope(const String_or_char *name);
280extern void        SwigType_inherit_scope(Typetab *scope);
281extern Typetab    *SwigType_pop_scope();
282extern Typetab    *SwigType_set_scope(Typetab *h);
283extern void        SwigType_print_scope(Typetab *t);
284extern SwigType   *SwigType_typedef_resolve(SwigType *t);
285extern SwigType   *SwigType_typedef_resolve_all(SwigType *t);
286extern SwigType   *SwigType_typedef_qualified(SwigType *t);
287extern int         SwigType_istypedef(SwigType *t);
288extern int         SwigType_isclass(SwigType *t);
289extern void        SwigType_attach_symtab(Symtab *syms);
290extern void        SwigType_remember(SwigType *t);
291extern void        SwigType_remember_clientdata(SwigType *t, const String_or_char *clientdata);
292extern void        SwigType_remember_mangleddata(String *mangled, const String_or_char *clientdata);
293extern void      (*SwigType_remember_trace(void (*tf)(SwigType *, String *, String *)))(SwigType *, String *, String *);
294extern void        SwigType_emit_type_table(File *f_headers, File *f_table);
295extern int         SwigType_type(SwigType *t);
296
297/* --- Symbol table module --- */
298
299extern void     Swig_symbol_init();
300extern void     Swig_symbol_setscopename(const String_or_char *name);
301extern String   *Swig_symbol_getscopename();
302extern String   *Swig_symbol_qualifiedscopename(Symtab *symtab);
303extern Symtab   *Swig_symbol_newscope();
304extern Symtab   *Swig_symbol_setscope(Symtab *);
305extern Symtab   *Swig_symbol_getscope(const String_or_char *symname);
306extern Symtab   *Swig_symbol_current();
307extern Symtab   *Swig_symbol_popscope();
308extern Node     *Swig_symbol_add(String_or_char *symname, Node *node);
309extern void      Swig_symbol_cadd(String_or_char *symname, Node *node);
310extern Node     *Swig_symbol_clookup(String_or_char *symname, Symtab *tab);
311extern Node     *Swig_symbol_clookup_check(String_or_char *symname, Symtab *tab, int (*check)(Node *));
312extern Symtab   *Swig_symbol_cscope(String_or_char *symname, Symtab *tab);
313extern Node     *Swig_symbol_clookup_local(String_or_char *symname, Symtab *tab);
314extern Node     *Swig_symbol_clookup_local_check(String_or_char *symname, Symtab *tab, int (*check)(Node *));
315extern String   *Swig_symbol_qualified(Node *node);
316extern Node     *Swig_symbol_isoverloaded(Node *node);
317extern void      Swig_symbol_remove(Node *node);
318extern void      Swig_symbol_alias(String_or_char *aliasname, Symtab *tab);
319extern void      Swig_symbol_inherit(Symtab *tab);
320extern SwigType *Swig_symbol_type_qualify(const SwigType *ty, Symtab *tab);
321extern String   *Swig_symbol_string_qualify(String *s, Symtab *tab);
322extern SwigType *Swig_symbol_typedef_reduce(SwigType *ty, Symtab *tab);
323
324extern void     Swig_symbol_template_defargs(Parm *parms, Parm *targs, Symtab *tscope, Symtab *tsdecl);
325extern SwigType *Swig_symbol_template_deftype(const SwigType *type, Symtab *tscope);
326extern SwigType *Swig_symbol_template_param_eval(const SwigType *p, Symtab *symtab);
327
328/* --- Parameters and Parameter Lists --- */
329
330/* Parameters are really just hidden behind a DOH object.  The following
331   interface will probably be simplified even further. */
332
333extern Parm       *NewParm(SwigType *type, const String_or_char *name);
334extern Parm       *NewParmFromNode(SwigType *type, const String_or_char *name, Node *n);
335extern Parm       *CopyParm(Parm *p);
336extern ParmList   *CopyParmList(ParmList *);
337extern int         ParmList_len(ParmList *);
338extern int         ParmList_numarg(ParmList *);
339extern int         ParmList_numrequired(ParmList *);
340extern String     *ParmList_str(ParmList *);
341extern String     *ParmList_str_defaultargs(ParmList *);
342extern String     *ParmList_protostr(ParmList *);
343extern int         ParmList_is_compactdefargs(ParmList *p);
344extern int         ParmList_has_defaultargs(ParmList *p);
345extern ParmList   *ParmList_copy_all_except_last_parm(ParmList *p);
346
347/* --- Parse tree support --- */
348
349/* DOM-like node access */
350#include "swigkeys.h"
351#define  nodeType(x)               Getattr(x,k_nodetype)
352#define  parentNode(x)             Getattr(x,k_parentnode)
353#define  previousSibling(x)        Getattr(x,k_previoussibling)
354#define  nextSibling(x)            Getattr(x,k_nextsibling)
355#define  firstChild(x)             Getattr(x,k_firstchild)
356#define  lastChild(x)              Getattr(x,k_lastchild)
357extern int checkAttribute(Node *obj, const String_or_char *name, const String_or_char *value);
358
359/* Macros to set up the DOM tree (mostly used by the parser) */
360
361#define  set_nodeType(x,v)         Setattr(x,"nodeType",v)
362#define  set_parentNode(x,v)       Setattr(x,"parentNode",v)
363#define  set_previousSibling(x,v)  Setattr(x,"previousSibling",v)
364#define  set_nextSibling(x,v)      Setattr(x,"nextSibling",v)
365#define  set_firstChild(x,v)       Setattr(x,"firstChild",v)
366#define  set_lastChild(x,v)        Setattr(x,"lastChild",v)
367
368extern void appendChild(Node *node, Node *child);
369extern void preppendChild(Node *node, Node *child);
370extern void deleteNode(Node *node);
371extern Node *copyNode(Node *node);
372
373extern void Swig_tag_nodes(Node *node, const String_or_char *attrname, DOH *value);
374
375extern int  Swig_require(const char *ns, Node *node, ...);
376extern int  Swig_save(const char *ns, Node *node,...);
377extern void Swig_restore(Node *node);
378
379/* Debugging of parse trees */
380extern void Swig_print_tags(File *obj, Node *root);
381extern void Swig_print_tree(Node *obj);
382extern void Swig_print_node(Node *obj);
383
384extern void Swig_print_xml(Node *obj, String* filename);
385
386/* -- Wrapper function Object */
387
388typedef struct {
389  Hash      *localh;
390  String    *def;
391  String    *locals;
392  String    *code;
393} Wrapper;
394
395extern Wrapper  *NewWrapper();
396extern void      DelWrapper(Wrapper *w);
397extern void      Wrapper_compact_print_mode_set(int flag);
398extern void      Wrapper_pretty_print(String *str, File *f);
399extern void      Wrapper_compact_print(String *str, File *f);
400extern void      Wrapper_print(Wrapper *w, File *f);
401extern int       Wrapper_add_local(Wrapper *w, const String_or_char *name, const String_or_char *decl);
402extern int       Wrapper_add_localv(Wrapper *w, const String_or_char *name, ...);
403extern int       Wrapper_check_local(Wrapper *w, const String_or_char *name);
404extern char     *Wrapper_new_local(Wrapper *w, const String_or_char *name, const String_or_char *decl);
405extern char     *Wrapper_new_localv(Wrapper *w, const String_or_char *name, ...);
406
407/* --- Naming functions --- */
408
409extern void     Swig_name_register(const String_or_char *method, const String_or_char *format);
410extern void     Swig_name_unregister(const String_or_char *method);
411extern String  *Swig_name_mangle(const String_or_char *s);
412extern String  *Swig_name_wrapper(const String_or_char *fname);
413extern String  *Swig_name_member(const String_or_char *classname, const String_or_char *mname);
414extern String  *Swig_name_get(const String_or_char *vname);
415extern String  *Swig_name_set(const String_or_char *vname);
416extern String  *Swig_name_construct(const String_or_char *classname);
417extern String  *Swig_name_copyconstructor(const String_or_char *classname);
418extern String  *Swig_name_destroy(const String_or_char *classname);
419extern String  *Swig_name_disown(const String_or_char *classname);
420
421extern void     Swig_naming_init();
422extern void     Swig_name_namewarn_add(String *prefix, String *name, SwigType *decl, Hash *namewrn);
423extern Hash    *Swig_name_namewarn_get(Node *n, String *prefix, String *name,SwigType *decl);
424extern void     Swig_name_rename_add(String *prefix, String *name, SwigType *decl, Hash *namewrn, ParmList *declaratorparms);
425extern void     Swig_name_inherit(String *base, String *derived);
426extern int      Swig_need_protected(Node *n);
427extern int      Swig_need_name_warning(Node *n);
428extern int      Swig_need_redefined_warn(Node* a, Node* b, int InClass);
429
430extern String  *Swig_name_make(Node *n, String *prefix, String_or_char *cname, SwigType *decl, String *oldname);
431extern String  *Swig_name_warning(Node *n, String *prefix, String *name,SwigType *decl);
432
433/* --- parameterized rename functions --- */
434
435extern void      Swig_name_object_set(Hash *namehash, String_or_char *name, SwigType *decl, DOH *object);
436extern DOH      *Swig_name_object_get(Hash *namehash, String_or_char *prefix, String_or_char *name, SwigType *decl);
437extern void      Swig_name_object_inherit(Hash *namehash, String *base, String *derived);
438extern void      Swig_features_get(Hash *features, String_or_char *prefix, String_or_char *name, SwigType *decl, Node *n);
439extern void      Swig_feature_set(Hash *features, const String_or_char *name, SwigType *decl, const String_or_char *featurename, String *value, Hash *featureattribs);
440
441/* --- Misc --- */
442extern char      *Swig_copy_string(const char *c);
443extern void       Swig_banner(File *f);
444extern String    *Swig_string_escape(String *s);
445extern String    *Swig_string_mangle(const String *s);
446extern void       Swig_scopename_split(String *s, String **prefix, String **last);
447extern String    *Swig_scopename_prefix(String *s);
448extern String    *Swig_scopename_last(String *s);
449extern String    *Swig_scopename_first(String *s);
450extern String    *Swig_scopename_suffix(String *s);
451extern int        Swig_scopename_check(String *s);
452extern String    *Swig_string_lower(String *s);
453extern String    *Swig_string_upper(String *s);
454extern String    *Swig_string_title(String *s);
455
456extern void       Swig_init();
457extern void       Swig_warn(const char *filename, int line, const char *msg);
458
459extern int        Swig_value_wrapper_mode(int mode);
460
461
462#define WARNING(msg) Swig_warn(__FILE__,__LINE__,msg)
463
464typedef enum { EMF_STANDARD, EMF_MICROSOFT } ErrorMessageFormat;
465
466extern void       Swig_warning(int num, const String_or_char *filename, int line, const char *fmt, ...);
467extern void       Swig_error(const String_or_char *filename, int line, const char *fmt, ...);
468extern int        Swig_error_count(void);
469extern void       Swig_error_silent(int s);
470extern void       Swig_warnfilter(const String_or_char *wlist, int val);
471extern void       Swig_warnall(void);
472extern int        Swig_warn_count(void);
473extern void       Swig_error_msg_format(ErrorMessageFormat format);
474
475/* --- C Wrappers --- */
476extern String    *Swig_cparm_name(Parm *p, int i);
477extern String    *Swig_wrapped_var_type(SwigType *t, int varcref);
478extern int        Swig_cargs(Wrapper *w, ParmList *l);
479extern String    *Swig_cresult(SwigType *t, const String_or_char *name, const String_or_char *decl);
480
481extern String    *Swig_cfunction_call(String_or_char *name, ParmList *parms);
482extern String    *Swig_cconstructor_call(String_or_char *name);
483extern String    *Swig_cppconstructor_call(String_or_char *name, ParmList *parms);
484extern String    *Swig_unref_call(Node *n);
485extern String    *Swig_ref_call(Node *n, const String* lname);
486extern String    *Swig_cdestructor_call(Node *n);
487extern String    *Swig_cppdestructor_call(Node *n);
488extern String    *Swig_cmemberset_call(String_or_char *name, SwigType *type, String_or_char *self, int varcref);
489extern String    *Swig_cmemberget_call(const String_or_char *name, SwigType *t, String_or_char *self, int varcref);
490
491extern String    *Swig_extension_code(const String *function_name,
492ParmList *parms, SwigType* return_type, const String *code, int cplusplus);
493extern int        Swig_add_extension_code(Node *n, const String *function_name, ParmList *parms, SwigType* return_type, const String *code, int cplusplus);
494
495/* --- Transformations --- */
496
497extern int        Swig_MethodToFunction(Node *n, String *classname, int flags, SwigType *director_type, int is_director);
498extern int        Swig_ConstructorToFunction(Node *n, String *classname, 
499					     String *none_comparison,
500					     String *director_ctor,
501					     int cplus, int flags);
502extern int        Swig_DestructorToFunction(Node *n, String *classname, int cplus, int flags);
503extern int        Swig_MembersetToFunction(Node *n, String *classname, int flags);
504extern int        Swig_MembergetToFunction(Node *n, String *classname, int flags);
505extern int        Swig_VargetToFunction(Node *n, int flags);
506extern int        Swig_VarsetToFunction(Node *n, int flags);
507
508#define  CWRAP_EXTEND             0x01
509#define  CWRAP_SMART_POINTER      0x02
510#define  CWRAP_NATURAL_VAR        0x04
511#define  CWRAP_DIRECTOR_ONE_CALL  0x08
512#define  CWRAP_DIRECTOR_TWO_CALLS 0x10
513
514/* --- Director Helpers --- */
515extern Node      *Swig_methodclass(Node *n);
516extern int        Swig_directorclass(Node *n);
517extern Node      *Swig_directormap(Node *n, String *type);
518
519/* --- Legacy Typemap API (somewhat simplified, ha!) --- */
520
521extern     void   Swig_typemap_init();
522extern     void   Swig_typemap_register(const String_or_char *op, ParmList *pattern, String_or_char *code, ParmList *locals, ParmList *kwargs);
523extern     int    Swig_typemap_copy(const String_or_char *op, ParmList *srcpattern, ParmList *pattern);
524extern     void   Swig_typemap_clear(const String_or_char *op, ParmList *pattern);
525extern     int    Swig_typemap_apply(ParmList *srcpat, ParmList *destpat);
526extern     void   Swig_typemap_clear_apply(ParmList *pattern);
527extern     void   Swig_typemap_debug();
528
529extern Hash  *Swig_typemap_search(const String_or_char *op, SwigType *type, const String_or_char *pname, SwigType **matchtype);
530extern Hash  *Swig_typemap_search_multi(const String_or_char *op, ParmList *parms, int *nmatch);
531extern String *Swig_typemap_lookup(const String_or_char *op, SwigType *type, String_or_char *pname, String_or_char *lname,
532				  String_or_char *source, String_or_char *target, Wrapper *f);
533
534extern String *Swig_typemap_lookup_new(const String_or_char *op, Node *n, const String_or_char *lname, Wrapper *f);
535extern void Swig_typemap_attach_kwargs(Hash *tm, const String_or_char *op, Parm *p);
536extern void   Swig_typemap_new_scope();
537extern Hash  *Swig_typemap_pop_scope();
538
539extern void   Swig_typemap_attach_parms(const String_or_char *op, ParmList *parms, Wrapper *f);
540
541/* --- Code fragment support --- */
542
543extern  void  Swig_fragment_register(Node* fragment);
544extern  void  Swig_fragment_emit(String *name);
545
546/* hacks defined in C++ ! */
547extern  int  Swig_director_mode();
548extern void  Wrapper_director_mode_set(int);
549
550
551/* -- template init -- */
552extern void SwigType_template_init();
553
554
555#ifdef __cplusplus
556}
557#endif
558
559#endif
560