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.1 1998/10/03 05:56:03 RD
374 + * *** empty log message ***
377 + ***********************************************************************/
384 *** makefile.msc.old Mon Jun 23 15:15:32 1997
385 --- makefile.msc Fri Aug 28 10:21:58 1998
388 # Normally, you shouldn't have to change anything below this point #
389 ########################################################################
391 LIBOBJS = main.obj scanner.obj symbol.obj include.obj types.obj parms.obj emit.obj newdoc.obj ascii.obj \
392 ! html.obj latex.obj cplus.obj lang.obj hash.obj sstring.obj wrapfunc.obj getopt.obj comment.obj typemap.obj naming.obj
394 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx emit.cxx \
395 ! newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx \
396 sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
398 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
399 LIBNAME = ..\libswig.lib
400 INCLUDE = -I../Include -I$(STD_INC)
401 ! CFLAGS = -Zi -nologo -DSWIG_LIB="\"$(SWIG_LIB)\"" -DSWIG_CC="\"$(CC)\"" -DMSDOS -DSTDC_HEADERS=1 -DHAVE_LIBDL=1 $(SWIG_OPTS)
407 # Normally, you shouldn't have to change anything below this point #
408 ########################################################################
410 LIBOBJS = main.obj scanner.obj symbol.obj include.obj types.obj parms.obj emit.obj newdoc.obj ascii.obj \
411 ! html.obj latex.obj cplus.obj lang.obj hash.obj vector.obj sstring.obj wrapfunc.obj getopt.obj comment.obj typemap.obj naming.obj
413 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx emit.cxx \
414 ! newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx vector.cxx \
415 sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
417 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
418 LIBNAME = ..\libswig.lib
419 INCLUDE = -I../Include -I$(STD_INC)
420 ! CFLAGS = -Zi -nologo -DSWIG_LIB="\"$(SWIG_LIB)\"" -DSWIG_CC="\"$(CC)\"" -DMSDOS -DSTDC_HEADERS=1 -DHAVE_LIBDL=1 $(SWIG_OPTS) $(OTHERFLAGS)
425 *** makefile.bc.old Sun Jan 04 12:49:24 1998
426 --- makefile.bc Fri Aug 28 14:42:58 1998
429 ########################################################################
431 LIBOBJS = main.obj scanner.obj symbol.obj include.obj types.obj parms.obj \
432 emit.obj newdoc.obj ascii.obj \
433 ! html.obj latex.obj cplus.obj lang.obj hash.obj sstring.obj \
434 wrapfunc.obj getopt.obj comment.obj typemap.obj naming.obj
436 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx \
437 emit.cxx newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx \
438 ! sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
440 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
441 LIBNAME = ..\libswig.lib
442 INCLUDE = -I../Include -I$(STD_INC)
444 ########################################################################
446 LIBOBJS = main.obj scanner.obj symbol.obj include.obj types.obj parms.obj \
447 emit.obj newdoc.obj ascii.obj \
448 ! html.obj latex.obj cplus.obj lang.obj hash.obj vector.obj sstring.obj \
449 wrapfunc.obj getopt.obj comment.obj typemap.obj naming.obj
451 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx \
452 emit.cxx newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx \
453 ! vector.cxx sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
455 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
456 LIBNAME = ..\libswig.lib
457 INCLUDE = -I../Include -I$(STD_INC)
458 *** Makefile.in.old Wed May 28 22:56:56 1997
459 --- Makefile.in Fri Aug 28 14:43:36 1998
462 # Normally, you shouldn't have to change anything below this point #
463 ########################################################################
465 LIBOBJS = main.o scanner.o symbol.o include.o types.o parms.o emit.o newdoc.o ascii.o \
466 ! html.o latex.o cplus.o lang.o hash.o sstring.o wrapfunc.o getopt.o comment.o \
469 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx emit.cxx \
470 ! newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx \
471 sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
473 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h
476 # Normally, you shouldn't have to change anything below this point #
477 ########################################################################
479 LIBOBJS = main.o scanner.o symbol.o include.o types.o parms.o emit.o newdoc.o ascii.o \
480 ! html.o latex.o cplus.o lang.o hash.o vector.o sstring.o wrapfunc.o getopt.o comment.o \
483 LIBSRCS = main.cxx scanner.cxx symbol.cxx include.cxx types.cxx parms.cxx emit.cxx \
484 ! newdoc.cxx ascii.cxx html.cxx latex.cxx cplus.cxx lang.cxx hash.cxx vector.cxx \
485 sstring.cxx wrapfunc.cxx getopt.cxx comment.cxx typemap.cxx naming.cxx
487 LIBHEADERS = internal.h ../Include/swig.h latex.h ascii.h html.h nodoc.h