~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Source/Modules/tcl8.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2009-11-15 14:00:28 UTC
  • mfrom: (1.2.9 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091115140028-me7amr2rie8zz1xn
Tags: 1.3.40-2ubuntu1
* Merge from Debian testing (LP: #356529), remaining changes:
  - Drop libchicken-dev from the build-depends (it's in universe)
  - Remove Pike from package description and from configure flags
  - drop "--without-mzscheme", we don't have it in our build-depends
  - use php-config5
  - Clean Runtime/ as well.
  - debian/rules (clean): Remove Lib/ocaml/swigp4.ml.
* debian/rules: Remove hardcoded python version.
* Remove upper limit for python from Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * Tcl8 language module for SWIG.
8
8
 * ----------------------------------------------------------------------------- */
9
9
 
10
 
char cvsroot_tcl8_cxx[] = "$Id: tcl8.cxx 10453 2008-05-15 21:18:44Z wsfulton $";
 
10
char cvsroot_tcl8_cxx[] = "$Id: tcl8.cxx 11518 2009-08-08 22:56:10Z wsfulton $";
11
11
 
12
12
#include "swigmod.h"
13
13
#include "cparse.h"
46
46
static File *f_header = 0;
47
47
static File *f_wrappers = 0;
48
48
static File *f_init = 0;
 
49
static File *f_begin = 0;
49
50
static File *f_runtime = 0;
50
51
 
51
52
 
121
122
    }
122
123
 
123
124
    Preprocessor_define("SWIGTCL 1", 0);
 
125
    // SWIGTCL8 is deprecated, and no longer documented.
124
126
    Preprocessor_define("SWIGTCL8 1", 0);
125
127
    SWIG_typemap_lang("tcl8");
126
128
    SWIG_config_file("tcl8.swg");
136
138
    /* Initialize all of the output files */
137
139
    String *outfile = Getattr(n, "outfile");
138
140
 
139
 
    f_runtime = NewFile(outfile, "w");
140
 
    if (!f_runtime) {
 
141
    f_begin = NewFile(outfile, "w", SWIG_output_files());
 
142
    if (!f_begin) {
141
143
      FileErrorDisplay(outfile);
142
144
      SWIG_exit(EXIT_FAILURE);
143
145
    }
 
146
    f_runtime = NewString("");
144
147
    f_init = NewString("");
145
148
    f_header = NewString("");
146
149
    f_wrappers = NewString("");
148
151
    /* Register file targets with the SWIG file handler */
149
152
    Swig_register_filebyname("header", f_header);
150
153
    Swig_register_filebyname("wrapper", f_wrappers);
 
154
    Swig_register_filebyname("begin", f_begin);
151
155
    Swig_register_filebyname("runtime", f_runtime);
152
156
    Swig_register_filebyname("init", f_init);
153
157
 
158
162
    methods_tab = NewString("");
159
163
    const_tab = NewString("");
160
164
 
161
 
    Swig_banner(f_runtime);
 
165
    Swig_banner(f_begin);
 
166
 
 
167
    Printf(f_runtime, "\n");
 
168
    Printf(f_runtime, "#define SWIGTCL\n");
 
169
    Printf(f_runtime, "\n");
162
170
 
163
171
    /* Set the module name, namespace, and prefix */
164
172
 
177
185
 
178
186
      Insert(module, 0, "_");
179
187
 
180
 
      if ((f_shadow = NewFile(filen, "w")) == 0) {
 
188
      if ((f_shadow = NewFile(filen, "w", SWIG_output_files())) == 0) {
181
189
        FileErrorDisplay(filen);
182
190
        SWIG_exit(EXIT_FAILURE);
183
191
      }
186
194
      Swig_register_filebyname("shadow", f_shadow);
187
195
      Swig_register_filebyname("itcl", f_shadow);
188
196
 
189
 
      Printf(f_shadow, "# This file was automatically generated by SWIG (http://www.swig.org).\n");
190
 
      Printf(f_shadow, "# Version %s\n", Swig_package_version());
191
 
      Printf(f_shadow, "#\n");
192
 
      Printf(f_shadow, "# Don't modify this file, modify the SWIG interface instead.\n");
 
197
      Swig_banner_target_lang(f_shadow, "#");
193
198
 
194
199
      Printv(f_shadow, "\npackage require Itcl\n\n", NIL);
195
200
      Delete(filen);
244
249
    }
245
250
 
246
251
    /* Close all of the files */
247
 
    Printv(f_runtime, f_header, f_wrappers, NIL);
248
 
    Wrapper_pretty_print(f_init, f_runtime);
 
252
    Dump(f_runtime, f_begin);
 
253
    Printv(f_begin, f_header, f_wrappers, NIL);
 
254
    Wrapper_pretty_print(f_init, f_begin);
249
255
    Delete(f_header);
250
256
    Delete(f_wrappers);
251
257
    Delete(f_init);
252
 
    Close(f_runtime);
 
258
    Close(f_begin);
 
259
    Delete(f_runtime);
 
260
    Delete(f_begin);
253
261
    return SWIG_OK;
254
262
  }
255
263
 
923
931
        Printv(f_shadow, "  constructor { } {\n", NIL);
924
932
        Printv(f_shadow, "    # This constructor will fail if called directly\n", NIL);
925
933
        Printv(f_shadow, "    if { [info class] == \"::", class_name, "\" } {\n", NIL);
926
 
        Printv(f_shadow, "      error \"No constructor for class ", class_name, "\"\n", NIL);
 
934
        Printv(f_shadow, "      error \"No constructor for class ", class_name, (Getattr(n, "abstract") ? " - class is abstract" : ""), "\"\n", NIL);
927
935
        Printv(f_shadow, "    }\n", NIL);
928
936
        Printv(f_shadow, "  }\n", NIL);
929
937
      }
930
938
 
931
939
      Printv(f_shadow, "}\n\n", NIL);
932
 
    };
 
940
    }
933
941
 
934
942
    Printv(f_wrappers, "static swig_class *swig_", mangled_classname, "_bases[] = {", base_class, "0};\n", NIL);
935
943
    Printv(f_wrappers, "static const char * swig_", mangled_classname, "_base_names[] = {", base_class_names, "0};\n", NIL);