]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/wxSWIG/SWIG/internal.h
1 /*******************************************************************************
2 * Simplified Wrapper and Interface Generator (SWIG)
4 * Author : David Beazley
6 * Department of Computer Science
7 * University of Chicago
10 * beazley@cs.uchicago.edu
12 * Please read the file LICENSE for the copyright and terms by which SWIG
13 * can be used and distributed.
14 *******************************************************************************/
16 /***********************************************************************
21 * Contains global variables used in libswig, but which are otherwise
22 * inaccessible to the user.
24 ***********************************************************************/
28 // -------------------------------------------------------------------
29 // class DocTitle : public DocEntry
31 // Top level class for managing documentation. Prints out a title,
33 // -------------------------------------------------------------------
35 class DocTitle
: public DocEntry
{
37 DocTitle(char *title
, DocEntry
*_parent
); // Create a new title
38 void output(Documentation
*d
); // Output documentation
41 // --------------------------------------------------------------------
42 // class DocSection : public DocEntry
44 // Documentation entry for a section
45 // --------------------------------------------------------------------
47 class DocSection
: public DocEntry
{
49 DocSection(char *section
, DocEntry
*_parent
);
50 void output(Documentation
*d
);
53 // --------------------------------------------------------------------
54 // class DocFunction : public DocEntry
56 // Documentation entry for generic sorts of declarations
57 // --------------------------------------------------------------------
59 class DocDecl
: public DocEntry
{
61 DocDecl(char *fname
, DocEntry
*_parent
);
62 DocDecl(DocEntry
*de
, DocEntry
*_parent
);
63 void output(Documentation
*d
);
66 // --------------------------------------------------------------------
67 // class DocClass : public DocEntry
69 // Documentation entry for a C++ class or C struct
70 // --------------------------------------------------------------------
72 class DocClass
: public DocEntry
{
74 DocClass(char *classname
, DocEntry
*_parent
);
75 void output(Documentation
*d
);
78 // --------------------------------------------------------------------
79 // class DocText : public DocEntry
81 // Documentation entry for some plain ole text. Declared using
82 // the %text %{,%} directive.
83 // --------------------------------------------------------------------
85 class DocText
: public DocEntry
{
87 DocText(char *_text
, DocEntry
*_parent
);
88 void output(Documentation
*d
);
91 // --------------------------------------------------------------------
92 // class CommentHandler
94 // Class for managing comment processing.
95 // --------------------------------------------------------------------
97 class CommentHandler
{
100 CommentHandler(CommentHandler
*c
);
102 void add_comment(char *text
, int line_num
, int col
, char *file
); // Add a comment
103 void set_entry(DocEntry
*d
); // Set documentation entry
104 static void cleanup(); // Clean-up everything before quitting
105 void style(char *name
, char *value
);
106 void parse_args(int argc
, char **argv
); // Parse command line options
108 // Comment handling style parameters
109 int skip_lines
; // # blank lines before comment is throw away
110 int location
; // Comment location (BEFORE or AFTER)
111 int chop_top
; // Lines to chop from the top of a comment
112 int chop_bottom
; // Lines to chop from the bottom
113 int chop_left
; // Characters to chop from left
114 int chop_right
; // Characters to chop from right
115 int untabify
; // Expand tabs
116 int ignore
; // Ignore comments
123 extern int include_file(char *); // Insert library file
124 extern char category
[256];
125 extern char title
[256];
126 extern DocEntry
*doc_entry
;
127 extern DocEntry
*doctitle
; // The very first docentry
128 extern DocEntry
*doc_stack
[256]; // Stack of documentation entries
129 extern CommentHandler
*handler_stack
[256]; // Stack of comment handlers
130 extern int doc_stack_top
; // Top of stack
132 extern Language
*lang
;
133 extern Documentation
*doc
;
134 extern CommentHandler
*comment_handler
; // Comment handling system
135 extern void swig_append(char *, FILE *);
136 extern int Stat_func
, Stat_var
, Stat_const
;
137 extern int IgnoreDoc
;
138 extern int ForceExtern
;
139 extern int WrapExtern
;
141 extern int GenerateDefault
;
143 extern char *ConfigFile
;
144 extern char *objc_construct
;
145 extern char *objc_destruct
;
148 // Structure for holding typemap parameters
149 // A typemap parameter consists of a single parameter (type + name)
150 // and an optional list of arguments corresponding to local variables.
151 // Has an optional link for building linked lists of parameter lists
162 /* Global variables. Needs to be cleaned up */
166 FILE *f_header
; // Some commonly used
167 FILE *f_wrappers
; // FILE pointers
171 char LibDir
[512]; // Library directory
172 char **InitNames
= 0;
174 int TypeStrict
; // Type checking strictness
176 char category
[256]; // Variables for documentation
178 DocEntry
*doc_entry
= 0; // Current documentation entry
179 DocEntry
*doctitle
= 0; // First doc entry
180 DocEntry
*doc_stack
[256]; // Stack of documentation entries
181 CommentHandler
*handler_stack
[256]; // Stack of comment handlers
182 int doc_stack_top
= 0; // Top of stack
184 Language
*lang
; // Language method
185 Documentation
*doc
; // Documentation method
192 int AddMethods
= 0; // AddMethods flag
193 int NewObject
= 0; // NewObject flag
194 int Inline
= 0; // Inline mode
196 int IgnoreDoc
= 0; // Ignore documentation mode
197 int ForceExtern
= 0; // Force extern mode
199 int GenerateDefault
= 0; // Generate default constructors
202 char *typemap_lang
= 0; // Typemap name
203 int type_id
= 0; // Type identifier
204 int error_count
= 0; // Error count
205 char *ConfigFile
= 0;
206 int DocOnly
= 0; // Only produce documentation
210 /* Number of initialization names that can be used */
214 extern void type_undefined_check(void);