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

« back to all changes in this revision

Viewing changes to Source/Modules/guile.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
 * Guile language module for SWIG.
8
8
 * ----------------------------------------------------------------------------- */
9
9
 
10
 
char cvsroot_guile_cxx[] = "$Id: guile.cxx 10562 2008-06-23 21:14:53Z wsfulton $";
 
10
char cvsroot_guile_cxx[] = "$Id: guile.cxx 11133 2009-02-20 07:52:24Z wsfulton $";
11
11
 
12
12
#include "swigmod.h"
13
13
 
47
47
     -exportprimitive        - Add the (export ...) code from scmstub into the\n\
48
48
                               GOOPS file.\n";
49
49
 
 
50
static File *f_begin = 0;
50
51
static File *f_runtime = 0;
51
52
static File *f_header = 0;
52
53
static File *f_wrappers = 0;
174
175
          }
175
176
        } else if (strcmp(argv[i], "-procdoc") == 0) {
176
177
          if (argv[i + 1]) {
177
 
            procdoc = NewFile(argv[i + 1], (char *) "w");
 
178
            procdoc = NewFile(argv[i + 1], "w", SWIG_output_files());
178
179
            if (!procdoc) {
179
180
              FileErrorDisplay(argv[i + 1]);
180
181
              SWIG_exit(EXIT_FAILURE);
299
300
    /* Initialize all of the output files */
300
301
    String *outfile = Getattr(n, "outfile");
301
302
 
302
 
    f_runtime = NewFile(outfile, "w");
303
 
    if (!f_runtime) {
 
303
    f_begin = NewFile(outfile, "w", SWIG_output_files());
 
304
    if (!f_begin) {
304
305
      FileErrorDisplay(outfile);
305
306
      SWIG_exit(EXIT_FAILURE);
306
307
    }
 
308
    f_runtime = NewString("");
307
309
    f_init = NewString("");
308
310
    f_header = NewString("");
309
311
    f_wrappers = NewString("");
311
313
    /* Register file targets with the SWIG file handler */
312
314
    Swig_register_filebyname("header", f_header);
313
315
    Swig_register_filebyname("wrapper", f_wrappers);
 
316
    Swig_register_filebyname("begin", f_begin);
314
317
    Swig_register_filebyname("runtime", f_runtime);
315
318
    Swig_register_filebyname("init", f_init);
316
319
 
322
325
    goopscode = NewString("");
323
326
    goopsexport = NewString("");
324
327
 
325
 
    Printf(f_runtime, "/* -*- buffer-read-only: t -*- vi: set ro: */\n");
326
 
    Swig_banner(f_runtime);
 
328
    Swig_banner(f_begin);
327
329
 
328
 
    Printf(f_runtime, "/* Implementation : GUILE */\n\n");
 
330
    Printf(f_runtime, "\n");
 
331
    Printf(f_runtime, "#define SWIGGUILE\n");
329
332
 
330
333
    if (!use_scm_interface) {
331
334
      if (SwigRuntime == 1)
358
361
      Printf(f_runtime, "\n}\n");
359
362
    }
360
363
 
 
364
    Printf(f_runtime, "\n");
 
365
 
361
366
    Language::top(n);
362
367
 
363
368
    /* Close module */
392
397
    Delete(goopstext);
393
398
 
394
399
    /* Close all of the files */
395
 
    Dump(f_header, f_runtime);
396
 
    Dump(f_wrappers, f_runtime);
397
 
    Wrapper_pretty_print(f_init, f_runtime);
 
400
    Dump(f_runtime, f_begin);
 
401
    Dump(f_header, f_begin);
 
402
    Dump(f_wrappers, f_begin);
 
403
    Wrapper_pretty_print(f_init, f_begin);
398
404
    Delete(f_header);
399
405
    Delete(f_wrappers);
400
406
    Delete(f_init);
401
 
    Close(f_runtime);
 
407
    Close(f_begin);
402
408
    Delete(f_runtime);
 
409
    Delete(f_begin);
403
410
    return SWIG_OK;
404
411
  }
405
412
 
499
506
                                 SWIG_output_directory(),
500
507
                                 primitive_name);
501
508
      Delete(primitive_name);
502
 
      File *scmstubfile = NewFile(fname, (char *) "w");
 
509
      File *scmstubfile = NewFile(fname, "w", SWIG_output_files());
503
510
      if (!scmstubfile) {
504
511
        FileErrorDisplay(fname);
505
512
        SWIG_exit(EXIT_FAILURE);
506
513
      }
507
514
      Delete(fname);
508
515
 
509
 
      Printf(scmstubfile, ";;; -*- buffer-read-only: t -*- vi: set ro: */\n");
510
 
      Printf(scmstubfile, ";;; Automatically generated by SWIG; do not edit.\n\n");
 
516
      Swig_banner_target_lang(scmstubfile, ";;;");
 
517
      Printf(scmstubfile, "\n");
511
518
      if (linkage == GUILE_LSTYLE_SIMPLE || linkage == GUILE_LSTYLE_PASSIVE)
512
519
        Printf(scmstubfile, "(define-module (%s))\n\n", mod);
513
520
      Delete(mod);
530
537
 
531
538
      String *fname = NewStringf("%s%s.scm", SWIG_output_directory(),
532
539
                                 module_name);
533
 
      File *goopsfile = NewFile(fname, (char *) "w");
 
540
      File *goopsfile = NewFile(fname, "w", SWIG_output_files());
534
541
      if (!goopsfile) {
535
542
        FileErrorDisplay(fname);
536
543
        SWIG_exit(EXIT_FAILURE);
537
544
      }
538
545
      Delete(fname);
539
 
      Printf(goopsfile, ";;; -*- buffer-read-only: t -*- vi: set ro: */\n");
540
 
      Printf(goopsfile, ";;; Automatically generated by SWIG; do not edit.\n\n");
 
546
      Swig_banner_target_lang(goopsfile, ";;;");
 
547
      Printf(goopsfile, "\n");
541
548
      Printf(goopsfile, "(define-module (%s))\n", mod);
542
549
      Printf(goopsfile, "%s\n", goopstext);
543
550
      Printf(goopsfile, "(use-modules (oop goops) (Swig common))\n");
1653
1660
   * If class_name = "" that means the mapping is for a function or
1654
1661
   * variable not attached to any class.
1655
1662
   * ------------------------------------------------------------ */
1656
 
  String *goopsNameMapping(String *name, String_or_char *class_name) {
 
1663
  String *goopsNameMapping(String *name, const_String_or_char_ptr class_name) {
1657
1664
    String *n = NewString("");
1658
1665
 
1659
1666
    if (Strcmp(class_name, "") == 0) {