~ubuntu-branches/ubuntu/vivid/znc/vivid

« back to all changes in this revision

Viewing changes to modules/modpython/swigpyrun.h

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2014-05-09 09:55:57 UTC
  • mfrom: (34.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20140509095557-5i5ltee23m2hg96p
Tags: 1.4-1
* New upstream release.
  - Drop merged patch 01-webadmin-dos.
  - Upstream provides a changelog now. Remove lintian overrides.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* ----------------------------------------------------------------------------
2
2
 * This file was automatically generated by SWIG (http://www.swig.org).
3
 
 * Version 2.0.9
4
 
 * 
5
 
 * This file is not intended to be easily readable and contains a number of 
 
3
 * Version 3.0.0
 
4
 *
 
5
 * This file is not intended to be easily readable and contains a number of
6
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. 
 
7
 * changes to this file unless you know what you are doing--modify the SWIG
 
8
 * interface file instead.
9
9
 * ----------------------------------------------------------------------------- */
10
10
 
11
11
/* -----------------------------------------------------------------------------
39
39
#ifndef SWIGUNUSED
40
40
# if defined(__GNUC__)
41
41
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
42
 
#     define SWIGUNUSED __attribute__ ((__unused__)) 
 
42
#     define SWIGUNUSED __attribute__ ((__unused__))
43
43
#   else
44
44
#     define SWIGUNUSED
45
45
#   endif
46
46
# elif defined(__ICC)
47
 
#   define SWIGUNUSED __attribute__ ((__unused__)) 
 
47
#   define SWIGUNUSED __attribute__ ((__unused__))
48
48
# else
49
 
#   define SWIGUNUSED 
 
49
#   define SWIGUNUSED
50
50
# endif
51
51
#endif
52
52
 
53
53
#ifndef SWIG_MSC_UNSUPPRESS_4505
54
54
# if defined(_MSC_VER)
55
55
#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
56
 
# endif 
 
56
# endif
57
57
#endif
58
58
 
59
59
#ifndef SWIGUNUSEDPARM
60
60
# ifdef __cplusplus
61
61
#   define SWIGUNUSEDPARM(p)
62
62
# else
63
 
#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
 
63
#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
64
64
# endif
65
65
#endif
66
66
 
103
103
#   define SWIGSTDCALL __stdcall
104
104
# else
105
105
#   define SWIGSTDCALL
106
 
# endif 
 
106
# endif
107
107
#endif
108
108
 
109
109
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
117
117
#endif
118
118
 
119
119
/*  Errors in SWIG */
120
 
#define  SWIG_UnknownError         -1 
121
 
#define  SWIG_IOError              -2 
122
 
#define  SWIG_RuntimeError         -3 
123
 
#define  SWIG_IndexError           -4 
124
 
#define  SWIG_TypeError            -5 
125
 
#define  SWIG_DivisionByZero       -6 
126
 
#define  SWIG_OverflowError        -7 
127
 
#define  SWIG_SyntaxError          -8 
128
 
#define  SWIG_ValueError           -9 
 
120
#define  SWIG_UnknownError         -1
 
121
#define  SWIG_IOError              -2
 
122
#define  SWIG_RuntimeError         -3
 
123
#define  SWIG_IndexError           -4
 
124
#define  SWIG_TypeError            -5
 
125
#define  SWIG_DivisionByZero       -6
 
126
#define  SWIG_OverflowError        -7
 
127
#define  SWIG_SyntaxError          -8
 
128
#define  SWIG_ValueError           -9
129
129
#define  SWIG_SystemError          -10
130
130
#define  SWIG_AttributeError       -11
131
 
#define  SWIG_MemoryError          -12 
 
131
#define  SWIG_MemoryError          -12
132
132
#define  SWIG_NullReferenceError   -13
133
133
 
134
134
 
156
156
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
157
157
  creating a static or dynamic library from the SWIG runtime code.
158
158
  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
159
 
  
 
159
 
160
160
  But only do this if strictly necessary, ie, if you have problems
161
161
  with your compiler or suchlike.
162
162
*/
182
182
#define SWIG_POINTER_OWN           0x1
183
183
 
184
184
 
185
 
/* 
 
185
/*
186
186
   Flags/methods for returning states.
187
 
   
188
 
   The SWIG conversion methods, as ConvertPtr, return an integer 
 
187
 
 
188
   The SWIG conversion methods, as ConvertPtr, return an integer
189
189
   that tells if the conversion was successful or not. And if not,
190
190
   an error code can be returned (see swigerrors.swg for the codes).
191
 
   
 
191
 
192
192
   Use the following macros/flags to set or process the returning
193
193
   states.
194
 
   
 
194
 
195
195
   In old versions of SWIG, code such as the following was usually written:
196
196
 
197
197
     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
224
224
    } else {
225
225
      // fail code
226
226
    }
227
 
    
 
227
 
228
228
   I.e., now SWIG_ConvertPtr can return new objects and you can
229
229
   identify the case and take care of the deallocation. Of course that
230
230
   also requires SWIG_ConvertPtr to return new result values, such as
231
231
 
232
 
      int SWIG_ConvertPtr(obj, ptr,...) {         
233
 
        if (<obj is ok>) {                             
234
 
          if (<need new object>) {                     
235
 
            *ptr = <ptr to new allocated object>; 
236
 
            return SWIG_NEWOBJ;                
237
 
          } else {                                     
238
 
            *ptr = <ptr to old object>;        
239
 
            return SWIG_OLDOBJ;                
240
 
          }                                    
241
 
        } else {                                       
242
 
          return SWIG_BADOBJ;                  
243
 
        }                                              
 
232
      int SWIG_ConvertPtr(obj, ptr,...) {
 
233
        if (<obj is ok>) {
 
234
          if (<need new object>) {
 
235
            *ptr = <ptr to new allocated object>;
 
236
            return SWIG_NEWOBJ;
 
237
          } else {
 
238
            *ptr = <ptr to old object>;
 
239
            return SWIG_OLDOBJ;
 
240
          }
 
241
        } else {
 
242
          return SWIG_BADOBJ;
 
243
        }
244
244
      }
245
245
 
246
246
   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
254
254
       int fooi(int);
255
255
 
256
256
   and you call
257
 
 
 
257
 
258
258
      food(1)   // cast rank '1'  (1 -> 1.0)
259
259
      fooi(1)   // cast rank '0'
260
260
 
261
261
   just use the SWIG_AddCast()/SWIG_CheckState()
262
262
*/
263
263
 
264
 
#define SWIG_OK                    (0) 
 
264
#define SWIG_OK                    (0)
265
265
#define SWIG_ERROR                 (-1)
266
266
#define SWIG_IsOK(r)               (r >= 0)
267
 
#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
 
267
#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
268
268
 
269
269
/* The CastRankLimit says how many bits are used for the cast rank */
270
270
#define SWIG_CASTRANKLIMIT         (1 << 8)
295
295
#  endif
296
296
#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
297
297
#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
298
 
SWIGINTERNINLINE int SWIG_AddCast(int r) { 
 
298
SWIGINTERNINLINE int SWIG_AddCast(int r) {
299
299
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
300
300
}
301
 
SWIGINTERNINLINE int SWIG_CheckState(int r) { 
302
 
  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
 
301
SWIGINTERNINLINE int SWIG_CheckState(int r) {
 
302
  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
303
303
}
304
304
#else /* no cast-rank mode */
305
 
#  define SWIG_AddCast
 
305
#  define SWIG_AddCast(r) (r)
306
306
#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
307
307
#endif
308
308
 
346
346
  void                    *clientdata;          /* Language specific module data */
347
347
} swig_module_info;
348
348
 
349
 
/* 
 
349
/*
350
350
  Compare two type names skipping the space characters, therefore
351
351
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
352
352
 
366
366
 
367
367
/*
368
368
  Check type equivalence in a name list like <name1>|<name2>|...
 
369
  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
 
370
*/
 
371
SWIGRUNTIME int
 
372
SWIG_TypeCmp(const char *nb, const char *tb) {
 
373
  int equiv = 1;
 
374
  const char* te = tb + strlen(tb);
 
375
  const char* ne = nb;
 
376
  while (equiv != 0 && *ne) {
 
377
    for (nb = ne; *ne; ++ne) {
 
378
      if (*ne == '|') break;
 
379
    }
 
380
    equiv = SWIG_TypeNameComp(nb, ne, tb, te);
 
381
    if (*ne) ++ne;
 
382
  }
 
383
  return equiv;
 
384
}
 
385
 
 
386
/*
 
387
  Check type equivalence in a name list like <name1>|<name2>|...
369
388
  Return 0 if not equal, 1 if equal
370
389
*/
371
390
SWIGRUNTIME int
372
391
SWIG_TypeEquiv(const char *nb, const char *tb) {
373
 
  int equiv = 0;
374
 
  const char* te = tb + strlen(tb);
375
 
  const char* ne = nb;
376
 
  while (!equiv && *ne) {
377
 
    for (nb = ne; *ne; ++ne) {
378
 
      if (*ne == '|') break;
379
 
    }
380
 
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
381
 
    if (*ne) ++ne;
382
 
  }
383
 
  return equiv;
384
 
}
385
 
 
386
 
/*
387
 
  Check type equivalence in a name list like <name1>|<name2>|...
388
 
  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
389
 
*/
390
 
SWIGRUNTIME int
391
 
SWIG_TypeCompare(const char *nb, const char *tb) {
392
 
  int equiv = 0;
393
 
  const char* te = tb + strlen(tb);
394
 
  const char* ne = nb;
395
 
  while (!equiv && *ne) {
396
 
    for (nb = ne; *ne; ++ne) {
397
 
      if (*ne == '|') break;
398
 
    }
399
 
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
400
 
    if (*ne) ++ne;
401
 
  }
402
 
  return equiv;
403
 
}
404
 
 
 
392
  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
 
393
}
405
394
 
406
395
/*
407
396
  Check the typename
430
419
  return 0;
431
420
}
432
421
 
433
 
/* 
 
422
/*
434
423
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
435
424
*/
436
425
SWIGRUNTIME swig_cast_info *
465
454
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
466
455
}
467
456
 
468
 
/* 
 
457
/*
469
458
   Dynamic pointer casting. Down an inheritance hierarchy
470
459
*/
471
460
SWIGRUNTIME swig_type_info *
509
498
    return type->name;
510
499
}
511
500
 
512
 
/* 
 
501
/*
513
502
   Set the clientdata field for a type
514
503
*/
515
504
SWIGRUNTIME void
517
506
  swig_cast_info *cast = ti->cast;
518
507
  /* if (ti->clientdata == clientdata) return; */
519
508
  ti->clientdata = clientdata;
520
 
  
 
509
 
521
510
  while (cast) {
522
511
    if (!cast->converter) {
523
512
      swig_type_info *tc = cast->type;
524
513
      if (!tc->clientdata) {
525
514
        SWIG_TypeClientData(tc, clientdata);
526
515
      }
527
 
    }    
 
516
    }
528
517
    cast = cast->next;
529
518
  }
530
519
}
533
522
  SWIG_TypeClientData(ti, clientdata);
534
523
  ti->owndata = 1;
535
524
}
536
 
  
 
525
 
537
526
/*
538
527
  Search for a swig_type_info structure only by mangled name
539
528
  Search is a O(log #types)
540
 
  
541
 
  We start searching at module start, and finish searching when start == end.  
 
529
 
 
530
  We start searching at module start, and finish searching when start == end.
542
531
  Note: if start == end at the beginning of the function, we go all the way around
543
532
  the circular list.
544
533
*/
545
534
SWIGRUNTIME swig_type_info *
546
 
SWIG_MangledTypeQueryModule(swig_module_info *start, 
547
 
                            swig_module_info *end, 
 
535
SWIG_MangledTypeQueryModule(swig_module_info *start,
 
536
                            swig_module_info *end,
548
537
                            const char *name) {
549
538
  swig_module_info *iter = start;
550
539
  do {
551
540
    if (iter->size) {
552
 
      register size_t l = 0;
553
 
      register size_t r = iter->size - 1;
 
541
      size_t l = 0;
 
542
      size_t r = iter->size - 1;
554
543
      do {
555
544
        /* since l+r >= 0, we can (>> 1) instead (/ 2) */
556
 
        register size_t i = (l + r) >> 1; 
 
545
        size_t i = (l + r) >> 1;
557
546
        const char *iname = iter->types[i]->name;
558
547
        if (iname) {
559
 
          register int compare = strcmp(name, iname);
560
 
          if (compare == 0) {       
 
548
          int compare = strcmp(name, iname);
 
549
          if (compare == 0) {
561
550
            return iter->types[i];
562
551
          } else if (compare < 0) {
563
552
            if (i) {
582
571
  Search for a swig_type_info structure for either a mangled name or a human readable name.
583
572
  It first searches the mangled names of the types, which is a O(log #types)
584
573
  If a type is not found it then searches the human readable names, which is O(#types).
585
 
  
586
 
  We start searching at module start, and finish searching when start == end.  
 
574
 
 
575
  We start searching at module start, and finish searching when start == end.
587
576
  Note: if start == end at the beginning of the function, we go all the way around
588
577
  the circular list.
589
578
*/
590
579
SWIGRUNTIME swig_type_info *
591
 
SWIG_TypeQueryModule(swig_module_info *start, 
592
 
                     swig_module_info *end, 
 
580
SWIG_TypeQueryModule(swig_module_info *start,
 
581
                     swig_module_info *end,
593
582
                     const char *name) {
594
583
  /* STEP 1: Search the name field using binary search */
595
584
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
600
589
       of the str field (the human readable name) */
601
590
    swig_module_info *iter = start;
602
591
    do {
603
 
      register size_t i = 0;
 
592
      size_t i = 0;
604
593
      for (; i < iter->size; ++i) {
605
594
        if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
606
595
          return iter->types[i];
608
597
      iter = iter->next;
609
598
    } while (iter != end);
610
599
  }
611
 
  
 
600
 
612
601
  /* neither found a match */
613
602
  return 0;
614
603
}
615
604
 
616
 
/* 
 
605
/*
617
606
   Pack binary data into a string
618
607
*/
619
608
SWIGRUNTIME char *
620
609
SWIG_PackData(char *c, void *ptr, size_t sz) {
621
610
  static const char hex[17] = "0123456789abcdef";
622
 
  register const unsigned char *u = (unsigned char *) ptr;
623
 
  register const unsigned char *eu =  u + sz;
 
611
  const unsigned char *u = (unsigned char *) ptr;
 
612
  const unsigned char *eu =  u + sz;
624
613
  for (; u != eu; ++u) {
625
 
    register unsigned char uu = *u;
 
614
    unsigned char uu = *u;
626
615
    *(c++) = hex[(uu & 0xf0) >> 4];
627
616
    *(c++) = hex[uu & 0xf];
628
617
  }
629
618
  return c;
630
619
}
631
620
 
632
 
/* 
 
621
/*
633
622
   Unpack binary data from a string
634
623
*/
635
624
SWIGRUNTIME const char *
636
625
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
637
 
  register unsigned char *u = (unsigned char *) ptr;
638
 
  register const unsigned char *eu = u + sz;
 
626
  unsigned char *u = (unsigned char *) ptr;
 
627
  const unsigned char *eu = u + sz;
639
628
  for (; u != eu; ++u) {
640
 
    register char d = *(c++);
641
 
    register unsigned char uu;
 
629
    char d = *(c++);
 
630
    unsigned char uu;
642
631
    if ((d >= '0') && (d <= '9'))
643
632
      uu = ((d - '0') << 4);
644
633
    else if ((d >= 'a') && (d <= 'f'))
645
634
      uu = ((d - ('a'-10)) << 4);
646
 
    else 
 
635
    else
647
636
      return (char *) 0;
648
637
    d = *(c++);
649
638
    if ((d >= '0') && (d <= '9'))
650
639
      uu |= (d - '0');
651
640
    else if ((d >= 'a') && (d <= 'f'))
652
641
      uu |= (d - ('a'-10));
653
 
    else 
 
642
    else
654
643
      return (char *) 0;
655
644
    *u = uu;
656
645
  }
657
646
  return c;
658
647
}
659
648
 
660
 
/* 
 
649
/*
661
650
   Pack 'void *' into a string buffer.
662
651
*/
663
652
SWIGRUNTIME char *
1293
1282
  }  
1294
1283
  if (!PyTuple_Check(args)) {
1295
1284
    if (min <= 1 && max >= 1) {
1296
 
      register int i;
 
1285
      int i;
1297
1286
      objs[0] = args;
1298
1287
      for (i = 1; i < max; ++i) {
1299
1288
        objs[i] = 0;
1303
1292
    PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1304
1293
    return 0;
1305
1294
  } else {
1306
 
    register Py_ssize_t l = PyTuple_GET_SIZE(args);
 
1295
    Py_ssize_t l = PyTuple_GET_SIZE(args);
1307
1296
    if (l < min) {
1308
1297
      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
1309
1298
                   name, (min == max ? "" : "at least "), (int)min, (int)l);
1313
1302
                   name, (min == max ? "" : "at most "), (int)max, (int)l);
1314
1303
      return 0;
1315
1304
    } else {
1316
 
      register int i;
 
1305
      int i;
1317
1306
      for (i = 0; i < l; ++i) {
1318
1307
        objs[i] = PyTuple_GET_ITEM(args, i);
1319
1308
      }
1567
1556
}
1568
1557
 
1569
1558
SWIGRUNTIME int
1570
 
SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1571
 
{
1572
 
  char *str;
1573
 
#ifdef METH_NOARGS
1574
 
  PyObject *repr = SwigPyObject_repr(v);
1575
 
#else
1576
 
  PyObject *repr = SwigPyObject_repr(v, NULL);
1577
 
#endif
1578
 
  if (repr) {
1579
 
    str = SWIG_Python_str_AsChar(repr); 
1580
 
    fputs(str, fp);
1581
 
    SWIG_Python_str_DelForPy3(str);
1582
 
    Py_DECREF(repr);
1583
 
    return 0; 
1584
 
  } else {
1585
 
    return 1; 
1586
 
  }
1587
 
}
1588
 
 
1589
 
SWIGRUNTIME PyObject *
1590
 
SwigPyObject_str(SwigPyObject *v)
1591
 
{
1592
 
  char result[SWIG_BUFFER_SIZE];
1593
 
  return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
1594
 
    SWIG_Python_str_FromChar(result) : 0;
1595
 
}
1596
 
 
1597
 
SWIGRUNTIME int
1598
1559
SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1599
1560
{
1600
1561
  void *i = v->ptr;
1786
1747
static PyMethodDef
1787
1748
swigobject_methods[] = {
1788
1749
  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
1789
 
  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
 
1750
  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"acquires ownership of the pointer"},
1790
1751
  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1791
1752
  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_O,       (char *)"appends another 'this' object"},
1792
1753
  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
1879
1840
      sizeof(SwigPyObject),                 /* tp_basicsize */
1880
1841
      0,                                    /* tp_itemsize */
1881
1842
      (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
1882
 
      (printfunc)SwigPyObject_print,        /* tp_print */
 
1843
      0,                                    /* tp_print */
1883
1844
#if PY_VERSION_HEX < 0x02020000
1884
1845
      (getattrfunc)SwigPyObject_getattr,    /* tp_getattr */
1885
1846
#else
1897
1858
      0,                                    /* tp_as_mapping */
1898
1859
      (hashfunc)0,                          /* tp_hash */
1899
1860
      (ternaryfunc)0,                       /* tp_call */
1900
 
      (reprfunc)SwigPyObject_str,           /* tp_str */
 
1861
      0,                                    /* tp_str */
1901
1862
      PyObject_GenericGetAttr,              /* tp_getattro */
1902
1863
      0,                                    /* tp_setattro */
1903
1864
      0,                                    /* tp_as_buffer */
2274
2235
SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2275
2236
  int res;
2276
2237
  SwigPyObject *sobj;
 
2238
  int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2277
2239
 
2278
2240
  if (!obj)
2279
2241
    return SWIG_ERROR;
2280
 
  if (obj == Py_None) {
 
2242
  if (obj == Py_None && !implicit_conv) {
2281
2243
    if (ptr)
2282
2244
      *ptr = 0;
2283
2245
    return SWIG_OK;
2326
2288
    }
2327
2289
    res = SWIG_OK;
2328
2290
  } else {
2329
 
    if (flags & SWIG_POINTER_IMPLICIT_CONV) {
 
2291
    if (implicit_conv) {
2330
2292
      SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2331
2293
      if (data && !data->implicitconv) {
2332
2294
        PyObject *klass = data->klass;
2361
2323
        }
2362
2324
      }
2363
2325
    }
 
2326
    if (!SWIG_IsOK(res) && obj == Py_None) {
 
2327
      if (ptr)
 
2328
        *ptr = 0;
 
2329
      if (PyErr_Occurred())
 
2330
        PyErr_Clear();
 
2331
      res = SWIG_OK;
 
2332
    }
2364
2333
  }
2365
2334
  return res;
2366
2335
}
2448
2417
    }
2449
2418
  } else {
2450
2419
#if PY_VERSION_HEX >= 0x03000000
2451
 
    inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
 
2420
    inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
2452
2421
    if (inst) {
2453
2422
      PyObject_SetAttr(inst, SWIG_This(), swig_this);
2454
2423
      Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2860
2829
  PyObject *descr;
2861
2830
  PyObject *encoded_name;
2862
2831
  descrsetfunc f;
2863
 
  int res;
 
2832
  int res = -1;
2864
2833
 
2865
2834
# ifdef Py_USING_UNICODE
2866
2835
  if (PyString_Check(name)) {
2883
2852
      goto done;
2884
2853
  }
2885
2854
 
2886
 
  res = -1;
2887
2855
  descr = _PyType_Lookup(tp, name);
2888
2856
  f = NULL;
2889
2857
  if (descr != NULL)