You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

6427 lines
206 KiB

  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.4
  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. #define SWIGPYTHON
  11. #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
  12. /* -----------------------------------------------------------------------------
  13. * This section contains generic SWIG labels for method/variable
  14. * declarations/attributes, and other compiler dependent labels.
  15. * ----------------------------------------------------------------------------- */
  16. /* template workaround for compilers that cannot correctly implement the C++ standard */
  17. #ifndef SWIGTEMPLATEDISAMBIGUATOR
  18. # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
  19. # define SWIGTEMPLATEDISAMBIGUATOR template
  20. # elif defined(__HP_aCC)
  21. /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
  22. /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
  23. # define SWIGTEMPLATEDISAMBIGUATOR template
  24. # else
  25. # define SWIGTEMPLATEDISAMBIGUATOR
  26. # endif
  27. #endif
  28. /* inline attribute */
  29. #ifndef SWIGINLINE
  30. # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
  31. # define SWIGINLINE inline
  32. # else
  33. # define SWIGINLINE
  34. # endif
  35. #endif
  36. /* attribute recognised by some compilers to avoid 'unused' warnings */
  37. #ifndef SWIGUNUSED
  38. # if defined(__GNUC__)
  39. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  40. # define SWIGUNUSED __attribute__ ((__unused__))
  41. # else
  42. # define SWIGUNUSED
  43. # endif
  44. # elif defined(__ICC)
  45. # define SWIGUNUSED __attribute__ ((__unused__))
  46. # else
  47. # define SWIGUNUSED
  48. # endif
  49. #endif
  50. #ifndef SWIG_MSC_UNSUPPRESS_4505
  51. # if defined(_MSC_VER)
  52. # pragma warning(disable : 4505) /* unreferenced local function has been removed */
  53. # endif
  54. #endif
  55. #ifndef SWIGUNUSEDPARM
  56. # ifdef __cplusplus
  57. # define SWIGUNUSEDPARM(p)
  58. # else
  59. # define SWIGUNUSEDPARM(p) p SWIGUNUSED
  60. # endif
  61. #endif
  62. /* internal SWIG method */
  63. #ifndef SWIGINTERN
  64. # define SWIGINTERN static SWIGUNUSED
  65. #endif
  66. /* internal inline SWIG method */
  67. #ifndef SWIGINTERNINLINE
  68. # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
  69. #endif
  70. /* exporting methods */
  71. #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  72. # ifndef GCC_HASCLASSVISIBILITY
  73. # define GCC_HASCLASSVISIBILITY
  74. # endif
  75. #endif
  76. #ifndef SWIGEXPORT
  77. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  78. # if defined(STATIC_LINKED)
  79. # define SWIGEXPORT
  80. # else
  81. # define SWIGEXPORT __declspec(dllexport)
  82. # endif
  83. # else
  84. # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
  85. # define SWIGEXPORT __attribute__ ((visibility("default")))
  86. # else
  87. # define SWIGEXPORT
  88. # endif
  89. # endif
  90. #endif
  91. /* calling conventions for Windows */
  92. #ifndef SWIGSTDCALL
  93. # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  94. # define SWIGSTDCALL __stdcall
  95. # else
  96. # define SWIGSTDCALL
  97. # endif
  98. #endif
  99. /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
  100. #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
  101. # define _CRT_SECURE_NO_DEPRECATE
  102. #endif
  103. /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
  104. #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
  105. # define _SCL_SECURE_NO_DEPRECATE
  106. #endif
  107. /* Python.h has to appear first */
  108. #include <Python.h>
  109. /* -----------------------------------------------------------------------------
  110. * swigrun.swg
  111. *
  112. * This file contains generic C API SWIG runtime support for pointer
  113. * type checking.
  114. * ----------------------------------------------------------------------------- */
  115. /* This should only be incremented when either the layout of swig_type_info changes,
  116. or for whatever reason, the runtime changes incompatibly */
  117. #define SWIG_RUNTIME_VERSION "4"
  118. /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
  119. #ifdef SWIG_TYPE_TABLE
  120. # define SWIG_QUOTE_STRING(x) #x
  121. # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
  122. # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
  123. #else
  124. # define SWIG_TYPE_TABLE_NAME
  125. #endif
  126. /*
  127. You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
  128. creating a static or dynamic library from the SWIG runtime code.
  129. In 99.9% of the cases, SWIG just needs to declare them as 'static'.
  130. But only do this if strictly necessary, ie, if you have problems
  131. with your compiler or suchlike.
  132. */
  133. #ifndef SWIGRUNTIME
  134. # define SWIGRUNTIME SWIGINTERN
  135. #endif
  136. #ifndef SWIGRUNTIMEINLINE
  137. # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
  138. #endif
  139. /* Generic buffer size */
  140. #ifndef SWIG_BUFFER_SIZE
  141. # define SWIG_BUFFER_SIZE 1024
  142. #endif
  143. /* Flags for pointer conversions */
  144. #define SWIG_POINTER_DISOWN 0x1
  145. #define SWIG_CAST_NEW_MEMORY 0x2
  146. /* Flags for new pointer objects */
  147. #define SWIG_POINTER_OWN 0x1
  148. /*
  149. Flags/methods for returning states.
  150. The SWIG conversion methods, as ConvertPtr, return an integer
  151. that tells if the conversion was successful or not. And if not,
  152. an error code can be returned (see swigerrors.swg for the codes).
  153. Use the following macros/flags to set or process the returning
  154. states.
  155. In old versions of SWIG, code such as the following was usually written:
  156. if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
  157. // success code
  158. } else {
  159. //fail code
  160. }
  161. Now you can be more explicit:
  162. int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
  163. if (SWIG_IsOK(res)) {
  164. // success code
  165. } else {
  166. // fail code
  167. }
  168. which is the same really, but now you can also do
  169. Type *ptr;
  170. int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
  171. if (SWIG_IsOK(res)) {
  172. // success code
  173. if (SWIG_IsNewObj(res) {
  174. ...
  175. delete *ptr;
  176. } else {
  177. ...
  178. }
  179. } else {
  180. // fail code
  181. }
  182. I.e., now SWIG_ConvertPtr can return new objects and you can
  183. identify the case and take care of the deallocation. Of course that
  184. also requires SWIG_ConvertPtr to return new result values, such as
  185. int SWIG_ConvertPtr(obj, ptr,...) {
  186. if (<obj is ok>) {
  187. if (<need new object>) {
  188. *ptr = <ptr to new allocated object>;
  189. return SWIG_NEWOBJ;
  190. } else {
  191. *ptr = <ptr to old object>;
  192. return SWIG_OLDOBJ;
  193. }
  194. } else {
  195. return SWIG_BADOBJ;
  196. }
  197. }
  198. Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
  199. more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
  200. SWIG errors code.
  201. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
  202. allows to return the 'cast rank', for example, if you have this
  203. int food(double)
  204. int fooi(int);
  205. and you call
  206. food(1) // cast rank '1' (1 -> 1.0)
  207. fooi(1) // cast rank '0'
  208. just use the SWIG_AddCast()/SWIG_CheckState()
  209. */
  210. #define SWIG_OK (0)
  211. #define SWIG_ERROR (-1)
  212. #define SWIG_IsOK(r) (r >= 0)
  213. #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
  214. /* The CastRankLimit says how many bits are used for the cast rank */
  215. #define SWIG_CASTRANKLIMIT (1 << 8)
  216. /* The NewMask denotes the object was created (using new/malloc) */
  217. #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
  218. /* The TmpMask is for in/out typemaps that use temporal objects */
  219. #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
  220. /* Simple returning values */
  221. #define SWIG_BADOBJ (SWIG_ERROR)
  222. #define SWIG_OLDOBJ (SWIG_OK)
  223. #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
  224. #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
  225. /* Check, add and del mask methods */
  226. #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
  227. #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
  228. #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
  229. #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
  230. #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
  231. #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
  232. /* Cast-Rank Mode */
  233. #if defined(SWIG_CASTRANK_MODE)
  234. # ifndef SWIG_TypeRank
  235. # define SWIG_TypeRank unsigned long
  236. # endif
  237. # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
  238. # define SWIG_MAXCASTRANK (2)
  239. # endif
  240. # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
  241. # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
  242. SWIGINTERNINLINE int SWIG_AddCast(int r) {
  243. return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
  244. }
  245. SWIGINTERNINLINE int SWIG_CheckState(int r) {
  246. return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
  247. }
  248. #else /* no cast-rank mode */
  249. # define SWIG_AddCast
  250. # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
  251. #endif
  252. #include <string.h>
  253. #ifdef __cplusplus
  254. extern "C" {
  255. #endif
  256. typedef void *(*swig_converter_func)(void *, int *);
  257. typedef struct swig_type_info *(*swig_dycast_func)(void **);
  258. /* Structure to store information on one type */
  259. typedef struct swig_type_info {
  260. const char *name; /* mangled name of this type */
  261. const char *str; /* human readable name of this type */
  262. swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
  263. struct swig_cast_info *cast; /* linked list of types that can cast into this type */
  264. void *clientdata; /* language specific type data */
  265. int owndata; /* flag if the structure owns the clientdata */
  266. } swig_type_info;
  267. /* Structure to store a type and conversion function used for casting */
  268. typedef struct swig_cast_info {
  269. swig_type_info *type; /* pointer to type that is equivalent to this type */
  270. swig_converter_func converter; /* function to cast the void pointers */
  271. struct swig_cast_info *next; /* pointer to next cast in linked list */
  272. struct swig_cast_info *prev; /* pointer to the previous cast */
  273. } swig_cast_info;
  274. /* Structure used to store module information
  275. * Each module generates one structure like this, and the runtime collects
  276. * all of these structures and stores them in a circularly linked list.*/
  277. typedef struct swig_module_info {
  278. swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
  279. size_t size; /* Number of types in this module */
  280. struct swig_module_info *next; /* Pointer to next element in circularly linked list */
  281. swig_type_info **type_initial; /* Array of initially generated type structures */
  282. swig_cast_info **cast_initial; /* Array of initially generated casting structures */
  283. void *clientdata; /* Language specific module data */
  284. } swig_module_info;
  285. /*
  286. Compare two type names skipping the space characters, therefore
  287. "char*" == "char *" and "Class<int>" == "Class<int >", etc.
  288. Return 0 when the two name types are equivalent, as in
  289. strncmp, but skipping ' '.
  290. */
  291. SWIGRUNTIME int
  292. SWIG_TypeNameComp(const char *f1, const char *l1,
  293. const char *f2, const char *l2) {
  294. for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
  295. while ((*f1 == ' ') && (f1 != l1)) ++f1;
  296. while ((*f2 == ' ') && (f2 != l2)) ++f2;
  297. if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
  298. }
  299. return (int)((l1 - f1) - (l2 - f2));
  300. }
  301. /*
  302. Check type equivalence in a name list like <name1>|<name2>|...
  303. Return 0 if not equal, 1 if equal
  304. */
  305. SWIGRUNTIME int
  306. SWIG_TypeEquiv(const char *nb, const char *tb) {
  307. int equiv = 0;
  308. const char* te = tb + strlen(tb);
  309. const char* ne = nb;
  310. while (!equiv && *ne) {
  311. for (nb = ne; *ne; ++ne) {
  312. if (*ne == '|') break;
  313. }
  314. equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
  315. if (*ne) ++ne;
  316. }
  317. return equiv;
  318. }
  319. /*
  320. Check type equivalence in a name list like <name1>|<name2>|...
  321. Return 0 if equal, -1 if nb < tb, 1 if nb > tb
  322. */
  323. SWIGRUNTIME int
  324. SWIG_TypeCompare(const char *nb, const char *tb) {
  325. int equiv = 0;
  326. const char* te = tb + strlen(tb);
  327. const char* ne = nb;
  328. while (!equiv && *ne) {
  329. for (nb = ne; *ne; ++ne) {
  330. if (*ne == '|') break;
  331. }
  332. equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
  333. if (*ne) ++ne;
  334. }
  335. return equiv;
  336. }
  337. /*
  338. Check the typename
  339. */
  340. SWIGRUNTIME swig_cast_info *
  341. SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  342. if (ty) {
  343. swig_cast_info *iter = ty->cast;
  344. while (iter) {
  345. if (strcmp(iter->type->name, c) == 0) {
  346. if (iter == ty->cast)
  347. return iter;
  348. /* Move iter to the top of the linked list */
  349. iter->prev->next = iter->next;
  350. if (iter->next)
  351. iter->next->prev = iter->prev;
  352. iter->next = ty->cast;
  353. iter->prev = 0;
  354. if (ty->cast) ty->cast->prev = iter;
  355. ty->cast = iter;
  356. return iter;
  357. }
  358. iter = iter->next;
  359. }
  360. }
  361. return 0;
  362. }
  363. /*
  364. Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
  365. */
  366. SWIGRUNTIME swig_cast_info *
  367. SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
  368. if (ty) {
  369. swig_cast_info *iter = ty->cast;
  370. while (iter) {
  371. if (iter->type == from) {
  372. if (iter == ty->cast)
  373. return iter;
  374. /* Move iter to the top of the linked list */
  375. iter->prev->next = iter->next;
  376. if (iter->next)
  377. iter->next->prev = iter->prev;
  378. iter->next = ty->cast;
  379. iter->prev = 0;
  380. if (ty->cast) ty->cast->prev = iter;
  381. ty->cast = iter;
  382. return iter;
  383. }
  384. iter = iter->next;
  385. }
  386. }
  387. return 0;
  388. }
  389. /*
  390. Cast a pointer up an inheritance hierarchy
  391. */
  392. SWIGRUNTIMEINLINE void *
  393. SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
  394. return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
  395. }
  396. /*
  397. Dynamic pointer casting. Down an inheritance hierarchy
  398. */
  399. SWIGRUNTIME swig_type_info *
  400. SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
  401. swig_type_info *lastty = ty;
  402. if (!ty || !ty->dcast) return ty;
  403. while (ty && (ty->dcast)) {
  404. ty = (*ty->dcast)(ptr);
  405. if (ty) lastty = ty;
  406. }
  407. return lastty;
  408. }
  409. /*
  410. Return the name associated with this type
  411. */
  412. SWIGRUNTIMEINLINE const char *
  413. SWIG_TypeName(const swig_type_info *ty) {
  414. return ty->name;
  415. }
  416. /*
  417. Return the pretty name associated with this type,
  418. that is an unmangled type name in a form presentable to the user.
  419. */
  420. SWIGRUNTIME const char *
  421. SWIG_TypePrettyName(const swig_type_info *type) {
  422. /* The "str" field contains the equivalent pretty names of the
  423. type, separated by vertical-bar characters. We choose
  424. to print the last name, as it is often (?) the most
  425. specific. */
  426. if (!type) return NULL;
  427. if (type->str != NULL) {
  428. const char *last_name = type->str;
  429. const char *s;
  430. for (s = type->str; *s; s++)
  431. if (*s == '|') last_name = s+1;
  432. return last_name;
  433. }
  434. else
  435. return type->name;
  436. }
  437. /*
  438. Set the clientdata field for a type
  439. */
  440. SWIGRUNTIME void
  441. SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  442. swig_cast_info *cast = ti->cast;
  443. /* if (ti->clientdata == clientdata) return; */
  444. ti->clientdata = clientdata;
  445. while (cast) {
  446. if (!cast->converter) {
  447. swig_type_info *tc = cast->type;
  448. if (!tc->clientdata) {
  449. SWIG_TypeClientData(tc, clientdata);
  450. }
  451. }
  452. cast = cast->next;
  453. }
  454. }
  455. SWIGRUNTIME void
  456. SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  457. SWIG_TypeClientData(ti, clientdata);
  458. ti->owndata = 1;
  459. }
  460. /*
  461. Search for a swig_type_info structure only by mangled name
  462. Search is a O(log #types)
  463. We start searching at module start, and finish searching when start == end.
  464. Note: if start == end at the beginning of the function, we go all the way around
  465. the circular list.
  466. */
  467. SWIGRUNTIME swig_type_info *
  468. SWIG_MangledTypeQueryModule(swig_module_info *start,
  469. swig_module_info *end,
  470. const char *name) {
  471. swig_module_info *iter = start;
  472. do {
  473. if (iter->size) {
  474. register size_t l = 0;
  475. register size_t r = iter->size - 1;
  476. do {
  477. /* since l+r >= 0, we can (>> 1) instead (/ 2) */
  478. register size_t i = (l + r) >> 1;
  479. const char *iname = iter->types[i]->name;
  480. if (iname) {
  481. register int compare = strcmp(name, iname);
  482. if (compare == 0) {
  483. return iter->types[i];
  484. } else if (compare < 0) {
  485. if (i) {
  486. r = i - 1;
  487. } else {
  488. break;
  489. }
  490. } else if (compare > 0) {
  491. l = i + 1;
  492. }
  493. } else {
  494. break; /* should never happen */
  495. }
  496. } while (l <= r);
  497. }
  498. iter = iter->next;
  499. } while (iter != end);
  500. return 0;
  501. }
  502. /*
  503. Search for a swig_type_info structure for either a mangled name or a human readable name.
  504. It first searches the mangled names of the types, which is a O(log #types)
  505. If a type is not found it then searches the human readable names, which is O(#types).
  506. We start searching at module start, and finish searching when start == end.
  507. Note: if start == end at the beginning of the function, we go all the way around
  508. the circular list.
  509. */
  510. SWIGRUNTIME swig_type_info *
  511. SWIG_TypeQueryModule(swig_module_info *start,
  512. swig_module_info *end,
  513. const char *name) {
  514. /* STEP 1: Search the name field using binary search */
  515. swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
  516. if (ret) {
  517. return ret;
  518. } else {
  519. /* STEP 2: If the type hasn't been found, do a complete search
  520. of the str field (the human readable name) */
  521. swig_module_info *iter = start;
  522. do {
  523. register size_t i = 0;
  524. for (; i < iter->size; ++i) {
  525. if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
  526. return iter->types[i];
  527. }
  528. iter = iter->next;
  529. } while (iter != end);
  530. }
  531. /* neither found a match */
  532. return 0;
  533. }
  534. /*
  535. Pack binary data into a string
  536. */
  537. SWIGRUNTIME char *
  538. SWIG_PackData(char *c, void *ptr, size_t sz) {
  539. static const char hex[17] = "0123456789abcdef";
  540. register const unsigned char *u = (unsigned char *) ptr;
  541. register const unsigned char *eu = u + sz;
  542. for (; u != eu; ++u) {
  543. register unsigned char uu = *u;
  544. *(c++) = hex[(uu & 0xf0) >> 4];
  545. *(c++) = hex[uu & 0xf];
  546. }
  547. return c;
  548. }
  549. /*
  550. Unpack binary data from a string
  551. */
  552. SWIGRUNTIME const char *
  553. SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
  554. register unsigned char *u = (unsigned char *) ptr;
  555. register const unsigned char *eu = u + sz;
  556. for (; u != eu; ++u) {
  557. register char d = *(c++);
  558. register unsigned char uu;
  559. if ((d >= '0') && (d <= '9'))
  560. uu = ((d - '0') << 4);
  561. else if ((d >= 'a') && (d <= 'f'))
  562. uu = ((d - ('a'-10)) << 4);
  563. else
  564. return (char *) 0;
  565. d = *(c++);
  566. if ((d >= '0') && (d <= '9'))
  567. uu |= (d - '0');
  568. else if ((d >= 'a') && (d <= 'f'))
  569. uu |= (d - ('a'-10));
  570. else
  571. return (char *) 0;
  572. *u = uu;
  573. }
  574. return c;
  575. }
  576. /*
  577. Pack 'void *' into a string buffer.
  578. */
  579. SWIGRUNTIME char *
  580. SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
  581. char *r = buff;
  582. if ((2*sizeof(void *) + 2) > bsz) return 0;
  583. *(r++) = '_';
  584. r = SWIG_PackData(r,&ptr,sizeof(void *));
  585. if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
  586. strcpy(r,name);
  587. return buff;
  588. }
  589. SWIGRUNTIME const char *
  590. SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
  591. if (*c != '_') {
  592. if (strcmp(c,"NULL") == 0) {
  593. *ptr = (void *) 0;
  594. return name;
  595. } else {
  596. return 0;
  597. }
  598. }
  599. return SWIG_UnpackData(++c,ptr,sizeof(void *));
  600. }
  601. SWIGRUNTIME char *
  602. SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
  603. char *r = buff;
  604. size_t lname = (name ? strlen(name) : 0);
  605. if ((2*sz + 2 + lname) > bsz) return 0;
  606. *(r++) = '_';
  607. r = SWIG_PackData(r,ptr,sz);
  608. if (lname) {
  609. strncpy(r,name,lname+1);
  610. } else {
  611. *r = 0;
  612. }
  613. return buff;
  614. }
  615. SWIGRUNTIME const char *
  616. SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  617. if (*c != '_') {
  618. if (strcmp(c,"NULL") == 0) {
  619. memset(ptr,0,sz);
  620. return name;
  621. } else {
  622. return 0;
  623. }
  624. }
  625. return SWIG_UnpackData(++c,ptr,sz);
  626. }
  627. #ifdef __cplusplus
  628. }
  629. #endif
  630. /* Errors in SWIG */
  631. #define SWIG_UnknownError -1
  632. #define SWIG_IOError -2
  633. #define SWIG_RuntimeError -3
  634. #define SWIG_IndexError -4
  635. #define SWIG_TypeError -5
  636. #define SWIG_DivisionByZero -6
  637. #define SWIG_OverflowError -7
  638. #define SWIG_SyntaxError -8
  639. #define SWIG_ValueError -9
  640. #define SWIG_SystemError -10
  641. #define SWIG_AttributeError -11
  642. #define SWIG_MemoryError -12
  643. #define SWIG_NullReferenceError -13
  644. /* Compatibility macros for Python 3 */
  645. #if PY_VERSION_HEX >= 0x03000000
  646. #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
  647. #define PyInt_Check(x) PyLong_Check(x)
  648. #define PyInt_AsLong(x) PyLong_AsLong(x)
  649. #define PyInt_FromLong(x) PyLong_FromLong(x)
  650. #define PyString_Check(name) PyBytes_Check(name)
  651. #define PyString_FromString(x) PyUnicode_FromString(x)
  652. #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
  653. #define PyString_AsString(str) PyBytes_AsString(str)
  654. #define PyString_Size(str) PyBytes_Size(str)
  655. #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
  656. #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
  657. #define PyString_AS_STRING(x) PyUnicode_AS_UNICODE(x)
  658. #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
  659. #endif
  660. #ifndef Py_TYPE
  661. # define Py_TYPE(op) ((op)->ob_type)
  662. #endif
  663. /* SWIG APIs for compatibility of both Python 2 & 3 */
  664. #if PY_VERSION_HEX >= 0x03000000
  665. # define SWIG_Python_str_FromFormat PyUnicode_FromFormat
  666. #else
  667. # define SWIG_Python_str_FromFormat PyString_FromFormat
  668. #endif
  669. /* Warning: This function will allocate a new string in Python 3,
  670. * so please call SWIG_Python_str_DelForPy3(x) to free the space.
  671. */
  672. SWIGINTERN char*
  673. SWIG_Python_str_AsChar(PyObject *str)
  674. {
  675. #if PY_VERSION_HEX >= 0x03000000
  676. char *cstr;
  677. char *newstr;
  678. Py_ssize_t len;
  679. str = PyUnicode_AsUTF8String(str);
  680. PyBytes_AsStringAndSize(str, &cstr, &len);
  681. newstr = (char *) malloc(len+1);
  682. memcpy(newstr, cstr, len+1);
  683. Py_XDECREF(str);
  684. return newstr;
  685. #else
  686. return PyString_AsString(str);
  687. #endif
  688. }
  689. #if PY_VERSION_HEX >= 0x03000000
  690. # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
  691. #else
  692. # define SWIG_Python_str_DelForPy3(x)
  693. #endif
  694. SWIGINTERN PyObject*
  695. SWIG_Python_str_FromChar(const char *c)
  696. {
  697. #if PY_VERSION_HEX >= 0x03000000
  698. return PyUnicode_FromString(c);
  699. #else
  700. return PyString_FromString(c);
  701. #endif
  702. }
  703. /* Add PyOS_snprintf for old Pythons */
  704. #if PY_VERSION_HEX < 0x02020000
  705. # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
  706. # define PyOS_snprintf _snprintf
  707. # else
  708. # define PyOS_snprintf snprintf
  709. # endif
  710. #endif
  711. /* A crude PyString_FromFormat implementation for old Pythons */
  712. #if PY_VERSION_HEX < 0x02020000
  713. #ifndef SWIG_PYBUFFER_SIZE
  714. # define SWIG_PYBUFFER_SIZE 1024
  715. #endif
  716. static PyObject *
  717. PyString_FromFormat(const char *fmt, ...) {
  718. va_list ap;
  719. char buf[SWIG_PYBUFFER_SIZE * 2];
  720. int res;
  721. va_start(ap, fmt);
  722. res = vsnprintf(buf, sizeof(buf), fmt, ap);
  723. va_end(ap);
  724. return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
  725. }
  726. #endif
  727. /* Add PyObject_Del for old Pythons */
  728. #if PY_VERSION_HEX < 0x01060000
  729. # define PyObject_Del(op) PyMem_DEL((op))
  730. #endif
  731. #ifndef PyObject_DEL
  732. # define PyObject_DEL PyObject_Del
  733. #endif
  734. /* A crude PyExc_StopIteration exception for old Pythons */
  735. #if PY_VERSION_HEX < 0x02020000
  736. # ifndef PyExc_StopIteration
  737. # define PyExc_StopIteration PyExc_RuntimeError
  738. # endif
  739. # ifndef PyObject_GenericGetAttr
  740. # define PyObject_GenericGetAttr 0
  741. # endif
  742. #endif
  743. /* Py_NotImplemented is defined in 2.1 and up. */
  744. #if PY_VERSION_HEX < 0x02010000
  745. # ifndef Py_NotImplemented
  746. # define Py_NotImplemented PyExc_RuntimeError
  747. # endif
  748. #endif
  749. /* A crude PyString_AsStringAndSize implementation for old Pythons */
  750. #if PY_VERSION_HEX < 0x02010000
  751. # ifndef PyString_AsStringAndSize
  752. # define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
  753. # endif
  754. #endif
  755. /* PySequence_Size for old Pythons */
  756. #if PY_VERSION_HEX < 0x02000000
  757. # ifndef PySequence_Size
  758. # define PySequence_Size PySequence_Length
  759. # endif
  760. #endif
  761. /* PyBool_FromLong for old Pythons */
  762. #if PY_VERSION_HEX < 0x02030000
  763. static
  764. PyObject *PyBool_FromLong(long ok)
  765. {
  766. PyObject *result = ok ? Py_True : Py_False;
  767. Py_INCREF(result);
  768. return result;
  769. }
  770. #endif
  771. /* Py_ssize_t for old Pythons */
  772. /* This code is as recommended by: */
  773. /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
  774. #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
  775. typedef int Py_ssize_t;
  776. # define PY_SSIZE_T_MAX INT_MAX
  777. # define PY_SSIZE_T_MIN INT_MIN
  778. typedef inquiry lenfunc;
  779. typedef intargfunc ssizeargfunc;
  780. typedef intintargfunc ssizessizeargfunc;
  781. typedef intobjargproc ssizeobjargproc;
  782. typedef intintobjargproc ssizessizeobjargproc;
  783. typedef getreadbufferproc readbufferproc;
  784. typedef getwritebufferproc writebufferproc;
  785. typedef getsegcountproc segcountproc;
  786. typedef getcharbufferproc charbufferproc;
  787. static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
  788. {
  789. long result = 0;
  790. PyObject *i = PyNumber_Int(x);
  791. if (i) {
  792. result = PyInt_AsLong(i);
  793. Py_DECREF(i);
  794. }
  795. return result;
  796. }
  797. #endif
  798. #if PY_VERSION_HEX < 0x02040000
  799. #define Py_VISIT(op) \
  800. do { \
  801. if (op) { \
  802. int vret = visit((op), arg); \
  803. if (vret) \
  804. return vret; \
  805. } \
  806. } while (0)
  807. #endif
  808. #if PY_VERSION_HEX < 0x02030000
  809. typedef struct {
  810. PyTypeObject type;
  811. PyNumberMethods as_number;
  812. PyMappingMethods as_mapping;
  813. PySequenceMethods as_sequence;
  814. PyBufferProcs as_buffer;
  815. PyObject *name, *slots;
  816. } PyHeapTypeObject;
  817. #endif
  818. #if PY_VERSION_HEX < 0x02030000
  819. typedef destructor freefunc;
  820. #endif
  821. #if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
  822. (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
  823. (PY_MAJOR_VERSION > 3))
  824. # define SWIGPY_USE_CAPSULE
  825. # define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
  826. #endif
  827. #if PY_VERSION_HEX < 0x03020000
  828. #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
  829. #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
  830. #endif
  831. /* -----------------------------------------------------------------------------
  832. * error manipulation
  833. * ----------------------------------------------------------------------------- */
  834. SWIGRUNTIME PyObject*
  835. SWIG_Python_ErrorType(int code) {
  836. PyObject* type = 0;
  837. switch(code) {
  838. case SWIG_MemoryError:
  839. type = PyExc_MemoryError;
  840. break;
  841. case SWIG_IOError:
  842. type = PyExc_IOError;
  843. break;
  844. case SWIG_RuntimeError:
  845. type = PyExc_RuntimeError;
  846. break;
  847. case SWIG_IndexError:
  848. type = PyExc_IndexError;
  849. break;
  850. case SWIG_TypeError:
  851. type = PyExc_TypeError;
  852. break;
  853. case SWIG_DivisionByZero:
  854. type = PyExc_ZeroDivisionError;
  855. break;
  856. case SWIG_OverflowError:
  857. type = PyExc_OverflowError;
  858. break;
  859. case SWIG_SyntaxError:
  860. type = PyExc_SyntaxError;
  861. break;
  862. case SWIG_ValueError:
  863. type = PyExc_ValueError;
  864. break;
  865. case SWIG_SystemError:
  866. type = PyExc_SystemError;
  867. break;
  868. case SWIG_AttributeError:
  869. type = PyExc_AttributeError;
  870. break;
  871. default:
  872. type = PyExc_RuntimeError;
  873. }
  874. return type;
  875. }
  876. SWIGRUNTIME void
  877. SWIG_Python_AddErrorMsg(const char* mesg)
  878. {
  879. PyObject *type = 0;
  880. PyObject *value = 0;
  881. PyObject *traceback = 0;
  882. if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
  883. if (value) {
  884. char *tmp;
  885. PyObject *old_str = PyObject_Str(value);
  886. PyErr_Clear();
  887. Py_XINCREF(type);
  888. PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
  889. SWIG_Python_str_DelForPy3(tmp);
  890. Py_DECREF(old_str);
  891. Py_DECREF(value);
  892. } else {
  893. PyErr_SetString(PyExc_RuntimeError, mesg);
  894. }
  895. }
  896. #if defined(SWIG_PYTHON_NO_THREADS)
  897. # if defined(SWIG_PYTHON_THREADS)
  898. # undef SWIG_PYTHON_THREADS
  899. # endif
  900. #endif
  901. #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
  902. # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
  903. # if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
  904. # define SWIG_PYTHON_USE_GIL
  905. # endif
  906. # endif
  907. # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
  908. # ifndef SWIG_PYTHON_INITIALIZE_THREADS
  909. # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
  910. # endif
  911. # ifdef __cplusplus /* C++ code */
  912. class SWIG_Python_Thread_Block {
  913. bool status;
  914. PyGILState_STATE state;
  915. public:
  916. void end() { if (status) { PyGILState_Release(state); status = false;} }
  917. SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
  918. ~SWIG_Python_Thread_Block() { end(); }
  919. };
  920. class SWIG_Python_Thread_Allow {
  921. bool status;
  922. PyThreadState *save;
  923. public:
  924. void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
  925. SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
  926. ~SWIG_Python_Thread_Allow() { end(); }
  927. };
  928. # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
  929. # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
  930. # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
  931. # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
  932. # else /* C code */
  933. # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
  934. # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
  935. # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
  936. # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
  937. # endif
  938. # else /* Old thread way, not implemented, user must provide it */
  939. # if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
  940. # define SWIG_PYTHON_INITIALIZE_THREADS
  941. # endif
  942. # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
  943. # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
  944. # endif
  945. # if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
  946. # define SWIG_PYTHON_THREAD_END_BLOCK
  947. # endif
  948. # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
  949. # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
  950. # endif
  951. # if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
  952. # define SWIG_PYTHON_THREAD_END_ALLOW
  953. # endif
  954. # endif
  955. #else /* No thread support */
  956. # define SWIG_PYTHON_INITIALIZE_THREADS
  957. # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
  958. # define SWIG_PYTHON_THREAD_END_BLOCK
  959. # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
  960. # define SWIG_PYTHON_THREAD_END_ALLOW
  961. #endif
  962. /* -----------------------------------------------------------------------------
  963. * Python API portion that goes into the runtime
  964. * ----------------------------------------------------------------------------- */
  965. #ifdef __cplusplus
  966. extern "C" {
  967. #endif
  968. /* -----------------------------------------------------------------------------
  969. * Constant declarations
  970. * ----------------------------------------------------------------------------- */
  971. /* Constant Types */
  972. #define SWIG_PY_POINTER 4
  973. #define SWIG_PY_BINARY 5
  974. /* Constant information structure */
  975. typedef struct swig_const_info {
  976. int type;
  977. char *name;
  978. long lvalue;
  979. double dvalue;
  980. void *pvalue;
  981. swig_type_info **ptype;
  982. } swig_const_info;
  983. /* -----------------------------------------------------------------------------
  984. * Wrapper of PyInstanceMethod_New() used in Python 3
  985. * It is exported to the generated module, used for -fastproxy
  986. * ----------------------------------------------------------------------------- */
  987. #if PY_VERSION_HEX >= 0x03000000
  988. SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
  989. {
  990. return PyInstanceMethod_New(func);
  991. }
  992. #else
  993. SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
  994. {
  995. return NULL;
  996. }
  997. #endif
  998. #ifdef __cplusplus
  999. }
  1000. #endif
  1001. /* -----------------------------------------------------------------------------
  1002. * pyrun.swg
  1003. *
  1004. * This file contains the runtime support for Python modules
  1005. * and includes code for managing global variables and pointer
  1006. * type checking.
  1007. *
  1008. * ----------------------------------------------------------------------------- */
  1009. /* Common SWIG API */
  1010. /* for raw pointers */
  1011. #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
  1012. #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
  1013. #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
  1014. #ifdef SWIGPYTHON_BUILTIN
  1015. #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
  1016. #else
  1017. #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
  1018. #endif
  1019. #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
  1020. #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
  1021. #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
  1022. #define swig_owntype int
  1023. /* for raw packed data */
  1024. #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
  1025. #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
  1026. /* for class or struct pointers */
  1027. #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
  1028. #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
  1029. /* for C or C++ function pointers */
  1030. #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
  1031. #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
  1032. /* for C++ member pointers, ie, member methods */
  1033. #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
  1034. #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
  1035. /* Runtime API */
  1036. #define SWIG_GetModule(clientdata) SWIG_Python_GetModule()
  1037. #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
  1038. #define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
  1039. #define SWIG_SetErrorObj SWIG_Python_SetErrorObj
  1040. #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
  1041. #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
  1042. #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
  1043. #define SWIG_fail goto fail
  1044. /* Runtime API implementation */
  1045. /* Error manipulation */
  1046. SWIGINTERN void
  1047. SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
  1048. SWIG_PYTHON_THREAD_BEGIN_BLOCK;
  1049. PyErr_SetObject(errtype, obj);
  1050. Py_DECREF(obj);
  1051. SWIG_PYTHON_THREAD_END_BLOCK;
  1052. }
  1053. SWIGINTERN void
  1054. SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
  1055. SWIG_PYTHON_THREAD_BEGIN_BLOCK;
  1056. PyErr_SetString(errtype, (char *) msg);
  1057. SWIG_PYTHON_THREAD_END_BLOCK;
  1058. }
  1059. #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
  1060. /* Set a constant value */
  1061. #if defined(SWIGPYTHON_BUILTIN)
  1062. SWIGINTERN void
  1063. SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
  1064. PyObject *s = PyString_InternFromString(key);
  1065. PyList_Append(seq, s);
  1066. Py_DECREF(s);
  1067. }
  1068. SWIGINTERN void
  1069. SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
  1070. PyDict_SetItemString(d, (char *)name, obj);
  1071. Py_DECREF(obj);
  1072. if (public_interface)
  1073. SwigPyBuiltin_AddPublicSymbol(public_interface, name);
  1074. }
  1075. #else
  1076. SWIGINTERN void
  1077. SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
  1078. PyDict_SetItemString(d, (char *)name, obj);
  1079. Py_DECREF(obj);
  1080. }
  1081. #endif
  1082. /* Append a value to the result obj */
  1083. SWIGINTERN PyObject*
  1084. SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
  1085. #if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
  1086. if (!result) {
  1087. result = obj;
  1088. } else if (result == Py_None) {
  1089. Py_DECREF(result);
  1090. result = obj;
  1091. } else {
  1092. if (!PyList_Check(result)) {
  1093. PyObject *o2 = result;
  1094. result = PyList_New(1);
  1095. PyList_SetItem(result, 0, o2);
  1096. }
  1097. PyList_Append(result,obj);
  1098. Py_DECREF(obj);
  1099. }
  1100. return result;
  1101. #else
  1102. PyObject* o2;
  1103. PyObject* o3;
  1104. if (!result) {
  1105. result = obj;
  1106. } else if (result == Py_None) {
  1107. Py_DECREF(result);
  1108. result = obj;
  1109. } else {
  1110. if (!PyTuple_Check(result)) {
  1111. o2 = result;
  1112. result = PyTuple_New(1);
  1113. PyTuple_SET_ITEM(result, 0, o2);
  1114. }
  1115. o3 = PyTuple_New(1);
  1116. PyTuple_SET_ITEM(o3, 0, obj);
  1117. o2 = result;
  1118. result = PySequence_Concat(o2, o3);
  1119. Py_DECREF(o2);
  1120. Py_DECREF(o3);
  1121. }
  1122. return result;
  1123. #endif
  1124. }
  1125. /* Unpack the argument tuple */
  1126. SWIGINTERN int
  1127. SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
  1128. {
  1129. if (!args) {
  1130. if (!min && !max) {
  1131. return 1;
  1132. } else {
  1133. PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
  1134. name, (min == max ? "" : "at least "), (int)min);
  1135. return 0;
  1136. }
  1137. }
  1138. if (!PyTuple_Check(args)) {
  1139. if (min <= 1 && max >= 1) {
  1140. register int i;
  1141. objs[0] = args;
  1142. for (i = 1; i < max; ++i) {
  1143. objs[i] = 0;
  1144. }
  1145. return 2;
  1146. }
  1147. PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
  1148. return 0;
  1149. } else {
  1150. register Py_ssize_t l = PyTuple_GET_SIZE(args);
  1151. if (l < min) {
  1152. PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
  1153. name, (min == max ? "" : "at least "), (int)min, (int)l);
  1154. return 0;
  1155. } else if (l > max) {
  1156. PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
  1157. name, (min == max ? "" : "at most "), (int)max, (int)l);
  1158. return 0;
  1159. } else {
  1160. register int i;
  1161. for (i = 0; i < l; ++i) {
  1162. objs[i] = PyTuple_GET_ITEM(args, i);
  1163. }
  1164. for (; l < max; ++l) {
  1165. objs[l] = 0;
  1166. }
  1167. return i + 1;
  1168. }
  1169. }
  1170. }
  1171. /* A functor is a function object with one single object argument */
  1172. #if PY_VERSION_HEX >= 0x02020000
  1173. #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
  1174. #else
  1175. #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj);
  1176. #endif
  1177. /*
  1178. Helper for static pointer initialization for both C and C++ code, for example
  1179. static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
  1180. */
  1181. #ifdef __cplusplus
  1182. #define SWIG_STATIC_POINTER(var) var
  1183. #else
  1184. #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
  1185. #endif
  1186. /* -----------------------------------------------------------------------------
  1187. * Pointer declarations
  1188. * ----------------------------------------------------------------------------- */
  1189. /* Flags for new pointer objects */
  1190. #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
  1191. #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
  1192. #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
  1193. #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
  1194. #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
  1195. #ifdef __cplusplus
  1196. extern "C" {
  1197. #endif
  1198. /* How to access Py_None */
  1199. #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  1200. # ifndef SWIG_PYTHON_NO_BUILD_NONE
  1201. # ifndef SWIG_PYTHON_BUILD_NONE
  1202. # define SWIG_PYTHON_BUILD_NONE
  1203. # endif
  1204. # endif
  1205. #endif
  1206. #ifdef SWIG_PYTHON_BUILD_NONE
  1207. # ifdef Py_None
  1208. # undef Py_None
  1209. # define Py_None SWIG_Py_None()
  1210. # endif
  1211. SWIGRUNTIMEINLINE PyObject *
  1212. _SWIG_Py_None(void)
  1213. {
  1214. PyObject *none = Py_BuildValue((char*)"");
  1215. Py_DECREF(none);
  1216. return none;
  1217. }
  1218. SWIGRUNTIME PyObject *
  1219. SWIG_Py_None(void)
  1220. {
  1221. static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
  1222. return none;
  1223. }
  1224. #endif
  1225. /* The python void return value */
  1226. SWIGRUNTIMEINLINE PyObject *
  1227. SWIG_Py_Void(void)
  1228. {
  1229. PyObject *none = Py_None;
  1230. Py_INCREF(none);
  1231. return none;
  1232. }
  1233. /* SwigPyClientData */
  1234. typedef struct {
  1235. PyObject *klass;
  1236. PyObject *newraw;
  1237. PyObject *newargs;
  1238. PyObject *destroy;
  1239. int delargs;
  1240. int implicitconv;
  1241. PyTypeObject *pytype;
  1242. } SwigPyClientData;
  1243. SWIGRUNTIMEINLINE int
  1244. SWIG_Python_CheckImplicit(swig_type_info *ty)
  1245. {
  1246. SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
  1247. return data ? data->implicitconv : 0;
  1248. }
  1249. SWIGRUNTIMEINLINE PyObject *
  1250. SWIG_Python_ExceptionType(swig_type_info *desc) {
  1251. SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
  1252. PyObject *klass = data ? data->klass : 0;
  1253. return (klass ? klass : PyExc_RuntimeError);
  1254. }
  1255. SWIGRUNTIME SwigPyClientData *
  1256. SwigPyClientData_New(PyObject* obj)
  1257. {
  1258. if (!obj) {
  1259. return 0;
  1260. } else {
  1261. SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
  1262. /* the klass element */
  1263. data->klass = obj;
  1264. Py_INCREF(data->klass);
  1265. /* the newraw method and newargs arguments used to create a new raw instance */
  1266. if (PyClass_Check(obj)) {
  1267. data->newraw = 0;
  1268. data->newargs = obj;
  1269. Py_INCREF(obj);
  1270. } else {
  1271. #if (PY_VERSION_HEX < 0x02020000)
  1272. data->newraw = 0;
  1273. #else
  1274. data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
  1275. #endif
  1276. if (data->newraw) {
  1277. Py_INCREF(data->newraw);
  1278. data->newargs = PyTuple_New(1);
  1279. PyTuple_SetItem(data->newargs, 0, obj);
  1280. } else {
  1281. data->newargs = obj;
  1282. }
  1283. Py_INCREF(data->newargs);
  1284. }
  1285. /* the destroy method, aka as the C++ delete method */
  1286. data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
  1287. if (PyErr_Occurred()) {
  1288. PyErr_Clear();
  1289. data->destroy = 0;
  1290. }
  1291. if (data->destroy) {
  1292. int flags;
  1293. Py_INCREF(data->destroy);
  1294. flags = PyCFunction_GET_FLAGS(data->destroy);
  1295. #ifdef METH_O
  1296. data->delargs = !(flags & (METH_O));
  1297. #else
  1298. data->delargs = 0;
  1299. #endif
  1300. } else {
  1301. data->delargs = 0;
  1302. }
  1303. data->implicitconv = 0;
  1304. data->pytype = 0;
  1305. return data;
  1306. }
  1307. }
  1308. SWIGRUNTIME void
  1309. SwigPyClientData_Del(SwigPyClientData *data) {
  1310. Py_XDECREF(data->newraw);
  1311. Py_XDECREF(data->newargs);
  1312. Py_XDECREF(data->destroy);
  1313. }
  1314. /* =============== SwigPyObject =====================*/
  1315. typedef struct {
  1316. PyObject_HEAD
  1317. void *ptr;
  1318. swig_type_info *ty;
  1319. int own;
  1320. PyObject *next;
  1321. #ifdef SWIGPYTHON_BUILTIN
  1322. PyObject *dict;
  1323. #endif
  1324. } SwigPyObject;
  1325. SWIGRUNTIME PyObject *
  1326. SwigPyObject_long(SwigPyObject *v)
  1327. {
  1328. return PyLong_FromVoidPtr(v->ptr);
  1329. }
  1330. SWIGRUNTIME PyObject *
  1331. SwigPyObject_format(const char* fmt, SwigPyObject *v)
  1332. {
  1333. PyObject *res = NULL;
  1334. PyObject *args = PyTuple_New(1);
  1335. if (args) {
  1336. if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
  1337. PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
  1338. if (ofmt) {
  1339. #if PY_VERSION_HEX >= 0x03000000
  1340. res = PyUnicode_Format(ofmt,args);
  1341. #else
  1342. res = PyString_Format(ofmt,args);
  1343. #endif
  1344. Py_DECREF(ofmt);
  1345. }
  1346. Py_DECREF(args);
  1347. }
  1348. }
  1349. return res;
  1350. }
  1351. SWIGRUNTIME PyObject *
  1352. SwigPyObject_oct(SwigPyObject *v)
  1353. {
  1354. return SwigPyObject_format("%o",v);
  1355. }
  1356. SWIGRUNTIME PyObject *
  1357. SwigPyObject_hex(SwigPyObject *v)
  1358. {
  1359. return SwigPyObject_format("%x",v);
  1360. }
  1361. SWIGRUNTIME PyObject *
  1362. #ifdef METH_NOARGS
  1363. SwigPyObject_repr(SwigPyObject *v)
  1364. #else
  1365. SwigPyObject_repr(SwigPyObject *v, PyObject *args)
  1366. #endif
  1367. {
  1368. const char *name = SWIG_TypePrettyName(v->ty);
  1369. PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, (void *)v);
  1370. if (v->next) {
  1371. # ifdef METH_NOARGS
  1372. PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
  1373. # else
  1374. PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
  1375. # endif
  1376. # if PY_VERSION_HEX >= 0x03000000
  1377. PyObject *joined = PyUnicode_Concat(repr, nrep);
  1378. Py_DecRef(repr);
  1379. Py_DecRef(nrep);
  1380. repr = joined;
  1381. # else
  1382. PyString_ConcatAndDel(&repr,nrep);
  1383. # endif
  1384. }
  1385. return repr;
  1386. }
  1387. SWIGRUNTIME int
  1388. SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
  1389. {
  1390. char *str;
  1391. #ifdef METH_NOARGS
  1392. PyObject *repr = SwigPyObject_repr(v);
  1393. #else
  1394. PyObject *repr = SwigPyObject_repr(v, NULL);
  1395. #endif
  1396. if (repr) {
  1397. str = SWIG_Python_str_AsChar(repr);
  1398. fputs(str, fp);
  1399. SWIG_Python_str_DelForPy3(str);
  1400. Py_DECREF(repr);
  1401. return 0;
  1402. } else {
  1403. return 1;
  1404. }
  1405. }
  1406. SWIGRUNTIME PyObject *
  1407. SwigPyObject_str(SwigPyObject *v)
  1408. {
  1409. char result[SWIG_BUFFER_SIZE];
  1410. return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
  1411. SWIG_Python_str_FromChar(result) : 0;
  1412. }
  1413. SWIGRUNTIME int
  1414. SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
  1415. {
  1416. void *i = v->ptr;
  1417. void *j = w->ptr;
  1418. return (i < j) ? -1 : ((i > j) ? 1 : 0);
  1419. }
  1420. /* Added for Python 3.x, would it also be useful for Python 2.x? */
  1421. SWIGRUNTIME PyObject*
  1422. SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
  1423. {
  1424. PyObject* res;
  1425. if( op != Py_EQ && op != Py_NE ) {
  1426. Py_INCREF(Py_NotImplemented);
  1427. return Py_NotImplemented;
  1428. }
  1429. res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
  1430. return res;
  1431. }
  1432. SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
  1433. #ifdef SWIGPYTHON_BUILTIN
  1434. static swig_type_info *SwigPyObject_stype = 0;
  1435. SWIGRUNTIME PyTypeObject*
  1436. SwigPyObject_type(void) {
  1437. SwigPyClientData *cd;
  1438. assert(SwigPyObject_stype);
  1439. cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
  1440. assert(cd);
  1441. assert(cd->pytype);
  1442. return cd->pytype;
  1443. }
  1444. #else
  1445. SWIGRUNTIME PyTypeObject*
  1446. SwigPyObject_type(void) {
  1447. static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
  1448. return type;
  1449. }
  1450. #endif
  1451. SWIGRUNTIMEINLINE int
  1452. SwigPyObject_Check(PyObject *op) {
  1453. #ifdef SWIGPYTHON_BUILTIN
  1454. PyTypeObject *target_tp = SwigPyObject_type();
  1455. if (PyType_IsSubtype(op->ob_type, target_tp))
  1456. return 1;
  1457. return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
  1458. #else
  1459. return (Py_TYPE(op) == SwigPyObject_type())
  1460. || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
  1461. #endif
  1462. }
  1463. SWIGRUNTIME PyObject *
  1464. SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
  1465. SWIGRUNTIME void
  1466. SwigPyObject_dealloc(PyObject *v)
  1467. {
  1468. SwigPyObject *sobj = (SwigPyObject *) v;
  1469. PyObject *next = sobj->next;
  1470. if (sobj->own == SWIG_POINTER_OWN) {
  1471. swig_type_info *ty = sobj->ty;
  1472. SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
  1473. PyObject *destroy = data ? data->destroy : 0;
  1474. if (destroy) {
  1475. /* destroy is always a VARARGS method */
  1476. PyObject *res;
  1477. if (data->delargs) {
  1478. /* we need to create a temporary object to carry the destroy operation */
  1479. PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
  1480. res = SWIG_Python_CallFunctor(destroy, tmp);
  1481. Py_DECREF(tmp);
  1482. } else {
  1483. PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
  1484. PyObject *mself = PyCFunction_GET_SELF(destroy);
  1485. res = ((*meth)(mself, v));
  1486. }
  1487. Py_XDECREF(res);
  1488. }
  1489. #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
  1490. else {
  1491. const char *name = SWIG_TypePrettyName(ty);
  1492. printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
  1493. }
  1494. #endif
  1495. }
  1496. Py_XDECREF(next);
  1497. PyObject_DEL(v);
  1498. }
  1499. SWIGRUNTIME PyObject*
  1500. SwigPyObject_append(PyObject* v, PyObject* next)
  1501. {
  1502. SwigPyObject *sobj = (SwigPyObject *) v;
  1503. #ifndef METH_O
  1504. PyObject *tmp = 0;
  1505. if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
  1506. next = tmp;
  1507. #endif
  1508. if (!SwigPyObject_Check(next)) {
  1509. return NULL;
  1510. }
  1511. sobj->next = next;
  1512. Py_INCREF(next);
  1513. return SWIG_Py_Void();
  1514. }
  1515. SWIGRUNTIME PyObject*
  1516. #ifdef METH_NOARGS
  1517. SwigPyObject_next(PyObject* v)
  1518. #else
  1519. SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
  1520. #endif
  1521. {
  1522. SwigPyObject *sobj = (SwigPyObject *) v;
  1523. if (sobj->next) {
  1524. Py_INCREF(sobj->next);
  1525. return sobj->next;
  1526. } else {
  1527. return SWIG_Py_Void();
  1528. }
  1529. }
  1530. SWIGINTERN PyObject*
  1531. #ifdef METH_NOARGS
  1532. SwigPyObject_disown(PyObject *v)
  1533. #else
  1534. SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
  1535. #endif
  1536. {
  1537. SwigPyObject *sobj = (SwigPyObject *)v;
  1538. sobj->own = 0;
  1539. return SWIG_Py_Void();
  1540. }
  1541. SWIGINTERN PyObject*
  1542. #ifdef METH_NOARGS
  1543. SwigPyObject_acquire(PyObject *v)
  1544. #else
  1545. SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
  1546. #endif
  1547. {
  1548. SwigPyObject *sobj = (SwigPyObject *)v;
  1549. sobj->own = SWIG_POINTER_OWN;
  1550. return SWIG_Py_Void();
  1551. }
  1552. SWIGINTERN PyObject*
  1553. SwigPyObject_own(PyObject *v, PyObject *args)
  1554. {
  1555. PyObject *val = 0;
  1556. #if (PY_VERSION_HEX < 0x02020000)
  1557. if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
  1558. #else
  1559. if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val))
  1560. #endif
  1561. {
  1562. return NULL;
  1563. }
  1564. else
  1565. {
  1566. SwigPyObject *sobj = (SwigPyObject *)v;
  1567. PyObject *obj = PyBool_FromLong(sobj->own);
  1568. if (val) {
  1569. #ifdef METH_NOARGS
  1570. if (PyObject_IsTrue(val)) {
  1571. SwigPyObject_acquire(v);
  1572. } else {
  1573. SwigPyObject_disown(v);
  1574. }
  1575. #else
  1576. if (PyObject_IsTrue(val)) {
  1577. SwigPyObject_acquire(v,args);
  1578. } else {
  1579. SwigPyObject_disown(v,args);
  1580. }
  1581. #endif
  1582. }
  1583. return obj;
  1584. }
  1585. }
  1586. #ifdef METH_O
  1587. static PyMethodDef
  1588. swigobject_methods[] = {
  1589. {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
  1590. {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"},
  1591. {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
  1592. {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"},
  1593. {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
  1594. {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"},
  1595. {0, 0, 0, 0}
  1596. };
  1597. #else
  1598. static PyMethodDef
  1599. swigobject_methods[] = {
  1600. {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
  1601. {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},
  1602. {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
  1603. {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
  1604. {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
  1605. {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"},
  1606. {0, 0, 0, 0}
  1607. };
  1608. #endif
  1609. #if PY_VERSION_HEX < 0x02020000
  1610. SWIGINTERN PyObject *
  1611. SwigPyObject_getattr(SwigPyObject *sobj,char *name)
  1612. {
  1613. return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
  1614. }
  1615. #endif
  1616. SWIGRUNTIME PyTypeObject*
  1617. SwigPyObject_TypeOnce(void) {
  1618. static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
  1619. static PyNumberMethods SwigPyObject_as_number = {
  1620. (binaryfunc)0, /*nb_add*/
  1621. (binaryfunc)0, /*nb_subtract*/
  1622. (binaryfunc)0, /*nb_multiply*/
  1623. /* nb_divide removed in Python 3 */
  1624. #if PY_VERSION_HEX < 0x03000000
  1625. (binaryfunc)0, /*nb_divide*/
  1626. #endif
  1627. (binaryfunc)0, /*nb_remainder*/
  1628. (binaryfunc)0, /*nb_divmod*/
  1629. (ternaryfunc)0,/*nb_power*/
  1630. (unaryfunc)0, /*nb_negative*/
  1631. (unaryfunc)0, /*nb_positive*/
  1632. (unaryfunc)0, /*nb_absolute*/
  1633. (inquiry)0, /*nb_nonzero*/
  1634. 0, /*nb_invert*/
  1635. 0, /*nb_lshift*/
  1636. 0, /*nb_rshift*/
  1637. 0, /*nb_and*/
  1638. 0, /*nb_xor*/
  1639. 0, /*nb_or*/
  1640. #if PY_VERSION_HEX < 0x03000000
  1641. 0, /*nb_coerce*/
  1642. #endif
  1643. (unaryfunc)SwigPyObject_long, /*nb_int*/
  1644. #if PY_VERSION_HEX < 0x03000000
  1645. (unaryfunc)SwigPyObject_long, /*nb_long*/
  1646. #else
  1647. 0, /*nb_reserved*/
  1648. #endif
  1649. (unaryfunc)0, /*nb_float*/
  1650. #if PY_VERSION_HEX < 0x03000000
  1651. (unaryfunc)SwigPyObject_oct, /*nb_oct*/
  1652. (unaryfunc)SwigPyObject_hex, /*nb_hex*/
  1653. #endif
  1654. #if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
  1655. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
  1656. #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
  1657. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
  1658. #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
  1659. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
  1660. #elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
  1661. 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
  1662. #endif
  1663. };
  1664. static PyTypeObject swigpyobject_type;
  1665. static int type_init = 0;
  1666. if (!type_init) {
  1667. const PyTypeObject tmp = {
  1668. /* PyObject header changed in Python 3 */
  1669. #if PY_VERSION_HEX >= 0x03000000
  1670. PyVarObject_HEAD_INIT(NULL, 0)
  1671. #else
  1672. PyObject_HEAD_INIT(NULL)
  1673. 0, /* ob_size */
  1674. #endif
  1675. (char *)"SwigPyObject", /* tp_name */
  1676. sizeof(SwigPyObject), /* tp_basicsize */
  1677. 0, /* tp_itemsize */
  1678. (destructor)SwigPyObject_dealloc, /* tp_dealloc */
  1679. (printfunc)SwigPyObject_print, /* tp_print */
  1680. #if PY_VERSION_HEX < 0x02020000
  1681. (getattrfunc)SwigPyObject_getattr, /* tp_getattr */
  1682. #else
  1683. (getattrfunc)0, /* tp_getattr */
  1684. #endif
  1685. (setattrfunc)0, /* tp_setattr */
  1686. #if PY_VERSION_HEX >= 0x03000000
  1687. 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
  1688. #else
  1689. (cmpfunc)SwigPyObject_compare, /* tp_compare */
  1690. #endif
  1691. (reprfunc)SwigPyObject_repr, /* tp_repr */
  1692. &SwigPyObject_as_number, /* tp_as_number */
  1693. 0, /* tp_as_sequence */
  1694. 0, /* tp_as_mapping */
  1695. (hashfunc)0, /* tp_hash */
  1696. (ternaryfunc)0, /* tp_call */
  1697. (reprfunc)SwigPyObject_str, /* tp_str */
  1698. PyObject_GenericGetAttr, /* tp_getattro */
  1699. 0, /* tp_setattro */
  1700. 0, /* tp_as_buffer */
  1701. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1702. swigobject_doc, /* tp_doc */
  1703. 0, /* tp_traverse */
  1704. 0, /* tp_clear */
  1705. (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
  1706. 0, /* tp_weaklistoffset */
  1707. #if PY_VERSION_HEX >= 0x02020000
  1708. 0, /* tp_iter */
  1709. 0, /* tp_iternext */
  1710. swigobject_methods, /* tp_methods */
  1711. 0, /* tp_members */
  1712. 0, /* tp_getset */
  1713. 0, /* tp_base */
  1714. 0, /* tp_dict */
  1715. 0, /* tp_descr_get */
  1716. 0, /* tp_descr_set */
  1717. 0, /* tp_dictoffset */
  1718. 0, /* tp_init */
  1719. 0, /* tp_alloc */
  1720. 0, /* tp_new */
  1721. 0, /* tp_free */
  1722. 0, /* tp_is_gc */
  1723. 0, /* tp_bases */
  1724. 0, /* tp_mro */
  1725. 0, /* tp_cache */
  1726. 0, /* tp_subclasses */
  1727. 0, /* tp_weaklist */
  1728. #endif
  1729. #if PY_VERSION_HEX >= 0x02030000
  1730. 0, /* tp_del */
  1731. #endif
  1732. #if PY_VERSION_HEX >= 0x02060000
  1733. 0, /* tp_version */
  1734. #endif
  1735. #ifdef COUNT_ALLOCS
  1736. 0,0,0,0 /* tp_alloc -> tp_next */
  1737. #endif
  1738. };
  1739. swigpyobject_type = tmp;
  1740. type_init = 1;
  1741. #if PY_VERSION_HEX < 0x02020000
  1742. swigpyobject_type.ob_type = &PyType_Type;
  1743. #else
  1744. if (PyType_Ready(&swigpyobject_type) < 0)
  1745. return NULL;
  1746. #endif
  1747. }
  1748. return &swigpyobject_type;
  1749. }
  1750. SWIGRUNTIME PyObject *
  1751. SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
  1752. {
  1753. SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
  1754. if (sobj) {
  1755. sobj->ptr = ptr;
  1756. sobj->ty = ty;
  1757. sobj->own = own;
  1758. sobj->next = 0;
  1759. }
  1760. return (PyObject *)sobj;
  1761. }
  1762. /* -----------------------------------------------------------------------------
  1763. * Implements a simple Swig Packed type, and use it instead of string
  1764. * ----------------------------------------------------------------------------- */
  1765. typedef struct {
  1766. PyObject_HEAD
  1767. void *pack;
  1768. swig_type_info *ty;
  1769. size_t size;
  1770. } SwigPyPacked;
  1771. SWIGRUNTIME int
  1772. SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
  1773. {
  1774. char result[SWIG_BUFFER_SIZE];
  1775. fputs("<Swig Packed ", fp);
  1776. if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
  1777. fputs("at ", fp);
  1778. fputs(result, fp);
  1779. }
  1780. fputs(v->ty->name,fp);
  1781. fputs(">", fp);
  1782. return 0;
  1783. }
  1784. SWIGRUNTIME PyObject *
  1785. SwigPyPacked_repr(SwigPyPacked *v)
  1786. {
  1787. char result[SWIG_BUFFER_SIZE];
  1788. if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
  1789. return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
  1790. } else {
  1791. return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
  1792. }
  1793. }
  1794. SWIGRUNTIME PyObject *
  1795. SwigPyPacked_str(SwigPyPacked *v)
  1796. {
  1797. char result[SWIG_BUFFER_SIZE];
  1798. if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
  1799. return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
  1800. } else {
  1801. return SWIG_Python_str_FromChar(v->ty->name);
  1802. }
  1803. }
  1804. SWIGRUNTIME int
  1805. SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
  1806. {
  1807. size_t i = v->size;
  1808. size_t j = w->size;
  1809. int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
  1810. return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
  1811. }
  1812. SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
  1813. SWIGRUNTIME PyTypeObject*
  1814. SwigPyPacked_type(void) {
  1815. static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
  1816. return type;
  1817. }
  1818. SWIGRUNTIMEINLINE int
  1819. SwigPyPacked_Check(PyObject *op) {
  1820. return ((op)->ob_type == SwigPyPacked_TypeOnce())
  1821. || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
  1822. }
  1823. SWIGRUNTIME void
  1824. SwigPyPacked_dealloc(PyObject *v)
  1825. {
  1826. if (SwigPyPacked_Check(v)) {
  1827. SwigPyPacked *sobj = (SwigPyPacked *) v;
  1828. free(sobj->pack);
  1829. }
  1830. PyObject_DEL(v);
  1831. }
  1832. SWIGRUNTIME PyTypeObject*
  1833. SwigPyPacked_TypeOnce(void) {
  1834. static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
  1835. static PyTypeObject swigpypacked_type;
  1836. static int type_init = 0;
  1837. if (!type_init) {
  1838. const PyTypeObject tmp = {
  1839. /* PyObject header changed in Python 3 */
  1840. #if PY_VERSION_HEX>=0x03000000
  1841. PyVarObject_HEAD_INIT(NULL, 0)
  1842. #else
  1843. PyObject_HEAD_INIT(NULL)
  1844. 0, /* ob_size */
  1845. #endif
  1846. (char *)"SwigPyPacked", /* tp_name */
  1847. sizeof(SwigPyPacked), /* tp_basicsize */
  1848. 0, /* tp_itemsize */
  1849. (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
  1850. (printfunc)SwigPyPacked_print, /* tp_print */
  1851. (getattrfunc)0, /* tp_getattr */
  1852. (setattrfunc)0, /* tp_setattr */
  1853. #if PY_VERSION_HEX>=0x03000000
  1854. 0, /* tp_reserved in 3.0.1 */
  1855. #else
  1856. (cmpfunc)SwigPyPacked_compare, /* tp_compare */
  1857. #endif
  1858. (reprfunc)SwigPyPacked_repr, /* tp_repr */
  1859. 0, /* tp_as_number */
  1860. 0, /* tp_as_sequence */
  1861. 0, /* tp_as_mapping */
  1862. (hashfunc)0, /* tp_hash */
  1863. (ternaryfunc)0, /* tp_call */
  1864. (reprfunc)SwigPyPacked_str, /* tp_str */
  1865. PyObject_GenericGetAttr, /* tp_getattro */
  1866. 0, /* tp_setattro */
  1867. 0, /* tp_as_buffer */
  1868. Py_TPFLAGS_DEFAULT, /* tp_flags */
  1869. swigpacked_doc, /* tp_doc */
  1870. 0, /* tp_traverse */
  1871. 0, /* tp_clear */
  1872. 0, /* tp_richcompare */
  1873. 0, /* tp_weaklistoffset */
  1874. #if PY_VERSION_HEX >= 0x02020000
  1875. 0, /* tp_iter */
  1876. 0, /* tp_iternext */
  1877. 0, /* tp_methods */
  1878. 0, /* tp_members */
  1879. 0, /* tp_getset */
  1880. 0, /* tp_base */
  1881. 0, /* tp_dict */
  1882. 0, /* tp_descr_get */
  1883. 0, /* tp_descr_set */
  1884. 0, /* tp_dictoffset */
  1885. 0, /* tp_init */
  1886. 0, /* tp_alloc */
  1887. 0, /* tp_new */
  1888. 0, /* tp_free */
  1889. 0, /* tp_is_gc */
  1890. 0, /* tp_bases */
  1891. 0, /* tp_mro */
  1892. 0, /* tp_cache */
  1893. 0, /* tp_subclasses */
  1894. 0, /* tp_weaklist */
  1895. #endif
  1896. #if PY_VERSION_HEX >= 0x02030000
  1897. 0, /* tp_del */
  1898. #endif
  1899. #if PY_VERSION_HEX >= 0x02060000
  1900. 0, /* tp_version */
  1901. #endif
  1902. #ifdef COUNT_ALLOCS
  1903. 0,0,0,0 /* tp_alloc -> tp_next */
  1904. #endif
  1905. };
  1906. swigpypacked_type = tmp;
  1907. type_init = 1;
  1908. #if PY_VERSION_HEX < 0x02020000
  1909. swigpypacked_type.ob_type = &PyType_Type;
  1910. #else
  1911. if (PyType_Ready(&swigpypacked_type) < 0)
  1912. return NULL;
  1913. #endif
  1914. }
  1915. return &swigpypacked_type;
  1916. }
  1917. SWIGRUNTIME PyObject *
  1918. SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
  1919. {
  1920. SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
  1921. if (sobj) {
  1922. void *pack = malloc(size);
  1923. if (pack) {
  1924. memcpy(pack, ptr, size);
  1925. sobj->pack = pack;
  1926. sobj->ty = ty;
  1927. sobj->size = size;
  1928. } else {
  1929. PyObject_DEL((PyObject *) sobj);
  1930. sobj = 0;
  1931. }
  1932. }
  1933. return (PyObject *) sobj;
  1934. }
  1935. SWIGRUNTIME swig_type_info *
  1936. SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
  1937. {
  1938. if (SwigPyPacked_Check(obj)) {
  1939. SwigPyPacked *sobj = (SwigPyPacked *)obj;
  1940. if (sobj->size != size) return 0;
  1941. memcpy(ptr, sobj->pack, size);
  1942. return sobj->ty;
  1943. } else {
  1944. return 0;
  1945. }
  1946. }
  1947. /* -----------------------------------------------------------------------------
  1948. * pointers/data manipulation
  1949. * ----------------------------------------------------------------------------- */
  1950. SWIGRUNTIMEINLINE PyObject *
  1951. _SWIG_This(void)
  1952. {
  1953. return SWIG_Python_str_FromChar("this");
  1954. }
  1955. static PyObject *swig_this = NULL;
  1956. SWIGRUNTIME PyObject *
  1957. SWIG_This(void)
  1958. {
  1959. if (swig_this == NULL)
  1960. swig_this = _SWIG_This();
  1961. return swig_this;
  1962. }
  1963. /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
  1964. /* TODO: I don't know how to implement the fast getset in Python 3 right now */
  1965. #if PY_VERSION_HEX>=0x03000000
  1966. #define SWIG_PYTHON_SLOW_GETSET_THIS
  1967. #endif
  1968. SWIGRUNTIME SwigPyObject *
  1969. SWIG_Python_GetSwigThis(PyObject *pyobj)
  1970. {
  1971. PyObject *obj;
  1972. if (SwigPyObject_Check(pyobj))
  1973. return (SwigPyObject *) pyobj;
  1974. #ifdef SWIGPYTHON_BUILTIN
  1975. (void)obj;
  1976. # ifdef PyWeakref_CheckProxy
  1977. if (PyWeakref_CheckProxy(pyobj)) {
  1978. pyobj = PyWeakref_GET_OBJECT(pyobj);
  1979. if (pyobj && SwigPyObject_Check(pyobj))
  1980. return (SwigPyObject*) pyobj;
  1981. }
  1982. # endif
  1983. return NULL;
  1984. #else
  1985. obj = 0;
  1986. #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
  1987. if (PyInstance_Check(pyobj)) {
  1988. obj = _PyInstance_Lookup(pyobj, SWIG_This());
  1989. } else {
  1990. PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
  1991. if (dictptr != NULL) {
  1992. PyObject *dict = *dictptr;
  1993. obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
  1994. } else {
  1995. #ifdef PyWeakref_CheckProxy
  1996. if (PyWeakref_CheckProxy(pyobj)) {
  1997. PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
  1998. return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
  1999. }
  2000. #endif
  2001. obj = PyObject_GetAttr(pyobj,SWIG_This());
  2002. if (obj) {
  2003. Py_DECREF(obj);
  2004. } else {
  2005. if (PyErr_Occurred()) PyErr_Clear();
  2006. return 0;
  2007. }
  2008. }
  2009. }
  2010. #else
  2011. obj = PyObject_GetAttr(pyobj,SWIG_This());
  2012. if (obj) {
  2013. Py_DECREF(obj);
  2014. } else {
  2015. if (PyErr_Occurred()) PyErr_Clear();
  2016. return 0;
  2017. }
  2018. #endif
  2019. if (obj && !SwigPyObject_Check(obj)) {
  2020. /* a PyObject is called 'this', try to get the 'real this'
  2021. SwigPyObject from it */
  2022. return SWIG_Python_GetSwigThis(obj);
  2023. }
  2024. return (SwigPyObject *)obj;
  2025. #endif
  2026. }
  2027. /* Acquire a pointer value */
  2028. SWIGRUNTIME int
  2029. SWIG_Python_AcquirePtr(PyObject *obj, int own) {
  2030. if (own == SWIG_POINTER_OWN) {
  2031. SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
  2032. if (sobj) {
  2033. int oldown = sobj->own;
  2034. sobj->own = own;
  2035. return oldown;
  2036. }
  2037. }
  2038. return 0;
  2039. }
  2040. /* Convert a pointer value */
  2041. SWIGRUNTIME int
  2042. SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
  2043. int res;
  2044. SwigPyObject *sobj;
  2045. if (!obj)
  2046. return SWIG_ERROR;
  2047. if (obj == Py_None) {
  2048. if (ptr)
  2049. *ptr = 0;
  2050. return SWIG_OK;
  2051. }
  2052. res = SWIG_ERROR;
  2053. sobj = SWIG_Python_GetSwigThis(obj);
  2054. if (own)
  2055. *own = 0;
  2056. while (sobj) {
  2057. void *vptr = sobj->ptr;
  2058. if (ty) {
  2059. swig_type_info *to = sobj->ty;
  2060. if (to == ty) {
  2061. /* no type cast needed */
  2062. if (ptr) *ptr = vptr;
  2063. break;
  2064. } else {
  2065. swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
  2066. if (!tc) {
  2067. sobj = (SwigPyObject *)sobj->next;
  2068. } else {
  2069. if (ptr) {
  2070. int newmemory = 0;
  2071. *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
  2072. if (newmemory == SWIG_CAST_NEW_MEMORY) {
  2073. assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
  2074. if (own)
  2075. *own = *own | SWIG_CAST_NEW_MEMORY;
  2076. }
  2077. }
  2078. break;
  2079. }
  2080. }
  2081. } else {
  2082. if (ptr) *ptr = vptr;
  2083. break;
  2084. }
  2085. }
  2086. if (sobj) {
  2087. if (own)
  2088. *own = *own | sobj->own;
  2089. if (flags & SWIG_POINTER_DISOWN) {
  2090. sobj->own = 0;
  2091. }
  2092. res = SWIG_OK;
  2093. } else {
  2094. if (flags & SWIG_POINTER_IMPLICIT_CONV) {
  2095. SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
  2096. if (data && !data->implicitconv) {
  2097. PyObject *klass = data->klass;
  2098. if (klass) {
  2099. PyObject *impconv;
  2100. data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
  2101. impconv = SWIG_Python_CallFunctor(klass, obj);
  2102. data->implicitconv = 0;
  2103. if (PyErr_Occurred()) {
  2104. PyErr_Clear();
  2105. impconv = 0;
  2106. }
  2107. if (impconv) {
  2108. SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
  2109. if (iobj) {
  2110. void *vptr;
  2111. res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
  2112. if (SWIG_IsOK(res)) {
  2113. if (ptr) {
  2114. *ptr = vptr;
  2115. /* transfer the ownership to 'ptr' */
  2116. iobj->own = 0;
  2117. res = SWIG_AddCast(res);
  2118. res = SWIG_AddNewMask(res);
  2119. } else {
  2120. res = SWIG_AddCast(res);
  2121. }
  2122. }
  2123. }
  2124. Py_DECREF(impconv);
  2125. }
  2126. }
  2127. }
  2128. }
  2129. }
  2130. return res;
  2131. }
  2132. /* Convert a function ptr value */
  2133. SWIGRUNTIME int
  2134. SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
  2135. if (!PyCFunction_Check(obj)) {
  2136. return SWIG_ConvertPtr(obj, ptr, ty, 0);
  2137. } else {
  2138. void *vptr = 0;
  2139. /* here we get the method pointer for callbacks */
  2140. const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
  2141. const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
  2142. if (desc)
  2143. desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
  2144. if (!desc)
  2145. return SWIG_ERROR;
  2146. if (ty) {
  2147. swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
  2148. if (tc) {
  2149. int newmemory = 0;
  2150. *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
  2151. assert(!newmemory); /* newmemory handling not yet implemented */
  2152. } else {
  2153. return SWIG_ERROR;
  2154. }
  2155. } else {
  2156. *ptr = vptr;
  2157. }
  2158. return SWIG_OK;
  2159. }
  2160. }
  2161. /* Convert a packed value value */
  2162. SWIGRUNTIME int
  2163. SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
  2164. swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
  2165. if (!to) return SWIG_ERROR;
  2166. if (ty) {
  2167. if (to != ty) {
  2168. /* check type cast? */
  2169. swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
  2170. if (!tc) return SWIG_ERROR;
  2171. }
  2172. }
  2173. return SWIG_OK;
  2174. }
  2175. /* -----------------------------------------------------------------------------
  2176. * Create a new pointer object
  2177. * ----------------------------------------------------------------------------- */
  2178. /*
  2179. Create a new instance object, without calling __init__, and set the
  2180. 'this' attribute.
  2181. */
  2182. SWIGRUNTIME PyObject*
  2183. SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
  2184. {
  2185. #if (PY_VERSION_HEX >= 0x02020000)
  2186. PyObject *inst = 0;
  2187. PyObject *newraw = data->newraw;
  2188. if (newraw) {
  2189. inst = PyObject_Call(newraw, data->newargs, NULL);
  2190. if (inst) {
  2191. #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
  2192. PyObject **dictptr = _PyObject_GetDictPtr(inst);
  2193. if (dictptr != NULL) {
  2194. PyObject *dict = *dictptr;
  2195. if (dict == NULL) {
  2196. dict = PyDict_New();
  2197. *dictptr = dict;
  2198. PyDict_SetItem(dict, SWIG_This(), swig_this);
  2199. }
  2200. }
  2201. #else
  2202. PyObject *key = SWIG_This();
  2203. PyObject_SetAttr(inst, key, swig_this);
  2204. #endif
  2205. }
  2206. } else {
  2207. #if PY_VERSION_HEX >= 0x03000000
  2208. inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
  2209. PyObject_SetAttr(inst, SWIG_This(), swig_this);
  2210. Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
  2211. #else
  2212. PyObject *dict = PyDict_New();
  2213. PyDict_SetItem(dict, SWIG_This(), swig_this);
  2214. inst = PyInstance_NewRaw(data->newargs, dict);
  2215. Py_DECREF(dict);
  2216. #endif
  2217. }
  2218. return inst;
  2219. #else
  2220. #if (PY_VERSION_HEX >= 0x02010000)
  2221. PyObject *inst;
  2222. PyObject *dict = PyDict_New();
  2223. PyDict_SetItem(dict, SWIG_This(), swig_this);
  2224. inst = PyInstance_NewRaw(data->newargs, dict);
  2225. Py_DECREF(dict);
  2226. return (PyObject *) inst;
  2227. #else
  2228. PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
  2229. if (inst == NULL) {
  2230. return NULL;
  2231. }
  2232. inst->in_class = (PyClassObject *)data->newargs;
  2233. Py_INCREF(inst->in_class);
  2234. inst->in_dict = PyDict_New();
  2235. if (inst->in_dict == NULL) {
  2236. Py_DECREF(inst);
  2237. return NULL;
  2238. }
  2239. #ifdef Py_TPFLAGS_HAVE_WEAKREFS
  2240. inst->in_weakreflist = NULL;
  2241. #endif
  2242. #ifdef Py_TPFLAGS_GC
  2243. PyObject_GC_Init(inst);
  2244. #endif
  2245. PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
  2246. return (PyObject *) inst;
  2247. #endif
  2248. #endif
  2249. }
  2250. SWIGRUNTIME void
  2251. SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
  2252. {
  2253. PyObject *dict;
  2254. #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
  2255. PyObject **dictptr = _PyObject_GetDictPtr(inst);
  2256. if (dictptr != NULL) {
  2257. dict = *dictptr;
  2258. if (dict == NULL) {
  2259. dict = PyDict_New();
  2260. *dictptr = dict;
  2261. }
  2262. PyDict_SetItem(dict, SWIG_This(), swig_this);
  2263. return;
  2264. }
  2265. #endif
  2266. dict = PyObject_GetAttrString(inst, (char*)"__dict__");
  2267. PyDict_SetItem(dict, SWIG_This(), swig_this);
  2268. Py_DECREF(dict);
  2269. }
  2270. SWIGINTERN PyObject *
  2271. SWIG_Python_InitShadowInstance(PyObject *args) {
  2272. PyObject *obj[2];
  2273. if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
  2274. return NULL;
  2275. } else {
  2276. SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
  2277. if (sthis) {
  2278. SwigPyObject_append((PyObject*) sthis, obj[1]);
  2279. } else {
  2280. SWIG_Python_SetSwigThis(obj[0], obj[1]);
  2281. }
  2282. return SWIG_Py_Void();
  2283. }
  2284. }
  2285. /* Create a new pointer object */
  2286. SWIGRUNTIME PyObject *
  2287. SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
  2288. SwigPyClientData *clientdata;
  2289. PyObject * robj;
  2290. int own;
  2291. if (!ptr)
  2292. return SWIG_Py_Void();
  2293. clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
  2294. own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
  2295. if (clientdata && clientdata->pytype) {
  2296. SwigPyObject *newobj;
  2297. if (flags & SWIG_BUILTIN_TP_INIT) {
  2298. newobj = (SwigPyObject*) self;
  2299. if (newobj->ptr) {
  2300. PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
  2301. while (newobj->next)
  2302. newobj = (SwigPyObject *) newobj->next;
  2303. newobj->next = next_self;
  2304. newobj = (SwigPyObject *)next_self;
  2305. }
  2306. } else {
  2307. newobj = PyObject_New(SwigPyObject, clientdata->pytype);
  2308. }
  2309. if (newobj) {
  2310. newobj->ptr = ptr;
  2311. newobj->ty = type;
  2312. newobj->own = own;
  2313. newobj->next = 0;
  2314. #ifdef SWIGPYTHON_BUILTIN
  2315. newobj->dict = 0;
  2316. #endif
  2317. return (PyObject*) newobj;
  2318. }
  2319. return SWIG_Py_Void();
  2320. }
  2321. assert(!(flags & SWIG_BUILTIN_TP_INIT));
  2322. robj = SwigPyObject_New(ptr, type, own);
  2323. if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
  2324. PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
  2325. if (inst) {
  2326. Py_DECREF(robj);
  2327. robj = inst;
  2328. }
  2329. }
  2330. return robj;
  2331. }
  2332. /* Create a new packed object */
  2333. SWIGRUNTIMEINLINE PyObject *
  2334. SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
  2335. return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
  2336. }
  2337. /* -----------------------------------------------------------------------------*
  2338. * Get type list
  2339. * -----------------------------------------------------------------------------*/
  2340. #ifdef SWIG_LINK_RUNTIME
  2341. void *SWIG_ReturnGlobalTypeList(void *);
  2342. #endif
  2343. SWIGRUNTIME swig_module_info *
  2344. SWIG_Python_GetModule(void) {
  2345. static void *type_pointer = (void *)0;
  2346. /* first check if module already created */
  2347. if (!type_pointer) {
  2348. #ifdef SWIG_LINK_RUNTIME
  2349. type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
  2350. #else
  2351. # ifdef SWIGPY_USE_CAPSULE
  2352. type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
  2353. # else
  2354. type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
  2355. (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
  2356. # endif
  2357. if (PyErr_Occurred()) {
  2358. PyErr_Clear();
  2359. type_pointer = (void *)0;
  2360. }
  2361. #endif
  2362. }
  2363. return (swig_module_info *) type_pointer;
  2364. }
  2365. #if PY_MAJOR_VERSION < 2
  2366. /* PyModule_AddObject function was introduced in Python 2.0. The following function
  2367. is copied out of Python/modsupport.c in python version 2.3.4 */
  2368. SWIGINTERN int
  2369. PyModule_AddObject(PyObject *m, char *name, PyObject *o)
  2370. {
  2371. PyObject *dict;
  2372. if (!PyModule_Check(m)) {
  2373. PyErr_SetString(PyExc_TypeError,
  2374. "PyModule_AddObject() needs module as first arg");
  2375. return SWIG_ERROR;
  2376. }
  2377. if (!o) {
  2378. PyErr_SetString(PyExc_TypeError,
  2379. "PyModule_AddObject() needs non-NULL value");
  2380. return SWIG_ERROR;
  2381. }
  2382. dict = PyModule_GetDict(m);
  2383. if (dict == NULL) {
  2384. /* Internal error -- modules must have a dict! */
  2385. PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
  2386. PyModule_GetName(m));
  2387. return SWIG_ERROR;
  2388. }
  2389. if (PyDict_SetItemString(dict, name, o))
  2390. return SWIG_ERROR;
  2391. Py_DECREF(o);
  2392. return SWIG_OK;
  2393. }
  2394. #endif
  2395. SWIGRUNTIME void
  2396. #ifdef SWIGPY_USE_CAPSULE
  2397. SWIG_Python_DestroyModule(PyObject *obj)
  2398. #else
  2399. SWIG_Python_DestroyModule(void *vptr)
  2400. #endif
  2401. {
  2402. #ifdef SWIGPY_USE_CAPSULE
  2403. swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
  2404. #else
  2405. swig_module_info *swig_module = (swig_module_info *) vptr;
  2406. #endif
  2407. swig_type_info **types = swig_module->types;
  2408. size_t i;
  2409. for (i =0; i < swig_module->size; ++i) {
  2410. swig_type_info *ty = types[i];
  2411. if (ty->owndata) {
  2412. SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
  2413. if (data) SwigPyClientData_Del(data);
  2414. }
  2415. }
  2416. Py_DECREF(SWIG_This());
  2417. swig_this = NULL;
  2418. }
  2419. SWIGRUNTIME void
  2420. SWIG_Python_SetModule(swig_module_info *swig_module) {
  2421. #if PY_VERSION_HEX >= 0x03000000
  2422. /* Add a dummy module object into sys.modules */
  2423. PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
  2424. #else
  2425. static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
  2426. PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
  2427. #endif
  2428. #ifdef SWIGPY_USE_CAPSULE
  2429. PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
  2430. if (pointer && module) {
  2431. PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
  2432. } else {
  2433. Py_XDECREF(pointer);
  2434. }
  2435. #else
  2436. PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
  2437. if (pointer && module) {
  2438. PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
  2439. } else {
  2440. Py_XDECREF(pointer);
  2441. }
  2442. #endif
  2443. }
  2444. /* The python cached type query */
  2445. SWIGRUNTIME PyObject *
  2446. SWIG_Python_TypeCache(void) {
  2447. static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
  2448. return cache;
  2449. }
  2450. SWIGRUNTIME swig_type_info *
  2451. SWIG_Python_TypeQuery(const char *type)
  2452. {
  2453. PyObject *cache = SWIG_Python_TypeCache();
  2454. PyObject *key = SWIG_Python_str_FromChar(type);
  2455. PyObject *obj = PyDict_GetItem(cache, key);
  2456. swig_type_info *descriptor;
  2457. if (obj) {
  2458. #ifdef SWIGPY_USE_CAPSULE
  2459. descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
  2460. #else
  2461. descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
  2462. #endif
  2463. } else {
  2464. swig_module_info *swig_module = SWIG_Python_GetModule();
  2465. descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
  2466. if (descriptor) {
  2467. #ifdef SWIGPY_USE_CAPSULE
  2468. obj = PyCapsule_New((void*) descriptor, NULL, NULL);
  2469. #else
  2470. obj = PyCObject_FromVoidPtr(descriptor, NULL);
  2471. #endif
  2472. PyDict_SetItem(cache, key, obj);
  2473. Py_DECREF(obj);
  2474. }
  2475. }
  2476. Py_DECREF(key);
  2477. return descriptor;
  2478. }
  2479. /*
  2480. For backward compatibility only
  2481. */
  2482. #define SWIG_POINTER_EXCEPTION 0
  2483. #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
  2484. #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
  2485. SWIGRUNTIME int
  2486. SWIG_Python_AddErrMesg(const char* mesg, int infront)
  2487. {
  2488. if (PyErr_Occurred()) {
  2489. PyObject *type = 0;
  2490. PyObject *value = 0;
  2491. PyObject *traceback = 0;
  2492. PyErr_Fetch(&type, &value, &traceback);
  2493. if (value) {
  2494. char *tmp;
  2495. PyObject *old_str = PyObject_Str(value);
  2496. Py_XINCREF(type);
  2497. PyErr_Clear();
  2498. if (infront) {
  2499. PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
  2500. } else {
  2501. PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
  2502. }
  2503. SWIG_Python_str_DelForPy3(tmp);
  2504. Py_DECREF(old_str);
  2505. }
  2506. return 1;
  2507. } else {
  2508. return 0;
  2509. }
  2510. }
  2511. SWIGRUNTIME int
  2512. SWIG_Python_ArgFail(int argnum)
  2513. {
  2514. if (PyErr_Occurred()) {
  2515. /* add information about failing argument */
  2516. char mesg[256];
  2517. PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
  2518. return SWIG_Python_AddErrMesg(mesg, 1);
  2519. } else {
  2520. return 0;
  2521. }
  2522. }
  2523. SWIGRUNTIMEINLINE const char *
  2524. SwigPyObject_GetDesc(PyObject *self)
  2525. {
  2526. SwigPyObject *v = (SwigPyObject *)self;
  2527. swig_type_info *ty = v ? v->ty : 0;
  2528. return ty ? ty->str : (char*)"";
  2529. }
  2530. SWIGRUNTIME void
  2531. SWIG_Python_TypeError(const char *type, PyObject *obj)
  2532. {
  2533. if (type) {
  2534. #if defined(SWIG_COBJECT_TYPES)
  2535. if (obj && SwigPyObject_Check(obj)) {
  2536. const char *otype = (const char *) SwigPyObject_GetDesc(obj);
  2537. if (otype) {
  2538. PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
  2539. type, otype);
  2540. return;
  2541. }
  2542. } else
  2543. #endif
  2544. {
  2545. const char *otype = (obj ? obj->ob_type->tp_name : 0);
  2546. if (otype) {
  2547. PyObject *str = PyObject_Str(obj);
  2548. const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
  2549. if (cstr) {
  2550. PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
  2551. type, otype, cstr);
  2552. SWIG_Python_str_DelForPy3(cstr);
  2553. } else {
  2554. PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
  2555. type, otype);
  2556. }
  2557. Py_XDECREF(str);
  2558. return;
  2559. }
  2560. }
  2561. PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
  2562. } else {
  2563. PyErr_Format(PyExc_TypeError, "unexpected type is received");
  2564. }
  2565. }
  2566. /* Convert a pointer value, signal an exception on a type mismatch */
  2567. SWIGRUNTIME void *
  2568. SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
  2569. void *result;
  2570. if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
  2571. PyErr_Clear();
  2572. #if SWIG_POINTER_EXCEPTION
  2573. if (flags) {
  2574. SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
  2575. SWIG_Python_ArgFail(argnum);
  2576. }
  2577. #endif
  2578. }
  2579. return result;
  2580. }
  2581. SWIGRUNTIME int
  2582. SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
  2583. PyTypeObject *tp = obj->ob_type;
  2584. PyObject *descr;
  2585. PyObject *encoded_name;
  2586. descrsetfunc f;
  2587. int res;
  2588. #ifdef Py_USING_UNICODE
  2589. if (PyString_Check(name)) {
  2590. name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
  2591. if (!name)
  2592. return -1;
  2593. } else if (!PyUnicode_Check(name))
  2594. #else
  2595. if (!PyString_Check(name))
  2596. #endif
  2597. {
  2598. PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
  2599. return -1;
  2600. } else {
  2601. Py_INCREF(name);
  2602. }
  2603. if (!tp->tp_dict) {
  2604. if (PyType_Ready(tp) < 0)
  2605. goto done;
  2606. }
  2607. res = -1;
  2608. descr = _PyType_Lookup(tp, name);
  2609. f = NULL;
  2610. if (descr != NULL)
  2611. f = descr->ob_type->tp_descr_set;
  2612. if (!f) {
  2613. if (PyString_Check(name)) {
  2614. encoded_name = name;
  2615. Py_INCREF(name);
  2616. } else {
  2617. encoded_name = PyUnicode_AsUTF8String(name);
  2618. }
  2619. PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
  2620. Py_DECREF(encoded_name);
  2621. } else {
  2622. res = f(descr, obj, value);
  2623. }
  2624. done:
  2625. Py_DECREF(name);
  2626. return res;
  2627. }
  2628. #ifdef __cplusplus
  2629. }
  2630. #endif
  2631. #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
  2632. #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
  2633. /* -------- TYPES TABLE (BEGIN) -------- */
  2634. #define SWIGTYPE_p_archive swig_types[0]
  2635. #define SWIGTYPE_p_archive_close_callback swig_types[1]
  2636. #define SWIGTYPE_p_archive_entry swig_types[2]
  2637. #define SWIGTYPE_p_archive_open_callback swig_types[3]
  2638. #define SWIGTYPE_p_archive_write_callback swig_types[4]
  2639. #define SWIGTYPE_p_char swig_types[5]
  2640. #define SWIGTYPE_p_int64_t swig_types[6]
  2641. #define SWIGTYPE_p_size_t swig_types[7]
  2642. #define SWIGTYPE_p_stat swig_types[8]
  2643. #define SWIGTYPE_p_time_t swig_types[9]
  2644. #define SWIGTYPE_p_unsigned_short swig_types[10]
  2645. #define SWIGTYPE_p_wchar_t swig_types[11]
  2646. static swig_type_info *swig_types[13];
  2647. static swig_module_info swig_module = {swig_types, 12, 0, 0, 0, 0};
  2648. #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
  2649. #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
  2650. /* -------- TYPES TABLE (END) -------- */
  2651. #if (PY_VERSION_HEX <= 0x02000000)
  2652. # if !defined(SWIG_PYTHON_CLASSIC)
  2653. # error "This python version requires swig to be run with the '-classic' option"
  2654. # endif
  2655. #endif
  2656. /*-----------------------------------------------
  2657. @(target):= __libarchive.so
  2658. ------------------------------------------------*/
  2659. #if PY_VERSION_HEX >= 0x03000000
  2660. # define SWIG_init PyInit___libarchive
  2661. #else
  2662. # define SWIG_init init__libarchive
  2663. #endif
  2664. #define SWIG_name "__libarchive"
  2665. #define SWIGVERSION 0x020004
  2666. #define SWIG_VERSION SWIGVERSION
  2667. #define SWIG_as_voidptr(a) (void *)((const void *)(a))
  2668. #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
  2669. #include <archive.h>
  2670. #include <archive_entry.h>
  2671. #define SWIG_From_long PyInt_FromLong
  2672. SWIGINTERNINLINE PyObject *
  2673. SWIG_From_int (int value)
  2674. {
  2675. return SWIG_From_long (value);
  2676. }
  2677. SWIGINTERN swig_type_info*
  2678. SWIG_pchar_descriptor(void)
  2679. {
  2680. static int init = 0;
  2681. static swig_type_info* info = 0;
  2682. if (!init) {
  2683. info = SWIG_TypeQuery("_p_char");
  2684. init = 1;
  2685. }
  2686. return info;
  2687. }
  2688. SWIGINTERN int
  2689. SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
  2690. {
  2691. #if PY_VERSION_HEX>=0x03000000
  2692. if (PyUnicode_Check(obj))
  2693. #else
  2694. if (PyString_Check(obj))
  2695. #endif
  2696. {
  2697. char *cstr; Py_ssize_t len;
  2698. #if PY_VERSION_HEX>=0x03000000
  2699. if (!alloc && cptr) {
  2700. /* We can't allow converting without allocation, since the internal
  2701. representation of string in Python 3 is UCS-2/UCS-4 but we require
  2702. a UTF-8 representation.
  2703. TODO(bhy) More detailed explanation */
  2704. return SWIG_RuntimeError;
  2705. }
  2706. obj = PyUnicode_AsUTF8String(obj);
  2707. PyBytes_AsStringAndSize(obj, &cstr, &len);
  2708. if(alloc) *alloc = SWIG_NEWOBJ;
  2709. #else
  2710. PyString_AsStringAndSize(obj, &cstr, &len);
  2711. #endif
  2712. if (cptr) {
  2713. if (alloc) {
  2714. /*
  2715. In python the user should not be able to modify the inner
  2716. string representation. To warranty that, if you define
  2717. SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
  2718. buffer is always returned.
  2719. The default behavior is just to return the pointer value,
  2720. so, be careful.
  2721. */
  2722. #if defined(SWIG_PYTHON_SAFE_CSTRINGS)
  2723. if (*alloc != SWIG_OLDOBJ)
  2724. #else
  2725. if (*alloc == SWIG_NEWOBJ)
  2726. #endif
  2727. {
  2728. *cptr = (char *)memcpy((char *)malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
  2729. *alloc = SWIG_NEWOBJ;
  2730. }
  2731. else {
  2732. *cptr = cstr;
  2733. *alloc = SWIG_OLDOBJ;
  2734. }
  2735. } else {
  2736. #if PY_VERSION_HEX>=0x03000000
  2737. assert(0); /* Should never reach here in Python 3 */
  2738. #endif
  2739. *cptr = SWIG_Python_str_AsChar(obj);
  2740. }
  2741. }
  2742. if (psize) *psize = len + 1;
  2743. #if PY_VERSION_HEX>=0x03000000
  2744. Py_XDECREF(obj);
  2745. #endif
  2746. return SWIG_OK;
  2747. } else {
  2748. swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
  2749. if (pchar_descriptor) {
  2750. void* vptr = 0;
  2751. if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
  2752. if (cptr) *cptr = (char *) vptr;
  2753. if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
  2754. if (alloc) *alloc = SWIG_OLDOBJ;
  2755. return SWIG_OK;
  2756. }
  2757. }
  2758. }
  2759. return SWIG_TypeError;
  2760. }
  2761. SWIGINTERN int
  2762. SWIG_AsVal_double (PyObject *obj, double *val)
  2763. {
  2764. int res = SWIG_TypeError;
  2765. if (PyFloat_Check(obj)) {
  2766. if (val) *val = PyFloat_AsDouble(obj);
  2767. return SWIG_OK;
  2768. } else if (PyInt_Check(obj)) {
  2769. if (val) *val = PyInt_AsLong(obj);
  2770. return SWIG_OK;
  2771. } else if (PyLong_Check(obj)) {
  2772. double v = PyLong_AsDouble(obj);
  2773. if (!PyErr_Occurred()) {
  2774. if (val) *val = v;
  2775. return SWIG_OK;
  2776. } else {
  2777. PyErr_Clear();
  2778. }
  2779. }
  2780. #ifdef SWIG_PYTHON_CAST_MODE
  2781. {
  2782. int dispatch = 0;
  2783. double d = PyFloat_AsDouble(obj);
  2784. if (!PyErr_Occurred()) {
  2785. if (val) *val = d;
  2786. return SWIG_AddCast(SWIG_OK);
  2787. } else {
  2788. PyErr_Clear();
  2789. }
  2790. if (!dispatch) {
  2791. long v = PyLong_AsLong(obj);
  2792. if (!PyErr_Occurred()) {
  2793. if (val) *val = v;
  2794. return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
  2795. } else {
  2796. PyErr_Clear();
  2797. }
  2798. }
  2799. }
  2800. #endif
  2801. return res;
  2802. }
  2803. #include <float.h>
  2804. #include <math.h>
  2805. SWIGINTERNINLINE int
  2806. SWIG_CanCastAsInteger(double *d, double min, double max) {
  2807. double x = *d;
  2808. if ((min <= x && x <= max)) {
  2809. double fx = floor(x);
  2810. double cx = ceil(x);
  2811. double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
  2812. if ((errno == EDOM) || (errno == ERANGE)) {
  2813. errno = 0;
  2814. } else {
  2815. double summ, reps, diff;
  2816. if (rd < x) {
  2817. diff = x - rd;
  2818. } else if (rd > x) {
  2819. diff = rd - x;
  2820. } else {
  2821. return 1;
  2822. }
  2823. summ = rd + x;
  2824. reps = diff/summ;
  2825. if (reps < 8*DBL_EPSILON) {
  2826. *d = rd;
  2827. return 1;
  2828. }
  2829. }
  2830. }
  2831. return 0;
  2832. }
  2833. SWIGINTERN int
  2834. SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
  2835. {
  2836. if (PyInt_Check(obj)) {
  2837. long v = PyInt_AsLong(obj);
  2838. if (v >= 0) {
  2839. if (val) *val = v;
  2840. return SWIG_OK;
  2841. } else {
  2842. return SWIG_OverflowError;
  2843. }
  2844. } else if (PyLong_Check(obj)) {
  2845. unsigned long v = PyLong_AsUnsignedLong(obj);
  2846. if (!PyErr_Occurred()) {
  2847. if (val) *val = v;
  2848. return SWIG_OK;
  2849. } else {
  2850. PyErr_Clear();
  2851. }
  2852. }
  2853. #ifdef SWIG_PYTHON_CAST_MODE
  2854. {
  2855. int dispatch = 0;
  2856. unsigned long v = PyLong_AsUnsignedLong(obj);
  2857. if (!PyErr_Occurred()) {
  2858. if (val) *val = v;
  2859. return SWIG_AddCast(SWIG_OK);
  2860. } else {
  2861. PyErr_Clear();
  2862. }
  2863. if (!dispatch) {
  2864. double d;
  2865. int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
  2866. if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
  2867. if (val) *val = (unsigned long)(d);
  2868. return res;
  2869. }
  2870. }
  2871. }
  2872. #endif
  2873. return SWIG_TypeError;
  2874. }
  2875. SWIGINTERNINLINE int
  2876. SWIG_AsVal_size_t (PyObject * obj, size_t *val)
  2877. {
  2878. unsigned long v;
  2879. int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
  2880. if (SWIG_IsOK(res) && val) *val = (size_t)(v);
  2881. return res;
  2882. }
  2883. #include <limits.h>
  2884. #if !defined(SWIG_NO_LLONG_MAX)
  2885. # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
  2886. # define LLONG_MAX __LONG_LONG_MAX__
  2887. # define LLONG_MIN (-LLONG_MAX - 1LL)
  2888. # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
  2889. # endif
  2890. #endif
  2891. SWIGINTERN int
  2892. SWIG_AsVal_long (PyObject *obj, long* val)
  2893. {
  2894. if (PyInt_Check(obj)) {
  2895. if (val) *val = PyInt_AsLong(obj);
  2896. return SWIG_OK;
  2897. } else if (PyLong_Check(obj)) {
  2898. long v = PyLong_AsLong(obj);
  2899. if (!PyErr_Occurred()) {
  2900. if (val) *val = v;
  2901. return SWIG_OK;
  2902. } else {
  2903. PyErr_Clear();
  2904. }
  2905. }
  2906. #ifdef SWIG_PYTHON_CAST_MODE
  2907. {
  2908. int dispatch = 0;
  2909. long v = PyInt_AsLong(obj);
  2910. if (!PyErr_Occurred()) {
  2911. if (val) *val = v;
  2912. return SWIG_AddCast(SWIG_OK);
  2913. } else {
  2914. PyErr_Clear();
  2915. }
  2916. if (!dispatch) {
  2917. double d;
  2918. int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
  2919. if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
  2920. if (val) *val = (long)(d);
  2921. return res;
  2922. }
  2923. }
  2924. }
  2925. #endif
  2926. return SWIG_TypeError;
  2927. }
  2928. SWIGINTERN int
  2929. SWIG_AsVal_int (PyObject * obj, int *val)
  2930. {
  2931. long v;
  2932. int res = SWIG_AsVal_long (obj, &v);
  2933. if (SWIG_IsOK(res)) {
  2934. if ((v < INT_MIN || v > INT_MAX)) {
  2935. return SWIG_OverflowError;
  2936. } else {
  2937. if (val) *val = (int)(v);
  2938. }
  2939. }
  2940. return res;
  2941. }
  2942. SWIGINTERNINLINE PyObject *
  2943. SWIG_FromCharPtrAndSize(const char* carray, size_t size)
  2944. {
  2945. if (carray) {
  2946. if (size > INT_MAX) {
  2947. swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
  2948. return pchar_descriptor ?
  2949. SWIG_InternalNewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void();
  2950. } else {
  2951. return PyUnicode_FromStringAndSize(carray, (int)(size));
  2952. }
  2953. } else {
  2954. return SWIG_Py_Void();
  2955. }
  2956. }
  2957. SWIGINTERNINLINE PyObject *
  2958. SWIG_FromCharPtr(const char *cptr)
  2959. {
  2960. return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
  2961. }
  2962. SWIGINTERNINLINE PyObject*
  2963. SWIG_From_unsigned_SS_long (unsigned long value)
  2964. {
  2965. return (value > LONG_MAX) ?
  2966. PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)(value));
  2967. }
  2968. SWIGINTERNINLINE PyObject *
  2969. SWIG_From_unsigned_SS_short (unsigned short value)
  2970. {
  2971. return SWIG_From_unsigned_SS_long (value);
  2972. }
  2973. SWIGINTERN int
  2974. SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
  2975. {
  2976. unsigned long v;
  2977. int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
  2978. if (SWIG_IsOK(res)) {
  2979. if ((v > UINT_MAX)) {
  2980. return SWIG_OverflowError;
  2981. } else {
  2982. if (val) *val = (unsigned int)(v);
  2983. }
  2984. }
  2985. return res;
  2986. }
  2987. SWIGINTERN int
  2988. SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val)
  2989. {
  2990. unsigned long v;
  2991. int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
  2992. if (SWIG_IsOK(res)) {
  2993. if ((v > USHRT_MAX)) {
  2994. return SWIG_OverflowError;
  2995. } else {
  2996. if (val) *val = (unsigned short)(v);
  2997. }
  2998. }
  2999. return res;
  3000. }
  3001. PyObject *archive_read_data_into_str(struct archive *archive, int len) {
  3002. PyObject *str = NULL;
  3003. if (!(str = PyUnicode_FromStringAndSize(NULL, len))) {
  3004. PyErr_SetString(PyExc_MemoryError, "could not allocate string.");
  3005. return NULL;
  3006. }
  3007. if (len != archive_read_data(archive, PyString_AS_STRING(str), len)) {
  3008. PyErr_SetString(PyExc_RuntimeError, "could not read requested data.");
  3009. return NULL;
  3010. }
  3011. return str;
  3012. }
  3013. PyObject *archive_write_data_from_str(struct archive *archive, PyObject *str) {
  3014. int len = PyString_Size(str);
  3015. if (!archive_write_data(archive, PyString_AS_STRING(str), len)) {
  3016. PyErr_SetString(PyExc_RuntimeError, "could not write requested data.");
  3017. return NULL;
  3018. }
  3019. return PyInt_FromLong(len);
  3020. }
  3021. #ifdef __cplusplus
  3022. extern "C" {
  3023. #endif
  3024. SWIGINTERN PyObject *_wrap_archive_read_new(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3025. PyObject *resultobj = 0;
  3026. struct archive *result = 0 ;
  3027. if (!PyArg_ParseTuple(args,(char *)":archive_read_new")) SWIG_fail;
  3028. result = (struct archive *)archive_read_new();
  3029. resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_archive, 0 | 0 );
  3030. return resultobj;
  3031. fail:
  3032. return NULL;
  3033. }
  3034. SWIGINTERN PyObject *_wrap_archive_read_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3035. PyObject *resultobj = 0;
  3036. struct archive *arg1 = (struct archive *) 0 ;
  3037. void *argp1 = 0 ;
  3038. int res1 = 0 ;
  3039. PyObject * obj0 = 0 ;
  3040. int result;
  3041. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_free",&obj0)) SWIG_fail;
  3042. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3043. if (!SWIG_IsOK(res1)) {
  3044. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_free" "', argument " "1"" of type '" "struct archive *""'");
  3045. }
  3046. arg1 = (struct archive *)(argp1);
  3047. result = (int)archive_read_free(arg1);
  3048. resultobj = SWIG_From_int((int)(result));
  3049. return resultobj;
  3050. fail:
  3051. return NULL;
  3052. }
  3053. SWIGINTERN PyObject *_wrap_archive_read_open_filename(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3054. PyObject *resultobj = 0;
  3055. struct archive *arg1 = (struct archive *) 0 ;
  3056. char *arg2 = (char *) 0 ;
  3057. size_t arg3 ;
  3058. void *argp1 = 0 ;
  3059. int res1 = 0 ;
  3060. int res2 ;
  3061. char *buf2 = 0 ;
  3062. int alloc2 = 0 ;
  3063. size_t val3 ;
  3064. int ecode3 = 0 ;
  3065. PyObject * obj0 = 0 ;
  3066. PyObject * obj1 = 0 ;
  3067. PyObject * obj2 = 0 ;
  3068. int result;
  3069. if (!PyArg_ParseTuple(args,(char *)"OOO:archive_read_open_filename",&obj0,&obj1,&obj2)) SWIG_fail;
  3070. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3071. if (!SWIG_IsOK(res1)) {
  3072. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_open_filename" "', argument " "1"" of type '" "struct archive *""'");
  3073. }
  3074. arg1 = (struct archive *)(argp1);
  3075. res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
  3076. if (!SWIG_IsOK(res2)) {
  3077. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "archive_read_open_filename" "', argument " "2"" of type '" "char const *""'");
  3078. }
  3079. arg2 = (char *)(buf2);
  3080. ecode3 = SWIG_AsVal_size_t(obj2, &val3);
  3081. if (!SWIG_IsOK(ecode3)) {
  3082. SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "archive_read_open_filename" "', argument " "3"" of type '" "size_t""'");
  3083. }
  3084. arg3 = (size_t)(val3);
  3085. result = (int)archive_read_open_filename(arg1,(char const *)arg2,arg3);
  3086. resultobj = SWIG_From_int((int)(result));
  3087. if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  3088. return resultobj;
  3089. fail:
  3090. if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  3091. return NULL;
  3092. }
  3093. SWIGINTERN PyObject *_wrap_archive_read_open_memory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3094. PyObject *resultobj = 0;
  3095. struct archive *arg1 = (struct archive *) 0 ;
  3096. void *arg2 = (void *) 0 ;
  3097. size_t arg3 ;
  3098. void *argp1 = 0 ;
  3099. int res1 = 0 ;
  3100. int res2 ;
  3101. size_t val3 ;
  3102. int ecode3 = 0 ;
  3103. PyObject * obj0 = 0 ;
  3104. PyObject * obj1 = 0 ;
  3105. PyObject * obj2 = 0 ;
  3106. int result;
  3107. if (!PyArg_ParseTuple(args,(char *)"OOO:archive_read_open_memory",&obj0,&obj1,&obj2)) SWIG_fail;
  3108. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3109. if (!SWIG_IsOK(res1)) {
  3110. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_open_memory" "', argument " "1"" of type '" "struct archive *""'");
  3111. }
  3112. arg1 = (struct archive *)(argp1);
  3113. res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0);
  3114. if (!SWIG_IsOK(res2)) {
  3115. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "archive_read_open_memory" "', argument " "2"" of type '" "void *""'");
  3116. }
  3117. ecode3 = SWIG_AsVal_size_t(obj2, &val3);
  3118. if (!SWIG_IsOK(ecode3)) {
  3119. SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "archive_read_open_memory" "', argument " "3"" of type '" "size_t""'");
  3120. }
  3121. arg3 = (size_t)(val3);
  3122. result = (int)archive_read_open_memory(arg1,arg2,arg3);
  3123. resultobj = SWIG_From_int((int)(result));
  3124. return resultobj;
  3125. fail:
  3126. return NULL;
  3127. }
  3128. SWIGINTERN PyObject *_wrap_archive_read_open_memory2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3129. PyObject *resultobj = 0;
  3130. struct archive *arg1 = (struct archive *) 0 ;
  3131. void *arg2 = (void *) 0 ;
  3132. size_t arg3 ;
  3133. size_t arg4 ;
  3134. void *argp1 = 0 ;
  3135. int res1 = 0 ;
  3136. int res2 ;
  3137. size_t val3 ;
  3138. int ecode3 = 0 ;
  3139. size_t val4 ;
  3140. int ecode4 = 0 ;
  3141. PyObject * obj0 = 0 ;
  3142. PyObject * obj1 = 0 ;
  3143. PyObject * obj2 = 0 ;
  3144. PyObject * obj3 = 0 ;
  3145. int result;
  3146. if (!PyArg_ParseTuple(args,(char *)"OOOO:archive_read_open_memory2",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
  3147. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3148. if (!SWIG_IsOK(res1)) {
  3149. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_open_memory2" "', argument " "1"" of type '" "struct archive *""'");
  3150. }
  3151. arg1 = (struct archive *)(argp1);
  3152. res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0);
  3153. if (!SWIG_IsOK(res2)) {
  3154. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "archive_read_open_memory2" "', argument " "2"" of type '" "void *""'");
  3155. }
  3156. ecode3 = SWIG_AsVal_size_t(obj2, &val3);
  3157. if (!SWIG_IsOK(ecode3)) {
  3158. SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "archive_read_open_memory2" "', argument " "3"" of type '" "size_t""'");
  3159. }
  3160. arg3 = (size_t)(val3);
  3161. ecode4 = SWIG_AsVal_size_t(obj3, &val4);
  3162. if (!SWIG_IsOK(ecode4)) {
  3163. SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "archive_read_open_memory2" "', argument " "4"" of type '" "size_t""'");
  3164. }
  3165. arg4 = (size_t)(val4);
  3166. result = (int)archive_read_open_memory2(arg1,arg2,arg3,arg4);
  3167. resultobj = SWIG_From_int((int)(result));
  3168. return resultobj;
  3169. fail:
  3170. return NULL;
  3171. }
  3172. SWIGINTERN PyObject *_wrap_archive_read_open_fd(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3173. PyObject *resultobj = 0;
  3174. struct archive *arg1 = (struct archive *) 0 ;
  3175. int arg2 ;
  3176. size_t arg3 ;
  3177. void *argp1 = 0 ;
  3178. int res1 = 0 ;
  3179. int val2 ;
  3180. int ecode2 = 0 ;
  3181. size_t val3 ;
  3182. int ecode3 = 0 ;
  3183. PyObject * obj0 = 0 ;
  3184. PyObject * obj1 = 0 ;
  3185. PyObject * obj2 = 0 ;
  3186. int result;
  3187. if (!PyArg_ParseTuple(args,(char *)"OOO:archive_read_open_fd",&obj0,&obj1,&obj2)) SWIG_fail;
  3188. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3189. if (!SWIG_IsOK(res1)) {
  3190. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_open_fd" "', argument " "1"" of type '" "struct archive *""'");
  3191. }
  3192. arg1 = (struct archive *)(argp1);
  3193. ecode2 = SWIG_AsVal_int(obj1, &val2);
  3194. if (!SWIG_IsOK(ecode2)) {
  3195. SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "archive_read_open_fd" "', argument " "2"" of type '" "int""'");
  3196. }
  3197. arg2 = (int)(val2);
  3198. ecode3 = SWIG_AsVal_size_t(obj2, &val3);
  3199. if (!SWIG_IsOK(ecode3)) {
  3200. SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "archive_read_open_fd" "', argument " "3"" of type '" "size_t""'");
  3201. }
  3202. arg3 = (size_t)(val3);
  3203. result = (int)archive_read_open_fd(arg1,arg2,arg3);
  3204. resultobj = SWIG_From_int((int)(result));
  3205. return resultobj;
  3206. fail:
  3207. return NULL;
  3208. }
  3209. SWIGINTERN PyObject *_wrap_archive_read_close(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3210. PyObject *resultobj = 0;
  3211. struct archive *arg1 = (struct archive *) 0 ;
  3212. void *argp1 = 0 ;
  3213. int res1 = 0 ;
  3214. PyObject * obj0 = 0 ;
  3215. int result;
  3216. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_close",&obj0)) SWIG_fail;
  3217. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3218. if (!SWIG_IsOK(res1)) {
  3219. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_close" "', argument " "1"" of type '" "struct archive *""'");
  3220. }
  3221. arg1 = (struct archive *)(argp1);
  3222. result = (int)archive_read_close(arg1);
  3223. resultobj = SWIG_From_int((int)(result));
  3224. return resultobj;
  3225. fail:
  3226. return NULL;
  3227. }
  3228. SWIGINTERN PyObject *_wrap_archive_format(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3229. PyObject *resultobj = 0;
  3230. struct archive *arg1 = (struct archive *) 0 ;
  3231. void *argp1 = 0 ;
  3232. int res1 = 0 ;
  3233. PyObject * obj0 = 0 ;
  3234. int result;
  3235. if (!PyArg_ParseTuple(args,(char *)"O:archive_format",&obj0)) SWIG_fail;
  3236. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3237. if (!SWIG_IsOK(res1)) {
  3238. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_format" "', argument " "1"" of type '" "struct archive *""'");
  3239. }
  3240. arg1 = (struct archive *)(argp1);
  3241. result = (int)archive_format(arg1);
  3242. resultobj = SWIG_From_int((int)(result));
  3243. return resultobj;
  3244. fail:
  3245. return NULL;
  3246. }
  3247. SWIGINTERN PyObject *_wrap_archive_read_next_header2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3248. PyObject *resultobj = 0;
  3249. struct archive *arg1 = (struct archive *) 0 ;
  3250. struct archive_entry *arg2 = (struct archive_entry *) 0 ;
  3251. void *argp1 = 0 ;
  3252. int res1 = 0 ;
  3253. void *argp2 = 0 ;
  3254. int res2 = 0 ;
  3255. PyObject * obj0 = 0 ;
  3256. PyObject * obj1 = 0 ;
  3257. int result;
  3258. if (!PyArg_ParseTuple(args,(char *)"OO:archive_read_next_header2",&obj0,&obj1)) SWIG_fail;
  3259. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3260. if (!SWIG_IsOK(res1)) {
  3261. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_next_header2" "', argument " "1"" of type '" "struct archive *""'");
  3262. }
  3263. arg1 = (struct archive *)(argp1);
  3264. res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_archive_entry, 0 | 0 );
  3265. if (!SWIG_IsOK(res2)) {
  3266. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "archive_read_next_header2" "', argument " "2"" of type '" "struct archive_entry *""'");
  3267. }
  3268. arg2 = (struct archive_entry *)(argp2);
  3269. result = (int)archive_read_next_header2(arg1,arg2);
  3270. resultobj = SWIG_From_int((int)(result));
  3271. return resultobj;
  3272. fail:
  3273. return NULL;
  3274. }
  3275. SWIGINTERN PyObject *_wrap_archive_entry_stat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3276. PyObject *resultobj = 0;
  3277. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  3278. void *argp1 = 0 ;
  3279. int res1 = 0 ;
  3280. PyObject * obj0 = 0 ;
  3281. struct stat *result = 0 ;
  3282. if (!PyArg_ParseTuple(args,(char *)"O:archive_entry_stat",&obj0)) SWIG_fail;
  3283. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  3284. if (!SWIG_IsOK(res1)) {
  3285. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_stat" "', argument " "1"" of type '" "struct archive_entry *""'");
  3286. }
  3287. arg1 = (struct archive_entry *)(argp1);
  3288. result = (struct stat *)archive_entry_stat(arg1);
  3289. resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stat, 0 | 0 );
  3290. return resultobj;
  3291. fail:
  3292. return NULL;
  3293. }
  3294. SWIGINTERN PyObject *_wrap_archive_read_header_position(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3295. PyObject *resultobj = 0;
  3296. struct archive *arg1 = (struct archive *) 0 ;
  3297. void *argp1 = 0 ;
  3298. int res1 = 0 ;
  3299. PyObject * obj0 = 0 ;
  3300. int64_t result;
  3301. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_header_position",&obj0)) SWIG_fail;
  3302. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3303. if (!SWIG_IsOK(res1)) {
  3304. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_header_position" "', argument " "1"" of type '" "struct archive *""'");
  3305. }
  3306. arg1 = (struct archive *)(argp1);
  3307. result = archive_read_header_position(arg1);
  3308. {
  3309. resultobj = PyLong_FromLong((long)result);
  3310. }
  3311. return resultobj;
  3312. fail:
  3313. return NULL;
  3314. }
  3315. SWIGINTERN PyObject *_wrap_archive_read_data_skip(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3316. PyObject *resultobj = 0;
  3317. struct archive *arg1 = (struct archive *) 0 ;
  3318. void *argp1 = 0 ;
  3319. int res1 = 0 ;
  3320. PyObject * obj0 = 0 ;
  3321. int result;
  3322. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_data_skip",&obj0)) SWIG_fail;
  3323. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3324. if (!SWIG_IsOK(res1)) {
  3325. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_data_skip" "', argument " "1"" of type '" "struct archive *""'");
  3326. }
  3327. arg1 = (struct archive *)(argp1);
  3328. result = (int)archive_read_data_skip(arg1);
  3329. resultobj = SWIG_From_int((int)(result));
  3330. return resultobj;
  3331. fail:
  3332. return NULL;
  3333. }
  3334. SWIGINTERN PyObject *_wrap_archive_read_data_into_fd(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3335. PyObject *resultobj = 0;
  3336. struct archive *arg1 = (struct archive *) 0 ;
  3337. int arg2 ;
  3338. void *argp1 = 0 ;
  3339. int res1 = 0 ;
  3340. int val2 ;
  3341. int ecode2 = 0 ;
  3342. PyObject * obj0 = 0 ;
  3343. PyObject * obj1 = 0 ;
  3344. int result;
  3345. if (!PyArg_ParseTuple(args,(char *)"OO:archive_read_data_into_fd",&obj0,&obj1)) SWIG_fail;
  3346. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3347. if (!SWIG_IsOK(res1)) {
  3348. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_data_into_fd" "', argument " "1"" of type '" "struct archive *""'");
  3349. }
  3350. arg1 = (struct archive *)(argp1);
  3351. ecode2 = SWIG_AsVal_int(obj1, &val2);
  3352. if (!SWIG_IsOK(ecode2)) {
  3353. SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "archive_read_data_into_fd" "', argument " "2"" of type '" "int""'");
  3354. }
  3355. arg2 = (int)(val2);
  3356. result = (int)archive_read_data_into_fd(arg1,arg2);
  3357. resultobj = SWIG_From_int((int)(result));
  3358. return resultobj;
  3359. fail:
  3360. return NULL;
  3361. }
  3362. SWIGINTERN PyObject *_wrap_archive_read_support_filter_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3363. PyObject *resultobj = 0;
  3364. struct archive *arg1 = (struct archive *) 0 ;
  3365. void *argp1 = 0 ;
  3366. int res1 = 0 ;
  3367. PyObject * obj0 = 0 ;
  3368. int result;
  3369. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_filter_all",&obj0)) SWIG_fail;
  3370. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3371. if (!SWIG_IsOK(res1)) {
  3372. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_filter_all" "', argument " "1"" of type '" "struct archive *""'");
  3373. }
  3374. arg1 = (struct archive *)(argp1);
  3375. result = (int)archive_read_support_filter_all(arg1);
  3376. resultobj = SWIG_From_int((int)(result));
  3377. return resultobj;
  3378. fail:
  3379. return NULL;
  3380. }
  3381. SWIGINTERN PyObject *_wrap_archive_read_support_filter_bzip2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3382. PyObject *resultobj = 0;
  3383. struct archive *arg1 = (struct archive *) 0 ;
  3384. void *argp1 = 0 ;
  3385. int res1 = 0 ;
  3386. PyObject * obj0 = 0 ;
  3387. int result;
  3388. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_filter_bzip2",&obj0)) SWIG_fail;
  3389. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3390. if (!SWIG_IsOK(res1)) {
  3391. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_filter_bzip2" "', argument " "1"" of type '" "struct archive *""'");
  3392. }
  3393. arg1 = (struct archive *)(argp1);
  3394. result = (int)archive_read_support_filter_bzip2(arg1);
  3395. resultobj = SWIG_From_int((int)(result));
  3396. return resultobj;
  3397. fail:
  3398. return NULL;
  3399. }
  3400. SWIGINTERN PyObject *_wrap_archive_read_support_filter_compress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3401. PyObject *resultobj = 0;
  3402. struct archive *arg1 = (struct archive *) 0 ;
  3403. void *argp1 = 0 ;
  3404. int res1 = 0 ;
  3405. PyObject * obj0 = 0 ;
  3406. int result;
  3407. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_filter_compress",&obj0)) SWIG_fail;
  3408. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3409. if (!SWIG_IsOK(res1)) {
  3410. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_filter_compress" "', argument " "1"" of type '" "struct archive *""'");
  3411. }
  3412. arg1 = (struct archive *)(argp1);
  3413. result = (int)archive_read_support_filter_compress(arg1);
  3414. resultobj = SWIG_From_int((int)(result));
  3415. return resultobj;
  3416. fail:
  3417. return NULL;
  3418. }
  3419. SWIGINTERN PyObject *_wrap_archive_read_support_filter_gzip(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3420. PyObject *resultobj = 0;
  3421. struct archive *arg1 = (struct archive *) 0 ;
  3422. void *argp1 = 0 ;
  3423. int res1 = 0 ;
  3424. PyObject * obj0 = 0 ;
  3425. int result;
  3426. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_filter_gzip",&obj0)) SWIG_fail;
  3427. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3428. if (!SWIG_IsOK(res1)) {
  3429. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_filter_gzip" "', argument " "1"" of type '" "struct archive *""'");
  3430. }
  3431. arg1 = (struct archive *)(argp1);
  3432. result = (int)archive_read_support_filter_gzip(arg1);
  3433. resultobj = SWIG_From_int((int)(result));
  3434. return resultobj;
  3435. fail:
  3436. return NULL;
  3437. }
  3438. SWIGINTERN PyObject *_wrap_archive_read_support_filter_lzip(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3439. PyObject *resultobj = 0;
  3440. struct archive *arg1 = (struct archive *) 0 ;
  3441. void *argp1 = 0 ;
  3442. int res1 = 0 ;
  3443. PyObject * obj0 = 0 ;
  3444. int result;
  3445. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_filter_lzip",&obj0)) SWIG_fail;
  3446. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3447. if (!SWIG_IsOK(res1)) {
  3448. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_filter_lzip" "', argument " "1"" of type '" "struct archive *""'");
  3449. }
  3450. arg1 = (struct archive *)(argp1);
  3451. result = (int)archive_read_support_filter_lzip(arg1);
  3452. resultobj = SWIG_From_int((int)(result));
  3453. return resultobj;
  3454. fail:
  3455. return NULL;
  3456. }
  3457. SWIGINTERN PyObject *_wrap_archive_read_support_filter_lzma(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3458. PyObject *resultobj = 0;
  3459. struct archive *arg1 = (struct archive *) 0 ;
  3460. void *argp1 = 0 ;
  3461. int res1 = 0 ;
  3462. PyObject * obj0 = 0 ;
  3463. int result;
  3464. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_filter_lzma",&obj0)) SWIG_fail;
  3465. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3466. if (!SWIG_IsOK(res1)) {
  3467. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_filter_lzma" "', argument " "1"" of type '" "struct archive *""'");
  3468. }
  3469. arg1 = (struct archive *)(argp1);
  3470. result = (int)archive_read_support_filter_lzma(arg1);
  3471. resultobj = SWIG_From_int((int)(result));
  3472. return resultobj;
  3473. fail:
  3474. return NULL;
  3475. }
  3476. SWIGINTERN PyObject *_wrap_archive_read_support_filter_none(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3477. PyObject *resultobj = 0;
  3478. struct archive *arg1 = (struct archive *) 0 ;
  3479. void *argp1 = 0 ;
  3480. int res1 = 0 ;
  3481. PyObject * obj0 = 0 ;
  3482. int result;
  3483. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_filter_none",&obj0)) SWIG_fail;
  3484. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3485. if (!SWIG_IsOK(res1)) {
  3486. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_filter_none" "', argument " "1"" of type '" "struct archive *""'");
  3487. }
  3488. arg1 = (struct archive *)(argp1);
  3489. result = (int)archive_read_support_filter_none(arg1);
  3490. resultobj = SWIG_From_int((int)(result));
  3491. return resultobj;
  3492. fail:
  3493. return NULL;
  3494. }
  3495. SWIGINTERN PyObject *_wrap_archive_read_support_filter_rpm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3496. PyObject *resultobj = 0;
  3497. struct archive *arg1 = (struct archive *) 0 ;
  3498. void *argp1 = 0 ;
  3499. int res1 = 0 ;
  3500. PyObject * obj0 = 0 ;
  3501. int result;
  3502. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_filter_rpm",&obj0)) SWIG_fail;
  3503. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3504. if (!SWIG_IsOK(res1)) {
  3505. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_filter_rpm" "', argument " "1"" of type '" "struct archive *""'");
  3506. }
  3507. arg1 = (struct archive *)(argp1);
  3508. result = (int)archive_read_support_filter_rpm(arg1);
  3509. resultobj = SWIG_From_int((int)(result));
  3510. return resultobj;
  3511. fail:
  3512. return NULL;
  3513. }
  3514. SWIGINTERN PyObject *_wrap_archive_read_support_filter_uu(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3515. PyObject *resultobj = 0;
  3516. struct archive *arg1 = (struct archive *) 0 ;
  3517. void *argp1 = 0 ;
  3518. int res1 = 0 ;
  3519. PyObject * obj0 = 0 ;
  3520. int result;
  3521. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_filter_uu",&obj0)) SWIG_fail;
  3522. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3523. if (!SWIG_IsOK(res1)) {
  3524. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_filter_uu" "', argument " "1"" of type '" "struct archive *""'");
  3525. }
  3526. arg1 = (struct archive *)(argp1);
  3527. result = (int)archive_read_support_filter_uu(arg1);
  3528. resultobj = SWIG_From_int((int)(result));
  3529. return resultobj;
  3530. fail:
  3531. return NULL;
  3532. }
  3533. SWIGINTERN PyObject *_wrap_archive_read_support_filter_xz(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3534. PyObject *resultobj = 0;
  3535. struct archive *arg1 = (struct archive *) 0 ;
  3536. void *argp1 = 0 ;
  3537. int res1 = 0 ;
  3538. PyObject * obj0 = 0 ;
  3539. int result;
  3540. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_filter_xz",&obj0)) SWIG_fail;
  3541. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3542. if (!SWIG_IsOK(res1)) {
  3543. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_filter_xz" "', argument " "1"" of type '" "struct archive *""'");
  3544. }
  3545. arg1 = (struct archive *)(argp1);
  3546. result = (int)archive_read_support_filter_xz(arg1);
  3547. resultobj = SWIG_From_int((int)(result));
  3548. return resultobj;
  3549. fail:
  3550. return NULL;
  3551. }
  3552. SWIGINTERN PyObject *_wrap_archive_read_support_format_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3553. PyObject *resultobj = 0;
  3554. struct archive *arg1 = (struct archive *) 0 ;
  3555. void *argp1 = 0 ;
  3556. int res1 = 0 ;
  3557. PyObject * obj0 = 0 ;
  3558. int result;
  3559. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_all",&obj0)) SWIG_fail;
  3560. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3561. if (!SWIG_IsOK(res1)) {
  3562. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_all" "', argument " "1"" of type '" "struct archive *""'");
  3563. }
  3564. arg1 = (struct archive *)(argp1);
  3565. result = (int)archive_read_support_format_all(arg1);
  3566. resultobj = SWIG_From_int((int)(result));
  3567. return resultobj;
  3568. fail:
  3569. return NULL;
  3570. }
  3571. SWIGINTERN PyObject *_wrap_archive_read_support_format_7zip(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3572. PyObject *resultobj = 0;
  3573. struct archive *arg1 = (struct archive *) 0 ;
  3574. void *argp1 = 0 ;
  3575. int res1 = 0 ;
  3576. PyObject * obj0 = 0 ;
  3577. int result;
  3578. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_7zip",&obj0)) SWIG_fail;
  3579. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3580. if (!SWIG_IsOK(res1)) {
  3581. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_7zip" "', argument " "1"" of type '" "struct archive *""'");
  3582. }
  3583. arg1 = (struct archive *)(argp1);
  3584. result = (int)archive_read_support_format_7zip(arg1);
  3585. resultobj = SWIG_From_int((int)(result));
  3586. return resultobj;
  3587. fail:
  3588. return NULL;
  3589. }
  3590. SWIGINTERN PyObject *_wrap_archive_read_support_format_ar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3591. PyObject *resultobj = 0;
  3592. struct archive *arg1 = (struct archive *) 0 ;
  3593. void *argp1 = 0 ;
  3594. int res1 = 0 ;
  3595. PyObject * obj0 = 0 ;
  3596. int result;
  3597. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_ar",&obj0)) SWIG_fail;
  3598. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3599. if (!SWIG_IsOK(res1)) {
  3600. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_ar" "', argument " "1"" of type '" "struct archive *""'");
  3601. }
  3602. arg1 = (struct archive *)(argp1);
  3603. result = (int)archive_read_support_format_ar(arg1);
  3604. resultobj = SWIG_From_int((int)(result));
  3605. return resultobj;
  3606. fail:
  3607. return NULL;
  3608. }
  3609. SWIGINTERN PyObject *_wrap_archive_read_support_format_cab(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3610. PyObject *resultobj = 0;
  3611. struct archive *arg1 = (struct archive *) 0 ;
  3612. void *argp1 = 0 ;
  3613. int res1 = 0 ;
  3614. PyObject * obj0 = 0 ;
  3615. int result;
  3616. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_cab",&obj0)) SWIG_fail;
  3617. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3618. if (!SWIG_IsOK(res1)) {
  3619. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_cab" "', argument " "1"" of type '" "struct archive *""'");
  3620. }
  3621. arg1 = (struct archive *)(argp1);
  3622. result = (int)archive_read_support_format_cab(arg1);
  3623. resultobj = SWIG_From_int((int)(result));
  3624. return resultobj;
  3625. fail:
  3626. return NULL;
  3627. }
  3628. SWIGINTERN PyObject *_wrap_archive_read_support_format_cpio(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3629. PyObject *resultobj = 0;
  3630. struct archive *arg1 = (struct archive *) 0 ;
  3631. void *argp1 = 0 ;
  3632. int res1 = 0 ;
  3633. PyObject * obj0 = 0 ;
  3634. int result;
  3635. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_cpio",&obj0)) SWIG_fail;
  3636. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3637. if (!SWIG_IsOK(res1)) {
  3638. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_cpio" "', argument " "1"" of type '" "struct archive *""'");
  3639. }
  3640. arg1 = (struct archive *)(argp1);
  3641. result = (int)archive_read_support_format_cpio(arg1);
  3642. resultobj = SWIG_From_int((int)(result));
  3643. return resultobj;
  3644. fail:
  3645. return NULL;
  3646. }
  3647. SWIGINTERN PyObject *_wrap_archive_read_support_format_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3648. PyObject *resultobj = 0;
  3649. struct archive *arg1 = (struct archive *) 0 ;
  3650. void *argp1 = 0 ;
  3651. int res1 = 0 ;
  3652. PyObject * obj0 = 0 ;
  3653. int result;
  3654. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_empty",&obj0)) SWIG_fail;
  3655. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3656. if (!SWIG_IsOK(res1)) {
  3657. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_empty" "', argument " "1"" of type '" "struct archive *""'");
  3658. }
  3659. arg1 = (struct archive *)(argp1);
  3660. result = (int)archive_read_support_format_empty(arg1);
  3661. resultobj = SWIG_From_int((int)(result));
  3662. return resultobj;
  3663. fail:
  3664. return NULL;
  3665. }
  3666. SWIGINTERN PyObject *_wrap_archive_read_support_format_gnutar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3667. PyObject *resultobj = 0;
  3668. struct archive *arg1 = (struct archive *) 0 ;
  3669. void *argp1 = 0 ;
  3670. int res1 = 0 ;
  3671. PyObject * obj0 = 0 ;
  3672. int result;
  3673. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_gnutar",&obj0)) SWIG_fail;
  3674. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3675. if (!SWIG_IsOK(res1)) {
  3676. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_gnutar" "', argument " "1"" of type '" "struct archive *""'");
  3677. }
  3678. arg1 = (struct archive *)(argp1);
  3679. result = (int)archive_read_support_format_gnutar(arg1);
  3680. resultobj = SWIG_From_int((int)(result));
  3681. return resultobj;
  3682. fail:
  3683. return NULL;
  3684. }
  3685. SWIGINTERN PyObject *_wrap_archive_read_support_format_iso9660(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3686. PyObject *resultobj = 0;
  3687. struct archive *arg1 = (struct archive *) 0 ;
  3688. void *argp1 = 0 ;
  3689. int res1 = 0 ;
  3690. PyObject * obj0 = 0 ;
  3691. int result;
  3692. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_iso9660",&obj0)) SWIG_fail;
  3693. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3694. if (!SWIG_IsOK(res1)) {
  3695. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_iso9660" "', argument " "1"" of type '" "struct archive *""'");
  3696. }
  3697. arg1 = (struct archive *)(argp1);
  3698. result = (int)archive_read_support_format_iso9660(arg1);
  3699. resultobj = SWIG_From_int((int)(result));
  3700. return resultobj;
  3701. fail:
  3702. return NULL;
  3703. }
  3704. SWIGINTERN PyObject *_wrap_archive_read_support_format_lha(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3705. PyObject *resultobj = 0;
  3706. struct archive *arg1 = (struct archive *) 0 ;
  3707. void *argp1 = 0 ;
  3708. int res1 = 0 ;
  3709. PyObject * obj0 = 0 ;
  3710. int result;
  3711. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_lha",&obj0)) SWIG_fail;
  3712. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3713. if (!SWIG_IsOK(res1)) {
  3714. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_lha" "', argument " "1"" of type '" "struct archive *""'");
  3715. }
  3716. arg1 = (struct archive *)(argp1);
  3717. result = (int)archive_read_support_format_lha(arg1);
  3718. resultobj = SWIG_From_int((int)(result));
  3719. return resultobj;
  3720. fail:
  3721. return NULL;
  3722. }
  3723. SWIGINTERN PyObject *_wrap_archive_read_support_format_rar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3724. PyObject *resultobj = 0;
  3725. struct archive *arg1 = (struct archive *) 0 ;
  3726. void *argp1 = 0 ;
  3727. int res1 = 0 ;
  3728. PyObject * obj0 = 0 ;
  3729. int result;
  3730. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_rar",&obj0)) SWIG_fail;
  3731. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3732. if (!SWIG_IsOK(res1)) {
  3733. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_rar" "', argument " "1"" of type '" "struct archive *""'");
  3734. }
  3735. arg1 = (struct archive *)(argp1);
  3736. result = (int)archive_read_support_format_rar(arg1);
  3737. resultobj = SWIG_From_int((int)(result));
  3738. return resultobj;
  3739. fail:
  3740. return NULL;
  3741. }
  3742. SWIGINTERN PyObject *_wrap_archive_read_support_format_raw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3743. PyObject *resultobj = 0;
  3744. struct archive *arg1 = (struct archive *) 0 ;
  3745. void *argp1 = 0 ;
  3746. int res1 = 0 ;
  3747. PyObject * obj0 = 0 ;
  3748. int result;
  3749. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_raw",&obj0)) SWIG_fail;
  3750. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3751. if (!SWIG_IsOK(res1)) {
  3752. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_raw" "', argument " "1"" of type '" "struct archive *""'");
  3753. }
  3754. arg1 = (struct archive *)(argp1);
  3755. result = (int)archive_read_support_format_raw(arg1);
  3756. resultobj = SWIG_From_int((int)(result));
  3757. return resultobj;
  3758. fail:
  3759. return NULL;
  3760. }
  3761. SWIGINTERN PyObject *_wrap_archive_read_support_format_tar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3762. PyObject *resultobj = 0;
  3763. struct archive *arg1 = (struct archive *) 0 ;
  3764. void *argp1 = 0 ;
  3765. int res1 = 0 ;
  3766. PyObject * obj0 = 0 ;
  3767. int result;
  3768. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_tar",&obj0)) SWIG_fail;
  3769. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3770. if (!SWIG_IsOK(res1)) {
  3771. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_tar" "', argument " "1"" of type '" "struct archive *""'");
  3772. }
  3773. arg1 = (struct archive *)(argp1);
  3774. result = (int)archive_read_support_format_tar(arg1);
  3775. resultobj = SWIG_From_int((int)(result));
  3776. return resultobj;
  3777. fail:
  3778. return NULL;
  3779. }
  3780. SWIGINTERN PyObject *_wrap_archive_read_support_format_xar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3781. PyObject *resultobj = 0;
  3782. struct archive *arg1 = (struct archive *) 0 ;
  3783. void *argp1 = 0 ;
  3784. int res1 = 0 ;
  3785. PyObject * obj0 = 0 ;
  3786. int result;
  3787. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_xar",&obj0)) SWIG_fail;
  3788. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3789. if (!SWIG_IsOK(res1)) {
  3790. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_xar" "', argument " "1"" of type '" "struct archive *""'");
  3791. }
  3792. arg1 = (struct archive *)(argp1);
  3793. result = (int)archive_read_support_format_xar(arg1);
  3794. resultobj = SWIG_From_int((int)(result));
  3795. return resultobj;
  3796. fail:
  3797. return NULL;
  3798. }
  3799. SWIGINTERN PyObject *_wrap_archive_read_support_format_zip(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3800. PyObject *resultobj = 0;
  3801. struct archive *arg1 = (struct archive *) 0 ;
  3802. void *argp1 = 0 ;
  3803. int res1 = 0 ;
  3804. PyObject * obj0 = 0 ;
  3805. int result;
  3806. if (!PyArg_ParseTuple(args,(char *)"O:archive_read_support_format_zip",&obj0)) SWIG_fail;
  3807. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3808. if (!SWIG_IsOK(res1)) {
  3809. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_support_format_zip" "', argument " "1"" of type '" "struct archive *""'");
  3810. }
  3811. arg1 = (struct archive *)(argp1);
  3812. result = (int)archive_read_support_format_zip(arg1);
  3813. resultobj = SWIG_From_int((int)(result));
  3814. return resultobj;
  3815. fail:
  3816. return NULL;
  3817. }
  3818. SWIGINTERN PyObject *_wrap_archive_write_new(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3819. PyObject *resultobj = 0;
  3820. struct archive *result = 0 ;
  3821. if (!PyArg_ParseTuple(args,(char *)":archive_write_new")) SWIG_fail;
  3822. result = (struct archive *)archive_write_new();
  3823. resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_archive, 0 | 0 );
  3824. return resultobj;
  3825. fail:
  3826. return NULL;
  3827. }
  3828. SWIGINTERN PyObject *_wrap_archive_write_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3829. PyObject *resultobj = 0;
  3830. struct archive *arg1 = (struct archive *) 0 ;
  3831. void *argp1 = 0 ;
  3832. int res1 = 0 ;
  3833. PyObject * obj0 = 0 ;
  3834. int result;
  3835. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_free",&obj0)) SWIG_fail;
  3836. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3837. if (!SWIG_IsOK(res1)) {
  3838. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_free" "', argument " "1"" of type '" "struct archive *""'");
  3839. }
  3840. arg1 = (struct archive *)(argp1);
  3841. result = (int)archive_write_free(arg1);
  3842. resultobj = SWIG_From_int((int)(result));
  3843. return resultobj;
  3844. fail:
  3845. return NULL;
  3846. }
  3847. SWIGINTERN PyObject *_wrap_archive_write_open(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3848. PyObject *resultobj = 0;
  3849. struct archive *arg1 = (struct archive *) 0 ;
  3850. void *arg2 = (void *) 0 ;
  3851. archive_open_callback *arg3 = (archive_open_callback *) 0 ;
  3852. archive_write_callback *arg4 = (archive_write_callback *) 0 ;
  3853. archive_close_callback *arg5 = (archive_close_callback *) 0 ;
  3854. void *argp1 = 0 ;
  3855. int res1 = 0 ;
  3856. int res2 ;
  3857. void *argp3 = 0 ;
  3858. int res3 = 0 ;
  3859. void *argp4 = 0 ;
  3860. int res4 = 0 ;
  3861. void *argp5 = 0 ;
  3862. int res5 = 0 ;
  3863. PyObject * obj0 = 0 ;
  3864. PyObject * obj1 = 0 ;
  3865. PyObject * obj2 = 0 ;
  3866. PyObject * obj3 = 0 ;
  3867. PyObject * obj4 = 0 ;
  3868. int result;
  3869. if (!PyArg_ParseTuple(args,(char *)"OOOOO:archive_write_open",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
  3870. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3871. if (!SWIG_IsOK(res1)) {
  3872. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_open" "', argument " "1"" of type '" "struct archive *""'");
  3873. }
  3874. arg1 = (struct archive *)(argp1);
  3875. res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0);
  3876. if (!SWIG_IsOK(res2)) {
  3877. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "archive_write_open" "', argument " "2"" of type '" "void *""'");
  3878. }
  3879. res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_archive_open_callback, 0 | 0 );
  3880. if (!SWIG_IsOK(res3)) {
  3881. SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "archive_write_open" "', argument " "3"" of type '" "archive_open_callback *""'");
  3882. }
  3883. arg3 = (archive_open_callback *)(argp3);
  3884. res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_archive_write_callback, 0 | 0 );
  3885. if (!SWIG_IsOK(res4)) {
  3886. SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "archive_write_open" "', argument " "4"" of type '" "archive_write_callback *""'");
  3887. }
  3888. arg4 = (archive_write_callback *)(argp4);
  3889. res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_archive_close_callback, 0 | 0 );
  3890. if (!SWIG_IsOK(res5)) {
  3891. SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "archive_write_open" "', argument " "5"" of type '" "archive_close_callback *""'");
  3892. }
  3893. arg5 = (archive_close_callback *)(argp5);
  3894. result = (int)archive_write_open(arg1,arg2,arg3,arg4,arg5);
  3895. resultobj = SWIG_From_int((int)(result));
  3896. return resultobj;
  3897. fail:
  3898. return NULL;
  3899. }
  3900. SWIGINTERN PyObject *_wrap_archive_write_open_fd(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3901. PyObject *resultobj = 0;
  3902. struct archive *arg1 = (struct archive *) 0 ;
  3903. int arg2 ;
  3904. void *argp1 = 0 ;
  3905. int res1 = 0 ;
  3906. int val2 ;
  3907. int ecode2 = 0 ;
  3908. PyObject * obj0 = 0 ;
  3909. PyObject * obj1 = 0 ;
  3910. int result;
  3911. if (!PyArg_ParseTuple(args,(char *)"OO:archive_write_open_fd",&obj0,&obj1)) SWIG_fail;
  3912. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3913. if (!SWIG_IsOK(res1)) {
  3914. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_open_fd" "', argument " "1"" of type '" "struct archive *""'");
  3915. }
  3916. arg1 = (struct archive *)(argp1);
  3917. ecode2 = SWIG_AsVal_int(obj1, &val2);
  3918. if (!SWIG_IsOK(ecode2)) {
  3919. SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "archive_write_open_fd" "', argument " "2"" of type '" "int""'");
  3920. }
  3921. arg2 = (int)(val2);
  3922. result = (int)archive_write_open_fd(arg1,arg2);
  3923. resultobj = SWIG_From_int((int)(result));
  3924. return resultobj;
  3925. fail:
  3926. return NULL;
  3927. }
  3928. SWIGINTERN PyObject *_wrap_archive_write_open_filename(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3929. PyObject *resultobj = 0;
  3930. struct archive *arg1 = (struct archive *) 0 ;
  3931. char *arg2 = (char *) 0 ;
  3932. void *argp1 = 0 ;
  3933. int res1 = 0 ;
  3934. int res2 ;
  3935. char *buf2 = 0 ;
  3936. int alloc2 = 0 ;
  3937. PyObject * obj0 = 0 ;
  3938. PyObject * obj1 = 0 ;
  3939. int result;
  3940. if (!PyArg_ParseTuple(args,(char *)"OO:archive_write_open_filename",&obj0,&obj1)) SWIG_fail;
  3941. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3942. if (!SWIG_IsOK(res1)) {
  3943. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_open_filename" "', argument " "1"" of type '" "struct archive *""'");
  3944. }
  3945. arg1 = (struct archive *)(argp1);
  3946. res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
  3947. if (!SWIG_IsOK(res2)) {
  3948. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "archive_write_open_filename" "', argument " "2"" of type '" "char const *""'");
  3949. }
  3950. arg2 = (char *)(buf2);
  3951. result = (int)archive_write_open_filename(arg1,(char const *)arg2);
  3952. resultobj = SWIG_From_int((int)(result));
  3953. if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  3954. return resultobj;
  3955. fail:
  3956. if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  3957. return NULL;
  3958. }
  3959. SWIGINTERN PyObject *_wrap_archive_write_open_filename_w(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3960. PyObject *resultobj = 0;
  3961. struct archive *arg1 = (struct archive *) 0 ;
  3962. wchar_t *arg2 = (wchar_t *) 0 ;
  3963. void *argp1 = 0 ;
  3964. int res1 = 0 ;
  3965. void *argp2 = 0 ;
  3966. int res2 = 0 ;
  3967. PyObject * obj0 = 0 ;
  3968. PyObject * obj1 = 0 ;
  3969. int result;
  3970. if (!PyArg_ParseTuple(args,(char *)"OO:archive_write_open_filename_w",&obj0,&obj1)) SWIG_fail;
  3971. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  3972. if (!SWIG_IsOK(res1)) {
  3973. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_open_filename_w" "', argument " "1"" of type '" "struct archive *""'");
  3974. }
  3975. arg1 = (struct archive *)(argp1);
  3976. res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_wchar_t, 0 | 0 );
  3977. if (!SWIG_IsOK(res2)) {
  3978. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "archive_write_open_filename_w" "', argument " "2"" of type '" "wchar_t const *""'");
  3979. }
  3980. arg2 = (wchar_t *)(argp2);
  3981. result = (int)archive_write_open_filename_w(arg1,(wchar_t const *)arg2);
  3982. resultobj = SWIG_From_int((int)(result));
  3983. return resultobj;
  3984. fail:
  3985. return NULL;
  3986. }
  3987. SWIGINTERN PyObject *_wrap_archive_write_open_memory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  3988. PyObject *resultobj = 0;
  3989. struct archive *arg1 = (struct archive *) 0 ;
  3990. void *arg2 = (void *) 0 ;
  3991. size_t arg3 ;
  3992. size_t *arg4 = (size_t *) 0 ;
  3993. void *argp1 = 0 ;
  3994. int res1 = 0 ;
  3995. int res2 ;
  3996. size_t val3 ;
  3997. int ecode3 = 0 ;
  3998. void *argp4 = 0 ;
  3999. int res4 = 0 ;
  4000. PyObject * obj0 = 0 ;
  4001. PyObject * obj1 = 0 ;
  4002. PyObject * obj2 = 0 ;
  4003. PyObject * obj3 = 0 ;
  4004. int result;
  4005. if (!PyArg_ParseTuple(args,(char *)"OOOO:archive_write_open_memory",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
  4006. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4007. if (!SWIG_IsOK(res1)) {
  4008. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_open_memory" "', argument " "1"" of type '" "struct archive *""'");
  4009. }
  4010. arg1 = (struct archive *)(argp1);
  4011. res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0);
  4012. if (!SWIG_IsOK(res2)) {
  4013. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "archive_write_open_memory" "', argument " "2"" of type '" "void *""'");
  4014. }
  4015. ecode3 = SWIG_AsVal_size_t(obj2, &val3);
  4016. if (!SWIG_IsOK(ecode3)) {
  4017. SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "archive_write_open_memory" "', argument " "3"" of type '" "size_t""'");
  4018. }
  4019. arg3 = (size_t)(val3);
  4020. res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_size_t, 0 | 0 );
  4021. if (!SWIG_IsOK(res4)) {
  4022. SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "archive_write_open_memory" "', argument " "4"" of type '" "size_t *""'");
  4023. }
  4024. arg4 = (size_t *)(argp4);
  4025. result = (int)archive_write_open_memory(arg1,arg2,arg3,arg4);
  4026. resultobj = SWIG_From_int((int)(result));
  4027. return resultobj;
  4028. fail:
  4029. return NULL;
  4030. }
  4031. SWIGINTERN PyObject *_wrap_archive_write_close(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4032. PyObject *resultobj = 0;
  4033. struct archive *arg1 = (struct archive *) 0 ;
  4034. void *argp1 = 0 ;
  4035. int res1 = 0 ;
  4036. PyObject * obj0 = 0 ;
  4037. int result;
  4038. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_close",&obj0)) SWIG_fail;
  4039. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4040. if (!SWIG_IsOK(res1)) {
  4041. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_close" "', argument " "1"" of type '" "struct archive *""'");
  4042. }
  4043. arg1 = (struct archive *)(argp1);
  4044. result = (int)archive_write_close(arg1);
  4045. resultobj = SWIG_From_int((int)(result));
  4046. return resultobj;
  4047. fail:
  4048. return NULL;
  4049. }
  4050. SWIGINTERN PyObject *_wrap_archive_write_header(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4051. PyObject *resultobj = 0;
  4052. struct archive *arg1 = (struct archive *) 0 ;
  4053. struct archive_entry *arg2 = (struct archive_entry *) 0 ;
  4054. void *argp1 = 0 ;
  4055. int res1 = 0 ;
  4056. void *argp2 = 0 ;
  4057. int res2 = 0 ;
  4058. PyObject * obj0 = 0 ;
  4059. PyObject * obj1 = 0 ;
  4060. int result;
  4061. if (!PyArg_ParseTuple(args,(char *)"OO:archive_write_header",&obj0,&obj1)) SWIG_fail;
  4062. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4063. if (!SWIG_IsOK(res1)) {
  4064. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_header" "', argument " "1"" of type '" "struct archive *""'");
  4065. }
  4066. arg1 = (struct archive *)(argp1);
  4067. res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_archive_entry, 0 | 0 );
  4068. if (!SWIG_IsOK(res2)) {
  4069. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "archive_write_header" "', argument " "2"" of type '" "struct archive_entry *""'");
  4070. }
  4071. arg2 = (struct archive_entry *)(argp2);
  4072. result = (int)archive_write_header(arg1,arg2);
  4073. resultobj = SWIG_From_int((int)(result));
  4074. return resultobj;
  4075. fail:
  4076. return NULL;
  4077. }
  4078. SWIGINTERN PyObject *_wrap_archive_write_finish_entry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4079. PyObject *resultobj = 0;
  4080. struct archive *arg1 = (struct archive *) 0 ;
  4081. void *argp1 = 0 ;
  4082. int res1 = 0 ;
  4083. PyObject * obj0 = 0 ;
  4084. int result;
  4085. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_finish_entry",&obj0)) SWIG_fail;
  4086. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4087. if (!SWIG_IsOK(res1)) {
  4088. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_finish_entry" "', argument " "1"" of type '" "struct archive *""'");
  4089. }
  4090. arg1 = (struct archive *)(argp1);
  4091. result = (int)archive_write_finish_entry(arg1);
  4092. resultobj = SWIG_From_int((int)(result));
  4093. return resultobj;
  4094. fail:
  4095. return NULL;
  4096. }
  4097. SWIGINTERN PyObject *_wrap_archive_write_add_filter_bzip2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4098. PyObject *resultobj = 0;
  4099. struct archive *arg1 = (struct archive *) 0 ;
  4100. void *argp1 = 0 ;
  4101. int res1 = 0 ;
  4102. PyObject * obj0 = 0 ;
  4103. int result;
  4104. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_add_filter_bzip2",&obj0)) SWIG_fail;
  4105. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4106. if (!SWIG_IsOK(res1)) {
  4107. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_add_filter_bzip2" "', argument " "1"" of type '" "struct archive *""'");
  4108. }
  4109. arg1 = (struct archive *)(argp1);
  4110. result = (int)archive_write_add_filter_bzip2(arg1);
  4111. resultobj = SWIG_From_int((int)(result));
  4112. return resultobj;
  4113. fail:
  4114. return NULL;
  4115. }
  4116. SWIGINTERN PyObject *_wrap_archive_write_add_filter_compress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4117. PyObject *resultobj = 0;
  4118. struct archive *arg1 = (struct archive *) 0 ;
  4119. void *argp1 = 0 ;
  4120. int res1 = 0 ;
  4121. PyObject * obj0 = 0 ;
  4122. int result;
  4123. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_add_filter_compress",&obj0)) SWIG_fail;
  4124. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4125. if (!SWIG_IsOK(res1)) {
  4126. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_add_filter_compress" "', argument " "1"" of type '" "struct archive *""'");
  4127. }
  4128. arg1 = (struct archive *)(argp1);
  4129. result = (int)archive_write_add_filter_compress(arg1);
  4130. resultobj = SWIG_From_int((int)(result));
  4131. return resultobj;
  4132. fail:
  4133. return NULL;
  4134. }
  4135. SWIGINTERN PyObject *_wrap_archive_write_add_filter_gzip(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4136. PyObject *resultobj = 0;
  4137. struct archive *arg1 = (struct archive *) 0 ;
  4138. void *argp1 = 0 ;
  4139. int res1 = 0 ;
  4140. PyObject * obj0 = 0 ;
  4141. int result;
  4142. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_add_filter_gzip",&obj0)) SWIG_fail;
  4143. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4144. if (!SWIG_IsOK(res1)) {
  4145. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_add_filter_gzip" "', argument " "1"" of type '" "struct archive *""'");
  4146. }
  4147. arg1 = (struct archive *)(argp1);
  4148. result = (int)archive_write_add_filter_gzip(arg1);
  4149. resultobj = SWIG_From_int((int)(result));
  4150. return resultobj;
  4151. fail:
  4152. return NULL;
  4153. }
  4154. SWIGINTERN PyObject *_wrap_archive_write_add_filter_lzip(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4155. PyObject *resultobj = 0;
  4156. struct archive *arg1 = (struct archive *) 0 ;
  4157. void *argp1 = 0 ;
  4158. int res1 = 0 ;
  4159. PyObject * obj0 = 0 ;
  4160. int result;
  4161. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_add_filter_lzip",&obj0)) SWIG_fail;
  4162. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4163. if (!SWIG_IsOK(res1)) {
  4164. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_add_filter_lzip" "', argument " "1"" of type '" "struct archive *""'");
  4165. }
  4166. arg1 = (struct archive *)(argp1);
  4167. result = (int)archive_write_add_filter_lzip(arg1);
  4168. resultobj = SWIG_From_int((int)(result));
  4169. return resultobj;
  4170. fail:
  4171. return NULL;
  4172. }
  4173. SWIGINTERN PyObject *_wrap_archive_write_add_filter_lzma(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4174. PyObject *resultobj = 0;
  4175. struct archive *arg1 = (struct archive *) 0 ;
  4176. void *argp1 = 0 ;
  4177. int res1 = 0 ;
  4178. PyObject * obj0 = 0 ;
  4179. int result;
  4180. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_add_filter_lzma",&obj0)) SWIG_fail;
  4181. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4182. if (!SWIG_IsOK(res1)) {
  4183. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_add_filter_lzma" "', argument " "1"" of type '" "struct archive *""'");
  4184. }
  4185. arg1 = (struct archive *)(argp1);
  4186. result = (int)archive_write_add_filter_lzma(arg1);
  4187. resultobj = SWIG_From_int((int)(result));
  4188. return resultobj;
  4189. fail:
  4190. return NULL;
  4191. }
  4192. SWIGINTERN PyObject *_wrap_archive_write_add_filter_none(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4193. PyObject *resultobj = 0;
  4194. struct archive *arg1 = (struct archive *) 0 ;
  4195. void *argp1 = 0 ;
  4196. int res1 = 0 ;
  4197. PyObject * obj0 = 0 ;
  4198. int result;
  4199. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_add_filter_none",&obj0)) SWIG_fail;
  4200. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4201. if (!SWIG_IsOK(res1)) {
  4202. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_add_filter_none" "', argument " "1"" of type '" "struct archive *""'");
  4203. }
  4204. arg1 = (struct archive *)(argp1);
  4205. result = (int)archive_write_add_filter_none(arg1);
  4206. resultobj = SWIG_From_int((int)(result));
  4207. return resultobj;
  4208. fail:
  4209. return NULL;
  4210. }
  4211. SWIGINTERN PyObject *_wrap_archive_write_add_filter_xz(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4212. PyObject *resultobj = 0;
  4213. struct archive *arg1 = (struct archive *) 0 ;
  4214. void *argp1 = 0 ;
  4215. int res1 = 0 ;
  4216. PyObject * obj0 = 0 ;
  4217. int result;
  4218. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_add_filter_xz",&obj0)) SWIG_fail;
  4219. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4220. if (!SWIG_IsOK(res1)) {
  4221. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_add_filter_xz" "', argument " "1"" of type '" "struct archive *""'");
  4222. }
  4223. arg1 = (struct archive *)(argp1);
  4224. result = (int)archive_write_add_filter_xz(arg1);
  4225. resultobj = SWIG_From_int((int)(result));
  4226. return resultobj;
  4227. fail:
  4228. return NULL;
  4229. }
  4230. SWIGINTERN PyObject *_wrap_archive_write_set_format(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4231. PyObject *resultobj = 0;
  4232. struct archive *arg1 = (struct archive *) 0 ;
  4233. int arg2 ;
  4234. void *argp1 = 0 ;
  4235. int res1 = 0 ;
  4236. int val2 ;
  4237. int ecode2 = 0 ;
  4238. PyObject * obj0 = 0 ;
  4239. PyObject * obj1 = 0 ;
  4240. int result;
  4241. if (!PyArg_ParseTuple(args,(char *)"OO:archive_write_set_format",&obj0,&obj1)) SWIG_fail;
  4242. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4243. if (!SWIG_IsOK(res1)) {
  4244. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format" "', argument " "1"" of type '" "struct archive *""'");
  4245. }
  4246. arg1 = (struct archive *)(argp1);
  4247. ecode2 = SWIG_AsVal_int(obj1, &val2);
  4248. if (!SWIG_IsOK(ecode2)) {
  4249. SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "archive_write_set_format" "', argument " "2"" of type '" "int""'");
  4250. }
  4251. arg2 = (int)(val2);
  4252. result = (int)archive_write_set_format(arg1,arg2);
  4253. resultobj = SWIG_From_int((int)(result));
  4254. return resultobj;
  4255. fail:
  4256. return NULL;
  4257. }
  4258. SWIGINTERN PyObject *_wrap_archive_write_set_format_by_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4259. PyObject *resultobj = 0;
  4260. struct archive *arg1 = (struct archive *) 0 ;
  4261. char *arg2 = (char *) 0 ;
  4262. void *argp1 = 0 ;
  4263. int res1 = 0 ;
  4264. int res2 ;
  4265. char *buf2 = 0 ;
  4266. int alloc2 = 0 ;
  4267. PyObject * obj0 = 0 ;
  4268. PyObject * obj1 = 0 ;
  4269. int result;
  4270. if (!PyArg_ParseTuple(args,(char *)"OO:archive_write_set_format_by_name",&obj0,&obj1)) SWIG_fail;
  4271. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4272. if (!SWIG_IsOK(res1)) {
  4273. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_by_name" "', argument " "1"" of type '" "struct archive *""'");
  4274. }
  4275. arg1 = (struct archive *)(argp1);
  4276. res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
  4277. if (!SWIG_IsOK(res2)) {
  4278. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "archive_write_set_format_by_name" "', argument " "2"" of type '" "char const *""'");
  4279. }
  4280. arg2 = (char *)(buf2);
  4281. result = (int)archive_write_set_format_by_name(arg1,(char const *)arg2);
  4282. resultobj = SWIG_From_int((int)(result));
  4283. if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  4284. return resultobj;
  4285. fail:
  4286. if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  4287. return NULL;
  4288. }
  4289. SWIGINTERN PyObject *_wrap_archive_write_set_format_ar_bsd(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4290. PyObject *resultobj = 0;
  4291. struct archive *arg1 = (struct archive *) 0 ;
  4292. void *argp1 = 0 ;
  4293. int res1 = 0 ;
  4294. PyObject * obj0 = 0 ;
  4295. int result;
  4296. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_ar_bsd",&obj0)) SWIG_fail;
  4297. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4298. if (!SWIG_IsOK(res1)) {
  4299. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_ar_bsd" "', argument " "1"" of type '" "struct archive *""'");
  4300. }
  4301. arg1 = (struct archive *)(argp1);
  4302. result = (int)archive_write_set_format_ar_bsd(arg1);
  4303. resultobj = SWIG_From_int((int)(result));
  4304. return resultobj;
  4305. fail:
  4306. return NULL;
  4307. }
  4308. SWIGINTERN PyObject *_wrap_archive_write_set_format_ar_svr4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4309. PyObject *resultobj = 0;
  4310. struct archive *arg1 = (struct archive *) 0 ;
  4311. void *argp1 = 0 ;
  4312. int res1 = 0 ;
  4313. PyObject * obj0 = 0 ;
  4314. int result;
  4315. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_ar_svr4",&obj0)) SWIG_fail;
  4316. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4317. if (!SWIG_IsOK(res1)) {
  4318. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_ar_svr4" "', argument " "1"" of type '" "struct archive *""'");
  4319. }
  4320. arg1 = (struct archive *)(argp1);
  4321. result = (int)archive_write_set_format_ar_svr4(arg1);
  4322. resultobj = SWIG_From_int((int)(result));
  4323. return resultobj;
  4324. fail:
  4325. return NULL;
  4326. }
  4327. SWIGINTERN PyObject *_wrap_archive_write_set_format_cpio(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4328. PyObject *resultobj = 0;
  4329. struct archive *arg1 = (struct archive *) 0 ;
  4330. void *argp1 = 0 ;
  4331. int res1 = 0 ;
  4332. PyObject * obj0 = 0 ;
  4333. int result;
  4334. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_cpio",&obj0)) SWIG_fail;
  4335. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4336. if (!SWIG_IsOK(res1)) {
  4337. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_cpio" "', argument " "1"" of type '" "struct archive *""'");
  4338. }
  4339. arg1 = (struct archive *)(argp1);
  4340. result = (int)archive_write_set_format_cpio(arg1);
  4341. resultobj = SWIG_From_int((int)(result));
  4342. return resultobj;
  4343. fail:
  4344. return NULL;
  4345. }
  4346. SWIGINTERN PyObject *_wrap_archive_write_set_format_cpio_newc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4347. PyObject *resultobj = 0;
  4348. struct archive *arg1 = (struct archive *) 0 ;
  4349. void *argp1 = 0 ;
  4350. int res1 = 0 ;
  4351. PyObject * obj0 = 0 ;
  4352. int result;
  4353. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_cpio_newc",&obj0)) SWIG_fail;
  4354. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4355. if (!SWIG_IsOK(res1)) {
  4356. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_cpio_newc" "', argument " "1"" of type '" "struct archive *""'");
  4357. }
  4358. arg1 = (struct archive *)(argp1);
  4359. result = (int)archive_write_set_format_cpio_newc(arg1);
  4360. resultobj = SWIG_From_int((int)(result));
  4361. return resultobj;
  4362. fail:
  4363. return NULL;
  4364. }
  4365. SWIGINTERN PyObject *_wrap_archive_write_set_format_gnutar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4366. PyObject *resultobj = 0;
  4367. struct archive *arg1 = (struct archive *) 0 ;
  4368. void *argp1 = 0 ;
  4369. int res1 = 0 ;
  4370. PyObject * obj0 = 0 ;
  4371. int result;
  4372. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_gnutar",&obj0)) SWIG_fail;
  4373. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4374. if (!SWIG_IsOK(res1)) {
  4375. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_gnutar" "', argument " "1"" of type '" "struct archive *""'");
  4376. }
  4377. arg1 = (struct archive *)(argp1);
  4378. result = (int)archive_write_set_format_gnutar(arg1);
  4379. resultobj = SWIG_From_int((int)(result));
  4380. return resultobj;
  4381. fail:
  4382. return NULL;
  4383. }
  4384. SWIGINTERN PyObject *_wrap_archive_write_set_format_iso9660(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4385. PyObject *resultobj = 0;
  4386. struct archive *arg1 = (struct archive *) 0 ;
  4387. void *argp1 = 0 ;
  4388. int res1 = 0 ;
  4389. PyObject * obj0 = 0 ;
  4390. int result;
  4391. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_iso9660",&obj0)) SWIG_fail;
  4392. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4393. if (!SWIG_IsOK(res1)) {
  4394. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_iso9660" "', argument " "1"" of type '" "struct archive *""'");
  4395. }
  4396. arg1 = (struct archive *)(argp1);
  4397. result = (int)archive_write_set_format_iso9660(arg1);
  4398. resultobj = SWIG_From_int((int)(result));
  4399. return resultobj;
  4400. fail:
  4401. return NULL;
  4402. }
  4403. SWIGINTERN PyObject *_wrap_archive_write_set_format_pax(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4404. PyObject *resultobj = 0;
  4405. struct archive *arg1 = (struct archive *) 0 ;
  4406. void *argp1 = 0 ;
  4407. int res1 = 0 ;
  4408. PyObject * obj0 = 0 ;
  4409. int result;
  4410. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_pax",&obj0)) SWIG_fail;
  4411. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4412. if (!SWIG_IsOK(res1)) {
  4413. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_pax" "', argument " "1"" of type '" "struct archive *""'");
  4414. }
  4415. arg1 = (struct archive *)(argp1);
  4416. result = (int)archive_write_set_format_pax(arg1);
  4417. resultobj = SWIG_From_int((int)(result));
  4418. return resultobj;
  4419. fail:
  4420. return NULL;
  4421. }
  4422. SWIGINTERN PyObject *_wrap_archive_write_set_format_pax_restricted(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4423. PyObject *resultobj = 0;
  4424. struct archive *arg1 = (struct archive *) 0 ;
  4425. void *argp1 = 0 ;
  4426. int res1 = 0 ;
  4427. PyObject * obj0 = 0 ;
  4428. int result;
  4429. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_pax_restricted",&obj0)) SWIG_fail;
  4430. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4431. if (!SWIG_IsOK(res1)) {
  4432. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_pax_restricted" "', argument " "1"" of type '" "struct archive *""'");
  4433. }
  4434. arg1 = (struct archive *)(argp1);
  4435. result = (int)archive_write_set_format_pax_restricted(arg1);
  4436. resultobj = SWIG_From_int((int)(result));
  4437. return resultobj;
  4438. fail:
  4439. return NULL;
  4440. }
  4441. SWIGINTERN PyObject *_wrap_archive_write_set_format_shar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4442. PyObject *resultobj = 0;
  4443. struct archive *arg1 = (struct archive *) 0 ;
  4444. void *argp1 = 0 ;
  4445. int res1 = 0 ;
  4446. PyObject * obj0 = 0 ;
  4447. int result;
  4448. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_shar",&obj0)) SWIG_fail;
  4449. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4450. if (!SWIG_IsOK(res1)) {
  4451. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_shar" "', argument " "1"" of type '" "struct archive *""'");
  4452. }
  4453. arg1 = (struct archive *)(argp1);
  4454. result = (int)archive_write_set_format_shar(arg1);
  4455. resultobj = SWIG_From_int((int)(result));
  4456. return resultobj;
  4457. fail:
  4458. return NULL;
  4459. }
  4460. SWIGINTERN PyObject *_wrap_archive_write_set_format_shar_dump(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4461. PyObject *resultobj = 0;
  4462. struct archive *arg1 = (struct archive *) 0 ;
  4463. void *argp1 = 0 ;
  4464. int res1 = 0 ;
  4465. PyObject * obj0 = 0 ;
  4466. int result;
  4467. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_shar_dump",&obj0)) SWIG_fail;
  4468. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4469. if (!SWIG_IsOK(res1)) {
  4470. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_shar_dump" "', argument " "1"" of type '" "struct archive *""'");
  4471. }
  4472. arg1 = (struct archive *)(argp1);
  4473. result = (int)archive_write_set_format_shar_dump(arg1);
  4474. resultobj = SWIG_From_int((int)(result));
  4475. return resultobj;
  4476. fail:
  4477. return NULL;
  4478. }
  4479. SWIGINTERN PyObject *_wrap_archive_write_set_format_ustar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4480. PyObject *resultobj = 0;
  4481. struct archive *arg1 = (struct archive *) 0 ;
  4482. void *argp1 = 0 ;
  4483. int res1 = 0 ;
  4484. PyObject * obj0 = 0 ;
  4485. int result;
  4486. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_ustar",&obj0)) SWIG_fail;
  4487. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4488. if (!SWIG_IsOK(res1)) {
  4489. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_ustar" "', argument " "1"" of type '" "struct archive *""'");
  4490. }
  4491. arg1 = (struct archive *)(argp1);
  4492. result = (int)archive_write_set_format_ustar(arg1);
  4493. resultobj = SWIG_From_int((int)(result));
  4494. return resultobj;
  4495. fail:
  4496. return NULL;
  4497. }
  4498. SWIGINTERN PyObject *_wrap_archive_write_set_format_xar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4499. PyObject *resultobj = 0;
  4500. struct archive *arg1 = (struct archive *) 0 ;
  4501. void *argp1 = 0 ;
  4502. int res1 = 0 ;
  4503. PyObject * obj0 = 0 ;
  4504. int result;
  4505. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_xar",&obj0)) SWIG_fail;
  4506. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4507. if (!SWIG_IsOK(res1)) {
  4508. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_xar" "', argument " "1"" of type '" "struct archive *""'");
  4509. }
  4510. arg1 = (struct archive *)(argp1);
  4511. result = (int)archive_write_set_format_xar(arg1);
  4512. resultobj = SWIG_From_int((int)(result));
  4513. return resultobj;
  4514. fail:
  4515. return NULL;
  4516. }
  4517. SWIGINTERN PyObject *_wrap_archive_write_set_format_zip(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4518. PyObject *resultobj = 0;
  4519. struct archive *arg1 = (struct archive *) 0 ;
  4520. void *argp1 = 0 ;
  4521. int res1 = 0 ;
  4522. PyObject * obj0 = 0 ;
  4523. int result;
  4524. if (!PyArg_ParseTuple(args,(char *)"O:archive_write_set_format_zip",&obj0)) SWIG_fail;
  4525. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4526. if (!SWIG_IsOK(res1)) {
  4527. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_set_format_zip" "', argument " "1"" of type '" "struct archive *""'");
  4528. }
  4529. arg1 = (struct archive *)(argp1);
  4530. result = (int)archive_write_set_format_zip(arg1);
  4531. resultobj = SWIG_From_int((int)(result));
  4532. return resultobj;
  4533. fail:
  4534. return NULL;
  4535. }
  4536. SWIGINTERN PyObject *_wrap_archive_entry_new(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4537. PyObject *resultobj = 0;
  4538. struct archive_entry *result = 0 ;
  4539. if (!PyArg_ParseTuple(args,(char *)":archive_entry_new")) SWIG_fail;
  4540. result = (struct archive_entry *)archive_entry_new();
  4541. resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_archive_entry, 0 | 0 );
  4542. return resultobj;
  4543. fail:
  4544. return NULL;
  4545. }
  4546. SWIGINTERN PyObject *_wrap_archive_entry_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4547. PyObject *resultobj = 0;
  4548. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  4549. void *argp1 = 0 ;
  4550. int res1 = 0 ;
  4551. PyObject * obj0 = 0 ;
  4552. if (!PyArg_ParseTuple(args,(char *)"O:archive_entry_free",&obj0)) SWIG_fail;
  4553. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  4554. if (!SWIG_IsOK(res1)) {
  4555. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_free" "', argument " "1"" of type '" "struct archive_entry *""'");
  4556. }
  4557. arg1 = (struct archive_entry *)(argp1);
  4558. archive_entry_free(arg1);
  4559. resultobj = SWIG_Py_Void();
  4560. return resultobj;
  4561. fail:
  4562. return NULL;
  4563. }
  4564. SWIGINTERN PyObject *_wrap_archive_entry_pathname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4565. PyObject *resultobj = 0;
  4566. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  4567. void *argp1 = 0 ;
  4568. int res1 = 0 ;
  4569. PyObject * obj0 = 0 ;
  4570. char *result = 0 ;
  4571. if (!PyArg_ParseTuple(args,(char *)"O:archive_entry_pathname",&obj0)) SWIG_fail;
  4572. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  4573. if (!SWIG_IsOK(res1)) {
  4574. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_pathname" "', argument " "1"" of type '" "struct archive_entry *""'");
  4575. }
  4576. arg1 = (struct archive_entry *)(argp1);
  4577. result = (char *)archive_entry_pathname(arg1);
  4578. resultobj = SWIG_FromCharPtr((const char *)result);
  4579. return resultobj;
  4580. fail:
  4581. return NULL;
  4582. }
  4583. SWIGINTERN PyObject *_wrap_archive_entry_pathname_w(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4584. PyObject *resultobj = 0;
  4585. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  4586. void *argp1 = 0 ;
  4587. int res1 = 0 ;
  4588. PyObject * obj0 = 0 ;
  4589. wchar_t *result = 0 ;
  4590. if (!PyArg_ParseTuple(args,(char *)"O:archive_entry_pathname_w",&obj0)) SWIG_fail;
  4591. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  4592. if (!SWIG_IsOK(res1)) {
  4593. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_pathname_w" "', argument " "1"" of type '" "struct archive_entry *""'");
  4594. }
  4595. arg1 = (struct archive_entry *)(argp1);
  4596. result = (wchar_t *)archive_entry_pathname_w(arg1);
  4597. resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_wchar_t, 0 | 0 );
  4598. return resultobj;
  4599. fail:
  4600. return NULL;
  4601. }
  4602. SWIGINTERN PyObject *_wrap_archive_entry_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4603. PyObject *resultobj = 0;
  4604. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  4605. void *argp1 = 0 ;
  4606. int res1 = 0 ;
  4607. PyObject * obj0 = 0 ;
  4608. int64_t result;
  4609. if (!PyArg_ParseTuple(args,(char *)"O:archive_entry_size",&obj0)) SWIG_fail;
  4610. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  4611. if (!SWIG_IsOK(res1)) {
  4612. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_size" "', argument " "1"" of type '" "struct archive_entry *""'");
  4613. }
  4614. arg1 = (struct archive_entry *)(argp1);
  4615. result = archive_entry_size(arg1);
  4616. {
  4617. resultobj = PyLong_FromLong((long)result);
  4618. }
  4619. return resultobj;
  4620. fail:
  4621. return NULL;
  4622. }
  4623. SWIGINTERN PyObject *_wrap_archive_entry_mtime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4624. PyObject *resultobj = 0;
  4625. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  4626. void *argp1 = 0 ;
  4627. int res1 = 0 ;
  4628. PyObject * obj0 = 0 ;
  4629. time_t result;
  4630. if (!PyArg_ParseTuple(args,(char *)"O:archive_entry_mtime",&obj0)) SWIG_fail;
  4631. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  4632. if (!SWIG_IsOK(res1)) {
  4633. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_mtime" "', argument " "1"" of type '" "struct archive_entry *""'");
  4634. }
  4635. arg1 = (struct archive_entry *)(argp1);
  4636. result = archive_entry_mtime(arg1);
  4637. {
  4638. resultobj = PyLong_FromLong((long)result);
  4639. }
  4640. return resultobj;
  4641. fail:
  4642. return NULL;
  4643. }
  4644. SWIGINTERN PyObject *_wrap_archive_entry_filetype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4645. PyObject *resultobj = 0;
  4646. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  4647. void *argp1 = 0 ;
  4648. int res1 = 0 ;
  4649. PyObject * obj0 = 0 ;
  4650. mode_t result;
  4651. if (!PyArg_ParseTuple(args,(char *)"O:archive_entry_filetype",&obj0)) SWIG_fail;
  4652. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  4653. if (!SWIG_IsOK(res1)) {
  4654. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_filetype" "', argument " "1"" of type '" "struct archive_entry *""'");
  4655. }
  4656. arg1 = (struct archive_entry *)(argp1);
  4657. result = (mode_t)archive_entry_filetype(arg1);
  4658. resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result));
  4659. return resultobj;
  4660. fail:
  4661. return NULL;
  4662. }
  4663. SWIGINTERN PyObject *_wrap_archive_entry_perm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4664. PyObject *resultobj = 0;
  4665. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  4666. void *argp1 = 0 ;
  4667. int res1 = 0 ;
  4668. PyObject * obj0 = 0 ;
  4669. mode_t result;
  4670. if (!PyArg_ParseTuple(args,(char *)"O:archive_entry_perm",&obj0)) SWIG_fail;
  4671. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  4672. if (!SWIG_IsOK(res1)) {
  4673. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_perm" "', argument " "1"" of type '" "struct archive_entry *""'");
  4674. }
  4675. arg1 = (struct archive_entry *)(argp1);
  4676. result = (mode_t)archive_entry_perm(arg1);
  4677. resultobj = SWIG_From_unsigned_SS_short((unsigned short)(result));
  4678. return resultobj;
  4679. fail:
  4680. return NULL;
  4681. }
  4682. SWIGINTERN PyObject *_wrap_archive_entry_set_pathname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4683. PyObject *resultobj = 0;
  4684. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  4685. char *arg2 = (char *) 0 ;
  4686. void *argp1 = 0 ;
  4687. int res1 = 0 ;
  4688. int res2 ;
  4689. char *buf2 = 0 ;
  4690. int alloc2 = 0 ;
  4691. PyObject * obj0 = 0 ;
  4692. PyObject * obj1 = 0 ;
  4693. if (!PyArg_ParseTuple(args,(char *)"OO:archive_entry_set_pathname",&obj0,&obj1)) SWIG_fail;
  4694. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  4695. if (!SWIG_IsOK(res1)) {
  4696. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_set_pathname" "', argument " "1"" of type '" "struct archive_entry *""'");
  4697. }
  4698. arg1 = (struct archive_entry *)(argp1);
  4699. res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
  4700. if (!SWIG_IsOK(res2)) {
  4701. SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "archive_entry_set_pathname" "', argument " "2"" of type '" "char const *""'");
  4702. }
  4703. arg2 = (char *)(buf2);
  4704. archive_entry_set_pathname(arg1,(char const *)arg2);
  4705. resultobj = SWIG_Py_Void();
  4706. if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  4707. return resultobj;
  4708. fail:
  4709. if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  4710. return NULL;
  4711. }
  4712. SWIGINTERN PyObject *_wrap_archive_entry_set_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4713. PyObject *resultobj = 0;
  4714. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  4715. int64_t arg2 ;
  4716. void *argp1 = 0 ;
  4717. int res1 = 0 ;
  4718. PyObject * obj0 = 0 ;
  4719. PyObject * obj1 = 0 ;
  4720. if (!PyArg_ParseTuple(args,(char *)"OO:archive_entry_set_size",&obj0,&obj1)) SWIG_fail;
  4721. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  4722. if (!SWIG_IsOK(res1)) {
  4723. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_set_size" "', argument " "1"" of type '" "struct archive_entry *""'");
  4724. }
  4725. arg1 = (struct archive_entry *)(argp1);
  4726. {
  4727. if (PyLong_Check(obj1))
  4728. arg2 = (int64_t) PyLong_AsLong(obj1);
  4729. else if (PyInt_Check(obj1))
  4730. arg2 = (int64_t) PyInt_AsLong(obj1);
  4731. else if (PyFloat_Check(obj1))
  4732. arg2 = (int64_t) PyFloat_AsDouble(obj1);
  4733. else {
  4734. PyErr_SetString(PyExc_TypeError,"Expected a large number");
  4735. return NULL;
  4736. }
  4737. }
  4738. archive_entry_set_size(arg1,arg2);
  4739. resultobj = SWIG_Py_Void();
  4740. return resultobj;
  4741. fail:
  4742. return NULL;
  4743. }
  4744. SWIGINTERN PyObject *_wrap_archive_entry_set_mtime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4745. PyObject *resultobj = 0;
  4746. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  4747. time_t arg2 ;
  4748. long arg3 ;
  4749. void *argp1 = 0 ;
  4750. int res1 = 0 ;
  4751. long val3 ;
  4752. int ecode3 = 0 ;
  4753. PyObject * obj0 = 0 ;
  4754. PyObject * obj1 = 0 ;
  4755. PyObject * obj2 = 0 ;
  4756. if (!PyArg_ParseTuple(args,(char *)"OOO:archive_entry_set_mtime",&obj0,&obj1,&obj2)) SWIG_fail;
  4757. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  4758. if (!SWIG_IsOK(res1)) {
  4759. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_set_mtime" "', argument " "1"" of type '" "struct archive_entry *""'");
  4760. }
  4761. arg1 = (struct archive_entry *)(argp1);
  4762. {
  4763. if (PyLong_Check(obj1))
  4764. arg2 = (time_t) PyLong_AsLong(obj1);
  4765. else if (PyInt_Check(obj1))
  4766. arg2 = (time_t) PyInt_AsLong(obj1);
  4767. else if (PyFloat_Check(obj1))
  4768. arg2 = (time_t) PyFloat_AsDouble(obj1);
  4769. else {
  4770. PyErr_SetString(PyExc_TypeError,"Expected a large number");
  4771. return NULL;
  4772. }
  4773. }
  4774. ecode3 = SWIG_AsVal_long(obj2, &val3);
  4775. if (!SWIG_IsOK(ecode3)) {
  4776. SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "archive_entry_set_mtime" "', argument " "3"" of type '" "long""'");
  4777. }
  4778. arg3 = (long)(val3);
  4779. archive_entry_set_mtime(arg1,arg2,arg3);
  4780. resultobj = SWIG_Py_Void();
  4781. return resultobj;
  4782. fail:
  4783. return NULL;
  4784. }
  4785. SWIGINTERN PyObject *_wrap_archive_entry_set_filetype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4786. PyObject *resultobj = 0;
  4787. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  4788. unsigned int arg2 ;
  4789. void *argp1 = 0 ;
  4790. int res1 = 0 ;
  4791. unsigned int val2 ;
  4792. int ecode2 = 0 ;
  4793. PyObject * obj0 = 0 ;
  4794. PyObject * obj1 = 0 ;
  4795. if (!PyArg_ParseTuple(args,(char *)"OO:archive_entry_set_filetype",&obj0,&obj1)) SWIG_fail;
  4796. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  4797. if (!SWIG_IsOK(res1)) {
  4798. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_set_filetype" "', argument " "1"" of type '" "struct archive_entry *""'");
  4799. }
  4800. arg1 = (struct archive_entry *)(argp1);
  4801. ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
  4802. if (!SWIG_IsOK(ecode2)) {
  4803. SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "archive_entry_set_filetype" "', argument " "2"" of type '" "unsigned int""'");
  4804. }
  4805. arg2 = (unsigned int)(val2);
  4806. archive_entry_set_filetype(arg1,arg2);
  4807. resultobj = SWIG_Py_Void();
  4808. return resultobj;
  4809. fail:
  4810. return NULL;
  4811. }
  4812. SWIGINTERN PyObject *_wrap_archive_entry_set_perm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4813. PyObject *resultobj = 0;
  4814. struct archive_entry *arg1 = (struct archive_entry *) 0 ;
  4815. mode_t arg2 ;
  4816. void *argp1 = 0 ;
  4817. int res1 = 0 ;
  4818. unsigned short val2 ;
  4819. int ecode2 = 0 ;
  4820. PyObject * obj0 = 0 ;
  4821. PyObject * obj1 = 0 ;
  4822. if (!PyArg_ParseTuple(args,(char *)"OO:archive_entry_set_perm",&obj0,&obj1)) SWIG_fail;
  4823. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive_entry, 0 | 0 );
  4824. if (!SWIG_IsOK(res1)) {
  4825. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_entry_set_perm" "', argument " "1"" of type '" "struct archive_entry *""'");
  4826. }
  4827. arg1 = (struct archive_entry *)(argp1);
  4828. ecode2 = SWIG_AsVal_unsigned_SS_short(obj1, &val2);
  4829. if (!SWIG_IsOK(ecode2)) {
  4830. SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "archive_entry_set_perm" "', argument " "2"" of type '" "mode_t""'");
  4831. }
  4832. arg2 = (mode_t)(val2);
  4833. archive_entry_set_perm(arg1,arg2);
  4834. resultobj = SWIG_Py_Void();
  4835. return resultobj;
  4836. fail:
  4837. return NULL;
  4838. }
  4839. SWIGINTERN PyObject *_wrap_archive_errno(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4840. PyObject *resultobj = 0;
  4841. struct archive *arg1 = (struct archive *) 0 ;
  4842. void *argp1 = 0 ;
  4843. int res1 = 0 ;
  4844. PyObject * obj0 = 0 ;
  4845. int result;
  4846. if (!PyArg_ParseTuple(args,(char *)"O:archive_errno",&obj0)) SWIG_fail;
  4847. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4848. if (!SWIG_IsOK(res1)) {
  4849. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_errno" "', argument " "1"" of type '" "struct archive *""'");
  4850. }
  4851. arg1 = (struct archive *)(argp1);
  4852. result = (int)archive_errno(arg1);
  4853. resultobj = SWIG_From_int((int)(result));
  4854. return resultobj;
  4855. fail:
  4856. return NULL;
  4857. }
  4858. SWIGINTERN PyObject *_wrap_archive_error_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4859. PyObject *resultobj = 0;
  4860. struct archive *arg1 = (struct archive *) 0 ;
  4861. void *argp1 = 0 ;
  4862. int res1 = 0 ;
  4863. PyObject * obj0 = 0 ;
  4864. char *result = 0 ;
  4865. if (!PyArg_ParseTuple(args,(char *)"O:archive_error_string",&obj0)) SWIG_fail;
  4866. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4867. if (!SWIG_IsOK(res1)) {
  4868. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_error_string" "', argument " "1"" of type '" "struct archive *""'");
  4869. }
  4870. arg1 = (struct archive *)(argp1);
  4871. result = (char *)archive_error_string(arg1);
  4872. resultobj = SWIG_FromCharPtr((const char *)result);
  4873. return resultobj;
  4874. fail:
  4875. return NULL;
  4876. }
  4877. SWIGINTERN PyObject *_wrap_archive_read_data_into_str(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4878. PyObject *resultobj = 0;
  4879. struct archive *arg1 = (struct archive *) 0 ;
  4880. int arg2 ;
  4881. void *argp1 = 0 ;
  4882. int res1 = 0 ;
  4883. int val2 ;
  4884. int ecode2 = 0 ;
  4885. PyObject * obj0 = 0 ;
  4886. PyObject * obj1 = 0 ;
  4887. PyObject *result = 0 ;
  4888. if (!PyArg_ParseTuple(args,(char *)"OO:archive_read_data_into_str",&obj0,&obj1)) SWIG_fail;
  4889. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4890. if (!SWIG_IsOK(res1)) {
  4891. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_read_data_into_str" "', argument " "1"" of type '" "struct archive *""'");
  4892. }
  4893. arg1 = (struct archive *)(argp1);
  4894. ecode2 = SWIG_AsVal_int(obj1, &val2);
  4895. if (!SWIG_IsOK(ecode2)) {
  4896. SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "archive_read_data_into_str" "', argument " "2"" of type '" "int""'");
  4897. }
  4898. arg2 = (int)(val2);
  4899. result = (PyObject *)archive_read_data_into_str(arg1,arg2);
  4900. resultobj = result;
  4901. return resultobj;
  4902. fail:
  4903. return NULL;
  4904. }
  4905. SWIGINTERN PyObject *_wrap_archive_write_data_from_str(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  4906. PyObject *resultobj = 0;
  4907. struct archive *arg1 = (struct archive *) 0 ;
  4908. PyObject *arg2 = (PyObject *) 0 ;
  4909. void *argp1 = 0 ;
  4910. int res1 = 0 ;
  4911. PyObject * obj0 = 0 ;
  4912. PyObject * obj1 = 0 ;
  4913. PyObject *result = 0 ;
  4914. if (!PyArg_ParseTuple(args,(char *)"OO:archive_write_data_from_str",&obj0,&obj1)) SWIG_fail;
  4915. res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_archive, 0 | 0 );
  4916. if (!SWIG_IsOK(res1)) {
  4917. SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "archive_write_data_from_str" "', argument " "1"" of type '" "struct archive *""'");
  4918. }
  4919. arg1 = (struct archive *)(argp1);
  4920. arg2 = obj1;
  4921. result = (PyObject *)archive_write_data_from_str(arg1,arg2);
  4922. resultobj = result;
  4923. return resultobj;
  4924. fail:
  4925. return NULL;
  4926. }
  4927. static PyMethodDef SwigMethods[] = {
  4928. { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
  4929. { (char *)"archive_read_new", _wrap_archive_read_new, METH_VARARGS, NULL},
  4930. { (char *)"archive_read_free", _wrap_archive_read_free, METH_VARARGS, NULL},
  4931. { (char *)"archive_read_open_filename", _wrap_archive_read_open_filename, METH_VARARGS, NULL},
  4932. { (char *)"archive_read_open_memory", _wrap_archive_read_open_memory, METH_VARARGS, NULL},
  4933. { (char *)"archive_read_open_memory2", _wrap_archive_read_open_memory2, METH_VARARGS, NULL},
  4934. { (char *)"archive_read_open_fd", _wrap_archive_read_open_fd, METH_VARARGS, NULL},
  4935. { (char *)"archive_read_close", _wrap_archive_read_close, METH_VARARGS, NULL},
  4936. { (char *)"archive_format", _wrap_archive_format, METH_VARARGS, NULL},
  4937. { (char *)"archive_read_next_header2", _wrap_archive_read_next_header2, METH_VARARGS, NULL},
  4938. { (char *)"archive_entry_stat", _wrap_archive_entry_stat, METH_VARARGS, NULL},
  4939. { (char *)"archive_read_header_position", _wrap_archive_read_header_position, METH_VARARGS, NULL},
  4940. { (char *)"archive_read_data_skip", _wrap_archive_read_data_skip, METH_VARARGS, NULL},
  4941. { (char *)"archive_read_data_into_fd", _wrap_archive_read_data_into_fd, METH_VARARGS, NULL},
  4942. { (char *)"archive_read_support_filter_all", _wrap_archive_read_support_filter_all, METH_VARARGS, NULL},
  4943. { (char *)"archive_read_support_filter_bzip2", _wrap_archive_read_support_filter_bzip2, METH_VARARGS, NULL},
  4944. { (char *)"archive_read_support_filter_compress", _wrap_archive_read_support_filter_compress, METH_VARARGS, NULL},
  4945. { (char *)"archive_read_support_filter_gzip", _wrap_archive_read_support_filter_gzip, METH_VARARGS, NULL},
  4946. { (char *)"archive_read_support_filter_lzip", _wrap_archive_read_support_filter_lzip, METH_VARARGS, NULL},
  4947. { (char *)"archive_read_support_filter_lzma", _wrap_archive_read_support_filter_lzma, METH_VARARGS, NULL},
  4948. { (char *)"archive_read_support_filter_none", _wrap_archive_read_support_filter_none, METH_VARARGS, NULL},
  4949. { (char *)"archive_read_support_filter_rpm", _wrap_archive_read_support_filter_rpm, METH_VARARGS, NULL},
  4950. { (char *)"archive_read_support_filter_uu", _wrap_archive_read_support_filter_uu, METH_VARARGS, NULL},
  4951. { (char *)"archive_read_support_filter_xz", _wrap_archive_read_support_filter_xz, METH_VARARGS, NULL},
  4952. { (char *)"archive_read_support_format_all", _wrap_archive_read_support_format_all, METH_VARARGS, NULL},
  4953. { (char *)"archive_read_support_format_7zip", _wrap_archive_read_support_format_7zip, METH_VARARGS, NULL},
  4954. { (char *)"archive_read_support_format_ar", _wrap_archive_read_support_format_ar, METH_VARARGS, NULL},
  4955. { (char *)"archive_read_support_format_cab", _wrap_archive_read_support_format_cab, METH_VARARGS, NULL},
  4956. { (char *)"archive_read_support_format_cpio", _wrap_archive_read_support_format_cpio, METH_VARARGS, NULL},
  4957. { (char *)"archive_read_support_format_empty", _wrap_archive_read_support_format_empty, METH_VARARGS, NULL},
  4958. { (char *)"archive_read_support_format_gnutar", _wrap_archive_read_support_format_gnutar, METH_VARARGS, NULL},
  4959. { (char *)"archive_read_support_format_iso9660", _wrap_archive_read_support_format_iso9660, METH_VARARGS, NULL},
  4960. { (char *)"archive_read_support_format_lha", _wrap_archive_read_support_format_lha, METH_VARARGS, NULL},
  4961. { (char *)"archive_read_support_format_rar", _wrap_archive_read_support_format_rar, METH_VARARGS, NULL},
  4962. { (char *)"archive_read_support_format_raw", _wrap_archive_read_support_format_raw, METH_VARARGS, NULL},
  4963. { (char *)"archive_read_support_format_tar", _wrap_archive_read_support_format_tar, METH_VARARGS, NULL},
  4964. { (char *)"archive_read_support_format_xar", _wrap_archive_read_support_format_xar, METH_VARARGS, NULL},
  4965. { (char *)"archive_read_support_format_zip", _wrap_archive_read_support_format_zip, METH_VARARGS, NULL},
  4966. { (char *)"archive_write_new", _wrap_archive_write_new, METH_VARARGS, NULL},
  4967. { (char *)"archive_write_free", _wrap_archive_write_free, METH_VARARGS, NULL},
  4968. { (char *)"archive_write_open", _wrap_archive_write_open, METH_VARARGS, NULL},
  4969. { (char *)"archive_write_open_fd", _wrap_archive_write_open_fd, METH_VARARGS, NULL},
  4970. { (char *)"archive_write_open_filename", _wrap_archive_write_open_filename, METH_VARARGS, NULL},
  4971. { (char *)"archive_write_open_filename_w", _wrap_archive_write_open_filename_w, METH_VARARGS, NULL},
  4972. { (char *)"archive_write_open_memory", _wrap_archive_write_open_memory, METH_VARARGS, NULL},
  4973. { (char *)"archive_write_close", _wrap_archive_write_close, METH_VARARGS, NULL},
  4974. { (char *)"archive_write_header", _wrap_archive_write_header, METH_VARARGS, NULL},
  4975. { (char *)"archive_write_finish_entry", _wrap_archive_write_finish_entry, METH_VARARGS, NULL},
  4976. { (char *)"archive_write_add_filter_bzip2", _wrap_archive_write_add_filter_bzip2, METH_VARARGS, NULL},
  4977. { (char *)"archive_write_add_filter_compress", _wrap_archive_write_add_filter_compress, METH_VARARGS, NULL},
  4978. { (char *)"archive_write_add_filter_gzip", _wrap_archive_write_add_filter_gzip, METH_VARARGS, NULL},
  4979. { (char *)"archive_write_add_filter_lzip", _wrap_archive_write_add_filter_lzip, METH_VARARGS, NULL},
  4980. { (char *)"archive_write_add_filter_lzma", _wrap_archive_write_add_filter_lzma, METH_VARARGS, NULL},
  4981. { (char *)"archive_write_add_filter_none", _wrap_archive_write_add_filter_none, METH_VARARGS, NULL},
  4982. { (char *)"archive_write_add_filter_xz", _wrap_archive_write_add_filter_xz, METH_VARARGS, NULL},
  4983. { (char *)"archive_write_set_format", _wrap_archive_write_set_format, METH_VARARGS, NULL},
  4984. { (char *)"archive_write_set_format_by_name", _wrap_archive_write_set_format_by_name, METH_VARARGS, NULL},
  4985. { (char *)"archive_write_set_format_ar_bsd", _wrap_archive_write_set_format_ar_bsd, METH_VARARGS, NULL},
  4986. { (char *)"archive_write_set_format_ar_svr4", _wrap_archive_write_set_format_ar_svr4, METH_VARARGS, NULL},
  4987. { (char *)"archive_write_set_format_cpio", _wrap_archive_write_set_format_cpio, METH_VARARGS, NULL},
  4988. { (char *)"archive_write_set_format_cpio_newc", _wrap_archive_write_set_format_cpio_newc, METH_VARARGS, NULL},
  4989. { (char *)"archive_write_set_format_gnutar", _wrap_archive_write_set_format_gnutar, METH_VARARGS, NULL},
  4990. { (char *)"archive_write_set_format_iso9660", _wrap_archive_write_set_format_iso9660, METH_VARARGS, NULL},
  4991. { (char *)"archive_write_set_format_pax", _wrap_archive_write_set_format_pax, METH_VARARGS, NULL},
  4992. { (char *)"archive_write_set_format_pax_restricted", _wrap_archive_write_set_format_pax_restricted, METH_VARARGS, NULL},
  4993. { (char *)"archive_write_set_format_shar", _wrap_archive_write_set_format_shar, METH_VARARGS, NULL},
  4994. { (char *)"archive_write_set_format_shar_dump", _wrap_archive_write_set_format_shar_dump, METH_VARARGS, NULL},
  4995. { (char *)"archive_write_set_format_ustar", _wrap_archive_write_set_format_ustar, METH_VARARGS, NULL},
  4996. { (char *)"archive_write_set_format_xar", _wrap_archive_write_set_format_xar, METH_VARARGS, NULL},
  4997. { (char *)"archive_write_set_format_zip", _wrap_archive_write_set_format_zip, METH_VARARGS, NULL},
  4998. { (char *)"archive_entry_new", _wrap_archive_entry_new, METH_VARARGS, NULL},
  4999. { (char *)"archive_entry_free", _wrap_archive_entry_free, METH_VARARGS, NULL},
  5000. { (char *)"archive_entry_pathname", _wrap_archive_entry_pathname, METH_VARARGS, NULL},
  5001. { (char *)"archive_entry_pathname_w", _wrap_archive_entry_pathname_w, METH_VARARGS, NULL},
  5002. { (char *)"archive_entry_size", _wrap_archive_entry_size, METH_VARARGS, NULL},
  5003. { (char *)"archive_entry_mtime", _wrap_archive_entry_mtime, METH_VARARGS, NULL},
  5004. { (char *)"archive_entry_filetype", _wrap_archive_entry_filetype, METH_VARARGS, NULL},
  5005. { (char *)"archive_entry_perm", _wrap_archive_entry_perm, METH_VARARGS, NULL},
  5006. { (char *)"archive_entry_set_pathname", _wrap_archive_entry_set_pathname, METH_VARARGS, NULL},
  5007. { (char *)"archive_entry_set_size", _wrap_archive_entry_set_size, METH_VARARGS, NULL},
  5008. { (char *)"archive_entry_set_mtime", _wrap_archive_entry_set_mtime, METH_VARARGS, NULL},
  5009. { (char *)"archive_entry_set_filetype", _wrap_archive_entry_set_filetype, METH_VARARGS, NULL},
  5010. { (char *)"archive_entry_set_perm", _wrap_archive_entry_set_perm, METH_VARARGS, NULL},
  5011. { (char *)"archive_errno", _wrap_archive_errno, METH_VARARGS, NULL},
  5012. { (char *)"archive_error_string", _wrap_archive_error_string, METH_VARARGS, NULL},
  5013. { (char *)"archive_read_data_into_str", _wrap_archive_read_data_into_str, METH_VARARGS, NULL},
  5014. { (char *)"archive_write_data_from_str", _wrap_archive_write_data_from_str, METH_VARARGS, NULL},
  5015. { NULL, NULL, 0, NULL }
  5016. };
  5017. /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
  5018. static swig_type_info _swigt__p_archive = {"_p_archive", "struct archive *", 0, 0, (void*)0, 0};
  5019. static swig_type_info _swigt__p_archive_close_callback = {"_p_archive_close_callback", "archive_close_callback *", 0, 0, (void*)0, 0};
  5020. static swig_type_info _swigt__p_archive_entry = {"_p_archive_entry", "struct archive_entry *", 0, 0, (void*)0, 0};
  5021. static swig_type_info _swigt__p_archive_open_callback = {"_p_archive_open_callback", "archive_open_callback *", 0, 0, (void*)0, 0};
  5022. static swig_type_info _swigt__p_archive_write_callback = {"_p_archive_write_callback", "archive_write_callback *", 0, 0, (void*)0, 0};
  5023. static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
  5024. static swig_type_info _swigt__p_int64_t = {"_p_int64_t", "int64_t *", 0, 0, (void*)0, 0};
  5025. static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *", 0, 0, (void*)0, 0};
  5026. static swig_type_info _swigt__p_stat = {"_p_stat", "struct stat *", 0, 0, (void*)0, 0};
  5027. static swig_type_info _swigt__p_time_t = {"_p_time_t", "time_t *", 0, 0, (void*)0, 0};
  5028. static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|mode_t *", 0, 0, (void*)0, 0};
  5029. static swig_type_info _swigt__p_wchar_t = {"_p_wchar_t", "wchar_t *", 0, 0, (void*)0, 0};
  5030. static swig_type_info *swig_type_initial[] = {
  5031. &_swigt__p_archive,
  5032. &_swigt__p_archive_close_callback,
  5033. &_swigt__p_archive_entry,
  5034. &_swigt__p_archive_open_callback,
  5035. &_swigt__p_archive_write_callback,
  5036. &_swigt__p_char,
  5037. &_swigt__p_int64_t,
  5038. &_swigt__p_size_t,
  5039. &_swigt__p_stat,
  5040. &_swigt__p_time_t,
  5041. &_swigt__p_unsigned_short,
  5042. &_swigt__p_wchar_t,
  5043. };
  5044. static swig_cast_info _swigc__p_archive[] = { {&_swigt__p_archive, 0, 0, 0},{0, 0, 0, 0}};
  5045. static swig_cast_info _swigc__p_archive_close_callback[] = { {&_swigt__p_archive_close_callback, 0, 0, 0},{0, 0, 0, 0}};
  5046. static swig_cast_info _swigc__p_archive_entry[] = { {&_swigt__p_archive_entry, 0, 0, 0},{0, 0, 0, 0}};
  5047. static swig_cast_info _swigc__p_archive_open_callback[] = { {&_swigt__p_archive_open_callback, 0, 0, 0},{0, 0, 0, 0}};
  5048. static swig_cast_info _swigc__p_archive_write_callback[] = { {&_swigt__p_archive_write_callback, 0, 0, 0},{0, 0, 0, 0}};
  5049. static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
  5050. static swig_cast_info _swigc__p_int64_t[] = { {&_swigt__p_int64_t, 0, 0, 0},{0, 0, 0, 0}};
  5051. static swig_cast_info _swigc__p_size_t[] = { {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}};
  5052. static swig_cast_info _swigc__p_stat[] = { {&_swigt__p_stat, 0, 0, 0},{0, 0, 0, 0}};
  5053. static swig_cast_info _swigc__p_time_t[] = { {&_swigt__p_time_t, 0, 0, 0},{0, 0, 0, 0}};
  5054. static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}};
  5055. static swig_cast_info _swigc__p_wchar_t[] = { {&_swigt__p_wchar_t, 0, 0, 0},{0, 0, 0, 0}};
  5056. static swig_cast_info *swig_cast_initial[] = {
  5057. _swigc__p_archive,
  5058. _swigc__p_archive_close_callback,
  5059. _swigc__p_archive_entry,
  5060. _swigc__p_archive_open_callback,
  5061. _swigc__p_archive_write_callback,
  5062. _swigc__p_char,
  5063. _swigc__p_int64_t,
  5064. _swigc__p_size_t,
  5065. _swigc__p_stat,
  5066. _swigc__p_time_t,
  5067. _swigc__p_unsigned_short,
  5068. _swigc__p_wchar_t,
  5069. };
  5070. /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
  5071. static swig_const_info swig_const_table[] = {
  5072. {0, 0, 0, 0.0, 0, 0}};
  5073. #ifdef __cplusplus
  5074. }
  5075. #endif
  5076. /* -----------------------------------------------------------------------------
  5077. * Type initialization:
  5078. * This problem is tough by the requirement that no dynamic
  5079. * memory is used. Also, since swig_type_info structures store pointers to
  5080. * swig_cast_info structures and swig_cast_info structures store pointers back
  5081. * to swig_type_info structures, we need some lookup code at initialization.
  5082. * The idea is that swig generates all the structures that are needed.
  5083. * The runtime then collects these partially filled structures.
  5084. * The SWIG_InitializeModule function takes these initial arrays out of
  5085. * swig_module, and does all the lookup, filling in the swig_module.types
  5086. * array with the correct data and linking the correct swig_cast_info
  5087. * structures together.
  5088. *
  5089. * The generated swig_type_info structures are assigned staticly to an initial
  5090. * array. We just loop through that array, and handle each type individually.
  5091. * First we lookup if this type has been already loaded, and if so, use the
  5092. * loaded structure instead of the generated one. Then we have to fill in the
  5093. * cast linked list. The cast data is initially stored in something like a
  5094. * two-dimensional array. Each row corresponds to a type (there are the same
  5095. * number of rows as there are in the swig_type_initial array). Each entry in
  5096. * a column is one of the swig_cast_info structures for that type.
  5097. * The cast_initial array is actually an array of arrays, because each row has
  5098. * a variable number of columns. So to actually build the cast linked list,
  5099. * we find the array of casts associated with the type, and loop through it
  5100. * adding the casts to the list. The one last trick we need to do is making
  5101. * sure the type pointer in the swig_cast_info struct is correct.
  5102. *
  5103. * First off, we lookup the cast->type name to see if it is already loaded.
  5104. * There are three cases to handle:
  5105. * 1) If the cast->type has already been loaded AND the type we are adding
  5106. * casting info to has not been loaded (it is in this module), THEN we
  5107. * replace the cast->type pointer with the type pointer that has already
  5108. * been loaded.
  5109. * 2) If BOTH types (the one we are adding casting info to, and the
  5110. * cast->type) are loaded, THEN the cast info has already been loaded by
  5111. * the previous module so we just ignore it.
  5112. * 3) Finally, if cast->type has not already been loaded, then we add that
  5113. * swig_cast_info to the linked list (because the cast->type) pointer will
  5114. * be correct.
  5115. * ----------------------------------------------------------------------------- */
  5116. #ifdef __cplusplus
  5117. extern "C" {
  5118. #if 0
  5119. } /* c-mode */
  5120. #endif
  5121. #endif
  5122. #if 0
  5123. #define SWIGRUNTIME_DEBUG
  5124. #endif
  5125. SWIGRUNTIME void
  5126. SWIG_InitializeModule(void *clientdata) {
  5127. size_t i;
  5128. swig_module_info *module_head, *iter;
  5129. int found, init;
  5130. clientdata = clientdata;
  5131. /* check to see if the circular list has been setup, if not, set it up */
  5132. if (swig_module.next==0) {
  5133. /* Initialize the swig_module */
  5134. swig_module.type_initial = swig_type_initial;
  5135. swig_module.cast_initial = swig_cast_initial;
  5136. swig_module.next = &swig_module;
  5137. init = 1;
  5138. } else {
  5139. init = 0;
  5140. }
  5141. /* Try and load any already created modules */
  5142. module_head = SWIG_GetModule(clientdata);
  5143. if (!module_head) {
  5144. /* This is the first module loaded for this interpreter */
  5145. /* so set the swig module into the interpreter */
  5146. SWIG_SetModule(clientdata, &swig_module);
  5147. module_head = &swig_module;
  5148. } else {
  5149. /* the interpreter has loaded a SWIG module, but has it loaded this one? */
  5150. found=0;
  5151. iter=module_head;
  5152. do {
  5153. if (iter==&swig_module) {
  5154. found=1;
  5155. break;
  5156. }
  5157. iter=iter->next;
  5158. } while (iter!= module_head);
  5159. /* if the is found in the list, then all is done and we may leave */
  5160. if (found) return;
  5161. /* otherwise we must add out module into the list */
  5162. swig_module.next = module_head->next;
  5163. module_head->next = &swig_module;
  5164. }
  5165. /* When multiple interpeters are used, a module could have already been initialized in
  5166. a different interpreter, but not yet have a pointer in this interpreter.
  5167. In this case, we do not want to continue adding types... everything should be
  5168. set up already */
  5169. if (init == 0) return;
  5170. /* Now work on filling in swig_module.types */
  5171. #ifdef SWIGRUNTIME_DEBUG
  5172. printf("SWIG_InitializeModule: size %d\n", swig_module.size);
  5173. #endif
  5174. for (i = 0; i < swig_module.size; ++i) {
  5175. swig_type_info *type = 0;
  5176. swig_type_info *ret;
  5177. swig_cast_info *cast;
  5178. #ifdef SWIGRUNTIME_DEBUG
  5179. printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
  5180. #endif
  5181. /* if there is another module already loaded */
  5182. if (swig_module.next != &swig_module) {
  5183. type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
  5184. }
  5185. if (type) {
  5186. /* Overwrite clientdata field */
  5187. #ifdef SWIGRUNTIME_DEBUG
  5188. printf("SWIG_InitializeModule: found type %s\n", type->name);
  5189. #endif
  5190. if (swig_module.type_initial[i]->clientdata) {
  5191. type->clientdata = swig_module.type_initial[i]->clientdata;
  5192. #ifdef SWIGRUNTIME_DEBUG
  5193. printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
  5194. #endif
  5195. }
  5196. } else {
  5197. type = swig_module.type_initial[i];
  5198. }
  5199. /* Insert casting types */
  5200. cast = swig_module.cast_initial[i];
  5201. while (cast->type) {
  5202. /* Don't need to add information already in the list */
  5203. ret = 0;
  5204. #ifdef SWIGRUNTIME_DEBUG
  5205. printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
  5206. #endif
  5207. if (swig_module.next != &swig_module) {
  5208. ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
  5209. #ifdef SWIGRUNTIME_DEBUG
  5210. if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
  5211. #endif
  5212. }
  5213. if (ret) {
  5214. if (type == swig_module.type_initial[i]) {
  5215. #ifdef SWIGRUNTIME_DEBUG
  5216. printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
  5217. #endif
  5218. cast->type = ret;
  5219. ret = 0;
  5220. } else {
  5221. /* Check for casting already in the list */
  5222. swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
  5223. #ifdef SWIGRUNTIME_DEBUG
  5224. if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
  5225. #endif
  5226. if (!ocast) ret = 0;
  5227. }
  5228. }
  5229. if (!ret) {
  5230. #ifdef SWIGRUNTIME_DEBUG
  5231. printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
  5232. #endif
  5233. if (type->cast) {
  5234. type->cast->prev = cast;
  5235. cast->next = type->cast;
  5236. }
  5237. type->cast = cast;
  5238. }
  5239. cast++;
  5240. }
  5241. /* Set entry in modules->types array equal to the type */
  5242. swig_module.types[i] = type;
  5243. }
  5244. swig_module.types[i] = 0;
  5245. #ifdef SWIGRUNTIME_DEBUG
  5246. printf("**** SWIG_InitializeModule: Cast List ******\n");
  5247. for (i = 0; i < swig_module.size; ++i) {
  5248. int j = 0;
  5249. swig_cast_info *cast = swig_module.cast_initial[i];
  5250. printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
  5251. while (cast->type) {
  5252. printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
  5253. cast++;
  5254. ++j;
  5255. }
  5256. printf("---- Total casts: %d\n",j);
  5257. }
  5258. printf("**** SWIG_InitializeModule: Cast List ******\n");
  5259. #endif
  5260. }
  5261. /* This function will propagate the clientdata field of type to
  5262. * any new swig_type_info structures that have been added into the list
  5263. * of equivalent types. It is like calling
  5264. * SWIG_TypeClientData(type, clientdata) a second time.
  5265. */
  5266. SWIGRUNTIME void
  5267. SWIG_PropagateClientData(void) {
  5268. size_t i;
  5269. swig_cast_info *equiv;
  5270. static int init_run = 0;
  5271. if (init_run) return;
  5272. init_run = 1;
  5273. for (i = 0; i < swig_module.size; i++) {
  5274. if (swig_module.types[i]->clientdata) {
  5275. equiv = swig_module.types[i]->cast;
  5276. while (equiv) {
  5277. if (!equiv->converter) {
  5278. if (equiv->type && !equiv->type->clientdata)
  5279. SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
  5280. }
  5281. equiv = equiv->next;
  5282. }
  5283. }
  5284. }
  5285. }
  5286. #ifdef __cplusplus
  5287. #if 0
  5288. {
  5289. /* c-mode */
  5290. #endif
  5291. }
  5292. #endif
  5293. #ifdef __cplusplus
  5294. extern "C" {
  5295. #endif
  5296. /* Python-specific SWIG API */
  5297. #define SWIG_newvarlink() SWIG_Python_newvarlink()
  5298. #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
  5299. #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
  5300. /* -----------------------------------------------------------------------------
  5301. * global variable support code.
  5302. * ----------------------------------------------------------------------------- */
  5303. typedef struct swig_globalvar {
  5304. char *name; /* Name of global variable */
  5305. PyObject *(*get_attr)(void); /* Return the current value */
  5306. int (*set_attr)(PyObject *); /* Set the value */
  5307. struct swig_globalvar *next;
  5308. } swig_globalvar;
  5309. typedef struct swig_varlinkobject {
  5310. PyObject_HEAD
  5311. swig_globalvar *vars;
  5312. } swig_varlinkobject;
  5313. SWIGINTERN PyObject *
  5314. swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
  5315. #if PY_VERSION_HEX >= 0x03000000
  5316. return PyUnicode_InternFromString("<Swig global variables>");
  5317. #else
  5318. return PyString_FromString("<Swig global variables>");
  5319. #endif
  5320. }
  5321. SWIGINTERN PyObject *
  5322. swig_varlink_str(swig_varlinkobject *v) {
  5323. #if PY_VERSION_HEX >= 0x03000000
  5324. PyObject *str = PyUnicode_InternFromString("(");
  5325. PyObject *tail;
  5326. PyObject *joined;
  5327. swig_globalvar *var;
  5328. for (var = v->vars; var; var=var->next) {
  5329. tail = PyUnicode_FromString(var->name);
  5330. joined = PyUnicode_Concat(str, tail);
  5331. Py_DecRef(str);
  5332. Py_DecRef(tail);
  5333. str = joined;
  5334. if (var->next) {
  5335. tail = PyUnicode_InternFromString(", ");
  5336. joined = PyUnicode_Concat(str, tail);
  5337. Py_DecRef(str);
  5338. Py_DecRef(tail);
  5339. str = joined;
  5340. }
  5341. }
  5342. tail = PyUnicode_InternFromString(")");
  5343. joined = PyUnicode_Concat(str, tail);
  5344. Py_DecRef(str);
  5345. Py_DecRef(tail);
  5346. str = joined;
  5347. #else
  5348. PyObject *str = PyString_FromString("(");
  5349. swig_globalvar *var;
  5350. for (var = v->vars; var; var=var->next) {
  5351. PyString_ConcatAndDel(&str,PyString_FromString(var->name));
  5352. if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
  5353. }
  5354. PyString_ConcatAndDel(&str,PyString_FromString(")"));
  5355. #endif
  5356. return str;
  5357. }
  5358. SWIGINTERN int
  5359. swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
  5360. char *tmp;
  5361. PyObject *str = swig_varlink_str(v);
  5362. fprintf(fp,"Swig global variables ");
  5363. fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
  5364. SWIG_Python_str_DelForPy3(tmp);
  5365. Py_DECREF(str);
  5366. return 0;
  5367. }
  5368. SWIGINTERN void
  5369. swig_varlink_dealloc(swig_varlinkobject *v) {
  5370. swig_globalvar *var = v->vars;
  5371. while (var) {
  5372. swig_globalvar *n = var->next;
  5373. free(var->name);
  5374. free(var);
  5375. var = n;
  5376. }
  5377. }
  5378. SWIGINTERN PyObject *
  5379. swig_varlink_getattr(swig_varlinkobject *v, char *n) {
  5380. PyObject *res = NULL;
  5381. swig_globalvar *var = v->vars;
  5382. while (var) {
  5383. if (strcmp(var->name,n) == 0) {
  5384. res = (*var->get_attr)();
  5385. break;
  5386. }
  5387. var = var->next;
  5388. }
  5389. if (res == NULL && !PyErr_Occurred()) {
  5390. PyErr_SetString(PyExc_NameError,"Unknown C global variable");
  5391. }
  5392. return res;
  5393. }
  5394. SWIGINTERN int
  5395. swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
  5396. int res = 1;
  5397. swig_globalvar *var = v->vars;
  5398. while (var) {
  5399. if (strcmp(var->name,n) == 0) {
  5400. res = (*var->set_attr)(p);
  5401. break;
  5402. }
  5403. var = var->next;
  5404. }
  5405. if (res == 1 && !PyErr_Occurred()) {
  5406. PyErr_SetString(PyExc_NameError,"Unknown C global variable");
  5407. }
  5408. return res;
  5409. }
  5410. SWIGINTERN PyTypeObject*
  5411. swig_varlink_type(void) {
  5412. static char varlink__doc__[] = "Swig var link object";
  5413. static PyTypeObject varlink_type;
  5414. static int type_init = 0;
  5415. if (!type_init) {
  5416. const PyTypeObject tmp = {
  5417. /* PyObject header changed in Python 3 */
  5418. #if PY_VERSION_HEX >= 0x03000000
  5419. PyVarObject_HEAD_INIT(NULL, 0)
  5420. #else
  5421. PyObject_HEAD_INIT(NULL)
  5422. 0, /* ob_size */
  5423. #endif
  5424. (char *)"swigvarlink", /* tp_name */
  5425. sizeof(swig_varlinkobject), /* tp_basicsize */
  5426. 0, /* tp_itemsize */
  5427. (destructor) swig_varlink_dealloc, /* tp_dealloc */
  5428. (printfunc) swig_varlink_print, /* tp_print */
  5429. (getattrfunc) swig_varlink_getattr, /* tp_getattr */
  5430. (setattrfunc) swig_varlink_setattr, /* tp_setattr */
  5431. 0, /* tp_compare */
  5432. (reprfunc) swig_varlink_repr, /* tp_repr */
  5433. 0, /* tp_as_number */
  5434. 0, /* tp_as_sequence */
  5435. 0, /* tp_as_mapping */
  5436. 0, /* tp_hash */
  5437. 0, /* tp_call */
  5438. (reprfunc) swig_varlink_str, /* tp_str */
  5439. 0, /* tp_getattro */
  5440. 0, /* tp_setattro */
  5441. 0, /* tp_as_buffer */
  5442. 0, /* tp_flags */
  5443. varlink__doc__, /* tp_doc */
  5444. 0, /* tp_traverse */
  5445. 0, /* tp_clear */
  5446. 0, /* tp_richcompare */
  5447. 0, /* tp_weaklistoffset */
  5448. #if PY_VERSION_HEX >= 0x02020000
  5449. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
  5450. #endif
  5451. #if PY_VERSION_HEX >= 0x02030000
  5452. 0, /* tp_del */
  5453. #endif
  5454. #if PY_VERSION_HEX >= 0x02060000
  5455. 0, /* tp_version */
  5456. #endif
  5457. #ifdef COUNT_ALLOCS
  5458. 0,0,0,0 /* tp_alloc -> tp_next */
  5459. #endif
  5460. };
  5461. varlink_type = tmp;
  5462. type_init = 1;
  5463. #if PY_VERSION_HEX < 0x02020000
  5464. varlink_type.ob_type = &PyType_Type;
  5465. #else
  5466. if (PyType_Ready(&varlink_type) < 0)
  5467. return NULL;
  5468. #endif
  5469. }
  5470. return &varlink_type;
  5471. }
  5472. /* Create a variable linking object for use later */
  5473. SWIGINTERN PyObject *
  5474. SWIG_Python_newvarlink(void) {
  5475. swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
  5476. if (result) {
  5477. result->vars = 0;
  5478. }
  5479. return ((PyObject*) result);
  5480. }
  5481. SWIGINTERN void
  5482. SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
  5483. swig_varlinkobject *v = (swig_varlinkobject *) p;
  5484. swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
  5485. if (gv) {
  5486. size_t size = strlen(name)+1;
  5487. gv->name = (char *)malloc(size);
  5488. if (gv->name) {
  5489. strncpy(gv->name,name,size);
  5490. gv->get_attr = get_attr;
  5491. gv->set_attr = set_attr;
  5492. gv->next = v->vars;
  5493. }
  5494. }
  5495. v->vars = gv;
  5496. }
  5497. SWIGINTERN PyObject *
  5498. SWIG_globals(void) {
  5499. static PyObject *_SWIG_globals = 0;
  5500. if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
  5501. return _SWIG_globals;
  5502. }
  5503. /* -----------------------------------------------------------------------------
  5504. * constants/methods manipulation
  5505. * ----------------------------------------------------------------------------- */
  5506. /* Install Constants */
  5507. SWIGINTERN void
  5508. SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
  5509. PyObject *obj = 0;
  5510. size_t i;
  5511. for (i = 0; constants[i].type; ++i) {
  5512. switch(constants[i].type) {
  5513. case SWIG_PY_POINTER:
  5514. obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
  5515. break;
  5516. case SWIG_PY_BINARY:
  5517. obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
  5518. break;
  5519. default:
  5520. obj = 0;
  5521. break;
  5522. }
  5523. if (obj) {
  5524. PyDict_SetItemString(d, constants[i].name, obj);
  5525. Py_DECREF(obj);
  5526. }
  5527. }
  5528. }
  5529. /* -----------------------------------------------------------------------------*/
  5530. /* Fix SwigMethods to carry the callback ptrs when needed */
  5531. /* -----------------------------------------------------------------------------*/
  5532. SWIGINTERN void
  5533. SWIG_Python_FixMethods(PyMethodDef *methods,
  5534. swig_const_info *const_table,
  5535. swig_type_info **types,
  5536. swig_type_info **types_initial) {
  5537. size_t i;
  5538. for (i = 0; methods[i].ml_name; ++i) {
  5539. const char *c = methods[i].ml_doc;
  5540. if (c && (c = strstr(c, "swig_ptr: "))) {
  5541. int j;
  5542. swig_const_info *ci = 0;
  5543. const char *name = c + 10;
  5544. for (j = 0; const_table[j].type; ++j) {
  5545. if (strncmp(const_table[j].name, name,
  5546. strlen(const_table[j].name)) == 0) {
  5547. ci = &(const_table[j]);
  5548. break;
  5549. }
  5550. }
  5551. if (ci) {
  5552. void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
  5553. if (ptr) {
  5554. size_t shift = (ci->ptype) - types;
  5555. swig_type_info *ty = types_initial[shift];
  5556. size_t ldoc = (c - methods[i].ml_doc);
  5557. size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
  5558. char *ndoc = (char*)malloc(ldoc + lptr + 10);
  5559. if (ndoc) {
  5560. char *buff = ndoc;
  5561. strncpy(buff, methods[i].ml_doc, ldoc);
  5562. buff += ldoc;
  5563. strncpy(buff, "swig_ptr: ", 10);
  5564. buff += 10;
  5565. SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
  5566. methods[i].ml_doc = ndoc;
  5567. }
  5568. }
  5569. }
  5570. }
  5571. }
  5572. }
  5573. #ifdef __cplusplus
  5574. }
  5575. #endif
  5576. /* -----------------------------------------------------------------------------*
  5577. * Partial Init method
  5578. * -----------------------------------------------------------------------------*/
  5579. #ifdef __cplusplus
  5580. extern "C"
  5581. #endif
  5582. SWIGEXPORT
  5583. #if PY_VERSION_HEX >= 0x03000000
  5584. PyObject*
  5585. #else
  5586. void
  5587. #endif
  5588. SWIG_init(void) {
  5589. PyObject *m, *d, *md;
  5590. #if PY_VERSION_HEX >= 0x03000000
  5591. static struct PyModuleDef SWIG_module = {
  5592. # if PY_VERSION_HEX >= 0x03020000
  5593. PyModuleDef_HEAD_INIT,
  5594. # else
  5595. {
  5596. PyObject_HEAD_INIT(NULL)
  5597. NULL, /* m_init */
  5598. 0, /* m_index */
  5599. NULL, /* m_copy */
  5600. },
  5601. # endif
  5602. (char *) SWIG_name,
  5603. NULL,
  5604. -1,
  5605. SwigMethods,
  5606. NULL,
  5607. NULL,
  5608. NULL,
  5609. NULL
  5610. };
  5611. #endif
  5612. #if defined(SWIGPYTHON_BUILTIN)
  5613. static SwigPyClientData SwigPyObject_clientdata = {
  5614. 0, 0, 0, 0, 0, 0, 0
  5615. };
  5616. static PyGetSetDef this_getset_def = {
  5617. (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
  5618. };
  5619. static SwigPyGetSet thisown_getset_closure = {
  5620. (PyCFunction) SwigPyObject_own,
  5621. (PyCFunction) SwigPyObject_own
  5622. };
  5623. static PyGetSetDef thisown_getset_def = {
  5624. (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
  5625. };
  5626. PyObject *metatype_args;
  5627. PyTypeObject *builtin_pytype;
  5628. int builtin_base_count;
  5629. swig_type_info *builtin_basetype;
  5630. PyObject *tuple;
  5631. PyGetSetDescrObject *static_getset;
  5632. PyTypeObject *metatype;
  5633. SwigPyClientData *cd;
  5634. PyObject *public_interface, *public_symbol;
  5635. PyObject *this_descr;
  5636. PyObject *thisown_descr;
  5637. int i;
  5638. (void)builtin_pytype;
  5639. (void)builtin_base_count;
  5640. (void)builtin_basetype;
  5641. (void)tuple;
  5642. (void)static_getset;
  5643. /* metatype is used to implement static member variables. */
  5644. metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type);
  5645. assert(metatype_args);
  5646. metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL);
  5647. assert(metatype);
  5648. Py_DECREF(metatype_args);
  5649. metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro;
  5650. assert(PyType_Ready(metatype) >= 0);
  5651. #endif
  5652. /* Fix SwigMethods to carry the callback ptrs when needed */
  5653. SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
  5654. #if PY_VERSION_HEX >= 0x03000000
  5655. m = PyModule_Create(&SWIG_module);
  5656. #else
  5657. m = Py_InitModule((char *) SWIG_name, SwigMethods);
  5658. #endif
  5659. md = d = PyModule_GetDict(m);
  5660. SWIG_InitializeModule(0);
  5661. #ifdef SWIGPYTHON_BUILTIN
  5662. SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
  5663. assert(SwigPyObject_stype);
  5664. cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
  5665. if (!cd) {
  5666. SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
  5667. SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce();
  5668. } else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) {
  5669. PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
  5670. # if PY_VERSION_HEX >= 0x03000000
  5671. return NULL;
  5672. # else
  5673. return;
  5674. # endif
  5675. }
  5676. /* All objects have a 'this' attribute */
  5677. this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
  5678. (void)this_descr;
  5679. /* All objects have a 'thisown' attribute */
  5680. thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
  5681. (void)thisown_descr;
  5682. public_interface = PyList_New(0);
  5683. public_symbol = 0;
  5684. (void)public_symbol;
  5685. PyDict_SetItemString(md, "__all__", public_interface);
  5686. Py_DECREF(public_interface);
  5687. for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
  5688. SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
  5689. for (i = 0; swig_const_table[i].name != 0; ++i)
  5690. SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
  5691. #endif
  5692. SWIG_InstallConstants(d,swig_const_table);
  5693. SWIG_Python_SetConstant(d, "ARCHIVE_VERSION_NUMBER",SWIG_From_int((int)(3000001)));
  5694. SWIG_Python_SetConstant(d, "ARCHIVE_VERSION_STRING",SWIG_FromCharPtr("libarchive 3.0.1b"));
  5695. SWIG_Python_SetConstant(d, "ARCHIVE_EOF",SWIG_From_int((int)(1)));
  5696. SWIG_Python_SetConstant(d, "ARCHIVE_OK",SWIG_From_int((int)(0)));
  5697. SWIG_Python_SetConstant(d, "ARCHIVE_RETRY",SWIG_From_int((int)((-10))));
  5698. SWIG_Python_SetConstant(d, "ARCHIVE_WARN",SWIG_From_int((int)((-20))));
  5699. SWIG_Python_SetConstant(d, "ARCHIVE_FAILED",SWIG_From_int((int)((-25))));
  5700. SWIG_Python_SetConstant(d, "ARCHIVE_FATAL",SWIG_From_int((int)((-30))));
  5701. SWIG_Python_SetConstant(d, "ARCHIVE_FILTER_NONE",SWIG_From_int((int)(0)));
  5702. SWIG_Python_SetConstant(d, "ARCHIVE_FILTER_GZIP",SWIG_From_int((int)(1)));
  5703. SWIG_Python_SetConstant(d, "ARCHIVE_FILTER_BZIP2",SWIG_From_int((int)(2)));
  5704. SWIG_Python_SetConstant(d, "ARCHIVE_FILTER_COMPRESS",SWIG_From_int((int)(3)));
  5705. SWIG_Python_SetConstant(d, "ARCHIVE_FILTER_PROGRAM",SWIG_From_int((int)(4)));
  5706. SWIG_Python_SetConstant(d, "ARCHIVE_FILTER_LZMA",SWIG_From_int((int)(5)));
  5707. SWIG_Python_SetConstant(d, "ARCHIVE_FILTER_XZ",SWIG_From_int((int)(6)));
  5708. SWIG_Python_SetConstant(d, "ARCHIVE_FILTER_UU",SWIG_From_int((int)(7)));
  5709. SWIG_Python_SetConstant(d, "ARCHIVE_FILTER_RPM",SWIG_From_int((int)(8)));
  5710. SWIG_Python_SetConstant(d, "ARCHIVE_FILTER_LZIP",SWIG_From_int((int)(9)));
  5711. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_BASE_MASK",SWIG_From_int((int)(0xff0000)));
  5712. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_CPIO",SWIG_From_int((int)(0x10000)));
  5713. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_CPIO_POSIX",SWIG_From_int((int)((0x10000|1))));
  5714. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_CPIO_BIN_LE",SWIG_From_int((int)((0x10000|2))));
  5715. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_CPIO_BIN_BE",SWIG_From_int((int)((0x10000|3))));
  5716. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_CPIO_SVR4_NOCRC",SWIG_From_int((int)((0x10000|4))));
  5717. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_CPIO_SVR4_CRC",SWIG_From_int((int)((0x10000|5))));
  5718. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_CPIO_AFIO_LARGE",SWIG_From_int((int)((0x10000|6))));
  5719. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_SHAR",SWIG_From_int((int)(0x20000)));
  5720. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_SHAR_BASE",SWIG_From_int((int)((0x20000|1))));
  5721. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_SHAR_DUMP",SWIG_From_int((int)((0x20000|2))));
  5722. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_TAR",SWIG_From_int((int)(0x30000)));
  5723. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_TAR_USTAR",SWIG_From_int((int)((0x30000|1))));
  5724. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE",SWIG_From_int((int)((0x30000|2))));
  5725. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_TAR_PAX_RESTRICTED",SWIG_From_int((int)((0x30000|3))));
  5726. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_TAR_GNUTAR",SWIG_From_int((int)((0x30000|4))));
  5727. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_ISO9660",SWIG_From_int((int)(0x40000)));
  5728. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_ISO9660_ROCKRIDGE",SWIG_From_int((int)((0x40000|1))));
  5729. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_ZIP",SWIG_From_int((int)(0x50000)));
  5730. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_EMPTY",SWIG_From_int((int)(0x60000)));
  5731. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_AR",SWIG_From_int((int)(0x70000)));
  5732. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_AR_GNU",SWIG_From_int((int)((0x70000|1))));
  5733. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_AR_BSD",SWIG_From_int((int)((0x70000|2))));
  5734. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_MTREE",SWIG_From_int((int)(0x80000)));
  5735. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_RAW",SWIG_From_int((int)(0x90000)));
  5736. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_XAR",SWIG_From_int((int)(0xA0000)));
  5737. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_LHA",SWIG_From_int((int)(0xB0000)));
  5738. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_CAB",SWIG_From_int((int)(0xC0000)));
  5739. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_RAR",SWIG_From_int((int)(0xD0000)));
  5740. SWIG_Python_SetConstant(d, "ARCHIVE_FORMAT_7ZIP",SWIG_From_int((int)(0xE0000)));
  5741. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_OWNER",SWIG_From_int((int)((0x0001))));
  5742. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_PERM",SWIG_From_int((int)((0x0002))));
  5743. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_TIME",SWIG_From_int((int)((0x0004))));
  5744. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_NO_OVERWRITE",SWIG_From_int((int)((0x0008))));
  5745. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_UNLINK",SWIG_From_int((int)((0x0010))));
  5746. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_ACL",SWIG_From_int((int)((0x0020))));
  5747. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_FFLAGS",SWIG_From_int((int)((0x0040))));
  5748. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_XATTR",SWIG_From_int((int)((0x0080))));
  5749. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_SECURE_SYMLINKS",SWIG_From_int((int)((0x0100))));
  5750. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_SECURE_NODOTDOT",SWIG_From_int((int)((0x0200))));
  5751. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_NO_AUTODIR",SWIG_From_int((int)((0x0400))));
  5752. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER",SWIG_From_int((int)((0x0800))));
  5753. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_SPARSE",SWIG_From_int((int)((0x1000))));
  5754. SWIG_Python_SetConstant(d, "ARCHIVE_EXTRACT_MAC_METADATA",SWIG_From_int((int)((0x2000))));
  5755. #if PY_VERSION_HEX >= 0x03000000
  5756. return m;
  5757. #else
  5758. return;
  5759. #endif
  5760. }