• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

tools/python/vgrid/vgridlib.c

00001 /* ----------------------------------------------------------------------------
00002  * This file was automatically generated by SWIG (http://www.swig.org).
00003  * Version 1.3.25
00004  * 
00005  * This file is not intended to be easily readable and contains a number of 
00006  * coding conventions designed to improve portability and efficiency. Do not make
00007  * changes to this file unless you know what you are doing--modify the SWIG 
00008  * interface file instead. 
00009  * ----------------------------------------------------------------------------- */
00010 
00011 #define SWIGPYTHON
00012 /***********************************************************************
00013  *
00014  *  This section contains generic SWIG labels for method/variable
00015  *  declarations/attributes, and other compiler dependent labels.
00016  *
00017  ************************************************************************/
00018 
00019 /* template workaround for compilers that cannot correctly implement the C++ standard */
00020 #ifndef SWIGTEMPLATEDISAMBIGUATOR
00021 #  if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
00022 #    define SWIGTEMPLATEDISAMBIGUATOR template
00023 #  else
00024 #    define SWIGTEMPLATEDISAMBIGUATOR 
00025 #  endif
00026 #endif
00027 
00028 /* inline attribute */
00029 #ifndef SWIGINLINE
00030 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
00031 #   define SWIGINLINE inline
00032 # else
00033 #   define SWIGINLINE
00034 # endif
00035 #endif
00036 
00037 /* attribute recognised by some compilers to avoid 'unused' warnings */
00038 #ifndef SWIGUNUSED
00039 # if defined(__GNUC__) || defined(__ICC)
00040 #   define SWIGUNUSED __attribute__ ((unused)) 
00041 # else
00042 #   define SWIGUNUSED 
00043 # endif
00044 #endif
00045 
00046 /* internal SWIG method */
00047 #ifndef SWIGINTERN
00048 # define SWIGINTERN static SWIGUNUSED
00049 #endif
00050 
00051 /* internal inline SWIG method */
00052 #ifndef SWIGINTERNINLINE
00053 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
00054 #endif
00055 
00056 /* exporting methods for Windows DLLs */
00057 #ifndef SWIGEXPORT
00058 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
00059 #   if defined(STATIC_LINKED)
00060 #     define SWIGEXPORT
00061 #   else
00062 #     define SWIGEXPORT __declspec(dllexport)
00063 #   endif
00064 # else
00065 #   define SWIGEXPORT
00066 # endif
00067 #endif
00068 
00069 /* calling conventions for Windows */
00070 #ifndef SWIGSTDCALL
00071 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
00072 #   define SWIGSTDCALL __stdcall
00073 # else
00074 #   define SWIGSTDCALL
00075 # endif 
00076 #endif
00077 
00078 
00079 
00080 #include <Python.h>
00081 
00082 /***********************************************************************
00083  * swigrun.swg
00084  *
00085  *     This file contains generic CAPI SWIG runtime support for pointer
00086  *     type checking.
00087  *
00088  ************************************************************************/
00089 
00090 /* This should only be incremented when either the layout of swig_type_info changes,
00091    or for whatever reason, the runtime changes incompatibly */
00092 #define SWIG_RUNTIME_VERSION "2"
00093 
00094 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
00095 #ifdef SWIG_TYPE_TABLE
00096 # define SWIG_QUOTE_STRING(x) #x
00097 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
00098 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
00099 #else
00100 # define SWIG_TYPE_TABLE_NAME
00101 #endif
00102 
00103 /*
00104   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
00105   creating a static or dynamic library from the swig runtime code.
00106   In 99.9% of the cases, swig just needs to declare them as 'static'.
00107   
00108   But only do this if is strictly necessary, ie, if you have problems
00109   with your compiler or so.
00110 */
00111 
00112 #ifndef SWIGRUNTIME
00113 # define SWIGRUNTIME SWIGINTERN
00114 #endif
00115 
00116 #ifndef SWIGRUNTIMEINLINE
00117 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
00118 #endif
00119 
00120 #include <string.h>
00121 
00122 #ifdef __cplusplus
00123 extern "C" {
00124 #endif
00125 
00126 typedef void *(*swig_converter_func)(void *);
00127 typedef struct swig_type_info *(*swig_dycast_func)(void **);
00128 
00129 /* Structure to store inforomation on one type */
00130 typedef struct swig_type_info {
00131   const char             *name;                        /* mangled name of this type */
00132   const char             *str;                         /* human readable name of this type */
00133   swig_dycast_func        dcast;            /* dynamic cast function down a hierarchy */
00134   struct swig_cast_info  *cast;                        /* linked list of types that can cast into this type */
00135   void                   *clientdata;                  /* language specific type data */
00136 } swig_type_info;
00137 
00138 /* Structure to store a type and conversion function used for casting */
00139 typedef struct swig_cast_info {
00140   swig_type_info         *type;                        /* pointer to type that is equivalent to this type */
00141   swig_converter_func     converter;                   /* function to cast the void pointers */
00142   struct swig_cast_info  *next;                        /* pointer to next cast in linked list */
00143   struct swig_cast_info  *prev;                        /* pointer to the previous cast */
00144 } swig_cast_info;
00145 
00146 /* Structure used to store module information
00147  * Each module generates one structure like this, and the runtime collects
00148  * all of these structures and stores them in a circularly linked list.*/
00149 typedef struct swig_module_info {
00150   swig_type_info         **types;                      /* Array of pointers to swig_type_info structures that are in this module */
00151   size_t                 size;                      /* Number of types in this module */
00152   struct swig_module_info *next;            /* Pointer to next element in circularly linked list */
00153   swig_type_info         **type_initial;    /* Array of initially generated type structures */
00154   swig_cast_info         **cast_initial;    /* Array of initially generated casting structures */
00155   void                    *clientdata;                 /* Language specific module data */
00156 } swig_module_info;
00157 
00158 
00159 /* 
00160   Compare two type names skipping the space characters, therefore
00161   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
00162 
00163   Return 0 when the two name types are equivalent, as in
00164   strncmp, but skipping ' '.
00165 */
00166 SWIGRUNTIME int
00167 SWIG_TypeNameComp(const char *f1, const char *l1,
00168                         const char *f2, const char *l2) {
00169   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
00170     while ((*f1 == ' ') && (f1 != l1)) ++f1;
00171     while ((*f2 == ' ') && (f2 != l2)) ++f2;
00172     if (*f1 != *f2) return (int)(*f1 - *f2);
00173   }
00174   return (l1 - f1) - (l2 - f2);
00175 }
00176 
00177 /*
00178   Check type equivalence in a name list like <name1>|<name2>|...
00179   Return 0 if not equal, 1 if equal
00180 */
00181 SWIGRUNTIME int
00182 SWIG_TypeEquiv(const char *nb, const char *tb) {
00183   int equiv = 0;
00184   const char* te = tb + strlen(tb);
00185   const char* ne = nb;
00186   while (!equiv && *ne) {
00187     for (nb = ne; *ne; ++ne) {
00188       if (*ne == '|') break;
00189     }
00190     equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
00191     if (*ne) ++ne;
00192   }
00193   return equiv;
00194 }
00195 
00196 /*
00197   Check type equivalence in a name list like <name1>|<name2>|...
00198   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
00199 */
00200 SWIGRUNTIME int
00201 SWIG_TypeCompare(const char *nb, const char *tb) {
00202   int equiv = 0;
00203   const char* te = tb + strlen(tb);
00204   const char* ne = nb;
00205   while (!equiv && *ne) {
00206     for (nb = ne; *ne; ++ne) {
00207       if (*ne == '|') break;
00208     }
00209     equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
00210     if (*ne) ++ne;
00211   }
00212   return equiv;
00213 }
00214 
00215 
00216 /* think of this as a c++ template<> or a scheme macro */
00217 #define SWIG_TypeCheck_Template(comparison, ty)         \
00218   if (ty) {                                             \
00219     swig_cast_info *iter = ty->cast;                    \
00220     while (iter) {                                      \
00221       if (comparison) {                                 \
00222         if (iter == ty->cast) return iter;              \
00223         /* Move iter to the top of the linked list */   \
00224         iter->prev->next = iter->next;                  \
00225         if (iter->next)                                 \
00226           iter->next->prev = iter->prev;                \
00227         iter->next = ty->cast;                          \
00228         iter->prev = 0;                                 \
00229         if (ty->cast) ty->cast->prev = iter;            \
00230         ty->cast = iter;                                \
00231         return iter;                                    \
00232       }                                                 \
00233       iter = iter->next;                                \
00234     }                                                   \
00235   }                                                     \
00236   return 0
00237 
00238 /*
00239   Check the typename
00240 */
00241 SWIGRUNTIME swig_cast_info *
00242 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
00243   SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
00244 }
00245 
00246 /* Same as previous function, except strcmp is replaced with a pointer comparison */
00247 SWIGRUNTIME swig_cast_info *
00248 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
00249   SWIG_TypeCheck_Template(iter->type == from, into);
00250 }
00251 
00252 /*
00253   Cast a pointer up an inheritance hierarchy
00254 */
00255 SWIGRUNTIMEINLINE void *
00256 SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
00257   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
00258 }
00259 
00260 /* 
00261    Dynamic pointer casting. Down an inheritance hierarchy
00262 */
00263 SWIGRUNTIME swig_type_info *
00264 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
00265   swig_type_info *lastty = ty;
00266   if (!ty || !ty->dcast) return ty;
00267   while (ty && (ty->dcast)) {
00268     ty = (*ty->dcast)(ptr);
00269     if (ty) lastty = ty;
00270   }
00271   return lastty;
00272 }
00273 
00274 /*
00275   Return the name associated with this type
00276 */
00277 SWIGRUNTIMEINLINE const char *
00278 SWIG_TypeName(const swig_type_info *ty) {
00279   return ty->name;
00280 }
00281 
00282 /*
00283   Return the pretty name associated with this type,
00284   that is an unmangled type name in a form presentable to the user.
00285 */
00286 SWIGRUNTIME const char *
00287 SWIG_TypePrettyName(const swig_type_info *type) {
00288   /* The "str" field contains the equivalent pretty names of the
00289      type, separated by vertical-bar characters.  We choose
00290      to print the last name, as it is often (?) the most
00291      specific. */
00292   if (type->str != NULL) {
00293     const char *last_name = type->str;
00294     const char *s;
00295     for (s = type->str; *s; s++)
00296       if (*s == '|') last_name = s+1;
00297     return last_name;
00298   }
00299   else
00300     return type->name;
00301 }
00302 
00303 /* 
00304    Set the clientdata field for a type
00305 */
00306 SWIGRUNTIME void
00307 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
00308   if (!ti->clientdata) {
00309     swig_cast_info *cast = ti->cast;
00310     /* if (ti->clientdata == clientdata) return; */
00311     ti->clientdata = clientdata;
00312     
00313     while (cast) {
00314       if (!cast->converter)
00315            SWIG_TypeClientData(cast->type, clientdata);
00316       cast = cast->next;
00317     }
00318   }
00319 }
00320 
00321 /*
00322   Search for a swig_type_info structure only by mangled name
00323   Search is a O(log #types)
00324   
00325   We start searching at module start, and finish searching when start == end.  
00326   Note: if start == end at the beginning of the function, we go all the way around
00327   the circular list.
00328 */
00329 SWIGRUNTIME swig_type_info *
00330 SWIG_MangledTypeQueryModule(swig_module_info *start, 
00331                             swig_module_info *end, 
00332                                   const char *name) {
00333   swig_module_info *iter = start;
00334   do {
00335     if (iter->size) {
00336       register size_t l = 0;
00337       register size_t r = iter->size - 1;
00338       do {
00339            /* since l+r >= 0, we can (>> 1) instead (/ 2) */
00340            register size_t i = (l + r) >> 1; 
00341            const char *iname = iter->types[i]->name;
00342            if (iname) {
00343              register int compare = strcmp(name, iname);
00344              if (compare == 0) {     
00345                return iter->types[i];
00346              } else if (compare < 0) {
00347                if (i) {
00348                  r = i - 1;
00349                } else {
00350                  break;
00351                }
00352              } else if (compare > 0) {
00353                l = i + 1;
00354              }
00355            } else {
00356              break; /* should never happen */
00357            }
00358       } while (l <= r);
00359     }
00360     iter = iter->next;
00361   } while (iter != end);
00362   return 0;
00363 }
00364 
00365 /*
00366   Search for a swig_type_info structure for either a mangled name or a human readable name.
00367   It first searches the mangled names of the types, which is a O(log #types)
00368   If a type is not found it then searches the human readable names, which is O(#types).
00369   
00370   We start searching at module start, and finish searching when start == end.  
00371   Note: if start == end at the beginning of the function, we go all the way around
00372   the circular list.
00373 */
00374 SWIGRUNTIME swig_type_info *
00375 SWIG_TypeQueryModule(swig_module_info *start, 
00376                      swig_module_info *end, 
00377                            const char *name) {
00378   /* STEP 1: Search the name field using binary search */
00379   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
00380   if (ret) {
00381     return ret;
00382   } else {
00383     /* STEP 2: If the type hasn't been found, do a complete search
00384        of the str field (the human readable name) */
00385     swig_module_info *iter = start;
00386     do {
00387       register size_t i = 0;
00388       for (; i < iter->size; ++i) {
00389            if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
00390              return iter->types[i];
00391       }
00392       iter = iter->next;
00393     } while (iter != end);
00394   }
00395   
00396   /* neither found a match */
00397   return 0;
00398 }
00399 
00400 
00401 /* 
00402    Pack binary data into a string
00403 */
00404 SWIGRUNTIME char *
00405 SWIG_PackData(char *c, void *ptr, size_t sz) {
00406   static const char hex[17] = "0123456789abcdef";
00407   register const unsigned char *u = (unsigned char *) ptr;
00408   register const unsigned char *eu =  u + sz;
00409   for (; u != eu; ++u) {
00410     register unsigned char uu = *u;
00411     *(c++) = hex[(uu & 0xf0) >> 4];
00412     *(c++) = hex[uu & 0xf];
00413   }
00414   return c;
00415 }
00416 
00417 /* 
00418    Unpack binary data from a string
00419 */
00420 SWIGRUNTIME const char *
00421 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
00422   register unsigned char *u = (unsigned char *) ptr;
00423   register const unsigned char *eu = u + sz;
00424   for (; u != eu; ++u) {
00425     register char d = *(c++);
00426     register unsigned char uu = 0;
00427     if ((d >= '0') && (d <= '9'))
00428       uu = ((d - '0') << 4);
00429     else if ((d >= 'a') && (d <= 'f'))
00430       uu = ((d - ('a'-10)) << 4);
00431     else 
00432       return (char *) 0;
00433     d = *(c++);
00434     if ((d >= '0') && (d <= '9'))
00435       uu |= (d - '0');
00436     else if ((d >= 'a') && (d <= 'f'))
00437       uu |= (d - ('a'-10));
00438     else 
00439       return (char *) 0;
00440     *u = uu;
00441   }
00442   return c;
00443 }
00444 
00445 /* 
00446    Pack 'void *' into a string buffer.
00447 */
00448 SWIGRUNTIME char *
00449 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
00450   char *r = buff;
00451   if ((2*sizeof(void *) + 2) > bsz) return 0;
00452   *(r++) = '_';
00453   r = SWIG_PackData(r,&ptr,sizeof(void *));
00454   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
00455   strcpy(r,name);
00456   return buff;
00457 }
00458 
00459 SWIGRUNTIME const char *
00460 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
00461   if (*c != '_') {
00462     if (strcmp(c,"NULL") == 0) {
00463       *ptr = (void *) 0;
00464       return name;
00465     } else {
00466       return 0;
00467     }
00468   }
00469   return SWIG_UnpackData(++c,ptr,sizeof(void *));
00470 }
00471 
00472 SWIGRUNTIME char *
00473 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
00474   char *r = buff;
00475   size_t lname = (name ? strlen(name) : 0);
00476   if ((2*sz + 2 + lname) > bsz) return 0;
00477   *(r++) = '_';
00478   r = SWIG_PackData(r,ptr,sz);
00479   if (lname) {
00480     strncpy(r,name,lname+1);
00481   } else {
00482     *r = 0;
00483   }
00484   return buff;
00485 }
00486 
00487 SWIGRUNTIME const char *
00488 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
00489   if (*c != '_') {
00490     if (strcmp(c,"NULL") == 0) {
00491       memset(ptr,0,sz);
00492       return name;
00493     } else {
00494       return 0;
00495     }
00496   }
00497   return SWIG_UnpackData(++c,ptr,sz);
00498 }
00499 
00500 #ifdef __cplusplus
00501 }
00502 #endif
00503 
00504 /* -----------------------------------------------------------------------------
00505  * SWIG API. Portion that goes into the runtime
00506  * ----------------------------------------------------------------------------- */
00507 
00508 #ifdef __cplusplus
00509 extern "C" {
00510 #endif
00511 
00512 /* -----------------------------------------------------------------------------
00513  * for internal method declarations
00514  * ----------------------------------------------------------------------------- */
00515 
00516 #ifndef SWIGINTERN
00517 #  define SWIGINTERN static SWIGUNUSED
00518 #endif
00519 
00520 #ifndef SWIGINTERNINLINE
00521 #  define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
00522 #endif
00523 
00524 /*
00525   Exception handling in wrappers
00526 */
00527 #define SWIG_fail                goto fail
00528 #define SWIG_arg_fail(arg)       SWIG_Python_ArgFail(arg)
00529 #define SWIG_append_errmsg(msg)   SWIG_Python_AddErrMesg(msg,0)
00530 #define SWIG_preppend_errmsg(msg) SWIG_Python_AddErrMesg(msg,1)
00531 #define SWIG_type_error(type,obj) SWIG_Python_TypeError(type,obj)
00532 #define SWIG_null_ref(type)       SWIG_Python_NullRef(type)
00533 
00534 /*
00535   Contract support
00536 */
00537 #define SWIG_contract_assert(expr, msg) \
00538  if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else
00539 
00540 /* -----------------------------------------------------------------------------
00541  * Constant declarations
00542  * ----------------------------------------------------------------------------- */
00543 
00544 /* Constant Types */
00545 #define SWIG_PY_INT     1
00546 #define SWIG_PY_FLOAT   2
00547 #define SWIG_PY_STRING  3
00548 #define SWIG_PY_POINTER 4
00549 #define SWIG_PY_BINARY  5
00550 
00551 /* Constant information structure */
00552 typedef struct swig_const_info {
00553     int type;
00554     char *name;
00555     long lvalue;
00556     double dvalue;
00557     void   *pvalue;
00558     swig_type_info **ptype;
00559 } swig_const_info;
00560 
00561 
00562 /* -----------------------------------------------------------------------------
00563  * Alloc. memory flags
00564  * ----------------------------------------------------------------------------- */
00565 #define SWIG_OLDOBJ  1
00566 #define SWIG_NEWOBJ  SWIG_OLDOBJ + 1
00567 #define SWIG_PYSTR   SWIG_NEWOBJ + 1
00568 
00569 #ifdef __cplusplus
00570 }
00571 #endif
00572 
00573 
00574 /***********************************************************************
00575  * pyrun.swg
00576  *
00577  *     This file contains the runtime support for Python modules
00578  *     and includes code for managing global variables and pointer
00579  *     type checking.
00580  *
00581  * Author : David Beazley (beazley@cs.uchicago.edu)
00582  ************************************************************************/
00583 
00584 /* Common SWIG API */
00585 #define SWIG_ConvertPtr(obj, pp, type, flags)    SWIG_Python_ConvertPtr(obj, pp, type, flags)
00586 #define SWIG_NewPointerObj(p, type, flags)       SWIG_Python_NewPointerObj(p, type, flags)
00587 #define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
00588  
00589 
00590 /* Python-specific SWIG API */
00591 #define SWIG_ConvertPacked(obj, ptr, sz, ty, flags)   SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags)
00592 #define SWIG_NewPackedObj(ptr, sz, type)              SWIG_Python_NewPackedObj(ptr, sz, type)
00593 
00594 /* Runtime API */
00595 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule()
00596 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
00597 
00598 /* -----------------------------------------------------------------------------
00599  * Pointer declarations
00600  * ----------------------------------------------------------------------------- */
00601 /*
00602   Use SWIG_NO_COBJECT_TYPES to force the use of strings to represent
00603   C/C++ pointers in the python side. Very useful for debugging, but
00604   not always safe.
00605 */
00606 #if !defined(SWIG_NO_COBJECT_TYPES) && !defined(SWIG_COBJECT_TYPES)
00607 #  define SWIG_COBJECT_TYPES
00608 #endif
00609 
00610 /* Flags for pointer conversion */
00611 #define SWIG_POINTER_EXCEPTION     0x1
00612 #define SWIG_POINTER_DISOWN        0x2
00613 
00614 
00615 /* Add PyOS_snprintf for old Pythons */
00616 #if PY_VERSION_HEX < 0x02020000
00617 #define PyOS_snprintf snprintf
00618 #endif
00619 
00620 #ifdef __cplusplus
00621 extern "C" {
00622 #endif
00623 
00624 /* -----------------------------------------------------------------------------
00625  * Create a new pointer string 
00626  * ----------------------------------------------------------------------------- */
00627 #ifndef SWIG_BUFFER_SIZE
00628 #define SWIG_BUFFER_SIZE 1024
00629 #endif
00630 
00631 #if defined(SWIG_COBJECT_TYPES)
00632 #if !defined(SWIG_COBJECT_PYTHON)
00633 /* -----------------------------------------------------------------------------
00634  * Implements a simple Swig Object type, and use it instead of PyCObject
00635  * ----------------------------------------------------------------------------- */
00636 
00637 typedef struct {
00638   PyObject_HEAD
00639   void *ptr;
00640   const char *desc;
00641 } PySwigObject;
00642 
00643 /* Declarations for objects of type PySwigObject */
00644 
00645 SWIGRUNTIME int
00646 PySwigObject_print(PySwigObject *v, FILE *fp, int flags)
00647 {
00648   char result[SWIG_BUFFER_SIZE];
00649   flags = flags;
00650   if (SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result))) {
00651     fputs("<Swig Object at ", fp); fputs(result, fp); fputs(">", fp);
00652     return 0; 
00653   } else {
00654     return 1; 
00655   }
00656 }
00657   
00658 SWIGRUNTIME PyObject *
00659 PySwigObject_repr(PySwigObject *v)
00660 {
00661   char result[SWIG_BUFFER_SIZE];
00662   return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ?
00663     PyString_FromFormat("<Swig Object at %s>", result) : 0;
00664 }
00665 
00666 SWIGRUNTIME PyObject *
00667 PySwigObject_str(PySwigObject *v)
00668 {
00669   char result[SWIG_BUFFER_SIZE];
00670   return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ?
00671     PyString_FromString(result) : 0;
00672 }
00673 
00674 SWIGRUNTIME PyObject *
00675 PySwigObject_long(PySwigObject *v)
00676 {
00677   return PyLong_FromVoidPtr(v->ptr);
00678 }
00679 
00680 SWIGRUNTIME PyObject *
00681 PySwigObject_format(const char* fmt, PySwigObject *v)
00682 {
00683   PyObject *res = NULL;
00684   PyObject *args = PyTuple_New(1);
00685   if (args && (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0)) {
00686     PyObject *ofmt = PyString_FromString(fmt);
00687     if (ofmt) {
00688       res = PyString_Format(ofmt,args);
00689       Py_DECREF(ofmt);
00690     }
00691     Py_DECREF(args);
00692   }  
00693   return res;
00694 }
00695 
00696 SWIGRUNTIME PyObject *
00697 PySwigObject_oct(PySwigObject *v)
00698 {
00699   return PySwigObject_format("%o",v);
00700 }
00701 
00702 SWIGRUNTIME PyObject *
00703 PySwigObject_hex(PySwigObject *v)
00704 {
00705   return PySwigObject_format("%x",v);
00706 }
00707 
00708 SWIGRUNTIME int
00709 PySwigObject_compare(PySwigObject *v, PySwigObject *w)
00710 {
00711   int c = strcmp(v->desc, w->desc);
00712   if (c) {
00713     return (c > 0) ? 1 : -1;
00714   } else {
00715     void *i = v->ptr;
00716     void *j = w->ptr;
00717     return (i < j) ? -1 : ((i > j) ? 1 : 0);
00718   }
00719 }
00720 
00721 SWIGRUNTIME void
00722 PySwigObject_dealloc(PySwigObject *self)
00723 {
00724   PyObject_DEL(self);
00725 }
00726 
00727 SWIGRUNTIME PyTypeObject*
00728 PySwigObject_type(void) {
00729   static char pyswigobject_type__doc__[] = 
00730     "Swig object carries a C/C++ instance pointer";
00731   
00732   static PyNumberMethods PySwigObject_as_number = {
00733     (binaryfunc)0, /*nb_add*/
00734     (binaryfunc)0, /*nb_subtract*/
00735     (binaryfunc)0, /*nb_multiply*/
00736     (binaryfunc)0, /*nb_divide*/
00737     (binaryfunc)0, /*nb_remainder*/
00738     (binaryfunc)0, /*nb_divmod*/
00739     (ternaryfunc)0,/*nb_power*/
00740     (unaryfunc)0,  /*nb_negative*/
00741     (unaryfunc)0,  /*nb_positive*/
00742     (unaryfunc)0,  /*nb_absolute*/
00743     (inquiry)0,    /*nb_nonzero*/
00744     0,                   /*nb_invert*/
00745     0,                   /*nb_lshift*/
00746     0,                   /*nb_rshift*/
00747     0,                   /*nb_and*/
00748     0,                   /*nb_xor*/
00749     0,                   /*nb_or*/
00750     (coercion)0,   /*nb_coerce*/
00751     (unaryfunc)PySwigObject_long, /*nb_int*/
00752     (unaryfunc)PySwigObject_long, /*nb_long*/
00753     (unaryfunc)0,                 /*nb_float*/
00754     (unaryfunc)PySwigObject_oct,  /*nb_oct*/
00755     (unaryfunc)PySwigObject_hex,  /*nb_hex*/
00756 #if PY_VERSION_HEX >= 0x02000000
00757     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ 
00758 #endif
00759   };
00760 
00761   static PyTypeObject pyswigobject_type
00762 #if !defined(__cplusplus)
00763   ;  
00764   static int type_init = 0;
00765   if (!type_init) {
00766     PyTypeObject tmp
00767 #endif
00768     = {
00769     PyObject_HEAD_INIT(&PyType_Type)
00770     0,                                                 /*ob_size*/
00771     (char *)"PySwigObject",                 /*tp_name*/
00772     sizeof(PySwigObject),                   /*tp_basicsize*/
00773     0,                                                 /*tp_itemsize*/
00774     /* methods */
00775     (destructor)PySwigObject_dealloc,       /*tp_dealloc*/
00776     (printfunc)PySwigObject_print,          /*tp_print*/
00777     (getattrfunc)0,                         /*tp_getattr*/
00778     (setattrfunc)0,                         /*tp_setattr*/
00779     (cmpfunc)PySwigObject_compare,          /*tp_compare*/
00780     (reprfunc)PySwigObject_repr, /*tp_repr*/
00781     &PySwigObject_as_number,             /*tp_as_number*/
00782     0,                                                 /*tp_as_sequence*/
00783     0,                                                 /*tp_as_mapping*/
00784     (hashfunc)0,                            /*tp_hash*/
00785     (ternaryfunc)0,                         /*tp_call*/
00786     (reprfunc)PySwigObject_str,             /*tp_str*/
00787     /* Space for future expansion */
00788     0,0,0,0,
00789     pyswigobject_type__doc__,            /* Documentation string */
00790 #if PY_VERSION_HEX >= 0x02000000
00791     0,                                  /* tp_traverse */
00792     0,                                  /* tp_clear */
00793 #endif
00794 #if PY_VERSION_HEX >= 0x02010000
00795     0,                                  /* tp_richcompare */
00796     0,                                  /* tp_weaklistoffset */
00797 #endif
00798 #if PY_VERSION_HEX >= 0x02020000
00799     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
00800 #endif
00801 #if PY_VERSION_HEX >= 0x02030000
00802     0,                                  /* tp_del */
00803 #endif
00804 #ifdef COUNT_ALLOCS
00805     0,0,0,0                             /* tp_alloc -> tp_next */
00806 #endif
00807     };
00808 #if !defined(__cplusplus)
00809     pyswigobject_type = tmp;
00810     type_init = 1;
00811   }
00812 #endif
00813   return &pyswigobject_type;
00814 }
00815 
00816 SWIGRUNTIME PyObject *
00817 PySwigObject_FromVoidPtrAndDesc(void *ptr, const char *desc)
00818 {
00819   PySwigObject *self = PyObject_NEW(PySwigObject, PySwigObject_type());
00820   if (self) {
00821     self->ptr = ptr;
00822     self->desc = desc;
00823   }
00824   return (PyObject *)self;
00825 }
00826 
00827 SWIGRUNTIMEINLINE void *
00828 PySwigObject_AsVoidPtr(PyObject *self)
00829 {
00830   return ((PySwigObject *)self)->ptr;
00831 }
00832 
00833 SWIGRUNTIMEINLINE const char *
00834 PySwigObject_GetDesc(PyObject *self)
00835 {
00836   return ((PySwigObject *)self)->desc;
00837 }
00838 
00839 SWIGRUNTIMEINLINE int
00840 PySwigObject_Check(PyObject *op) {
00841   return ((op)->ob_type == PySwigObject_type()) 
00842     || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
00843 }
00844 
00845 /* -----------------------------------------------------------------------------
00846  * Implements a simple Swig Packed type, and use it instead of string
00847  * ----------------------------------------------------------------------------- */
00848 
00849 typedef struct {
00850   PyObject_HEAD
00851   void *pack;
00852   const char *desc;
00853   size_t size;
00854 } PySwigPacked;
00855 
00856 SWIGRUNTIME int
00857 PySwigPacked_print(PySwigPacked *v, FILE *fp, int flags)
00858 {
00859   char result[SWIG_BUFFER_SIZE];
00860   flags = flags;
00861   fputs("<Swig Packed ", fp); 
00862   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
00863     fputs("at ", fp); 
00864     fputs(result, fp); 
00865   }
00866   fputs(v->desc,fp); 
00867   fputs(">", fp);
00868   return 0; 
00869 }
00870   
00871 SWIGRUNTIME PyObject *
00872 PySwigPacked_repr(PySwigPacked *v)
00873 {
00874   char result[SWIG_BUFFER_SIZE];
00875   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
00876     return PyString_FromFormat("<Swig Packed at %s%s>", result, v->desc);
00877   } else {
00878     return PyString_FromFormat("<Swig Packed %s>", v->desc);
00879   }  
00880 }
00881 
00882 SWIGRUNTIME PyObject *
00883 PySwigPacked_str(PySwigPacked *v)
00884 {
00885   char result[SWIG_BUFFER_SIZE];
00886   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
00887     return PyString_FromFormat("%s%s", result, v->desc);
00888   } else {
00889     return PyString_FromFormat("%s", v->desc);
00890   }  
00891 }
00892 
00893 SWIGRUNTIME int
00894 PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
00895 {
00896   int c = strcmp(v->desc, w->desc);
00897   if (c) {
00898     return (c > 0) ? 1 : -1;
00899   } else {
00900     size_t i = v->size;
00901     size_t j = w->size;
00902     int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
00903     return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
00904   }
00905 }
00906 
00907 SWIGRUNTIME void
00908 PySwigPacked_dealloc(PySwigPacked *self)
00909 {
00910   free(self->pack);
00911   PyObject_DEL(self);
00912 }
00913 
00914 SWIGRUNTIME PyTypeObject*
00915 PySwigPacked_type(void) {
00916   static char pyswigpacked_type__doc__[] = 
00917     "Swig object carries a C/C++ instance pointer";
00918   static PyTypeObject pyswigpacked_type
00919 #if !defined(__cplusplus)
00920   ;
00921   static int type_init = 0;  
00922   if (!type_init) {
00923     PyTypeObject tmp
00924 #endif
00925     = {
00926     PyObject_HEAD_INIT(&PyType_Type)
00927     0,                                                 /*ob_size*/
00928     (char *)"PySwigPacked",                 /*tp_name*/
00929     sizeof(PySwigPacked),                   /*tp_basicsize*/
00930     0,                                                 /*tp_itemsize*/
00931     /* methods */
00932     (destructor)PySwigPacked_dealloc,       /*tp_dealloc*/
00933     (printfunc)PySwigPacked_print,          /*tp_print*/
00934     (getattrfunc)0,                         /*tp_getattr*/
00935     (setattrfunc)0,                         /*tp_setattr*/
00936     (cmpfunc)PySwigPacked_compare,          /*tp_compare*/
00937     (reprfunc)PySwigPacked_repr, /*tp_repr*/
00938     0,                                     /*tp_as_number*/
00939     0,                                                 /*tp_as_sequence*/
00940     0,                                                 /*tp_as_mapping*/
00941     (hashfunc)0,                            /*tp_hash*/
00942     (ternaryfunc)0,                         /*tp_call*/
00943     (reprfunc)PySwigPacked_str,             /*tp_str*/
00944     /* Space for future expansion */
00945     0,0,0,0,
00946     pyswigpacked_type__doc__,            /* Documentation string */
00947 #if PY_VERSION_HEX >= 0x02000000
00948     0,                                  /* tp_traverse */
00949     0,                                  /* tp_clear */
00950 #endif
00951 #if PY_VERSION_HEX >= 0x02010000
00952     0,                                  /* tp_richcompare */
00953     0,                                  /* tp_weaklistoffset */
00954 #endif
00955 #if PY_VERSION_HEX >= 0x02020000         
00956     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
00957 #endif
00958 #if PY_VERSION_HEX >= 0x02030000
00959     0,                                  /* tp_del */
00960 #endif
00961 #ifdef COUNT_ALLOCS
00962     0,0,0,0                             /* tp_alloc -> tp_next */
00963 #endif
00964     };
00965 #if !defined(__cplusplus)
00966     pyswigpacked_type = tmp;
00967     type_init = 1;
00968   }
00969 #endif
00970   return &pyswigpacked_type;
00971 }
00972 
00973 SWIGRUNTIME PyObject *
00974 PySwigPacked_FromDataAndDesc(void *ptr, size_t size, const char *desc)
00975 {
00976   PySwigPacked *self = PyObject_NEW(PySwigPacked, PySwigPacked_type());
00977   if (self == NULL) {
00978     return NULL;
00979   } else {
00980     void *pack = malloc(size);
00981     if (pack) {
00982       memcpy(pack, ptr, size);
00983       self->pack = pack;
00984       self->desc = desc;
00985       self->size = size;
00986       return (PyObject *) self;
00987     }
00988     return NULL;
00989   }
00990 }
00991 
00992 SWIGRUNTIMEINLINE const char *
00993 PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
00994 {
00995   PySwigPacked *self = (PySwigPacked *)obj;
00996   if (self->size != size) return 0;
00997   memcpy(ptr, self->pack, size);
00998   return self->desc;
00999 }
01000 
01001 SWIGRUNTIMEINLINE const char *
01002 PySwigPacked_GetDesc(PyObject *self)
01003 {
01004   return ((PySwigPacked *)self)->desc;
01005 }
01006 
01007 SWIGRUNTIMEINLINE int
01008 PySwigPacked_Check(PyObject *op) {
01009   return ((op)->ob_type == PySwigPacked_type()) 
01010     || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
01011 }
01012 
01013 #else
01014 /* -----------------------------------------------------------------------------
01015  * Use the old Python PyCObject instead of PySwigObject
01016  * ----------------------------------------------------------------------------- */
01017 
01018 #define PySwigObject_GetDesc(obj)                      PyCObject_GetDesc(obj)
01019 #define PySwigObject_Check(obj)             PyCObject_Check(obj)
01020 #define PySwigObject_AsVoidPtr(obj)            PyCObject_AsVoidPtr(obj)
01021 #define PySwigObject_FromVoidPtrAndDesc(p, d)  PyCObject_FromVoidPtrAndDesc(p, d, NULL)
01022 
01023 #endif
01024 
01025 #endif
01026 
01027 /* -----------------------------------------------------------------------------
01028  * errors manipulation
01029  * ----------------------------------------------------------------------------- */
01030 
01031 SWIGRUNTIME void
01032 SWIG_Python_TypeError(const char *type, PyObject *obj)
01033 {
01034   if (type) {
01035 #if defined(SWIG_COBJECT_TYPES)
01036     if (obj && PySwigObject_Check(obj)) {
01037       const char *otype = (const char *) PySwigObject_GetDesc(obj);
01038       if (otype) {
01039            PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
01040                            type, otype);
01041            return;
01042       }
01043     } else 
01044 #endif      
01045     {
01046       const char *otype = (obj ? obj->ob_type->tp_name : 0); 
01047       if (otype) {
01048            PyObject *str = PyObject_Str(obj);
01049            const char *cstr = str ? PyString_AsString(str) : 0;
01050            if (cstr) {
01051              PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
01052                              type, otype, cstr);
01053            } else {
01054              PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
01055                              type, otype);
01056            }
01057            Py_XDECREF(str);
01058            return;
01059       }
01060     }   
01061     PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
01062   } else {
01063     PyErr_Format(PyExc_TypeError, "unexpected type is received");
01064   }
01065 }
01066 
01067 SWIGRUNTIMEINLINE void
01068 SWIG_Python_NullRef(const char *type)
01069 {
01070   if (type) {
01071     PyErr_Format(PyExc_TypeError, "null reference of type '%s' was received",type);
01072   } else {
01073     PyErr_Format(PyExc_TypeError, "null reference was received");
01074   }
01075 }
01076 
01077 SWIGRUNTIME int
01078 SWIG_Python_AddErrMesg(const char* mesg, int infront)
01079 {
01080   if (PyErr_Occurred()) {
01081     PyObject *type = 0;
01082     PyObject *value = 0;
01083     PyObject *traceback = 0;
01084     PyErr_Fetch(&type, &value, &traceback);
01085     if (value) {
01086       PyObject *old_str = PyObject_Str(value);
01087       Py_XINCREF(type);
01088       PyErr_Clear();
01089       if (infront) {
01090            PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
01091       } else {
01092            PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
01093       }
01094       Py_DECREF(old_str);
01095     }
01096     return 1;
01097   } else {
01098     return 0;
01099   }
01100 }
01101 
01102 SWIGRUNTIME int
01103 SWIG_Python_ArgFail(int argnum)
01104 {
01105   if (PyErr_Occurred()) {
01106     /* add information about failing argument */
01107     char mesg[256];
01108     PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
01109     return SWIG_Python_AddErrMesg(mesg, 1);
01110   } else {
01111     return 0;
01112   }
01113 }
01114 
01115 
01116 /* -----------------------------------------------------------------------------
01117  * pointers/data manipulation
01118  * ----------------------------------------------------------------------------- */
01119 
01120 /* Convert a pointer value */
01121 SWIGRUNTIME int
01122 SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) {
01123   swig_cast_info *tc;
01124   const char *c = 0;
01125   static PyObject *SWIG_this = 0;
01126   int    newref = 0;
01127   PyObject  *pyobj = 0;
01128   void *vptr;
01129   
01130   if (!obj) return 0;
01131   if (obj == Py_None) {
01132     *ptr = 0;
01133     return 0;
01134   }
01135 
01136 #ifdef SWIG_COBJECT_TYPES
01137   if (!(PySwigObject_Check(obj))) {
01138     if (!SWIG_this)
01139       SWIG_this = PyString_FromString("this");
01140     pyobj = obj;
01141     obj = PyObject_GetAttr(obj,SWIG_this);
01142     newref = 1;
01143     if (!obj) goto type_error;
01144     if (!PySwigObject_Check(obj)) {
01145       Py_DECREF(obj);
01146       goto type_error;
01147     }
01148   }  
01149   vptr = PySwigObject_AsVoidPtr(obj);
01150   c = (const char *) PySwigObject_GetDesc(obj);
01151   if (newref) { Py_DECREF(obj); }
01152   goto type_check;
01153 #else
01154   if (!(PyString_Check(obj))) {
01155     if (!SWIG_this)
01156       SWIG_this = PyString_FromString("this");
01157     pyobj = obj;
01158     obj = PyObject_GetAttr(obj,SWIG_this);
01159     newref = 1;
01160     if (!obj) goto type_error;
01161     if (!PyString_Check(obj)) {
01162       Py_DECREF(obj);
01163       goto type_error;
01164     }
01165   } 
01166   c = PyString_AS_STRING(obj);
01167   /* Pointer values must start with leading underscore */
01168   c = SWIG_UnpackVoidPtr(c, &vptr, ty->name);
01169   if (newref) { Py_DECREF(obj); }
01170   if (!c) goto type_error;
01171 #endif
01172 
01173 type_check:
01174   if (ty) {
01175     tc = SWIG_TypeCheck(c,ty);
01176     if (!tc) goto type_error;
01177     *ptr = SWIG_TypeCast(tc,vptr);
01178   } else {
01179     *ptr = vptr;
01180   }
01181   if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) {
01182     PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False);
01183   }
01184   return 0;
01185 
01186 type_error:
01187   PyErr_Clear();
01188   if (pyobj && !obj) {    
01189     obj = pyobj;
01190     if (PyCFunction_Check(obj)) {
01191       /* here we get the method pointer for callbacks */
01192       char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
01193       c = doc ? strstr(doc, "swig_ptr: ") : 0;
01194       if (c) {
01195            c = ty ? SWIG_UnpackVoidPtr(c + 10, &vptr, ty->name) : 0;
01196            if (!c) goto type_error;
01197            goto type_check;
01198       }
01199     }
01200   }
01201   if (flags & SWIG_POINTER_EXCEPTION) {
01202     if (ty) {
01203       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
01204     } else {
01205       SWIG_Python_TypeError("C/C++ pointer", obj);
01206     }
01207   }
01208   return -1;
01209 }
01210 
01211 /* Convert a pointer value, signal an exception on a type mismatch */
01212 SWIGRUNTIME void *
01213 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
01214   void *result;
01215   if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
01216     PyErr_Clear();
01217     if (flags & SWIG_POINTER_EXCEPTION) {
01218       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
01219       SWIG_Python_ArgFail(argnum);
01220     }
01221   }
01222   return result;
01223 }
01224 
01225 /* Convert a packed value value */
01226 SWIGRUNTIME int
01227 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty, int flags) {
01228   swig_cast_info *tc;
01229   const char *c = 0;
01230 
01231 #if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON)
01232   c = PySwigPacked_UnpackData(obj, ptr, sz);
01233 #else
01234   if ((!obj) || (!PyString_Check(obj))) goto type_error;
01235   c = PyString_AS_STRING(obj);
01236   /* Pointer values must start with leading underscore */
01237   c = SWIG_UnpackDataName(c, ptr, sz, ty->name);
01238 #endif
01239   if (!c) goto type_error;
01240   if (ty) {
01241     tc = SWIG_TypeCheck(c,ty);
01242     if (!tc) goto type_error;
01243   }
01244   return 0;
01245 
01246 type_error:
01247   PyErr_Clear();
01248   if (flags & SWIG_POINTER_EXCEPTION) {
01249     if (ty) {
01250       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
01251     } else {
01252       SWIG_Python_TypeError("C/C++ packed data", obj);
01253     }
01254   }
01255   return -1;
01256 }  
01257 
01258 /* Create a new array object */
01259 SWIGRUNTIME PyObject *
01260 SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) {
01261   PyObject *robj = 0;
01262   if (!type) {
01263     if (!PyErr_Occurred()) {
01264       PyErr_Format(PyExc_TypeError, "Swig: null type passed to NewPointerObj");
01265     }
01266     return robj;
01267   }
01268   if (!ptr) {
01269     Py_INCREF(Py_None);
01270     return Py_None;
01271   }
01272 #ifdef SWIG_COBJECT_TYPES
01273   robj = PySwigObject_FromVoidPtrAndDesc((void *) ptr, (char *)type->name);
01274 #else
01275   {
01276     char result[SWIG_BUFFER_SIZE];
01277     robj = SWIG_PackVoidPtr(result, ptr, type->name, sizeof(result)) ?
01278       PyString_FromString(result) : 0;
01279   }
01280 #endif
01281   if (!robj || (robj == Py_None)) return robj;
01282   if (type->clientdata) {
01283     PyObject *inst;
01284     PyObject *args = Py_BuildValue((char*)"(O)", robj);
01285     Py_DECREF(robj);
01286     inst = PyObject_CallObject((PyObject *) type->clientdata, args);
01287     Py_DECREF(args);
01288     if (inst) {
01289       if (own) {
01290         PyObject_SetAttrString(inst,(char*)"thisown",Py_True);
01291       }
01292       robj = inst;
01293     }
01294   }
01295   return robj;
01296 }
01297 
01298 SWIGRUNTIME PyObject *
01299 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
01300   PyObject *robj = 0;
01301   if (!ptr) {
01302     Py_INCREF(Py_None);
01303     return Py_None;
01304   }
01305 #if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON)
01306   robj = PySwigPacked_FromDataAndDesc((void *) ptr, sz, (char *)type->name);
01307 #else
01308   {
01309     char result[SWIG_BUFFER_SIZE];
01310     robj = SWIG_PackDataName(result, ptr, sz, type->name, sizeof(result)) ?
01311       PyString_FromString(result) : 0;
01312   }
01313 #endif
01314   return robj;
01315 }
01316 
01317 /* -----------------------------------------------------------------------------*
01318  *  Get type list 
01319  * -----------------------------------------------------------------------------*/
01320 
01321 #ifdef SWIG_LINK_RUNTIME
01322 void *SWIG_ReturnGlobalTypeList(void *);
01323 #endif
01324 
01325 SWIGRUNTIME swig_module_info *
01326 SWIG_Python_GetModule(void) {
01327   static void *type_pointer = (void *)0;
01328   /* first check if module already created */
01329   if (!type_pointer) {
01330 #ifdef SWIG_LINK_RUNTIME
01331     type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
01332 #else
01333     type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
01334                                                 (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
01335     if (PyErr_Occurred()) {
01336       PyErr_Clear();
01337       type_pointer = (void *)0;
01338     }
01339   }
01340 #endif
01341   return (swig_module_info *) type_pointer;
01342 }
01343 
01344 SWIGRUNTIME void
01345 SWIG_Python_SetModule(swig_module_info *swig_module) {
01346   static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
01347 
01348   PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
01349                                                swig_empty_runtime_method_table);
01350   PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, NULL);
01351   if (pointer && module) {
01352     PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
01353   }
01354 }
01355 
01356 #ifdef __cplusplus
01357 }
01358 #endif
01359 
01360 
01361 /* -------- TYPES TABLE (BEGIN) -------- */
01362 
01363 #define SWIGTYPE_p_Vgrid swig_types[0]
01364 #define SWIGTYPE_p_char swig_types[1]
01365 #define SWIGTYPE_p_double swig_types[2]
01366 #define SWIGTYPE_p_p_Vgrid swig_types[3]
01367 #define SWIGTYPE_ptrdiff_t swig_types[4]
01368 #define SWIGTYPE_size_t swig_types[5]
01369 static swig_type_info *swig_types[6];
01370 static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0};
01371 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
01372 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
01373 
01374 /* -------- TYPES TABLE (END) -------- */
01375 
01376 
01377 /*-----------------------------------------------
01378               @(target):= _vgrid.so
01379   ------------------------------------------------*/
01380 #define SWIG_init    init_vgrid
01381 
01382 #define SWIG_name    "_vgrid"
01383 
01384 #include "routines.h"
01385 #include "apbs/vgrid.h"
01386 
01387 
01388 double *null_array(){
01389      return NULL;
01390 }
01391 
01392 
01393 #include <limits.h>
01394 
01395 
01396 SWIGINTERN int
01397   SWIG_CheckLongInRange(long value, long min_value, long max_value,
01398                                  const char *errmsg)
01399 {
01400   if (value < min_value) {
01401     if (errmsg) {
01402       PyErr_Format(PyExc_OverflowError, 
01403                          "value %ld is less than '%s' minimum %ld", 
01404                          value, errmsg, min_value);
01405     }
01406     return 0;    
01407   } else if (value > max_value) {
01408     if (errmsg) {
01409       PyErr_Format(PyExc_OverflowError,
01410                          "value %ld is greater than '%s' maximum %ld", 
01411                          value, errmsg, max_value);
01412     }
01413     return 0;
01414   }
01415   return 1;
01416 }
01417 
01418 
01419 SWIGINTERN int
01420   SWIG_AsVal_long(PyObject * obj, long* val)
01421 {
01422   if (PyInt_Check(obj)) {
01423     if (val) *val = PyInt_AS_LONG(obj);
01424     return 1;
01425   }
01426   if (PyLong_Check(obj)) {
01427     long v = PyLong_AsLong(obj);
01428     if (!PyErr_Occurred()) {
01429       if (val) *val = v;
01430       return 1;
01431     } else {
01432       if (!val) PyErr_Clear();
01433       return 0;
01434     }
01435   }
01436   if (val) {
01437     SWIG_type_error("long", obj);
01438   }
01439   return 0;
01440  }
01441 
01442 
01443 #if INT_MAX != LONG_MAX
01444 SWIGINTERN int
01445   SWIG_AsVal_int(PyObject *obj, int *val)
01446 { 
01447   const char* errmsg = val ? "int" : (char*)0;
01448   long v;
01449   if (SWIG_AsVal_long(obj, &v)) {
01450     if (SWIG_CheckLongInRange(v, INT_MIN,INT_MAX, errmsg)) {
01451       if (val) *val = (int)(v);
01452       return 1;
01453     } else {
01454       return 0;
01455     }
01456   } else {
01457     PyErr_Clear();
01458   }
01459   if (val) {
01460     SWIG_type_error(errmsg, obj);
01461   }
01462   return 0;    
01463 }
01464 #else
01465 SWIGINTERNINLINE int
01466   SWIG_AsVal_int(PyObject *obj, int *val)
01467 {
01468   return SWIG_AsVal_long(obj,(long*)val);
01469 }
01470 #endif
01471 
01472 
01473 SWIGINTERNINLINE int
01474 SWIG_As_int(PyObject* obj)
01475 {
01476   int v;
01477   if (!SWIG_AsVal_int(obj, &v)) {
01478     /*
01479       this is needed to make valgrind/purify happier. 
01480      */
01481     memset((void*)&v, 0, sizeof(int));
01482   }
01483   return v;
01484 }
01485 
01486   
01487 SWIGINTERNINLINE int
01488 SWIG_Check_int(PyObject* obj)
01489 {
01490   return SWIG_AsVal_int(obj, (int*)0);
01491 }
01492 
01493 
01494   /*@/usr/local/share/swig/1.3.25/python/pymacros.swg,66,SWIG_define@*/
01495 #define SWIG_From_int PyInt_FromLong
01496 /*@@*/
01497 
01498 
01499 SWIGINTERN int
01500   SWIG_AsVal_double(PyObject *obj, double *val)
01501 {
01502   if (PyFloat_Check(obj)) {
01503     if (val) *val = PyFloat_AS_DOUBLE(obj);
01504     return 1;
01505   }  
01506   if (PyInt_Check(obj)) {
01507     if (val) *val = PyInt_AS_LONG(obj);
01508     return 1;
01509   }
01510   if (PyLong_Check(obj)) {
01511     double v = PyLong_AsDouble(obj);
01512     if (!PyErr_Occurred()) {
01513       if (val) *val = v;
01514       return 1;
01515     } else {
01516       if (!val) PyErr_Clear();
01517       return 0;
01518     }
01519   }
01520   if (val) {
01521     SWIG_type_error("double", obj);
01522   }
01523   return 0;
01524 }
01525 
01526 
01527 SWIGINTERNINLINE double
01528 SWIG_As_double(PyObject* obj)
01529 {
01530   double v;
01531   if (!SWIG_AsVal_double(obj, &v)) {
01532     /*
01533       this is needed to make valgrind/purify happier. 
01534      */
01535     memset((void*)&v, 0, sizeof(double));
01536   }
01537   return v;
01538 }
01539 
01540   
01541 SWIGINTERNINLINE int
01542 SWIG_Check_double(PyObject* obj)
01543 {
01544   return SWIG_AsVal_double(obj, (double*)0);
01545 }
01546 
01547 
01548   /*@/usr/local/share/swig/1.3.25/python/pymacros.swg,66,SWIG_define@*/
01549 #define SWIG_From_double PyFloat_FromDouble
01550 /*@@*/
01551 
01552 
01553 void delete_vgrid(Vgrid *thee){
01554     if (thee != VNULL) {
01555         Vmem_free(thee->mem, (thee->nx*thee->ny*thee->nz), sizeof(double),
01556           (void **)&(thee->data));
01557         Vmem_free(VNULL, 1, sizeof(Vgrid), (void **)&thee);
01558         thee = VNULL;
01559     }
01560 }
01561 
01562 int Vgrid_ctor2(Vgrid *,int,int,int,double,double,double,double,double,double,double *);
01563 void Vgrid_dtor(Vgrid **);
01564 void Vgrid_dtor2(Vgrid *);
01565 void Vgrid_writeUHBD(Vgrid *,char const *,char const *,char const *,char const *,char *,double *);
01566 
01567 /* returns SWIG_OLDOBJ if the input is a raw char*, SWIG_PYSTR if is a PyString */
01568 SWIGINTERN int
01569 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize)
01570 {
01571   static swig_type_info* pchar_info = 0;
01572   char* vptr = 0;
01573   if (!pchar_info) pchar_info = SWIG_TypeQuery("char *");
01574   if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_info, 0) != -1) {
01575     if (cptr) *cptr = vptr;
01576     if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
01577     return SWIG_OLDOBJ;
01578   } else {
01579     PyErr_Clear();
01580     if (PyString_Check(obj)) {
01581       if (cptr) {
01582            *cptr = PyString_AS_STRING(obj);
01583            if (psize) {
01584              *psize = PyString_GET_SIZE(obj) + 1;
01585            }
01586       }
01587       return SWIG_PYSTR;
01588     }
01589   }
01590   if (cptr) {
01591     SWIG_type_error("char *", obj);
01592   }
01593   return 0;
01594 }
01595 
01596 
01597 SWIGINTERNINLINE int
01598 SWIG_AsCharPtr(PyObject *obj, char **val)
01599 {
01600   if (SWIG_AsCharPtrAndSize(obj, val, (size_t*)(0))) {
01601     return 1;
01602   }
01603   if (val) {
01604     PyErr_Clear();
01605     SWIG_type_error("char *", obj);
01606   }
01607   return 0;
01608 }
01609 
01610 void Vgrid_writeDX(Vgrid *,char const *,char const *,char const *,char const *,char *,double *);
01611 int Vgrid_readDX(Vgrid *,char const *,char const *,char const *,char const *);
01612 void startVio();
01613 int Vgrid_value(Vgrid *,double [3],double *);
01614 
01615 SWIGINTERN PyObject*
01616 t_output_helper(PyObject* target, PyObject* o) {
01617   if (!target) {
01618     target = o;
01619   } else if (target == Py_None) {  
01620     Py_DECREF(target);
01621     target = o;
01622   } else {
01623     if (!PyList_Check(target)) {
01624       PyObject *o2 = target;
01625       target = PyList_New(1);
01626       PyList_SetItem(target, 0, o2);
01627     }
01628     PyList_Append(target,o);
01629     Py_DECREF(o);
01630     }
01631   return target;
01632 }
01633 
01634 
01635 int Vgrid_curvature(Vgrid *,double [3],int,double *);
01636 int Vgrid_gradient(Vgrid *,double [3],double [3]);
01637 Vgrid *Vgrid_ctor(int,int,int,double,double,double,double,double,double,double *);
01638 #ifdef __cplusplus
01639 extern "C" {
01640 #endif
01641 static PyObject *_wrap_null_array(PyObject *self, PyObject *args) {
01642     PyObject *resultobj = NULL;
01643     double *result;
01644     
01645     if(!PyArg_ParseTuple(args,(char *)":null_array")) goto fail;
01646     result = (double *)null_array();
01647     
01648     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_double, 0);
01649     return resultobj;
01650     fail:
01651     return NULL;
01652 }
01653 
01654 
01655 static PyObject *_wrap_new_Vgrid(PyObject *self, PyObject *args) {
01656     PyObject *resultobj = NULL;
01657     Vgrid *result;
01658     
01659     if(!PyArg_ParseTuple(args,(char *)":new_Vgrid")) goto fail;
01660     result = (Vgrid *)(Vgrid *) calloc(1, sizeof(Vgrid));
01661     
01662     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_Vgrid, 1);
01663     return resultobj;
01664     fail:
01665     return NULL;
01666 }
01667 
01668 
01669 static PyObject *_wrap_delete_Vgrid(PyObject *self, PyObject *args) {
01670     PyObject *resultobj = NULL;
01671     Vgrid *arg1 = (Vgrid *) 0 ;
01672     PyObject * obj0 = 0 ;
01673     
01674     if(!PyArg_ParseTuple(args,(char *)"O:delete_Vgrid",&obj0)) goto fail;
01675     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01676     if (SWIG_arg_fail(1)) SWIG_fail;
01677     free((char *) arg1);
01678     
01679     Py_INCREF(Py_None); resultobj = Py_None;
01680     return resultobj;
01681     fail:
01682     return NULL;
01683 }
01684 
01685 
01686 static PyObject *_wrap_Vgrid_nx_set(PyObject *self, PyObject *args) {
01687     PyObject *resultobj = NULL;
01688     Vgrid *arg1 = (Vgrid *) 0 ;
01689     int arg2 ;
01690     PyObject * obj0 = 0 ;
01691     PyObject * obj1 = 0 ;
01692     
01693     if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_nx_set",&obj0,&obj1)) goto fail;
01694     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01695     if (SWIG_arg_fail(1)) SWIG_fail;
01696     {
01697         arg2 = (int)(SWIG_As_int(obj1)); 
01698         if (SWIG_arg_fail(2)) SWIG_fail;
01699     }
01700     if (arg1) (arg1)->nx = arg2;
01701     
01702     Py_INCREF(Py_None); resultobj = Py_None;
01703     return resultobj;
01704     fail:
01705     return NULL;
01706 }
01707 
01708 
01709 static PyObject *_wrap_Vgrid_nx_get(PyObject *self, PyObject *args) {
01710     PyObject *resultobj = NULL;
01711     Vgrid *arg1 = (Vgrid *) 0 ;
01712     int result;
01713     PyObject * obj0 = 0 ;
01714     
01715     if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_nx_get",&obj0)) goto fail;
01716     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01717     if (SWIG_arg_fail(1)) SWIG_fail;
01718     result = (int) ((arg1)->nx);
01719     
01720     {
01721         resultobj = SWIG_From_int((int)(result)); 
01722     }
01723     return resultobj;
01724     fail:
01725     return NULL;
01726 }
01727 
01728 
01729 static PyObject *_wrap_Vgrid_ny_set(PyObject *self, PyObject *args) {
01730     PyObject *resultobj = NULL;
01731     Vgrid *arg1 = (Vgrid *) 0 ;
01732     int arg2 ;
01733     PyObject * obj0 = 0 ;
01734     PyObject * obj1 = 0 ;
01735     
01736     if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_ny_set",&obj0,&obj1)) goto fail;
01737     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01738     if (SWIG_arg_fail(1)) SWIG_fail;
01739     {
01740         arg2 = (int)(SWIG_As_int(obj1)); 
01741         if (SWIG_arg_fail(2)) SWIG_fail;
01742     }
01743     if (arg1) (arg1)->ny = arg2;
01744     
01745     Py_INCREF(Py_None); resultobj = Py_None;
01746     return resultobj;
01747     fail:
01748     return NULL;
01749 }
01750 
01751 
01752 static PyObject *_wrap_Vgrid_ny_get(PyObject *self, PyObject *args) {
01753     PyObject *resultobj = NULL;
01754     Vgrid *arg1 = (Vgrid *) 0 ;
01755     int result;
01756     PyObject * obj0 = 0 ;
01757     
01758     if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_ny_get",&obj0)) goto fail;
01759     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01760     if (SWIG_arg_fail(1)) SWIG_fail;
01761     result = (int) ((arg1)->ny);
01762     
01763     {
01764         resultobj = SWIG_From_int((int)(result)); 
01765     }
01766     return resultobj;
01767     fail:
01768     return NULL;
01769 }
01770 
01771 
01772 static PyObject *_wrap_Vgrid_nz_set(PyObject *self, PyObject *args) {
01773     PyObject *resultobj = NULL;
01774     Vgrid *arg1 = (Vgrid *) 0 ;
01775     int arg2 ;
01776     PyObject * obj0 = 0 ;
01777     PyObject * obj1 = 0 ;
01778     
01779     if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_nz_set",&obj0,&obj1)) goto fail;
01780     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01781     if (SWIG_arg_fail(1)) SWIG_fail;
01782     {
01783         arg2 = (int)(SWIG_As_int(obj1)); 
01784         if (SWIG_arg_fail(2)) SWIG_fail;
01785     }
01786     if (arg1) (arg1)->nz = arg2;
01787     
01788     Py_INCREF(Py_None); resultobj = Py_None;
01789     return resultobj;
01790     fail:
01791     return NULL;
01792 }
01793 
01794 
01795 static PyObject *_wrap_Vgrid_nz_get(PyObject *self, PyObject *args) {
01796     PyObject *resultobj = NULL;
01797     Vgrid *arg1 = (Vgrid *) 0 ;
01798     int result;
01799     PyObject * obj0 = 0 ;
01800     
01801     if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_nz_get",&obj0)) goto fail;
01802     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01803     if (SWIG_arg_fail(1)) SWIG_fail;
01804     result = (int) ((arg1)->nz);
01805     
01806     {
01807         resultobj = SWIG_From_int((int)(result)); 
01808     }
01809     return resultobj;
01810     fail:
01811     return NULL;
01812 }
01813 
01814 
01815 static PyObject *_wrap_Vgrid_hx_set(PyObject *self, PyObject *args) {
01816     PyObject *resultobj = NULL;
01817     Vgrid *arg1 = (Vgrid *) 0 ;
01818     double arg2 ;
01819     PyObject * obj0 = 0 ;
01820     PyObject * obj1 = 0 ;
01821     
01822     if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_hx_set",&obj0,&obj1)) goto fail;
01823     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01824     if (SWIG_arg_fail(1)) SWIG_fail;
01825     {
01826         arg2 = (double)(SWIG_As_double(obj1)); 
01827         if (SWIG_arg_fail(2)) SWIG_fail;
01828     }
01829     if (arg1) (arg1)->hx = arg2;
01830     
01831     Py_INCREF(Py_None); resultobj = Py_None;
01832     return resultobj;
01833     fail:
01834     return NULL;
01835 }
01836 
01837 
01838 static PyObject *_wrap_Vgrid_hx_get(PyObject *self, PyObject *args) {
01839     PyObject *resultobj = NULL;
01840     Vgrid *arg1 = (Vgrid *) 0 ;
01841     double result;
01842     PyObject * obj0 = 0 ;
01843     
01844     if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_hx_get",&obj0)) goto fail;
01845     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01846     if (SWIG_arg_fail(1)) SWIG_fail;
01847     result = (double) ((arg1)->hx);
01848     
01849     {
01850         resultobj = SWIG_From_double((double)(result)); 
01851     }
01852     return resultobj;
01853     fail:
01854     return NULL;
01855 }
01856 
01857 
01858 static PyObject *_wrap_Vgrid_hy_set(PyObject *self, PyObject *args) {
01859     PyObject *resultobj = NULL;
01860     Vgrid *arg1 = (Vgrid *) 0 ;
01861     double arg2 ;
01862     PyObject * obj0 = 0 ;
01863     PyObject * obj1 = 0 ;
01864     
01865     if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_hy_set",&obj0,&obj1)) goto fail;
01866     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01867     if (SWIG_arg_fail(1)) SWIG_fail;
01868     {
01869         arg2 = (double)(SWIG_As_double(obj1)); 
01870         if (SWIG_arg_fail(2)) SWIG_fail;
01871     }
01872     if (arg1) (arg1)->hy = arg2;
01873     
01874     Py_INCREF(Py_None); resultobj = Py_None;
01875     return resultobj;
01876     fail:
01877     return NULL;
01878 }
01879 
01880 
01881 static PyObject *_wrap_Vgrid_hy_get(PyObject *self, PyObject *args) {
01882     PyObject *resultobj = NULL;
01883     Vgrid *arg1 = (Vgrid *) 0 ;
01884     double result;
01885     PyObject * obj0 = 0 ;
01886     
01887     if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_hy_get",&obj0)) goto fail;
01888     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01889     if (SWIG_arg_fail(1)) SWIG_fail;
01890     result = (double) ((arg1)->hy);
01891     
01892     {
01893         resultobj = SWIG_From_double((double)(result)); 
01894     }
01895     return resultobj;
01896     fail:
01897     return NULL;
01898 }
01899 
01900 
01901 static PyObject *_wrap_Vgrid_hzed_set(PyObject *self, PyObject *args) {
01902     PyObject *resultobj = NULL;
01903     Vgrid *arg1 = (Vgrid *) 0 ;
01904     double arg2 ;
01905     PyObject * obj0 = 0 ;
01906     PyObject * obj1 = 0 ;
01907     
01908     if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_hzed_set",&obj0,&obj1)) goto fail;
01909     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01910     if (SWIG_arg_fail(1)) SWIG_fail;
01911     {
01912         arg2 = (double)(SWIG_As_double(obj1)); 
01913         if (SWIG_arg_fail(2)) SWIG_fail;
01914     }
01915     if (arg1) (arg1)->hzed = arg2;
01916     
01917     Py_INCREF(Py_None); resultobj = Py_None;
01918     return resultobj;
01919     fail:
01920     return NULL;
01921 }
01922 
01923 
01924 static PyObject *_wrap_Vgrid_hzed_get(PyObject *self, PyObject *args) {
01925     PyObject *resultobj = NULL;
01926     Vgrid *arg1 = (Vgrid *) 0 ;
01927     double result;
01928     PyObject * obj0 = 0 ;
01929     
01930     if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_hzed_get",&obj0)) goto fail;
01931     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01932     if (SWIG_arg_fail(1)) SWIG_fail;
01933     result = (double) ((arg1)->hzed);
01934     
01935     {
01936         resultobj = SWIG_From_double((double)(result)); 
01937     }
01938     return resultobj;
01939     fail:
01940     return NULL;
01941 }
01942 
01943 
01944 static PyObject *_wrap_Vgrid_xmin_set(PyObject *self, PyObject *args) {
01945     PyObject *resultobj = NULL;
01946     Vgrid *arg1 = (Vgrid *) 0 ;
01947     double arg2 ;
01948     PyObject * obj0 = 0 ;
01949     PyObject * obj1 = 0 ;
01950     
01951     if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_xmin_set",&obj0,&obj1)) goto fail;
01952     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01953     if (SWIG_arg_fail(1)) SWIG_fail;
01954     {
01955         arg2 = (double)(SWIG_As_double(obj1)); 
01956         if (SWIG_arg_fail(2)) SWIG_fail;
01957     }
01958     if (arg1) (arg1)->xmin = arg2;
01959     
01960     Py_INCREF(Py_None); resultobj = Py_None;
01961     return resultobj;
01962     fail:
01963     return NULL;
01964 }
01965 
01966 
01967 static PyObject *_wrap_Vgrid_xmin_get(PyObject *self, PyObject *args) {
01968     PyObject *resultobj = NULL;
01969     Vgrid *arg1 = (Vgrid *) 0 ;
01970     double result;
01971     PyObject * obj0 = 0 ;
01972     
01973     if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_xmin_get",&obj0)) goto fail;
01974     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01975     if (SWIG_arg_fail(1)) SWIG_fail;
01976     result = (double) ((arg1)->xmin);
01977     
01978     {
01979         resultobj = SWIG_From_double((double)(result)); 
01980     }
01981     return resultobj;
01982     fail:
01983     return NULL;
01984 }
01985 
01986 
01987 static PyObject *_wrap_Vgrid_ymin_set(PyObject *self, PyObject *args) {
01988     PyObject *resultobj = NULL;
01989     Vgrid *arg1 = (Vgrid *) 0 ;
01990     double arg2 ;
01991     PyObject * obj0 = 0 ;
01992     PyObject * obj1 = 0 ;
01993     
01994     if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_ymin_set",&obj0,&obj1)) goto fail;
01995     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
01996     if (SWIG_arg_fail(1)) SWIG_fail;
01997     {
01998         arg2 = (double)(SWIG_As_double(obj1)); 
01999         if (SWIG_arg_fail(2)) SWIG_fail;
02000     }
02001     if (arg1) (arg1)->ymin = arg2;
02002     
02003     Py_INCREF(Py_None); resultobj = Py_None;
02004     return resultobj;
02005     fail:
02006     return NULL;
02007 }
02008 
02009 
02010 static PyObject *_wrap_Vgrid_ymin_get(PyObject *self, PyObject *args) {
02011     PyObject *resultobj = NULL;
02012     Vgrid *arg1 = (Vgrid *) 0 ;
02013     double result;
02014     PyObject * obj0 = 0 ;
02015     
02016     if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_ymin_get",&obj0)) goto fail;
02017     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02018     if (SWIG_arg_fail(1)) SWIG_fail;
02019     result = (double) ((arg1)->ymin);
02020     
02021     {
02022         resultobj = SWIG_From_double((double)(result)); 
02023     }
02024     return resultobj;
02025     fail:
02026     return NULL;
02027 }
02028 
02029 
02030 static PyObject *_wrap_Vgrid_zmin_set(PyObject *self, PyObject *args) {
02031     PyObject *resultobj = NULL;
02032     Vgrid *arg1 = (Vgrid *) 0 ;
02033     double arg2 ;
02034     PyObject * obj0 = 0 ;
02035     PyObject * obj1 = 0 ;
02036     
02037     if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_zmin_set",&obj0,&obj1)) goto fail;
02038     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02039     if (SWIG_arg_fail(1)) SWIG_fail;
02040     {
02041         arg2 = (double)(SWIG_As_double(obj1)); 
02042         if (SWIG_arg_fail(2)) SWIG_fail;
02043     }
02044     if (arg1) (arg1)->zmin = arg2;
02045     
02046     Py_INCREF(Py_None); resultobj = Py_None;
02047     return resultobj;
02048     fail:
02049     return NULL;
02050 }
02051 
02052 
02053 static PyObject *_wrap_Vgrid_zmin_get(PyObject *self, PyObject *args) {
02054     PyObject *resultobj = NULL;
02055     Vgrid *arg1 = (Vgrid *) 0 ;
02056     double result;
02057     PyObject * obj0 = 0 ;
02058     
02059     if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_zmin_get",&obj0)) goto fail;
02060     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02061     if (SWIG_arg_fail(1)) SWIG_fail;
02062     result = (double) ((arg1)->zmin);
02063     
02064     {
02065         resultobj = SWIG_From_double((double)(result)); 
02066     }
02067     return resultobj;
02068     fail:
02069     return NULL;
02070 }
02071 
02072 
02073 static PyObject *_wrap_Vgrid_data_set(PyObject *self, PyObject *args) {
02074     PyObject *resultobj = NULL;
02075     Vgrid *arg1 = (Vgrid *) 0 ;
02076     double *arg2 = (double *) 0 ;
02077     PyObject * obj0 = 0 ;
02078     PyObject * obj1 = 0 ;
02079     
02080     if(!PyArg_ParseTuple(args,(char *)"OO:Vgrid_data_set",&obj0,&obj1)) goto fail;
02081     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02082     if (SWIG_arg_fail(1)) SWIG_fail;
02083     SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_double, SWIG_POINTER_EXCEPTION | SWIG_POINTER_DISOWN);
02084     if (SWIG_arg_fail(2)) SWIG_fail;
02085     if (arg1) (arg1)->data = arg2;
02086     
02087     Py_INCREF(Py_None); resultobj = Py_None;
02088     return resultobj;
02089     fail:
02090     return NULL;
02091 }
02092 
02093 
02094 static PyObject *_wrap_Vgrid_data_get(PyObject *self, PyObject *args) {
02095     PyObject *resultobj = NULL;
02096     Vgrid *arg1 = (Vgrid *) 0 ;
02097     double *result;
02098     PyObject * obj0 = 0 ;
02099     
02100     if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_data_get",&obj0)) goto fail;
02101     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02102     if (SWIG_arg_fail(1)) SWIG_fail;
02103     result = (double *) ((arg1)->data);
02104     
02105     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_double, 0);
02106     return resultobj;
02107     fail:
02108     return NULL;
02109 }
02110 
02111 
02112 static PyObject * Vgrid_swigregister(PyObject *self, PyObject *args) {
02113     PyObject *obj;
02114     if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL;
02115     SWIG_TypeClientData(SWIGTYPE_p_Vgrid, obj);
02116     Py_INCREF(obj);
02117     return Py_BuildValue((char *)"");
02118 }
02119 static PyObject *_wrap_delete_vgrid(PyObject *self, PyObject *args) {
02120     PyObject *resultobj = NULL;
02121     Vgrid *arg1 = (Vgrid *) 0 ;
02122     PyObject * obj0 = 0 ;
02123     
02124     if(!PyArg_ParseTuple(args,(char *)"O:delete_vgrid",&obj0)) goto fail;
02125     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02126     if (SWIG_arg_fail(1)) SWIG_fail;
02127     delete_vgrid(arg1);
02128     
02129     Py_INCREF(Py_None); resultobj = Py_None;
02130     return resultobj;
02131     fail:
02132     return NULL;
02133 }
02134 
02135 
02136 static PyObject *_wrap_Vgrid_ctor2(PyObject *self, PyObject *args) {
02137     PyObject *resultobj = NULL;
02138     Vgrid *arg1 = (Vgrid *) 0 ;
02139     int arg2 ;
02140     int arg3 ;
02141     int arg4 ;
02142     double arg5 ;
02143     double arg6 ;
02144     double arg7 ;
02145     double arg8 ;
02146     double arg9 ;
02147     double arg10 ;
02148     double *arg11 = (double *) 0 ;
02149     int result;
02150     PyObject * obj0 = 0 ;
02151     PyObject * obj1 = 0 ;
02152     PyObject * obj2 = 0 ;
02153     PyObject * obj3 = 0 ;
02154     PyObject * obj4 = 0 ;
02155     PyObject * obj5 = 0 ;
02156     PyObject * obj6 = 0 ;
02157     PyObject * obj7 = 0 ;
02158     PyObject * obj8 = 0 ;
02159     PyObject * obj9 = 0 ;
02160     PyObject * obj10 = 0 ;
02161     
02162     if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:Vgrid_ctor2",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) goto fail;
02163     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02164     if (SWIG_arg_fail(1)) SWIG_fail;
02165     {
02166         arg2 = (int)(SWIG_As_int(obj1)); 
02167         if (SWIG_arg_fail(2)) SWIG_fail;
02168     }
02169     {
02170         arg3 = (int)(SWIG_As_int(obj2)); 
02171         if (SWIG_arg_fail(3)) SWIG_fail;
02172     }
02173     {
02174         arg4 = (int)(SWIG_As_int(obj3)); 
02175         if (SWIG_arg_fail(4)) SWIG_fail;
02176     }
02177     {
02178         arg5 = (double)(SWIG_As_double(obj4)); 
02179         if (SWIG_arg_fail(5)) SWIG_fail;
02180     }
02181     {
02182         arg6 = (double)(SWIG_As_double(obj5)); 
02183         if (SWIG_arg_fail(6)) SWIG_fail;
02184     }
02185     {
02186         arg7 = (double)(SWIG_As_double(obj6)); 
02187         if (SWIG_arg_fail(7)) SWIG_fail;
02188     }
02189     {
02190         arg8 = (double)(SWIG_As_double(obj7)); 
02191         if (SWIG_arg_fail(8)) SWIG_fail;
02192     }
02193     {
02194         arg9 = (double)(SWIG_As_double(obj8)); 
02195         if (SWIG_arg_fail(9)) SWIG_fail;
02196     }
02197     {
02198         arg10 = (double)(SWIG_As_double(obj9)); 
02199         if (SWIG_arg_fail(10)) SWIG_fail;
02200     }
02201     SWIG_Python_ConvertPtr(obj10, (void **)&arg11, SWIGTYPE_p_double, SWIG_POINTER_EXCEPTION | 0);
02202     if (SWIG_arg_fail(11)) SWIG_fail;
02203     result = (int)Vgrid_ctor2(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11);
02204     
02205     {
02206         resultobj = SWIG_From_int((int)(result)); 
02207     }
02208     return resultobj;
02209     fail:
02210     return NULL;
02211 }
02212 
02213 
02214 static PyObject *_wrap_Vgrid_dtor(PyObject *self, PyObject *args) {
02215     PyObject *resultobj = NULL;
02216     Vgrid **arg1 = (Vgrid **) 0 ;
02217     PyObject * obj0 = 0 ;
02218     
02219     if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_dtor",&obj0)) goto fail;
02220     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02221     if (SWIG_arg_fail(1)) SWIG_fail;
02222     Vgrid_dtor(arg1);
02223     
02224     Py_INCREF(Py_None); resultobj = Py_None;
02225     return resultobj;
02226     fail:
02227     return NULL;
02228 }
02229 
02230 
02231 static PyObject *_wrap_Vgrid_dtor2(PyObject *self, PyObject *args) {
02232     PyObject *resultobj = NULL;
02233     Vgrid *arg1 = (Vgrid *) 0 ;
02234     PyObject * obj0 = 0 ;
02235     
02236     if(!PyArg_ParseTuple(args,(char *)"O:Vgrid_dtor2",&obj0)) goto fail;
02237     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02238     if (SWIG_arg_fail(1)) SWIG_fail;
02239     Vgrid_dtor2(arg1);
02240     
02241     Py_INCREF(Py_None); resultobj = Py_None;
02242     return resultobj;
02243     fail:
02244     return NULL;
02245 }
02246 
02247 
02248 static PyObject *_wrap_Vgrid_writeUHBD(PyObject *self, PyObject *args) {
02249     PyObject *resultobj = NULL;
02250     Vgrid *arg1 = (Vgrid *) 0 ;
02251     char *arg2 = (char *) 0 ;
02252     char *arg3 = (char *) 0 ;
02253     char *arg4 = (char *) 0 ;
02254     char *arg5 = (char *) 0 ;
02255     char *arg6 = (char *) 0 ;
02256     double *arg7 = (double *) 0 ;
02257     PyObject * obj0 = 0 ;
02258     PyObject * obj1 = 0 ;
02259     PyObject * obj2 = 0 ;
02260     PyObject * obj3 = 0 ;
02261     PyObject * obj4 = 0 ;
02262     PyObject * obj5 = 0 ;
02263     PyObject * obj6 = 0 ;
02264     
02265     if(!PyArg_ParseTuple(args,(char *)"OOOOOOO:Vgrid_writeUHBD",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) goto fail;
02266     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02267     if (SWIG_arg_fail(1)) SWIG_fail;
02268     if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
02269         SWIG_arg_fail(2);SWIG_fail;
02270     }
02271     if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
02272         SWIG_arg_fail(3);SWIG_fail;
02273     }
02274     if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) {
02275         SWIG_arg_fail(4);SWIG_fail;
02276     }
02277     if (!SWIG_AsCharPtr(obj4, (char**)&arg5)) {
02278         SWIG_arg_fail(5);SWIG_fail;
02279     }
02280     if (!SWIG_AsCharPtr(obj5, (char**)&arg6)) {
02281         SWIG_arg_fail(6);SWIG_fail;
02282     }
02283     SWIG_Python_ConvertPtr(obj6, (void **)&arg7, SWIGTYPE_p_double, SWIG_POINTER_EXCEPTION | 0);
02284     if (SWIG_arg_fail(7)) SWIG_fail;
02285     Vgrid_writeUHBD(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,arg6,arg7);
02286     
02287     Py_INCREF(Py_None); resultobj = Py_None;
02288     return resultobj;
02289     fail:
02290     return NULL;
02291 }
02292 
02293 
02294 static PyObject *_wrap_Vgrid_writeDX(PyObject *self, PyObject *args) {
02295     PyObject *resultobj = NULL;
02296     Vgrid *arg1 = (Vgrid *) 0 ;
02297     char *arg2 = (char *) 0 ;
02298     char *arg3 = (char *) 0 ;
02299     char *arg4 = (char *) 0 ;
02300     char *arg5 = (char *) 0 ;
02301     char *arg6 = (char *) 0 ;
02302     double *arg7 = (double *) 0 ;
02303     PyObject * obj0 = 0 ;
02304     PyObject * obj1 = 0 ;
02305     PyObject * obj2 = 0 ;
02306     PyObject * obj3 = 0 ;
02307     PyObject * obj4 = 0 ;
02308     PyObject * obj5 = 0 ;
02309     PyObject * obj6 = 0 ;
02310     
02311     if(!PyArg_ParseTuple(args,(char *)"OOOOOOO:Vgrid_writeDX",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) goto fail;
02312     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02313     if (SWIG_arg_fail(1)) SWIG_fail;
02314     if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
02315         SWIG_arg_fail(2);SWIG_fail;
02316     }
02317     if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
02318         SWIG_arg_fail(3);SWIG_fail;
02319     }
02320     if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) {
02321         SWIG_arg_fail(4);SWIG_fail;
02322     }
02323     if (!SWIG_AsCharPtr(obj4, (char**)&arg5)) {
02324         SWIG_arg_fail(5);SWIG_fail;
02325     }
02326     if (!SWIG_AsCharPtr(obj5, (char**)&arg6)) {
02327         SWIG_arg_fail(6);SWIG_fail;
02328     }
02329     SWIG_Python_ConvertPtr(obj6, (void **)&arg7, SWIGTYPE_p_double, SWIG_POINTER_EXCEPTION | 0);
02330     if (SWIG_arg_fail(7)) SWIG_fail;
02331     Vgrid_writeDX(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,arg6,arg7);
02332     
02333     Py_INCREF(Py_None); resultobj = Py_None;
02334     return resultobj;
02335     fail:
02336     return NULL;
02337 }
02338 
02339 
02340 static PyObject *_wrap_Vgrid_readDX(PyObject *self, PyObject *args) {
02341     PyObject *resultobj = NULL;
02342     Vgrid *arg1 = (Vgrid *) 0 ;
02343     char *arg2 = (char *) 0 ;
02344     char *arg3 = (char *) 0 ;
02345     char *arg4 = (char *) 0 ;
02346     char *arg5 = (char *) 0 ;
02347     int result;
02348     PyObject * obj0 = 0 ;
02349     PyObject * obj1 = 0 ;
02350     PyObject * obj2 = 0 ;
02351     PyObject * obj3 = 0 ;
02352     PyObject * obj4 = 0 ;
02353     
02354     if(!PyArg_ParseTuple(args,(char *)"OOOOO:Vgrid_readDX",&obj0,&obj1,&obj2,&obj3,&obj4)) goto fail;
02355     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02356     if (SWIG_arg_fail(1)) SWIG_fail;
02357     if (!SWIG_AsCharPtr(obj1, (char**)&arg2)) {
02358         SWIG_arg_fail(2);SWIG_fail;
02359     }
02360     if (!SWIG_AsCharPtr(obj2, (char**)&arg3)) {
02361         SWIG_arg_fail(3);SWIG_fail;
02362     }
02363     if (!SWIG_AsCharPtr(obj3, (char**)&arg4)) {
02364         SWIG_arg_fail(4);SWIG_fail;
02365     }
02366     if (!SWIG_AsCharPtr(obj4, (char**)&arg5)) {
02367         SWIG_arg_fail(5);SWIG_fail;
02368     }
02369     result = (int)Vgrid_readDX(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5);
02370     
02371     {
02372         resultobj = SWIG_From_int((int)(result)); 
02373     }
02374     return resultobj;
02375     fail:
02376     return NULL;
02377 }
02378 
02379 
02380 static PyObject *_wrap_startVio(PyObject *self, PyObject *args) {
02381     PyObject *resultobj = NULL;
02382     
02383     if(!PyArg_ParseTuple(args,(char *)":startVio")) goto fail;
02384     startVio();
02385     
02386     Py_INCREF(Py_None); resultobj = Py_None;
02387     return resultobj;
02388     fail:
02389     return NULL;
02390 }
02391 
02392 
02393 static PyObject *_wrap_Vgrid_value(PyObject *self, PyObject *args) {
02394     PyObject *resultobj = NULL;
02395     Vgrid *arg1 = (Vgrid *) 0 ;
02396     double *arg2 ;
02397     double *arg3 = (double *) 0 ;
02398     int result;
02399     double temp3 ;
02400     int res3 = 0 ;
02401     PyObject * obj0 = 0 ;
02402     PyObject * obj1 = 0 ;
02403     PyObject * obj2 = 0 ;
02404     
02405     if(!PyArg_ParseTuple(args,(char *)"OOO:Vgrid_value",&obj0,&obj1,&obj2)) goto fail;
02406     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02407     if (SWIG_arg_fail(1)) SWIG_fail;
02408     {
02409         /* Check if is a list */
02410         if (PyList_Check(obj1)) {
02411             int size = PyList_Size(obj1);
02412             int i = 0;
02413             arg2 = (double *) malloc((size+1)*sizeof(double));
02414             for (i = 0; i < size; i++) {
02415                 PyObject *o = PyList_GetItem(obj1,i);
02416                 if (PyFloat_Check(o))
02417                 arg2[i] = PyFloat_AsDouble(PyList_GetItem(obj1,i));
02418                 else {
02419                     PyErr_SetString(PyExc_TypeError,"list must contain floats");
02420                     free(arg2);
02421                     return NULL;
02422                 }
02423             }
02424             arg2[i] = 0;
02425         } else {
02426             PyErr_SetString(PyExc_TypeError,"not a list");
02427             return NULL;
02428         }
02429     }
02430     {
02431         if (!(SWIG_ConvertPtr(obj2,(void **)(&arg3),SWIGTYPE_p_double,0) != -1)) {
02432             temp3 = SWIG_As_double(obj2);
02433             if (SWIG_arg_fail(3)) SWIG_fail;
02434             arg3 = &temp3;
02435             res3 = SWIG_NEWOBJ;
02436         }
02437     }
02438     result = (int)Vgrid_value(arg1,arg2,arg3);
02439     
02440     {
02441         resultobj = SWIG_From_int((int)(result)); 
02442     }
02443     resultobj = t_output_helper(resultobj, ((res3 == SWIG_NEWOBJ) ?
02444     SWIG_From_double((*arg3)) : SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_double, 0)));
02445     return resultobj;
02446     fail:
02447     return NULL;
02448 }
02449 
02450 
02451 static PyObject *_wrap_Vgrid_curvature(PyObject *self, PyObject *args) {
02452     PyObject *resultobj = NULL;
02453     Vgrid *arg1 = (Vgrid *) 0 ;
02454     double *arg2 ;
02455     int arg3 ;
02456     double *arg4 = (double *) 0 ;
02457     int result;
02458     PyObject * obj0 = 0 ;
02459     PyObject * obj1 = 0 ;
02460     PyObject * obj2 = 0 ;
02461     PyObject * obj3 = 0 ;
02462     
02463     if(!PyArg_ParseTuple(args,(char *)"OOOO:Vgrid_curvature",&obj0,&obj1,&obj2,&obj3)) goto fail;
02464     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02465     if (SWIG_arg_fail(1)) SWIG_fail;
02466     {
02467         /* Check if is a list */
02468         if (PyList_Check(obj1)) {
02469             int size = PyList_Size(obj1);
02470             int i = 0;
02471             arg2 = (double *) malloc((size+1)*sizeof(double));
02472             for (i = 0; i < size; i++) {
02473                 PyObject *o = PyList_GetItem(obj1,i);
02474                 if (PyFloat_Check(o))
02475                 arg2[i] = PyFloat_AsDouble(PyList_GetItem(obj1,i));
02476                 else {
02477                     PyErr_SetString(PyExc_TypeError,"list must contain floats");
02478                     free(arg2);
02479                     return NULL;
02480                 }
02481             }
02482             arg2[i] = 0;
02483         } else {
02484             PyErr_SetString(PyExc_TypeError,"not a list");
02485             return NULL;
02486         }
02487     }
02488     {
02489         arg3 = (int)(SWIG_As_int(obj2)); 
02490         if (SWIG_arg_fail(3)) SWIG_fail;
02491     }
02492     {
02493         if (PyList_Check(obj3)) {
02494             int size = PyList_Size(obj3);
02495             int i = 0;
02496             arg4 = (double *) malloc((size+1)*sizeof(double));
02497             for (i = 0; i < size; i++) {
02498                 PyObject *o = PyList_GetItem(obj3,i);
02499                 if (PyFloat_Check(o))
02500                 arg4[i] = PyFloat_AsDouble(PyList_GetItem(obj3,i));
02501                 else {
02502                     PyErr_SetString(PyExc_TypeError,"list must contain floats");
02503                     free(arg4);
02504                     return NULL;
02505                 }
02506             }
02507             arg4[i] = 0;
02508         } else {
02509             PyErr_SetString(PyExc_TypeError,"not a list");
02510             return NULL;
02511         }
02512     }
02513     result = (int)Vgrid_curvature(arg1,arg2,arg3,arg4);
02514     
02515     {
02516         resultobj = SWIG_From_int((int)(result)); 
02517     }
02518     return resultobj;
02519     fail:
02520     return NULL;
02521 }
02522 
02523 
02524 static PyObject *_wrap_Vgrid_gradient(PyObject *self, PyObject *args) {
02525     PyObject *resultobj = NULL;
02526     Vgrid *arg1 = (Vgrid *) 0 ;
02527     double *arg2 ;
02528     double *arg3 ;
02529     int result;
02530     PyObject * obj0 = 0 ;
02531     PyObject * obj1 = 0 ;
02532     PyObject * obj2 = 0 ;
02533     
02534     if(!PyArg_ParseTuple(args,(char *)"OOO:Vgrid_gradient",&obj0,&obj1,&obj2)) goto fail;
02535     SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_Vgrid, SWIG_POINTER_EXCEPTION | 0);
02536     if (SWIG_arg_fail(1)) SWIG_fail;
02537     {
02538         /* Check if is a list */
02539         if (PyList_Check(obj1)) {
02540             int size = PyList_Size(obj1);
02541             int i = 0;
02542             arg2 = (double *) malloc((size+1)*sizeof(double));
02543             for (i = 0; i < size; i++) {
02544                 PyObject *o = PyList_GetItem(obj1,i);
02545                 if (PyFloat_Check(o))
02546                 arg2[i] = PyFloat_AsDouble(PyList_GetItem(obj1,i));
02547                 else {
02548                     PyErr_SetString(PyExc_TypeError,"list must contain floats");
02549                     free(arg2);
02550                     return NULL;
02551                 }
02552             }
02553             arg2[i] = 0;
02554         } else {
02555             PyErr_SetString(PyExc_TypeError,"not a list");
02556             return NULL;
02557         }
02558     }
02559     {
02560         /* Check if is a list */
02561         if (PyList_Check(obj2)) {
02562             int size = PyList_Size(obj2);
02563             int i = 0;
02564             arg3 = (double *) malloc((size+1)*sizeof(double));
02565             for (i = 0; i < size; i++) {
02566                 PyObject *o = PyList_GetItem(obj2,i);
02567                 if (PyFloat_Check(o))
02568                 arg3[i] = PyFloat_AsDouble(PyList_GetItem(obj2,i));
02569                 else {
02570                     PyErr_SetString(PyExc_TypeError,"list must contain floats");
02571                     free(arg3);
02572                     return NULL;
02573                 }
02574             }
02575             arg3[i] = 0;
02576         } else {
02577             PyErr_SetString(PyExc_TypeError,"not a list");
02578             return NULL;
02579         }
02580     }
02581     result = (int)Vgrid_gradient(arg1,arg2,arg3);
02582     
02583     {
02584         resultobj = SWIG_From_int((int)(result)); 
02585     }
02586     return resultobj;
02587     fail:
02588     return NULL;
02589 }
02590 
02591 
02592 static PyObject *_wrap_Vgrid_ctor(PyObject *self, PyObject *args) {
02593     PyObject *resultobj = NULL;
02594     int arg1 ;
02595     int arg2 ;
02596     int arg3 ;
02597     double arg4 ;
02598     double arg5 ;
02599     double arg6 ;
02600     double arg7 ;
02601     double arg8 ;
02602     double arg9 ;
02603     double *arg10 = (double *) 0 ;
02604     Vgrid *result;
02605     PyObject * obj0 = 0 ;
02606     PyObject * obj1 = 0 ;
02607     PyObject * obj2 = 0 ;
02608     PyObject * obj3 = 0 ;
02609     PyObject * obj4 = 0 ;
02610     PyObject * obj5 = 0 ;
02611     PyObject * obj6 = 0 ;
02612     PyObject * obj7 = 0 ;
02613     PyObject * obj8 = 0 ;
02614     PyObject * obj9 = 0 ;
02615     
02616     if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:Vgrid_ctor",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) goto fail;
02617     {
02618         arg1 = (int)(SWIG_As_int(obj0)); 
02619         if (SWIG_arg_fail(1)) SWIG_fail;
02620     }
02621     {
02622         arg2 = (int)(SWIG_As_int(obj1)); 
02623         if (SWIG_arg_fail(2)) SWIG_fail;
02624     }
02625     {
02626         arg3 = (int)(SWIG_As_int(obj2)); 
02627         if (SWIG_arg_fail(3)) SWIG_fail;
02628     }
02629     {
02630         arg4 = (double)(SWIG_As_double(obj3)); 
02631         if (SWIG_arg_fail(4)) SWIG_fail;
02632     }
02633     {
02634         arg5 = (double)(SWIG_As_double(obj4)); 
02635         if (SWIG_arg_fail(5)) SWIG_fail;
02636     }
02637     {
02638         arg6 = (double)(SWIG_As_double(obj5)); 
02639         if (SWIG_arg_fail(6)) SWIG_fail;
02640     }
02641     {
02642         arg7 = (double)(SWIG_As_double(obj6)); 
02643         if (SWIG_arg_fail(7)) SWIG_fail;
02644     }
02645     {
02646         arg8 = (double)(SWIG_As_double(obj7)); 
02647         if (SWIG_arg_fail(8)) SWIG_fail;
02648     }
02649     {
02650         arg9 = (double)(SWIG_As_double(obj8)); 
02651         if (SWIG_arg_fail(9)) SWIG_fail;
02652     }
02653     {
02654         if (PyList_Check(obj9)) {
02655             int size = PyList_Size(obj9);
02656             int i = 0;
02657             arg10 = (double *) malloc((size+1)*sizeof(double));
02658             for (i = 0; i < size; i++) {
02659                 PyObject *o = PyList_GetItem(obj9,i);
02660                 if (PyFloat_Check(o))
02661                 arg10[i] = PyFloat_AsDouble(PyList_GetItem(obj9,i));
02662                 else {
02663                     PyErr_SetString(PyExc_TypeError,"list must contain floats");
02664                     free(arg10);
02665                     return NULL;
02666                 }
02667             }
02668             arg10[i] = 0;
02669         } else {
02670             PyErr_SetString(PyExc_TypeError,"not a list");
02671             return NULL;
02672         }
02673     }
02674     result = (Vgrid *)Vgrid_ctor(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
02675     
02676     resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_Vgrid, 0);
02677     return resultobj;
02678     fail:
02679     return NULL;
02680 }
02681 
02682 
02683 static PyMethodDef SwigMethods[] = {
02684             { (char *)"null_array", _wrap_null_array, METH_VARARGS, NULL},
02685             { (char *)"new_Vgrid", _wrap_new_Vgrid, METH_VARARGS, NULL},
02686             { (char *)"delete_Vgrid", _wrap_delete_Vgrid, METH_VARARGS, NULL},
02687             { (char *)"Vgrid_nx_set", _wrap_Vgrid_nx_set, METH_VARARGS, NULL},
02688             { (char *)"Vgrid_nx_get", _wrap_Vgrid_nx_get, METH_VARARGS, NULL},
02689             { (char *)"Vgrid_ny_set", _wrap_Vgrid_ny_set, METH_VARARGS, NULL},
02690             { (char *)"Vgrid_ny_get", _wrap_Vgrid_ny_get, METH_VARARGS, NULL},
02691             { (char *)"Vgrid_nz_set", _wrap_Vgrid_nz_set, METH_VARARGS, NULL},
02692             { (char *)"Vgrid_nz_get", _wrap_Vgrid_nz_get, METH_VARARGS, NULL},
02693             { (char *)"Vgrid_hx_set", _wrap_Vgrid_hx_set, METH_VARARGS, NULL},
02694             { (char *)"Vgrid_hx_get", _wrap_Vgrid_hx_get, METH_VARARGS, NULL},
02695             { (char *)"Vgrid_hy_set", _wrap_Vgrid_hy_set, METH_VARARGS, NULL},
02696             { (char *)"Vgrid_hy_get", _wrap_Vgrid_hy_get, METH_VARARGS, NULL},
02697             { (char *)"Vgrid_hzed_set", _wrap_Vgrid_hzed_set, METH_VARARGS, NULL},
02698             { (char *)"Vgrid_hzed_get", _wrap_Vgrid_hzed_get, METH_VARARGS, NULL},
02699             { (char *)"Vgrid_xmin_set", _wrap_Vgrid_xmin_set, METH_VARARGS, NULL},
02700             { (char *)"Vgrid_xmin_get", _wrap_Vgrid_xmin_get, METH_VARARGS, NULL},
02701             { (char *)"Vgrid_ymin_set", _wrap_Vgrid_ymin_set, METH_VARARGS, NULL},
02702             { (char *)"Vgrid_ymin_get", _wrap_Vgrid_ymin_get, METH_VARARGS, NULL},
02703             { (char *)"Vgrid_zmin_set", _wrap_Vgrid_zmin_set, METH_VARARGS, NULL},
02704             { (char *)"Vgrid_zmin_get", _wrap_Vgrid_zmin_get, METH_VARARGS, NULL},
02705             { (char *)"Vgrid_data_set", _wrap_Vgrid_data_set, METH_VARARGS, NULL},
02706             { (char *)"Vgrid_data_get", _wrap_Vgrid_data_get, METH_VARARGS, NULL},
02707             { (char *)"Vgrid_swigregister", Vgrid_swigregister, METH_VARARGS, NULL},
02708             { (char *)"delete_vgrid", _wrap_delete_vgrid, METH_VARARGS, NULL},
02709             { (char *)"Vgrid_ctor2", _wrap_Vgrid_ctor2, METH_VARARGS, NULL},
02710             { (char *)"Vgrid_dtor", _wrap_Vgrid_dtor, METH_VARARGS, NULL},
02711             { (char *)"Vgrid_dtor2", _wrap_Vgrid_dtor2, METH_VARARGS, NULL},
02712             { (char *)"Vgrid_writeUHBD", _wrap_Vgrid_writeUHBD, METH_VARARGS, NULL},
02713             { (char *)"Vgrid_writeDX", _wrap_Vgrid_writeDX, METH_VARARGS, NULL},
02714             { (char *)"Vgrid_readDX", _wrap_Vgrid_readDX, METH_VARARGS, NULL},
02715             { (char *)"startVio", _wrap_startVio, METH_VARARGS, NULL},
02716             { (char *)"Vgrid_value", _wrap_Vgrid_value, METH_VARARGS, NULL},
02717             { (char *)"Vgrid_curvature", _wrap_Vgrid_curvature, METH_VARARGS, NULL},
02718             { (char *)"Vgrid_gradient", _wrap_Vgrid_gradient, METH_VARARGS, NULL},
02719             { (char *)"Vgrid_ctor", _wrap_Vgrid_ctor, METH_VARARGS, NULL},
02720             { NULL, NULL, 0, NULL }
02721 };
02722 
02723 
02724 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
02725 
02726 static swig_type_info _swigt__p_Vgrid = {"_p_Vgrid", "Vgrid *", 0, 0, 0};
02727 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, 0};
02728 static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, 0};
02729 static swig_type_info _swigt__p_p_Vgrid = {"_p_p_Vgrid", "Vgrid **", 0, 0, 0};
02730 static swig_type_info _swigt__ptrdiff_t = {"_ptrdiff_t", "ptrdiff_t", 0, 0, 0};
02731 static swig_type_info _swigt__size_t = {"_size_t", "size_t", 0, 0, 0};
02732 
02733 static swig_type_info *swig_type_initial[] = {
02734   &_swigt__p_Vgrid,
02735   &_swigt__p_char,
02736   &_swigt__p_double,
02737   &_swigt__p_p_Vgrid,
02738   &_swigt__ptrdiff_t,
02739   &_swigt__size_t,
02740 };
02741 
02742 static swig_cast_info _swigc__p_Vgrid[] = {  {&_swigt__p_Vgrid, 0, 0, 0},{0, 0, 0, 0}};
02743 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
02744 static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
02745 static swig_cast_info _swigc__p_p_Vgrid[] = {  {&_swigt__p_p_Vgrid, 0, 0, 0},{0, 0, 0, 0}};
02746 static swig_cast_info _swigc__ptrdiff_t[] = {  {&_swigt__ptrdiff_t, 0, 0, 0},{0, 0, 0, 0}};
02747 static swig_cast_info _swigc__size_t[] = {  {&_swigt__size_t, 0, 0, 0},{0, 0, 0, 0}};
02748 
02749 static swig_cast_info *swig_cast_initial[] = {
02750   _swigc__p_Vgrid,
02751   _swigc__p_char,
02752   _swigc__p_double,
02753   _swigc__p_p_Vgrid,
02754   _swigc__ptrdiff_t,
02755   _swigc__size_t,
02756 };
02757 
02758 
02759 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
02760 
02761 static swig_const_info swig_const_table[] = {
02762 {0, 0, 0, 0.0, 0, 0}};
02763 
02764 #ifdef __cplusplus
02765 }
02766 #endif
02767 /*************************************************************************
02768  * Type initialization:
02769  * This problem is tough by the requirement that no dynamic 
02770  * memory is used. Also, since swig_type_info structures store pointers to 
02771  * swig_cast_info structures and swig_cast_info structures store pointers back
02772  * to swig_type_info structures, we need some lookup code at initialization. 
02773  * The idea is that swig generates all the structures that are needed. 
02774  * The runtime then collects these partially filled structures. 
02775  * The SWIG_InitializeModule function takes these initial arrays out of 
02776  * swig_module, and does all the lookup, filling in the swig_module.types
02777  * array with the correct data and linking the correct swig_cast_info
02778  * structures together.
02779 
02780  * The generated swig_type_info structures are assigned staticly to an initial 
02781  * array. We just loop though that array, and handle each type individually.
02782  * First we lookup if this type has been already loaded, and if so, use the
02783  * loaded structure instead of the generated one. Then we have to fill in the
02784  * cast linked list. The cast data is initially stored in something like a
02785  * two-dimensional array. Each row corresponds to a type (there are the same
02786  * number of rows as there are in the swig_type_initial array). Each entry in
02787  * a column is one of the swig_cast_info structures for that type.
02788  * The cast_initial array is actually an array of arrays, because each row has
02789  * a variable number of columns. So to actually build the cast linked list,
02790  * we find the array of casts associated with the type, and loop through it 
02791  * adding the casts to the list. The one last trick we need to do is making
02792  * sure the type pointer in the swig_cast_info struct is correct.
02793 
02794  * First off, we lookup the cast->type name to see if it is already loaded. 
02795  * There are three cases to handle:
02796  *  1) If the cast->type has already been loaded AND the type we are adding
02797  *     casting info to has not been loaded (it is in this module), THEN we
02798  *     replace the cast->type pointer with the type pointer that has already
02799  *     been loaded.
02800  *  2) If BOTH types (the one we are adding casting info to, and the 
02801  *     cast->type) are loaded, THEN the cast info has already been loaded by
02802  *     the previous module so we just ignore it.
02803  *  3) Finally, if cast->type has not already been loaded, then we add that
02804  *     swig_cast_info to the linked list (because the cast->type) pointer will
02805  *     be correct.
02806 **/
02807 
02808 #ifdef __cplusplus
02809 extern "C" {
02810 #endif
02811     
02812     SWIGRUNTIME void
02813     SWIG_InitializeModule(void *clientdata) {
02814         swig_type_info *type, *ret;
02815         swig_cast_info *cast;
02816         size_t i;
02817         swig_module_info *module_head;
02818         static int init_run = 0;
02819         
02820         clientdata = clientdata;
02821         
02822         if (init_run) return;
02823         init_run = 1;
02824         
02825         /* Initialize the swig_module */
02826         swig_module.type_initial = swig_type_initial;
02827         swig_module.cast_initial = swig_cast_initial;
02828         
02829         /* Try and load any already created modules */
02830         module_head = SWIG_GetModule(clientdata);
02831         if (module_head) {
02832             swig_module.next = module_head->next;
02833             module_head->next = &swig_module;
02834         } else {
02835             /* This is the first module loaded */
02836             swig_module.next = &swig_module;
02837             SWIG_SetModule(clientdata, &swig_module);
02838         }
02839         
02840         /* Now work on filling in swig_module.types */
02841         for (i = 0; i < swig_module.size; ++i) {
02842             type = 0;
02843             
02844             /* if there is another module already loaded */
02845             if (swig_module.next != &swig_module) {
02846                 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
02847             }
02848             if (type) {
02849                 /* Overwrite clientdata field */
02850                 if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
02851             } else {
02852                 type = swig_module.type_initial[i];
02853             }
02854             
02855             /* Insert casting types */
02856             cast = swig_module.cast_initial[i];
02857             while (cast->type) {
02858                 /* Don't need to add information already in the list */
02859                 ret = 0;
02860                 if (swig_module.next != &swig_module) {
02861                     ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
02862                 }
02863                 if (ret && type == swig_module.type_initial[i]) {
02864                     cast->type = ret;
02865                     ret = 0;
02866                 }
02867                 
02868                 if (!ret) {
02869                     if (type->cast) {
02870                         type->cast->prev = cast;
02871                         cast->next = type->cast;
02872                     }
02873                     type->cast = cast;
02874                 }
02875                 
02876                 cast++;
02877             }
02878             
02879             /* Set entry in modules->types array equal to the type */
02880             swig_module.types[i] = type;
02881         }
02882     }
02883     
02884     /* This function will propagate the clientdata field of type to
02885     * any new swig_type_info structures that have been added into the list
02886     * of equivalent types.  It is like calling
02887     * SWIG_TypeClientData(type, clientdata) a second time.
02888     */
02889     SWIGRUNTIME void
02890     SWIG_PropagateClientData(void) {
02891         size_t i;
02892         swig_cast_info *equiv;
02893         static int init_run = 0;
02894         
02895         if (init_run) return;
02896         init_run = 1;
02897         
02898         for (i = 0; i < swig_module.size; i++) {
02899             if (swig_module.types[i]->clientdata) {
02900                 equiv = swig_module.types[i]->cast;
02901                 while (equiv) {
02902                     if (!equiv->converter) {
02903                         if (equiv->type && !equiv->type->clientdata)
02904                         SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
02905                     }
02906                     equiv = equiv->next;
02907                 }
02908             }
02909         }
02910     }
02911     
02912 #ifdef __cplusplus
02913 }
02914 #endif
02915 
02916 
02917 
02918 #ifdef __cplusplus
02919 extern "C" {
02920 #endif
02921     
02922     /* Python-specific SWIG API */
02923 #define SWIG_newvarlink()                             SWIG_Python_newvarlink()
02924 #define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
02925 #define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
02926     
02927     /* -----------------------------------------------------------------------------
02928      * global variable support code.
02929      * ----------------------------------------------------------------------------- */
02930     
02931     typedef struct swig_globalvar {
02932         char       *name;                  /* Name of global variable */
02933         PyObject *(*get_attr)(void);       /* Return the current value */
02934         int       (*set_attr)(PyObject *); /* Set the value */
02935         struct swig_globalvar *next;
02936     } swig_globalvar;
02937     
02938     typedef struct swig_varlinkobject {
02939         PyObject_HEAD
02940         swig_globalvar *vars;
02941     } swig_varlinkobject;
02942     
02943     SWIGINTERN PyObject *
02944     swig_varlink_repr(swig_varlinkobject *v) {
02945         v = v;
02946         return PyString_FromString("<Swig global variables>");
02947     }
02948     
02949     SWIGINTERN int
02950     swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) {
02951         swig_globalvar  *var;
02952         flags = flags;
02953         fprintf(fp,"Swig global variables { ");
02954         for (var = v->vars; var; var=var->next) {
02955             fprintf(fp,"%s", var->name);
02956             if (var->next) fprintf(fp,", ");
02957         }
02958         fprintf(fp," }\n");
02959         return 0;
02960     }
02961     
02962     SWIGINTERN PyObject *
02963     swig_varlink_getattr(swig_varlinkobject *v, char *n) {
02964         swig_globalvar *var = v->vars;
02965         while (var) {
02966             if (strcmp(var->name,n) == 0) {
02967                 return (*var->get_attr)();
02968             }
02969             var = var->next;
02970         }
02971         PyErr_SetString(PyExc_NameError,"Unknown C global variable");
02972         return NULL;
02973     }
02974     
02975     SWIGINTERN int
02976     swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
02977         swig_globalvar *var = v->vars;
02978         while (var) {
02979             if (strcmp(var->name,n) == 0) {
02980                 return (*var->set_attr)(p);
02981             }
02982             var = var->next;
02983         }
02984         PyErr_SetString(PyExc_NameError,"Unknown C global variable");
02985         return 1;
02986     }
02987     
02988     SWIGINTERN PyTypeObject*
02989     swig_varlink_type(void) {
02990         static char varlink__doc__[] = "Swig var link object";
02991         static PyTypeObject varlink_type
02992 #if !defined(__cplusplus)
02993         ;
02994         static int type_init = 0;  
02995         if (!type_init) {
02996             PyTypeObject tmp
02997 #endif
02998             = {
02999                 PyObject_HEAD_INIT(&PyType_Type)
03000                 0,                                  /* Number of items in variable part (ob_size) */
03001                 (char *)"swigvarlink",              /* Type name (tp_name) */
03002                 sizeof(swig_varlinkobject),         /* Basic size (tp_basicsize) */
03003                 0,                                  /* Itemsize (tp_itemsize) */
03004                 0,                                  /* Deallocator (tp_dealloc) */ 
03005                 (printfunc) swig_varlink_print,     /* Print (tp_print) */
03006                 (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
03007                 (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
03008                 0,                                  /* tp_compare */
03009                 (reprfunc) swig_varlink_repr,       /* tp_repr */
03010                 0,                                  /* tp_as_number */
03011                 0,                                  /* tp_as_sequence */
03012                 0,                                  /* tp_as_mapping */
03013                 0,                                  /* tp_hash */
03014                 0,                                  /* tp_call */
03015                 0,                                  /* tp_str */
03016                 0,                                  /* tp_getattro */
03017                 0,                                  /* tp_setattro */
03018                 0,                                  /* tp_as_buffer */
03019                 0,                                  /* tp_flags */
03020                 varlink__doc__,                     /* tp_doc */
03021 #if PY_VERSION_HEX >= 0x02000000
03022                 0,                                  /* tp_traverse */
03023                 0,                                  /* tp_clear */
03024 #endif
03025 #if PY_VERSION_HEX >= 0x02010000
03026                 0,                                  /* tp_richcompare */
03027                 0,                                  /* tp_weaklistoffset */
03028 #endif
03029 #if PY_VERSION_HEX >= 0x02020000
03030                 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
03031 #endif
03032 #if PY_VERSION_HEX >= 0x02030000
03033                 0,                                  /* tp_del */
03034 #endif
03035 #ifdef COUNT_ALLOCS
03036                 0,0,0,0                             /* tp_alloc -> tp_next */
03037 #endif
03038             };
03039 #if !defined(__cplusplus)
03040             varlink_type = tmp;
03041             type_init = 1;
03042         }
03043 #endif
03044         return &varlink_type;
03045     }
03046     
03047     /* Create a variable linking object for use later */
03048     SWIGINTERN PyObject *
03049     SWIG_Python_newvarlink(void) {
03050         swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
03051         if (result) {
03052             result->vars = 0;
03053         }
03054         return ((PyObject*) result);
03055     }
03056     
03057     SWIGINTERN void 
03058     SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
03059         swig_varlinkobject *v = (swig_varlinkobject *) p;
03060         swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
03061         if (gv) {
03062             size_t size = strlen(name)+1;
03063             gv->name = (char *)malloc(size);
03064             if (gv->name) {
03065                 strncpy(gv->name,name,size);
03066                 gv->get_attr = get_attr;
03067                 gv->set_attr = set_attr;
03068                 gv->next = v->vars;
03069             }
03070         }
03071         v->vars = gv;
03072     }
03073     
03074     /* -----------------------------------------------------------------------------
03075      * constants/methods manipulation
03076      * ----------------------------------------------------------------------------- */
03077     
03078     /* Install Constants */
03079     SWIGINTERN void
03080     SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
03081         PyObject *obj = 0;
03082         size_t i;
03083         for (i = 0; constants[i].type; ++i) {
03084             switch(constants[i].type) {
03085                 case SWIG_PY_INT:
03086                 obj = PyInt_FromLong(constants[i].lvalue);
03087                 break;
03088                 case SWIG_PY_FLOAT:
03089                 obj = PyFloat_FromDouble(constants[i].dvalue);
03090                 break;
03091                 case SWIG_PY_STRING:
03092                 if (constants[i].pvalue) {
03093                     obj = PyString_FromString((char *) constants[i].pvalue);
03094                 } else {
03095                     Py_INCREF(Py_None);
03096                     obj = Py_None;
03097                 }
03098                 break;
03099                 case SWIG_PY_POINTER:
03100                 obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
03101                 break;
03102                 case SWIG_PY_BINARY:
03103                 obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
03104                 break;
03105                 default:
03106                 obj = 0;
03107                 break;
03108             }
03109             if (obj) {
03110                 PyDict_SetItemString(d,constants[i].name,obj);
03111                 Py_DECREF(obj);
03112             }
03113         }
03114     }
03115     
03116     /* -----------------------------------------------------------------------------*/
03117     /* Fix SwigMethods to carry the callback ptrs when needed */
03118     /* -----------------------------------------------------------------------------*/
03119     
03120     SWIGINTERN void
03121     SWIG_Python_FixMethods(PyMethodDef *methods,
03122     swig_const_info *const_table,
03123     swig_type_info **types,
03124     swig_type_info **types_initial) {
03125         size_t i;
03126         for (i = 0; methods[i].ml_name; ++i) {
03127             char *c = methods[i].ml_doc;
03128             if (c && (c = strstr(c, "swig_ptr: "))) {
03129                 int j;
03130                 swig_const_info *ci = 0;
03131                 char *name = c + 10;
03132                 for (j = 0; const_table[j].type; ++j) {
03133                     if (strncmp(const_table[j].name, name, 
03134                     strlen(const_table[j].name)) == 0) {
03135                         ci = &(const_table[j]);
03136                         break;
03137                     }
03138                 }
03139                 if (ci) {
03140                     size_t shift = (ci->ptype) - types;
03141                     swig_type_info *ty = types_initial[shift];
03142                     size_t ldoc = (c - methods[i].ml_doc);
03143                     size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
03144                     char *ndoc = (char*)malloc(ldoc + lptr + 10);
03145                     if (ndoc) {
03146                         char *buff = ndoc;
03147                         void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
03148                         if (ptr) {
03149                             strncpy(buff, methods[i].ml_doc, ldoc);
03150                             buff += ldoc;
03151                             strncpy(buff, "swig_ptr: ", 10);
03152                             buff += 10;
03153                             SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
03154                             methods[i].ml_doc = ndoc;
03155                         }
03156                     }
03157                 }
03158             }
03159         }
03160     }
03161     
03162     /* -----------------------------------------------------------------------------*
03163      *  Initialize type list
03164      * -----------------------------------------------------------------------------*/
03165     
03166 #if PY_MAJOR_VERSION < 2
03167     /* PyModule_AddObject function was introduced in Python 2.0.  The following function
03168     is copied out of Python/modsupport.c in python version 2.3.4 */
03169     SWIGINTERN int
03170     PyModule_AddObject(PyObject *m, char *name, PyObject *o)
03171     {
03172         PyObject *dict;
03173         if (!PyModule_Check(m)) {
03174             PyErr_SetString(PyExc_TypeError,
03175             "PyModule_AddObject() needs module as first arg");
03176             return -1;
03177         }
03178         if (!o) {
03179             PyErr_SetString(PyExc_TypeError,
03180             "PyModule_AddObject() needs non-NULL value");
03181             return -1;
03182         }
03183         
03184         dict = PyModule_GetDict(m);
03185         if (dict == NULL) {
03186             /* Internal error -- modules must have a dict! */
03187             PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
03188             PyModule_GetName(m));
03189             return -1;
03190         }
03191         if (PyDict_SetItemString(dict, name, o))
03192         return -1;
03193         Py_DECREF(o);
03194         return 0;
03195     }
03196 #endif
03197     
03198 #ifdef __cplusplus
03199 }
03200 #endif
03201 
03202 /* -----------------------------------------------------------------------------*
03203  *  Partial Init method
03204  * -----------------------------------------------------------------------------*/
03205 
03206 #ifdef __cplusplus
03207 extern "C"
03208 #endif
03209 SWIGEXPORT void SWIG_init(void) {
03210     static PyObject *SWIG_globals = 0; 
03211     PyObject *m, *d;
03212     if (!SWIG_globals) SWIG_globals = SWIG_newvarlink();
03213     
03214     /* Fix SwigMethods to carry the callback ptrs when needed */
03215     SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
03216     
03217     m = Py_InitModule((char *) SWIG_name, SwigMethods);
03218     d = PyModule_GetDict(m);
03219     
03220     SWIG_InitializeModule(0);
03221     SWIG_InstallConstants(d,swig_const_table);
03222     
03223 }
03224 

Generated on Wed Oct 20 2010 11:12:21 for APBS by  doxygen 1.7.2