| 1 |
|
| /* ---------------------------------------------------------------------------- |
| 2 |
|
| * This file was automatically generated by SWIG (http://www.swig.org). |
| 3 |
|
| * Version 1.3.15u-20020925-1151 |
| 4 |
|
| * |
| 5 |
|
| * This file is not intended to be easily readable and contains a number of |
| 6 |
|
| * coding conventions designed to improve portability and efficiency. Do not make |
| 7 |
|
| * changes to this file unless you know what you are doing--modify the SWIG |
| 8 |
|
| * interface file instead. |
| 9 |
|
| * ----------------------------------------------------------------------------- */ |
| 10 |
|
| |
| 11 |
|
| /*********************************************************************** |
| 12 |
|
| * common.swg |
| 13 |
|
| * |
| 14 |
|
| * This file contains generic SWIG runtime support for pointer |
| 15 |
|
| * type checking as well as a few commonly used macros to control |
| 16 |
|
| * external linkage. |
| 17 |
|
| * |
| 18 |
|
| * Author : David Beazley (beazley@cs.uchicago.edu) |
| 19 |
|
| * |
| 20 |
|
| * Copyright (c) 1999-2000, The University of Chicago |
| 21 |
|
| * |
| 22 |
|
| * This file may be freely redistributed without license or fee provided |
| 23 |
|
| * this copyright message remains intact. |
| 24 |
|
| ************************************************************************/ |
| 25 |
|
| |
| 26 |
|
| #include <string.h> |
| 27 |
|
| |
| 28 |
|
| #if defined(_WIN32) || defined(__WIN32__) |
| 29 |
|
| # if defined(_MSC_VER) |
| 30 |
|
| # if defined(STATIC_LINKED) |
| 31 |
|
| # define SWIGEXPORT(a) a |
| 32 |
|
| # define SWIGIMPORT(a) extern a |
| 33 |
|
| # else |
| 34 |
|
| # define SWIGEXPORT(a) __declspec(dllexport) a |
| 35 |
|
| # define SWIGIMPORT(a) extern a |
| 36 |
|
| # endif |
| 37 |
|
| # else |
| 38 |
|
| # if defined(__BORLANDC__) |
| 39 |
|
| # define SWIGEXPORT(a) a _export |
| 40 |
|
| # define SWIGIMPORT(a) a _export |
| 41 |
|
| # else |
| 42 |
|
| # define SWIGEXPORT(a) a |
| 43 |
|
| # define SWIGIMPORT(a) a |
| 44 |
|
| # endif |
| 45 |
|
| # endif |
| 46 |
|
| #else |
| 47 |
|
| # define SWIGEXPORT(a) a |
| 48 |
|
| # define SWIGIMPORT(a) a |
| 49 |
|
| #endif |
| 50 |
|
| |
| 51 |
|
| #ifdef SWIG_GLOBAL |
| 52 |
|
| #define SWIGRUNTIME(a) SWIGEXPORT(a) |
| 53 |
|
| #else |
| 54 |
|
| #define SWIGRUNTIME(a) static a |
| 55 |
|
| #endif |
| 56 |
|
| |
| 57 |
|
| #ifdef __cplusplus |
| 58 |
|
| extern "C" { |
| 59 |
|
| #endif |
| 60 |
|
| |
| 61 |
|
| typedef void *(*swig_converter_func)(void *); |
| 62 |
|
| typedef struct swig_type_info *(*swig_dycast_func)(void **); |
| 63 |
|
| |
| 64 |
|
| typedef struct swig_type_info { |
| 65 |
|
| const char *name; |
| 66 |
|
| swig_converter_func converter; |
| 67 |
|
| const char *str; |
| 68 |
|
| void *clientdata; |
| 69 |
|
| swig_dycast_func dcast; |
| 70 |
|
| struct swig_type_info *next; |
| 71 |
|
| struct swig_type_info *prev; |
| 72 |
|
| } swig_type_info; |
| 73 |
|
| |
| 74 |
|
| #ifdef SWIG_NOINCLUDE |
| 75 |
|
| |
| 76 |
|
| SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *); |
| 77 |
|
| SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); |
| 78 |
|
| SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *); |
| 79 |
|
| SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); |
| 80 |
|
| SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); |
| 81 |
|
| SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); |
| 82 |
|
| |
| 83 |
|
| #else |
| 84 |
|
| |
| 85 |
|
| static swig_type_info *swig_type_list = 0; |
| 86 |
|
| |
| 87 |
|
| /* Register a type mapping with the type-checking */ |
| 88 |
|
| SWIGRUNTIME(swig_type_info *) |
| 89 |
0 |
| SWIG_TypeRegister(swig_type_info *ti) |
| 90 |
|
| { |
| 91 |
|
| swig_type_info *tc, *head, *ret, *next; |
| 92 |
|
| /* Check to see if this type has already been registered */ |
| 93 |
0 |
| tc = swig_type_list; |
| 94 |
0 |
▶ | while (tc) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (tc) { |
0 |
0 |
0 |
|
| 95 |
0 |
▶ | if (strcmp(tc->name, ti->name) == 0) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (strcmp(tc->name, ti->name) == 0) { |
0 |
0 |
0 |
|
| 96 |
|
| /* Already exists in the table. Just add additional types to the list */ |
| 97 |
0 |
▶ | if (tc->clientdata) ti->clientdata = tc->clientdata; |
Branch: 1 branch
| Branch | True | False | Total |
| if (tc->clientdata) ti->clientdata = tc->clientdata; |
0 |
0 |
0 |
|
| 98 |
0 |
| head = tc; |
| 99 |
0 |
| next = tc->next; |
| 100 |
0 |
| goto l1; |
| 101 |
|
| } |
| 102 |
0 |
| tc = tc->prev; |
| 103 |
|
| } |
| 104 |
0 |
| head = ti; |
| 105 |
0 |
| next = 0; |
| 106 |
|
| |
| 107 |
|
| /* Place in list */ |
| 108 |
0 |
| ti->prev = swig_type_list; |
| 109 |
0 |
| swig_type_list = ti; |
| 110 |
|
| |
| 111 |
|
| /* Build linked lists */ |
| 112 |
0 |
| l1: |
| 113 |
0 |
| ret = head; |
| 114 |
0 |
| tc = ti + 1; |
| 115 |
|
| /* Patch up the rest of the links */ |
| 116 |
0 |
▶ | while (tc->name) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (tc->name) { |
0 |
0 |
0 |
|
| 117 |
0 |
| head->next = tc; |
| 118 |
0 |
| tc->prev = head; |
| 119 |
0 |
| head = tc; |
| 120 |
0 |
| tc++; |
| 121 |
|
| } |
| 122 |
0 |
| head->next = next; |
| 123 |
0 |
| return ret; |
| 124 |
|
| } |
| 125 |
|
| |
| 126 |
|
| /* Check the typename */ |
| 127 |
|
| SWIGRUNTIME(swig_type_info *) |
| 128 |
0 |
| SWIG_TypeCheck(char *c, swig_type_info *ty) |
| 129 |
|
| { |
| 130 |
|
| swig_type_info *s; |
| 131 |
0 |
▶ | if (!ty) return 0; /* Void pointer */ |
Branch: 1 branch
| Branch | True | False | Total |
| if (!ty) return 0; /* Void pointer */ |
0 |
0 |
0 |
|
| 132 |
0 |
| s = ty->next; /* First element always just a name */ |
| 133 |
|
| do { |
| 134 |
0 |
▶ | if (strcmp(s->name,c) == 0) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (strcmp(s->name,c) == 0) { |
0 |
0 |
0 |
|
| 135 |
0 |
▶ | if (s == ty->next) return s; |
Branch: 1 branch
| Branch | True | False | Total |
| if (s == ty->next) return s; |
0 |
0 |
0 |
|
| 136 |
|
| /* Move s to the top of the linked list */ |
| 137 |
0 |
| s->prev->next = s->next; |
| 138 |
0 |
▶ | if (s->next) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (s->next) { |
0 |
0 |
0 |
|
| 139 |
0 |
| s->next->prev = s->prev; |
| 140 |
|
| } |
| 141 |
|
| /* Insert s as second element in the list */ |
| 142 |
0 |
| s->next = ty->next; |
| 143 |
0 |
▶ | if (ty->next) ty->next->prev = s; |
Branch: 1 branch
| Branch | True | False | Total |
| if (ty->next) ty->next->prev = s; |
0 |
0 |
0 |
|
| 144 |
0 |
| ty->next = s; |
| 145 |
0 |
| return s; |
| 146 |
|
| } |
| 147 |
0 |
| s = s->next; |
| 148 |
0 |
▶ | } while (s && (s != ty->next)); |
Branch: 2 branches
| Branch | True | False | Total |
| } while (s && (s != ty->next)); |
0 |
0 |
0 |
| } while (s && (s != ty->next)); |
0 |
0 |
0 |
|
| 149 |
0 |
| return 0; |
| 150 |
|
| } |
| 151 |
|
| |
| 152 |
|
| /* Cast a pointer up an inheritance hierarchy */ |
| 153 |
|
| SWIGRUNTIME(void *) |
| 154 |
0 |
| SWIG_TypeCast(swig_type_info *ty, void *ptr) |
| 155 |
|
| { |
| 156 |
0 |
▶ | if ((!ty) || (!ty->converter)) return ptr; |
Branch: 2 branches
| Branch | True | False | Total |
| if ((!ty) || (!ty->converter)) return ptr; |
0 |
0 |
0 |
| if ((!ty) || (!ty->converter)) return ptr; |
0 |
0 |
0 |
|
| 157 |
0 |
| return (*ty->converter)(ptr); |
| 158 |
|
| } |
| 159 |
|
| |
| 160 |
|
| /* Dynamic pointer casting. Down an inheritance hierarchy */ |
| 161 |
|
| SWIGRUNTIME(swig_type_info *) |
| 162 |
0 |
| SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) |
| 163 |
|
| { |
| 164 |
0 |
| swig_type_info *lastty = ty; |
| 165 |
0 |
▶ | if (!ty || !ty->dcast) return ty; |
Branch: 2 branches
| Branch | True | False | Total |
| if (!ty || !ty->dcast) return ty; |
0 |
0 |
0 |
| if (!ty || !ty->dcast) return ty; |
0 |
0 |
0 |
|
| 166 |
0 |
▶ | while (ty && (ty->dcast)) { |
Branch: 2 branches
| Branch | True | False | Total |
| while (ty && (ty->dcast)) { |
0 |
0 |
0 |
| while (ty && (ty->dcast)) { |
0 |
0 |
0 |
|
| 167 |
0 |
| ty = (*ty->dcast)(ptr); |
| 168 |
0 |
▶ | if (ty) lastty = ty; |
Branch: 1 branch
| Branch | True | False | Total |
| if (ty) lastty = ty; |
0 |
0 |
0 |
|
| 169 |
|
| } |
| 170 |
0 |
| return lastty; |
| 171 |
|
| } |
| 172 |
|
| |
| 173 |
|
| /* Search for a swig_type_info structure */ |
| 174 |
|
| SWIGRUNTIME(swig_type_info *) |
| 175 |
0 |
| SWIG_TypeQuery(const char *name) { |
| 176 |
0 |
| swig_type_info *ty = swig_type_list; |
| 177 |
0 |
▶ | while (ty) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (ty) { |
0 |
0 |
0 |
|
| 178 |
0 |
▶ | if (ty->str && (strcmp(name,ty->str) == 0)) return ty; |
Branch: 2 branches
| Branch | True | False | Total |
| if (ty->str && (strcmp(name,ty->str) == 0)) return ty; |
0 |
0 |
0 |
| if (ty->str && (strcmp(name,ty->str) == 0)) return ty; |
0 |
0 |
0 |
|
| 179 |
0 |
▶ | if (ty->name && (strcmp(name,ty->name) == 0)) return ty; |
Branch: 2 branches
| Branch | True | False | Total |
| if (ty->name && (strcmp(name,ty->name) == 0)) return ty; |
0 |
0 |
0 |
| if (ty->name && (strcmp(name,ty->name) == 0)) return ty; |
0 |
0 |
0 |
|
| 180 |
0 |
| ty = ty->prev; |
| 181 |
|
| } |
| 182 |
0 |
| return 0; |
| 183 |
|
| } |
| 184 |
|
| |
| 185 |
|
| /* Set the clientdata field for a type */ |
| 186 |
|
| SWIGRUNTIME(void) |
| 187 |
0 |
| SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { |
| 188 |
|
| swig_type_info *tc, *equiv; |
| 189 |
0 |
▶ | if (ti->clientdata) return; |
Branch: 1 branch
| Branch | True | False | Total |
| if (ti->clientdata) return; |
0 |
0 |
0 |
|
| 190 |
0 |
| ti->clientdata = clientdata; |
| 191 |
0 |
| equiv = ti->next; |
| 192 |
0 |
▶ | while (equiv) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (equiv) { |
0 |
0 |
0 |
|
| 193 |
0 |
▶ | if (!equiv->converter) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!equiv->converter) { |
0 |
0 |
0 |
|
| 194 |
0 |
| tc = swig_type_list; |
| 195 |
0 |
▶ | while (tc) { |
Branch: 1 branch
| Branch | True | False | Total |
| while (tc) { |
0 |
0 |
0 |
|
| 196 |
0 |
▶ | if ((strcmp(tc->name, equiv->name) == 0)) |
Branch: 1 branch
| Branch | True | False | Total |
| if ((strcmp(tc->name, equiv->name) == 0)) |
0 |
0 |
0 |
|
| 197 |
0 |
| SWIG_TypeClientData(tc,clientdata); |
| 198 |
0 |
| tc = tc->prev; |
| 199 |
|
| } |
| 200 |
|
| } |
| 201 |
0 |
| equiv = equiv->next; |
| 202 |
|
| } |
| 203 |
|
| } |
| 204 |
|
| #endif |
| 205 |
|
| |
| 206 |
|
| #ifdef __cplusplus |
| 207 |
|
| } |
| 208 |
|
| |
| 209 |
|
| #endif |
| 210 |
|
| |
| 211 |
|
| /* ----------------------------------------------------------------------------- |
| 212 |
|
| * perl5.swg |
| 213 |
|
| * |
| 214 |
|
| * Perl5 runtime library |
| 215 |
|
| * $Header: /cvs/projects/SWIG/Lib/perl5/Attic/perlrun.swg,v 1.1.2.10 2002/09/02 22:54:30 beazley Exp $ |
| 216 |
|
| * ----------------------------------------------------------------------------- */ |
| 217 |
|
| |
| 218 |
|
| #define SWIGPERL |
| 219 |
|
| #define SWIGPERL5 |
| 220 |
|
| #ifdef __cplusplus |
| 221 |
|
| /* Needed on some windows machines---since MS plays funny |
| 222 |
|
| games with the header files under C++ */ |
| 223 |
|
| #include <math.h> |
| 224 |
|
| #include <stdlib.h> |
| 225 |
|
| extern "C" { |
| 226 |
|
| #endif |
| 227 |
|
| #include "EXTERN.h" |
| 228 |
|
| #include "perl.h" |
| 229 |
|
| #include "XSUB.h" |
| 230 |
|
| |
| 231 |
|
| /* Get rid of free and malloc defined by perl */ |
| 232 |
|
| #undef free |
| 233 |
|
| #undef malloc |
| 234 |
|
| |
| 235 |
|
| #ifndef pTHX_ |
| 236 |
|
| #define pTHX_ |
| 237 |
|
| #endif |
| 238 |
|
| |
| 239 |
|
| #include <string.h> |
| 240 |
|
| #ifdef __cplusplus |
| 241 |
|
| } |
| 242 |
|
| #endif |
| 243 |
|
| |
| 244 |
|
| /* Macro to call an XS function */ |
| 245 |
|
| |
| 246 |
|
| #ifdef PERL_OBJECT |
| 247 |
|
| #define SWIG_CALLXS(_name) _name(cv,pPerl) |
| 248 |
|
| #else |
| 249 |
|
| #ifndef MULTIPLICITY |
| 250 |
|
| #define SWIG_CALLXS(_name) _name(cv) |
| 251 |
|
| #else |
| 252 |
|
| #define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) |
| 253 |
|
| #endif |
| 254 |
|
| #endif |
| 255 |
|
| |
| 256 |
|
| /* Macros for low-level exception handling */ |
| 257 |
|
| #define SWIG_fail goto fail |
| 258 |
|
| #define SWIG_croak(x) while ((_swigerr = (const char *) x)) goto fail |
| 259 |
|
| #define SWIG_MAX_ERRMSG 256 |
| 260 |
|
| |
| 261 |
|
| /* Note: SwigMagicFuncHack is a typedef used to get the C++ |
| 262 |
|
| compiler to just shut up already */ |
| 263 |
|
| |
| 264 |
|
| #ifdef PERL_OBJECT |
| 265 |
|
| #define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this; |
| 266 |
|
| typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *); |
| 267 |
|
| |
| 268 |
|
| #ifdef __cplusplus |
| 269 |
|
| extern "C" { |
| 270 |
|
| #endif |
| 271 |
|
| typedef int (CPerlObj::*SwigMagicFuncHack)(SV *, MAGIC *); |
| 272 |
|
| #ifdef __cplusplus |
| 273 |
|
| } |
| 274 |
|
| #endif |
| 275 |
|
| |
| 276 |
|
| #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) |
| 277 |
|
| #define SWIGCLASS_STATIC |
| 278 |
|
| #else |
| 279 |
|
| #define MAGIC_PPERL |
| 280 |
|
| #define SWIGCLASS_STATIC static |
| 281 |
|
| #ifndef MULTIPLICITY |
| 282 |
|
| #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) |
| 283 |
|
| typedef int (*SwigMagicFunc)(SV *, MAGIC *); |
| 284 |
|
| |
| 285 |
|
| #ifdef __cplusplus |
| 286 |
|
| extern "C" { |
| 287 |
|
| #endif |
| 288 |
|
| typedef int (*SwigMagicFuncHack)(SV *, MAGIC *); |
| 289 |
|
| #ifdef __cplusplus |
| 290 |
|
| } |
| 291 |
|
| #endif |
| 292 |
|
| |
| 293 |
|
| |
| 294 |
|
| #else |
| 295 |
|
| #define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) |
| 296 |
|
| typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); |
| 297 |
|
| #ifdef __cplusplus |
| 298 |
|
| extern "C" { |
| 299 |
|
| #endif |
| 300 |
|
| typedef int (*SwigMagicFuncHack)(struct interpreter *, SV *, MAGIC *); |
| 301 |
|
| #ifdef __cplusplus |
| 302 |
|
| } |
| 303 |
|
| #endif |
| 304 |
|
| |
| 305 |
|
| #endif |
| 306 |
|
| #endif |
| 307 |
|
| |
| 308 |
|
| #if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) |
| 309 |
|
| #define PerlIO_exportFILE(fh,fl) (FILE*)(fh) |
| 310 |
|
| #endif |
| 311 |
|
| |
| 312 |
|
| /* Modifications for newer Perl 5.005 releases */ |
| 313 |
|
| |
| 314 |
|
| #if !defined(PERL_REVISION) || ((PERL_REVISION >= 5) && ((PERL_VERSION < 5) || ((PERL_VERSION == 5) && (PERL_SUBVERSION < 50)))) |
| 315 |
|
| #ifndef PL_sv_yes |
| 316 |
|
| #define PL_sv_yes sv_yes |
| 317 |
|
| #endif |
| 318 |
|
| #ifndef PL_sv_undef |
| 319 |
|
| #define PL_sv_undef sv_undef |
| 320 |
|
| #endif |
| 321 |
|
| #ifndef PL_na |
| 322 |
|
| #define PL_na na |
| 323 |
|
| #endif |
| 324 |
|
| #endif |
| 325 |
|
| |
| 326 |
|
| #include <stdlib.h> |
| 327 |
|
| |
| 328 |
|
| #ifdef __cplusplus |
| 329 |
|
| extern "C" { |
| 330 |
|
| #endif |
| 331 |
|
| |
| 332 |
|
| #ifdef SWIG_NOINCLUDE |
| 333 |
|
| |
| 334 |
|
| #ifndef PERL_OBJECT |
| 335 |
|
| extern int SWIG_ConvertPtr(SV *, void **, swig_type_info *, int flags); |
| 336 |
|
| extern void SWIG_MakePtr(SV *, void *, swig_type_info *, int flags); |
| 337 |
|
| #else |
| 338 |
|
| extern int _SWIG_ConvertPtr(CPerlObj *, SV *, void **, swig_type_info *,int flags); |
| 339 |
|
| extern void _SWIG_MakePtr(CPerlObj *, SV *, void *, swig_type_info *, int flags); |
| 340 |
|
| #define SWIG_ConvertPtr(a,b,c,d) _SWIG_ConvertPtr(pPerl,a,b,c,d) |
| 341 |
|
| #define SWIG_MakePtr(a,b,c,d) _SWIG_MakePtr(pPerl,a,b,c,d) |
| 342 |
|
| #endif |
| 343 |
|
| |
| 344 |
|
| #else |
| 345 |
|
| |
| 346 |
|
| /* Function for getting a pointer value */ |
| 347 |
|
| |
| 348 |
|
| #ifndef PERL_OBJECT |
| 349 |
|
| SWIGRUNTIME(int) |
| 350 |
0 |
| SWIG_ConvertPtr(SV *sv, void **ptr, swig_type_info *_t, int flags) |
| 351 |
|
| #else |
| 352 |
|
| #define SWIG_ConvertPtr(a,b,c,d) _SWIG_ConvertPtr(pPerl,a,b,c,d) |
| 353 |
|
| SWIGRUNTIME(int) |
| 354 |
|
| _SWIG_ConvertPtr(CPerlObj *pPerl, SV *sv, void **ptr, swig_type_info *_t, int flags) |
| 355 |
|
| #endif |
| 356 |
|
| { |
| 357 |
|
| char *_c; |
| 358 |
|
| swig_type_info *tc; |
| 359 |
|
| IV tmp; |
| 360 |
|
| |
| 361 |
|
| /* If magical, apply more magic */ |
| 362 |
0 |
▶ | if (SvGMAGICAL(sv)) |
Branch: 1 branch
| Branch | True | False | Total |
| if (SvGMAGICAL(sv)) |
0 |
0 |
0 |
|
| 363 |
0 |
| mg_get(sv); |
| 364 |
|
| |
| 365 |
|
| /* Check to see if this is an object */ |
| 366 |
0 |
▶ | if (sv_isobject(sv)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (sv_isobject(sv)) { |
0 |
0 |
0 |
|
| 367 |
0 |
| SV *tsv = (SV*) SvRV(sv); |
| 368 |
0 |
▶ | if ((SvTYPE(tsv) == SVt_PVHV)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if ((SvTYPE(tsv) == SVt_PVHV)) { |
0 |
0 |
0 |
|
| 369 |
|
| MAGIC *mg; |
| 370 |
0 |
▶ | if (SvMAGICAL(tsv)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (SvMAGICAL(tsv)) { |
0 |
0 |
0 |
|
| 371 |
0 |
| mg = mg_find(tsv,'P'); |
| 372 |
0 |
▶ | if (mg) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (mg) { |
0 |
0 |
0 |
|
| 373 |
0 |
| SV *rsv = mg->mg_obj; |
| 374 |
0 |
▶ | if (sv_isobject(rsv)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (sv_isobject(rsv)) { |
0 |
0 |
0 |
|
| 375 |
0 |
| tmp = SvIV((SV*)SvRV(rsv)); |
| 376 |
|
| } |
| 377 |
|
| } |
| 378 |
|
| } else { |
| 379 |
0 |
| return -1; |
| 380 |
|
| } |
| 381 |
|
| } else { |
| 382 |
0 |
| tmp = SvIV((SV*)SvRV(sv)); |
| 383 |
|
| } |
| 384 |
0 |
▶ | if (!_t) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!_t) { |
0 |
0 |
0 |
|
| 385 |
0 |
| *(ptr) = (void *) tmp; |
| 386 |
0 |
| return 0; |
| 387 |
|
| } |
| 388 |
0 |
▶ | } else if (! SvOK(sv)) { /* Check for undef */ |
Branch: 1 branch
| Branch | True | False | Total |
| } else if (! SvOK(sv)) { /* Check for undef */ |
0 |
0 |
0 |
|
| 389 |
0 |
| *(ptr) = (void *) 0; |
| 390 |
0 |
| return 0; |
| 391 |
0 |
▶ | } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ |
Branch: 1 branch
| Branch | True | False | Total |
| } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ |
0 |
0 |
0 |
|
| 392 |
0 |
| *(ptr) = (void *) 0; |
| 393 |
0 |
▶ | if (!SvROK(sv)) |
Branch: 1 branch
| Branch | True | False | Total |
| if (!SvROK(sv)) |
0 |
0 |
0 |
|
| 394 |
0 |
| return 0; |
| 395 |
|
| else |
| 396 |
0 |
| return -1; |
| 397 |
|
| } else { /* Don't know what it is */ |
| 398 |
0 |
| *(ptr) = (void *) 0; |
| 399 |
0 |
| return -1; |
| 400 |
|
| } |
| 401 |
0 |
▶ | if (_t) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (_t) { |
0 |
0 |
0 |
|
| 402 |
|
| /* Now see if the types match */ |
| 403 |
0 |
▶ | _c = HvNAME(SvSTASH(SvRV(sv))); |
Branch: 6 branches
| Branch | True | False | Total |
| _c = HvNAME(SvSTASH(SvRV(sv))); |
0 |
0 |
0 |
| _c = HvNAME(SvSTASH(SvRV(sv))); |
0 |
0 |
0 |
| _c = HvNAME(SvSTASH(SvRV(sv))); |
0 |
0 |
0 |
| _c = HvNAME(SvSTASH(SvRV(sv))); |
0 |
0 |
0 |
| _c = HvNAME(SvSTASH(SvRV(sv))); |
0 |
0 |
0 |
| _c = HvNAME(SvSTASH(SvRV(sv))); |
0 |
0 |
0 |
|
| 404 |
0 |
| tc = SWIG_TypeCheck(_c,_t); |
| 405 |
0 |
▶ | if (!tc) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!tc) { |
0 |
0 |
0 |
|
| 406 |
0 |
| *ptr = (void *) tmp; |
| 407 |
0 |
| return -1; |
| 408 |
|
| } |
| 409 |
0 |
| *ptr = SWIG_TypeCast(tc,(void *)tmp); |
| 410 |
0 |
| return 0; |
| 411 |
|
| } |
| 412 |
0 |
| *ptr = (void *) tmp; |
| 413 |
0 |
| return 0; |
| 414 |
|
| } |
| 415 |
|
| #ifndef PERL_OBJECT |
| 416 |
|
| SWIGRUNTIME(void) |
| 417 |
0 |
| SWIG_MakePtr(SV *sv, void *ptr, swig_type_info *t,int flags) |
| 418 |
|
| #else |
| 419 |
|
| #define SWIG_MakePtr(a,b,c,d) _SWIG_MakePtr(pPerl,a,b,c,d) |
| 420 |
|
| SWIGRUNTIME(void) |
| 421 |
|
| _SWIG_MakePtr(CPerlObj *pPerl, SV *sv, void *ptr, swig_type_info *t, int flags) |
| 422 |
|
| #endif |
| 423 |
|
| { |
| 424 |
0 |
| sv_setref_pv(sv, (char *) t->name, ptr); |
| 425 |
0 |
| } |
| 426 |
|
| |
| 427 |
|
| #endif |
| 428 |
|
| |
| 429 |
|
| typedef XS(SwigPerlWrapper); |
| 430 |
|
| typedef SwigPerlWrapper *SwigPerlWrapperPtr; |
| 431 |
|
| |
| 432 |
|
| /* Structure for command table */ |
| 433 |
|
| typedef struct { |
| 434 |
|
| const char *name; |
| 435 |
|
| SwigPerlWrapperPtr wrapper; |
| 436 |
|
| } swig_command_info; |
| 437 |
|
| |
| 438 |
|
| /* Information for constant table */ |
| 439 |
|
| |
| 440 |
|
| #define SWIG_INT 1 |
| 441 |
|
| #define SWIG_FLOAT 2 |
| 442 |
|
| #define SWIG_STRING 3 |
| 443 |
|
| #define SWIG_POINTER 4 |
| 444 |
|
| #define SWIG_BINARY 5 |
| 445 |
|
| |
| 446 |
|
| /* Constant information structure */ |
| 447 |
|
| typedef struct swig_constant_info { |
| 448 |
|
| int type; |
| 449 |
|
| const char *name; |
| 450 |
|
| long lvalue; |
| 451 |
|
| double dvalue; |
| 452 |
|
| void *pvalue; |
| 453 |
|
| swig_type_info **ptype; |
| 454 |
|
| } swig_constant_info; |
| 455 |
|
| |
| 456 |
|
| #ifdef __cplusplus |
| 457 |
|
| } |
| 458 |
|
| #endif |
| 459 |
|
| |
| 460 |
|
| /* Structure for variable table */ |
| 461 |
|
| typedef struct { |
| 462 |
|
| const char *name; |
| 463 |
|
| SwigMagicFunc set; |
| 464 |
|
| SwigMagicFunc get; |
| 465 |
|
| swig_type_info **type; |
| 466 |
|
| } swig_variable_info; |
| 467 |
|
| |
| 468 |
|
| /* Magic variable code */ |
| 469 |
|
| #ifndef PERL_OBJECT |
| 470 |
|
| #define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c) |
| 471 |
|
| #ifndef MULTIPLICITY |
| 472 |
0 |
| static void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int \ |
| 473 |
|
| (*get)(SV *,MAGIC *)) { |
| 474 |
|
| #else |
| 475 |
|
| static void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*,\ |
| 476 |
|
| SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) { |
| 477 |
|
| #endif |
| 478 |
|
| #else |
| 479 |
|
| #define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c) |
| 480 |
|
| static void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) { |
| 481 |
|
| #endif |
| 482 |
|
| MAGIC *mg; |
| 483 |
0 |
| sv_magic(sv,sv,'U',(char *) name,strlen(name)); |
| 484 |
0 |
| mg = mg_find(sv,'U'); |
| 485 |
0 |
| mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); |
| 486 |
0 |
| mg->mg_virtual->svt_get = (SwigMagicFuncHack) get; |
| 487 |
0 |
| mg->mg_virtual->svt_set = (SwigMagicFuncHack) set; |
| 488 |
0 |
| mg->mg_virtual->svt_len = 0; |
| 489 |
0 |
| mg->mg_virtual->svt_clear = 0; |
| 490 |
0 |
| mg->mg_virtual->svt_free = 0; |
| 491 |
0 |
| } |
| 492 |
|
| |
| 493 |
|
| |
| 494 |
|
| |
| 495 |
|
| |
| 496 |
|
| |
| 497 |
|
| |
| 498 |
|
| |
| 499 |
|
| /* -------- TYPES TABLE (BEGIN) -------- */ |
| 500 |
|
| |
| 501 |
|
| static swig_type_info *swig_types[1]; |
| 502 |
|
| |
| 503 |
|
| /* -------- TYPES TABLE (END) -------- */ |
| 504 |
|
| |
| 505 |
|
| #define SWIG_init boot_String__Ediff |
| 506 |
|
| |
| 507 |
|
| #define SWIG_name "String::Ediff::boot_String__Ediff" |
| 508 |
|
| #define SWIG_prefix "String::Ediff::" |
| 509 |
|
| |
| 510 |
|
| #ifdef __cplusplus |
| 511 |
|
| extern "C" |
| 512 |
|
| #endif |
| 513 |
|
| #ifndef PERL_OBJECT |
| 514 |
|
| #ifndef MULTIPLICITY |
| 515 |
|
| SWIGEXPORT(void) SWIG_init (CV* cv); |
| 516 |
|
| #else |
| 517 |
|
| SWIGEXPORT(void) SWIG_init (pTHXo_ CV* cv); |
| 518 |
|
| #endif |
| 519 |
|
| #else |
| 520 |
|
| SWIGEXPORT(void) SWIG_init (CV *cv, CPerlObj *); |
| 521 |
|
| #endif |
| 522 |
|
| |
| 523 |
|
| #ifdef PERL_OBJECT |
| 524 |
|
| #define MAGIC_CLASS _wrap_String::Ediff_var:: |
| 525 |
|
| class _wrap_String::Ediff_var : public CPerlObj { |
| 526 |
|
| public: |
| 527 |
|
| #else |
| 528 |
|
| #define MAGIC_CLASS |
| 529 |
|
| #endif |
| 530 |
0 |
| SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *sv, MAGIC *mg) { |
| 531 |
|
| MAGIC_PPERL |
| 532 |
0 |
| sv = sv; mg = mg; |
| 533 |
0 |
| croak("Value is read-only."); |
| 534 |
|
| return 0; |
| 535 |
|
| } |
| 536 |
|
| |
| 537 |
|
| |
| 538 |
|
| #ifdef PERL_OBJECT |
| 539 |
|
| }; |
| 540 |
|
| #endif |
| 541 |
|
| |
| 542 |
|
| #ifdef __cplusplus |
| 543 |
|
| extern "C" { |
| 544 |
|
| #endif |
| 545 |
0 |
| XS(_wrap_ediff) { |
| 546 |
0 |
| char _swigmsg[SWIG_MAX_ERRMSG] = ""; |
| 547 |
0 |
| const char *_swigerr = _swigmsg; |
| 548 |
|
| { |
| 549 |
|
| char *arg1 ; |
| 550 |
|
| char *arg2 ; |
| 551 |
|
| char *result; |
| 552 |
0 |
| int argvi = 0; |
| 553 |
0 |
| dXSARGS; |
| 554 |
|
| |
| 555 |
0 |
▶ | if ((items < 2) || (items > 2)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if ((items < 2) || (items > 2)) { |
0 |
0 |
0 |
| if ((items < 2) || (items > 2)) { |
0 |
0 |
0 |
|
| 556 |
0 |
| SWIG_croak("Usage: ediff(s1,s2);"); |
| 557 |
|
| } |
| 558 |
0 |
▶ | if (!SvOK((SV*) ST(0))) arg1 = 0; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!SvOK((SV*) ST(0))) arg1 = 0; |
0 |
0 |
0 |
|
| 559 |
0 |
| else arg1 = (char *) SvPV(ST(0), PL_na); |
| 560 |
0 |
▶ | if (!SvOK((SV*) ST(1))) arg2 = 0; |
Branch: 1 branch
| Branch | True | False | Total |
| if (!SvOK((SV*) ST(1))) arg2 = 0; |
0 |
0 |
0 |
|
| 561 |
0 |
| else arg2 = (char *) SvPV(ST(1), PL_na); |
| 562 |
0 |
| result = (char *)ediff(arg1,arg2); |
| 563 |
|
| |
| 564 |
0 |
| ST(argvi) = sv_newmortal(); |
| 565 |
0 |
▶ | if (result) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (result) { |
0 |
0 |
0 |
|
| 566 |
0 |
| sv_setpv((SV*)ST(argvi++), (char *) result); |
| 567 |
0 |
| free(result); |
| 568 |
|
| }else { |
| 569 |
0 |
| sv_setsv((SV*)ST(argvi++), &PL_sv_undef); |
| 570 |
|
| } |
| 571 |
0 |
| XSRETURN(argvi); |
| 572 |
0 |
| fail: |
| 573 |
|
| (void) _swigerr; |
| 574 |
|
| } |
| 575 |
0 |
| croak(_swigerr); |
| 576 |
|
| } |
| 577 |
|
| |
| 578 |
|
| |
| 579 |
|
| |
| 580 |
|
| /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ |
| 581 |
|
| |
| 582 |
|
| |
| 583 |
|
| static swig_type_info *swig_types_initial[] = { |
| 584 |
|
| 0 |
| 585 |
|
| }; |
| 586 |
|
| |
| 587 |
|
| |
| 588 |
|
| /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ |
| 589 |
|
| |
| 590 |
|
| static swig_constant_info swig_constants[] = { |
| 591 |
|
| {0} |
| 592 |
|
| }; |
| 593 |
|
| #ifdef __cplusplus |
| 594 |
|
| } |
| 595 |
|
| #endif |
| 596 |
|
| static swig_variable_info swig_variables[] = { |
| 597 |
|
| {0} |
| 598 |
|
| }; |
| 599 |
|
| static swig_command_info swig_commands[] = { |
| 600 |
|
| {"String::Ediff::ediff", _wrap_ediff}, |
| 601 |
|
| {0,0} |
| 602 |
|
| }; |
| 603 |
|
| |
| 604 |
|
| #ifdef __cplusplus |
| 605 |
|
| extern "C" |
| 606 |
|
| #endif |
| 607 |
|
| |
| 608 |
0 |
| XS(SWIG_init) { |
| 609 |
0 |
| dXSARGS; |
| 610 |
|
| int i; |
| 611 |
|
| static int _init = 0; |
| 612 |
0 |
▶ | if (!_init) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!_init) { |
0 |
0 |
0 |
|
| 613 |
0 |
▶ | for (i = 0; swig_types_initial[i]; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = 0; swig_types_initial[i]; i++) { |
0 |
0 |
0 |
|
| 614 |
0 |
| swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]); |
| 615 |
|
| } |
| 616 |
0 |
| _init = 1; |
| 617 |
|
| } |
| 618 |
|
| |
| 619 |
|
| /* Install commands */ |
| 620 |
0 |
▶ | for (i = 0; swig_commands[i].name; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = 0; swig_commands[i].name; i++) { |
0 |
0 |
0 |
|
| 621 |
0 |
| newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__); |
| 622 |
|
| } |
| 623 |
|
| |
| 624 |
|
| /* Install variables */ |
| 625 |
0 |
▶ | for (i = 0; swig_variables[i].name; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = 0; swig_variables[i].name; i++) { |
0 |
0 |
0 |
|
| 626 |
|
| SV *sv; |
| 627 |
0 |
| sv = perl_get_sv((char*) swig_variables[i].name, TRUE | 0x2); |
| 628 |
0 |
▶ | if (swig_variables[i].type) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (swig_variables[i].type) { |
0 |
0 |
0 |
|
| 629 |
0 |
| SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); |
| 630 |
|
| }else { |
| 631 |
0 |
| sv_setiv(sv,(IV) 0); |
| 632 |
|
| } |
| 633 |
0 |
| swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); |
| 634 |
|
| } |
| 635 |
|
| |
| 636 |
|
| /* Install constant */ |
| 637 |
0 |
▶ | for (i = 0; swig_constants[i].type; i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = 0; swig_constants[i].type; i++) { |
0 |
0 |
0 |
|
| 638 |
|
| SV *sv; |
| 639 |
0 |
| sv = perl_get_sv((char*)swig_constants[i].name, TRUE | 0x2); |
| 640 |
0 |
| switch(swig_constants[i].type) { |
| 641 |
0 |
| case SWIG_INT: |
| 642 |
0 |
| sv_setiv(sv, (IV) swig_constants[i].lvalue); |
| 643 |
0 |
| break; |
| 644 |
0 |
| case SWIG_FLOAT: |
| 645 |
0 |
| sv_setnv(sv, (double) swig_constants[i].dvalue); |
| 646 |
0 |
| break; |
| 647 |
0 |
| case SWIG_STRING: |
| 648 |
0 |
| sv_setpv(sv, (char *) swig_constants[i].pvalue); |
| 649 |
0 |
| break; |
| 650 |
0 |
| case SWIG_POINTER: |
| 651 |
0 |
| SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); |
| 652 |
0 |
| break; |
| 653 |
0 |
| case SWIG_BINARY: |
| 654 |
|
| /* obj = SWIG_NewPackedObj(swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype)); */ |
| 655 |
0 |
| break; |
| 656 |
0 |
| default: |
| 657 |
0 |
| break; |
| 658 |
|
| } |
| 659 |
0 |
| SvREADONLY_on(sv); |
| 660 |
|
| } |
| 661 |
|
| |
| 662 |
0 |
| ST(0) = &PL_sv_yes; |
| 663 |
0 |
| XSRETURN(1); |
| 664 |
|
| } |
| 665 |
|
| |