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

« back to all changes in this revision

Viewing changes to Lib/guile/guile_scm_run.swg

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
    scm_error(scm_str2symbol("swig-contract-assertion-failed"), \
48
48
              (char *) FUNC_NAME, (char *) msg,                 \
49
49
              SCM_EOL, SCM_BOOL_F); else
 
50
 
 
51
/* Runtime API */
 
52
#define SWIG_GetModule(clientdata) SWIG_Guile_GetModule()
 
53
#define SWIG_SetModule(clientdata, pointer) SWIG_Guile_SetModule(pointer)
50
54
  
51
55
static char *
52
56
SWIG_Guile_scm2newstr(SCM str, size_t *len) {
138
142
static int
139
143
SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags)
140
144
{
141
 
  swig_type_info *cast;
 
145
  swig_cast_info *cast;
142
146
  swig_type_info *from;
143
147
  SCM smob = SWIG_Guile_GetSmob(s);
144
148
 
150
154
    from = (swig_type_info *) SCM_CELL_WORD_2(smob);
151
155
    if (!from) return 1;
152
156
    if (type) {
153
 
      cast = SWIG_TypeCheck((char*)from->name, type);
 
157
      cast = SWIG_TypeCheckStruct(from, type);
154
158
      if (cast) {
155
159
        *result = SWIG_TypeCast(cast, (void *) SCM_CELL_WORD_1(smob));
156
160
        return 0;
304
308
  }
305
309
}
306
310
 
307
 
static void
 
311
static SCM
308
312
SWIG_Guile_Init ()
309
313
{
310
 
  SCM swig_module;
 
314
  static SCM swig_module;
311
315
  
312
 
  if (swig_initialized) return;
 
316
  if (swig_initialized) return swig_module;
313
317
  swig_initialized = 1;
314
318
 
315
319
  swig_module = scm_c_resolve_module("Swig swigrun");
329
333
    scm_set_smob_print(swig_destroyed_tag, print_destroyed_swig);
330
334
    scm_set_smob_equalp(swig_destroyed_tag, equalp_swig);
331
335
  }
332
 
  {
333
 
    SCM variable = scm_sym2var(scm_str2symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME),
334
 
                               scm_module_lookup_closure(swig_module),
335
 
                               SCM_BOOL_T);
336
 
    if (SCM_UNBNDP(SCM_VARIABLE_REF(variable))) {
337
 
      SCM_VARIABLE_SET(variable, scm_ulong2num((unsigned long) swig_type_list_handle));
338
 
    }
339
 
    else {
340
 
      swig_type_list_handle
341
 
        = (swig_type_info **) scm_num2ulong(SCM_VARIABLE_REF(variable), 0,
342
 
                                            "SWIG_Guile_Init");
343
 
    }
344
 
  }
345
336
  swig_make_func = scm_permanent_object(
346
337
  scm_variable_ref(scm_c_module_lookup(scm_c_resolve_module("oop goops"), "make")));
347
338
  swig_keyword = scm_permanent_object(scm_c_make_keyword((char*) "init-smob"));
349
340
#ifdef SWIG_INIT_RUNTIME_MODULE
350
341
  SWIG_INIT_RUNTIME_MODULE
351
342
#endif
 
343
 
 
344
  return swig_module;
 
345
}
 
346
 
 
347
static swig_module_info *
 
348
SWIG_Guile_GetModule()
 
349
{
 
350
  SCM module;
 
351
  SCM variable;
 
352
 
 
353
  module = SWIG_Guile_Init();
 
354
 
 
355
  variable = scm_sym2var(scm_str2symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME),
 
356
                               scm_module_lookup_closure(module),
 
357
                               SCM_BOOL_T);
 
358
  if (SCM_UNBNDP(SCM_VARIABLE_REF(variable))) {
 
359
    return NULL;
 
360
  } else {
 
361
    return (swig_module_info *) scm_num2ulong(SCM_VARIABLE_REF(variable), 0, "SWIG_Guile_Init");
 
362
  }
 
363
}
 
364
 
 
365
static void
 
366
SWIG_Guile_SetModule(swig_module_info *swig_module)
 
367
{
 
368
  SCM module;
 
369
  SCM variable;
 
370
 
 
371
  module = SWIG_Guile_Init();
 
372
    
 
373
  variable = scm_sym2var(scm_str2symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME),
 
374
                               scm_module_lookup_closure(module),
 
375
                               SCM_BOOL_T);
 
376
 
 
377
  SCM_VARIABLE_SET(variable, scm_ulong2num((unsigned long) swig_module));
352
378
}
353
379
 
354
380
static int