1 *** cplus.cxx.old Mon Feb 02 14:55:42 1998
2 --- cplus.cxx Fri Aug 28 12:02:50 1998
5 // Class for managing class members (internally)
6 // ----------------------------------------------------------------------
8 static char *inherit_base_class = 0;
12 - char *classname; // Real class name
13 - char *classrename; // New name of class (if applicable)
14 - char *classtype; // class type (struct, union, class)
15 - int strip; // Strip off class declarator
16 - int wextern; // Value of extern wrapper variable for this class
17 - int have_constructor; // Status bit indicating if we've seen a constructor
18 - int have_destructor; // Status bit indicating if a destructor has been seen
19 - int is_abstract; // Status bit indicating if this is an abstract class
20 - int generate_default; // Generate default constructors
21 - int objective_c; // Set if this is an objective C class
22 - int error; // Set if this class can't be generated
23 - int line; // Line number
24 - char **baseclass; // Base classes (if any)
25 - Hash *local; // Hash table for local types
26 - Hash *scope; // Local scope hash table
27 - DocEntry *de; // Documentation entry of class
28 - CPP_member *members; // Linked list of members
29 - CPP_class *next; // Next class
30 - static CPP_class *classlist; // List of all classes stored
32 ! CPP_class(char *name, char *ctype) {
34 classname = copy_string(name);
35 classtype = copy_string(ctype);
38 // Class for managing class members (internally)
39 // ----------------------------------------------------------------------
41 static char *inherit_base_class = 0;
42 + CPP_class *CPP_class::classlist = 0;
43 + CPP_class *current_class;
46 ! CPP_class::CPP_class(char *name, char *ctype) {
48 classname = copy_string(name);
49 classtype = copy_string(ctype);
53 // ------------------------------------------------------------------------------
54 // Add a new C++ member to this class
55 // ------------------------------------------------------------------------------
57 ! void add_member(CPP_member *m) {
60 // Set base class where this was defined
61 if (inherit_base_class)
63 // ------------------------------------------------------------------------------
64 // Add a new C++ member to this class
65 // ------------------------------------------------------------------------------
67 ! void CPP_class::add_member(CPP_member *m) {
70 // Set base class where this was defined
71 if (inherit_base_class)
74 // ------------------------------------------------------------------------------
75 // Search for a member with the given name. Returns the member on success, 0 on failure
76 // ------------------------------------------------------------------------------
78 ! CPP_member *search_member(char *name) {
84 // ------------------------------------------------------------------------------
85 // Search for a member with the given name. Returns the member on success, 0 on failure
86 // ------------------------------------------------------------------------------
88 ! CPP_member *CPP_class::search_member(char *name) {
95 // ------------------------------------------------------------------------------
96 // Inherit. Put all the declarations associated with this class into the current
97 // ------------------------------------------------------------------------------
99 ! void inherit_decls(int mode) {
103 inherit_base_class = m->base;
105 // ------------------------------------------------------------------------------
106 // Inherit. Put all the declarations associated with this class into the current
107 // ------------------------------------------------------------------------------
109 ! void CPP_class::inherit_decls(int mode) {
113 inherit_base_class = m->base;
116 // ------------------------------------------------------------------------------
117 // Emit all of the declarations associated with this class
118 // ------------------------------------------------------------------------------
120 ! void emit_decls() {
121 CPP_member *m = members;
122 int last_scope = name_scope(0);
123 abstract = is_abstract;
126 // ------------------------------------------------------------------------------
127 // Emit all of the declarations associated with this class
128 // ------------------------------------------------------------------------------
130 ! void CPP_class::emit_decls() {
131 CPP_member *m = members;
132 int last_scope = name_scope(0);
133 abstract = is_abstract;
137 // ------------------------------------------------------------------------------
138 // Search for a given class in the list
139 // ------------------------------------------------------------------------------
141 ! static CPP_class *search(char *name) {
147 // ------------------------------------------------------------------------------
148 // Search for a given class in the list
149 // ------------------------------------------------------------------------------
151 ! CPP_class *CPP_class::search(char *name) {
158 // Add default constructors and destructors
160 // ------------------------------------------------------------------------------
162 ! void create_default() {
163 if (!generate_default) return;
165 // Try to generate a constructor if not available.
168 // Add default constructors and destructors
170 // ------------------------------------------------------------------------------
172 ! void CPP_class::create_default() {
173 if (!generate_default) return;
175 // Try to generate a constructor if not available.
179 // ------------------------------------------------------------------------------
180 // Dump *all* of the classes saved out to the various
181 // language modules (this does what cplus_close_class used to do)
182 // ------------------------------------------------------------------------------
183 - static void create_all();
186 - CPP_class *CPP_class::classlist = 0;
187 - static CPP_class *current_class;
189 void CPP_class::create_all() {
194 *** vector.cxx.old Fri Aug 28 14:23:16 1998
195 --- vector.cxx Fri Aug 28 14:46:52 1998
200 + /*******************************************************************************
201 + * Simplified Wrapper and Interface Generator (SWIG)
205 + * Department of Computer Science Theoretical Division (T-11)
206 + * University of Utah Los Alamos National Laboratory
207 + * Salt Lake City, Utah 84112 Los Alamos, New Mexico 87545
208 + * beazley@cs.utah.edu beazley@lanl.gov
210 + * Copyright (c) 1995-1997
211 + * The University of Utah and the Regents of the University of California
212 + * All Rights Reserved
214 + * Permission is hereby granted, without written agreement and without
215 + * license or royalty fees, to use, copy, modify, and distribute this
216 + * software and its documentation for any purpose, provided that
217 + * (1) The above copyright notice and the following two paragraphs
218 + * appear in all copies of the source code and (2) redistributions
219 + * including binaries reproduces these notices in the supporting
220 + * documentation. Substantial modifications to this software may be
221 + * copyrighted by their authors and need not follow the licensing terms
222 + * described here, provided that the new terms are clearly indicated in
223 + * all files where they apply.
225 + * IN NO EVENT SHALL THE AUTHOR, THE UNIVERSITY OF CALIFORNIA, THE
226 + * UNIVERSITY OF UTAH OR DISTRIBUTORS OF THIS SOFTWARE BE LIABLE TO ANY
227 + * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
228 + * DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
229 + * EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN ADVISED OF
230 + * THE POSSIBILITY OF SUCH DAMAGE.
232 + * THE AUTHOR, THE UNIVERSITY OF CALIFORNIA, AND THE UNIVERSITY OF UTAH
233 + * SPECIFICALLY DISCLAIM ANY WARRANTIES,INCLUDING, BUT NOT LIMITED TO,
234 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
235 + * PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND
236 + * THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE,
237 + * SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
239 + *******************************************************************************/
241 + #include "internal.h"
243 + /*******************************************************************************
246 + * File : vector.cxx
248 + * A very simple Vector class. Allways assumes that memory allocations are
249 + * successful. Should be made more robust...
251 + *******************************************************************************/
253 + void* Vector::s_nullPtr = NULL;
255 + // -----------------------------------------------------------------------------
256 + // Vector::Vector(size_t allocSize = 8)
258 + // Constructor. Creates a new Vector.
260 + // Inputs : initial allocation size (optional)
262 + // Output : New Vector object.
264 + // Side Effects : None
265 + // -----------------------------------------------------------------------------
267 + Vector::Vector(size_t allocSize)
268 + : m_size(allocSize),
273 + m_data = new void*[m_size];
275 + for (i=0; i<m_size;i++)
281 + // -----------------------------------------------------------------------------
284 + // Destructor. Only cleans up the vector, not its contents!
286 + // -----------------------------------------------------------------------------
289 + Vector::~Vector() {
295 + m_size = m_count = 0;
300 + // -----------------------------------------------------------------------------
301 + // size_t Vector::extend(size_t newSize)
303 + // Extends the vector to at least newSize length. Won't do anything if newSize
304 + // is smaller than the current size of the vector.
306 + // Returns the new allocated size.
308 + // -----------------------------------------------------------------------------
310 + #define GRANULARITY 16
312 + size_t Vector::extend(size_t newSize) {
314 + if (newSize > m_size) {
315 + newSize = newSize + (GRANULARITY - (newSize % GRANULARITY));
317 + void** temp = new void*[newSize];
318 + memcpy(temp, m_data, m_size*sizeof(void*));
321 + for (i=m_size; i<newSize; i++)
332 + // -----------------------------------------------------------------------------
333 + // Vector::append(void* object)
335 + // Appends the object pointer to vector at index m_count. Increments m_count.
336 + // Returns the new count.
337 + // -----------------------------------------------------------------------------
339 + size_t Vector::append(void* object) {
340 + if (m_count >= m_size) {
341 + extend(m_count + 1);
344 + m_data[m_count] = object;
351 + // -----------------------------------------------------------------------------
352 + // Vector::operator[] (size_t idx)
354 + // Returns a reference to the void pointer at idx. If idx is beyond the range
355 + // of the vector, returns a reference to s_nullPtr.
357 + // -----------------------------------------------------------------------------
359 + void*& Vector::operator[] (size_t idx) {
360 + if (idx >= m_size) {
365 + return m_data[idx];
369 + /***********************************************************************
371 + * -- Revision History
373 + * Revision 1.2 1999/04/30 03:28:35 RD
374 + * wxPython 2.0b9, first phase (win32)
375 + * Added gobs of stuff, see wxPython/README.txt for details
377 + * Revision 1.1.4.1 1999/03/27 23:28:59 RD
380 + * Python thread support
381 + * various minor additions
382 + * various minor fixes
384 + * Revision 1.1 1998/10/03 05:56:03 RD
385 + * *** empty log message ***
388 + ***********************************************************************/
395 *** makefile.msc.old Mon Jun 23 15:15:32 1997
396 --- makefile.msc Fri Aug 28 10:21:58 1998
399 # Normally, you shouldn't have to change anything below this point #
400 ########################################################################
402 LIBOBJS = main.obj scanner.obj symbol.obj include.obj types.obj parms.obj emit.obj newdoc.obj ascii.obj \
403 ! html.obj latex.obj cplus.obj lang.obj hash.obj sstring.obj wrapfunc.obj getopt.obj comment.obj typemap.obj naming.obj
405 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx emit.cxx \
406 ! newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx \
407 sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
409 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
410 LIBNAME = ..\libswig.lib
411 INCLUDE = -I../Include -I$(STD_INC)
412 ! CFLAGS = -Zi -nologo -DSWIG_LIB="\"$(SWIG_LIB)\"" -DSWIG_CC="\"$(CC)\"" -DMSDOS -DSTDC_HEADERS=1 -DHAVE_LIBDL=1 $(SWIG_OPTS)
418 # Normally, you shouldn't have to change anything below this point #
419 ########################################################################
421 LIBOBJS = main.obj scanner.obj symbol.obj include.obj types.obj parms.obj emit.obj newdoc.obj ascii.obj \
422 ! html.obj latex.obj cplus.obj lang.obj hash.obj vector.obj sstring.obj wrapfunc.obj getopt.obj comment.obj typemap.obj naming.obj
424 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx emit.cxx \
425 ! newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx vector.cxx \
426 sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
428 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
429 LIBNAME = ..\libswig.lib
430 INCLUDE = -I../Include -I$(STD_INC)
431 ! CFLAGS = -Zi -nologo -DSWIG_LIB="\"$(SWIG_LIB)\"" -DSWIG_CC="\"$(CC)\"" -DMSDOS -DSTDC_HEADERS=1 -DHAVE_LIBDL=1 $(SWIG_OPTS) $(OTHERFLAGS)
436 *** makefile.bc.old Sun Jan 04 12:49:24 1998
437 --- makefile.bc Fri Aug 28 14:42:58 1998
440 ########################################################################
442 LIBOBJS = main.obj scanner.obj symbol.obj include.obj types.obj parms.obj \
443 emit.obj newdoc.obj ascii.obj \
444 ! html.obj latex.obj cplus.obj lang.obj hash.obj sstring.obj \
445 wrapfunc.obj getopt.obj comment.obj typemap.obj naming.obj
447 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx \
448 emit.cxx newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx \
449 ! sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
451 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
452 LIBNAME = ..\libswig.lib
453 INCLUDE = -I../Include -I$(STD_INC)
455 ########################################################################
457 LIBOBJS = main.obj scanner.obj symbol.obj include.obj types.obj parms.obj \
458 emit.obj newdoc.obj ascii.obj \
459 ! html.obj latex.obj cplus.obj lang.obj hash.obj vector.obj sstring.obj \
460 wrapfunc.obj getopt.obj comment.obj typemap.obj naming.obj
462 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx \
463 emit.cxx newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx \
464 ! vector.cxx sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
466 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
467 LIBNAME = ..\libswig.lib
468 INCLUDE = -I../Include -I$(STD_INC)
469 *** Makefile.in.old Wed May 28 22:56:56 1997
470 --- Makefile.in Fri Aug 28 14:43:36 1998
473 # Normally, you shouldn't have to change anything below this point #
474 ########################################################################
476 LIBOBJS = main.o scanner.o symbol.o include.o types.o parms.o emit.o newdoc.o ascii.o \
477 ! html.o latex.o cplus.o lang.o hash.o sstring.o wrapfunc.o getopt.o comment.o \
480 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx emit.cxx \
481 ! newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx \
482 sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
484 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
487 # Normally, you shouldn't have to change anything below this point #
488 ########################################################################
490 LIBOBJS = main.o scanner.o symbol.o include.o types.o parms.o emit.o newdoc.o ascii.o \
491 ! html.o latex.o cplus.o lang.o hash.o vector.o sstring.o wrapfunc.o getopt.o comment.o \
494 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx emit.cxx \
495 ! newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx vector.cxx \
496 sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
498 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h