PLplot  5.10.0
plplotluacLUA_wrap.c
Go to the documentation of this file.
00001 /* ----------------------------------------------------------------------------
00002  * This file was automatically generated by SWIG (http://www.swig.org).
00003  * Version 3.0.2
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 SWIGLUA
00012 #define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
00013 #define SWIG_LUA_MODULE_GLOBAL
00014 
00015 /* -----------------------------------------------------------------------------
00016  *  This section contains generic SWIG labels for method/variable
00017  *  declarations/attributes, and other compiler dependent labels.
00018  * ----------------------------------------------------------------------------- */
00019 
00020 /* template workaround for compilers that cannot correctly implement the C++ standard */
00021 #ifndef SWIGTEMPLATEDISAMBIGUATOR
00022 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
00023 #  define SWIGTEMPLATEDISAMBIGUATOR template
00024 # elif defined(__HP_aCC)
00025 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
00026 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
00027 #  define SWIGTEMPLATEDISAMBIGUATOR template
00028 # else
00029 #  define SWIGTEMPLATEDISAMBIGUATOR
00030 # endif
00031 #endif
00032 
00033 /* inline attribute */
00034 #ifndef SWIGINLINE
00035 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
00036 #   define SWIGINLINE inline
00037 # else
00038 #   define SWIGINLINE
00039 # endif
00040 #endif
00041 
00042 /* attribute recognised by some compilers to avoid 'unused' warnings */
00043 #ifndef SWIGUNUSED
00044 # if defined(__GNUC__)
00045 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
00046 #     define SWIGUNUSED __attribute__ ((__unused__))
00047 #   else
00048 #     define SWIGUNUSED
00049 #   endif
00050 # elif defined(__ICC)
00051 #   define SWIGUNUSED __attribute__ ((__unused__))
00052 # else
00053 #   define SWIGUNUSED
00054 # endif
00055 #endif
00056 
00057 #ifndef SWIG_MSC_UNSUPPRESS_4505
00058 # if defined(_MSC_VER)
00059 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
00060 # endif
00061 #endif
00062 
00063 #ifndef SWIGUNUSEDPARM
00064 # ifdef __cplusplus
00065 #   define SWIGUNUSEDPARM(p)
00066 # else
00067 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
00068 # endif
00069 #endif
00070 
00071 /* internal SWIG method */
00072 #ifndef SWIGINTERN
00073 # define SWIGINTERN static SWIGUNUSED
00074 #endif
00075 
00076 /* internal inline SWIG method */
00077 #ifndef SWIGINTERNINLINE
00078 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
00079 #endif
00080 
00081 /* exporting methods */
00082 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
00083 #  ifndef GCC_HASCLASSVISIBILITY
00084 #    define GCC_HASCLASSVISIBILITY
00085 #  endif
00086 #endif
00087 
00088 #ifndef SWIGEXPORT
00089 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
00090 #   if defined(STATIC_LINKED)
00091 #     define SWIGEXPORT
00092 #   else
00093 #     define SWIGEXPORT __declspec(dllexport)
00094 #   endif
00095 # else
00096 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
00097 #     define SWIGEXPORT __attribute__ ((visibility("default")))
00098 #   else
00099 #     define SWIGEXPORT
00100 #   endif
00101 # endif
00102 #endif
00103 
00104 /* calling conventions for Windows */
00105 #ifndef SWIGSTDCALL
00106 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
00107 #   define SWIGSTDCALL __stdcall
00108 # else
00109 #   define SWIGSTDCALL
00110 # endif
00111 #endif
00112 
00113 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
00114 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
00115 # define _CRT_SECURE_NO_DEPRECATE
00116 #endif
00117 
00118 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
00119 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
00120 # define _SCL_SECURE_NO_DEPRECATE
00121 #endif
00122 
00123 
00124 /* -----------------------------------------------------------------------------
00125  * swigrun.swg
00126  *
00127  * This file contains generic C API SWIG runtime support for pointer
00128  * type checking.
00129  * ----------------------------------------------------------------------------- */
00130 
00131 /* This should only be incremented when either the layout of swig_type_info changes,
00132    or for whatever reason, the runtime changes incompatibly */
00133 #define SWIG_RUNTIME_VERSION "4"
00134 
00135 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
00136 #ifdef SWIG_TYPE_TABLE
00137 # define SWIG_QUOTE_STRING(x) #x
00138 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
00139 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
00140 #else
00141 # define SWIG_TYPE_TABLE_NAME
00142 #endif
00143 
00144 /*
00145   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
00146   creating a static or dynamic library from the SWIG runtime code.
00147   In 99.9% of the cases, SWIG just needs to declare them as 'static'.
00148 
00149   But only do this if strictly necessary, ie, if you have problems
00150   with your compiler or suchlike.
00151 */
00152 
00153 #ifndef SWIGRUNTIME
00154 # define SWIGRUNTIME SWIGINTERN
00155 #endif
00156 
00157 #ifndef SWIGRUNTIMEINLINE
00158 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
00159 #endif
00160 
00161 /*  Generic buffer size */
00162 #ifndef SWIG_BUFFER_SIZE
00163 # define SWIG_BUFFER_SIZE 1024
00164 #endif
00165 
00166 /* Flags for pointer conversions */
00167 #define SWIG_POINTER_DISOWN        0x1
00168 #define SWIG_CAST_NEW_MEMORY       0x2
00169 
00170 /* Flags for new pointer objects */
00171 #define SWIG_POINTER_OWN           0x1
00172 
00173 
00174 /*
00175    Flags/methods for returning states.
00176 
00177    The SWIG conversion methods, as ConvertPtr, return an integer
00178    that tells if the conversion was successful or not. And if not,
00179    an error code can be returned (see swigerrors.swg for the codes).
00180 
00181    Use the following macros/flags to set or process the returning
00182    states.
00183 
00184    In old versions of SWIG, code such as the following was usually written:
00185 
00186      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
00187        // success code
00188      } else {
00189        //fail code
00190      }
00191 
00192    Now you can be more explicit:
00193 
00194     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
00195     if (SWIG_IsOK(res)) {
00196       // success code
00197     } else {
00198       // fail code
00199     }
00200 
00201    which is the same really, but now you can also do
00202 
00203     Type *ptr;
00204     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
00205     if (SWIG_IsOK(res)) {
00206       // success code
00207       if (SWIG_IsNewObj(res) {
00208         ...
00209         delete *ptr;
00210       } else {
00211         ...
00212       }
00213     } else {
00214       // fail code
00215     }
00216 
00217    I.e., now SWIG_ConvertPtr can return new objects and you can
00218    identify the case and take care of the deallocation. Of course that
00219    also requires SWIG_ConvertPtr to return new result values, such as
00220 
00221       int SWIG_ConvertPtr(obj, ptr,...) {
00222         if (<obj is ok>) {
00223           if (<need new object>) {
00224             *ptr = <ptr to new allocated object>;
00225             return SWIG_NEWOBJ;
00226           } else {
00227             *ptr = <ptr to old object>;
00228             return SWIG_OLDOBJ;
00229           }
00230         } else {
00231           return SWIG_BADOBJ;
00232         }
00233       }
00234 
00235    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
00236    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
00237    SWIG errors code.
00238 
00239    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
00240    allows to return the 'cast rank', for example, if you have this
00241 
00242        int food(double)
00243        int fooi(int);
00244 
00245    and you call
00246 
00247       food(1)   // cast rank '1'  (1 -> 1.0)
00248       fooi(1)   // cast rank '0'
00249 
00250    just use the SWIG_AddCast()/SWIG_CheckState()
00251 */
00252 
00253 #define SWIG_OK                    (0)
00254 #define SWIG_ERROR                 (-1)
00255 #define SWIG_IsOK(r)               (r >= 0)
00256 #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
00257 
00258 /* The CastRankLimit says how many bits are used for the cast rank */
00259 #define SWIG_CASTRANKLIMIT         (1 << 8)
00260 /* The NewMask denotes the object was created (using new/malloc) */
00261 #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
00262 /* The TmpMask is for in/out typemaps that use temporal objects */
00263 #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
00264 /* Simple returning values */
00265 #define SWIG_BADOBJ                (SWIG_ERROR)
00266 #define SWIG_OLDOBJ                (SWIG_OK)
00267 #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
00268 #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
00269 /* Check, add and del mask methods */
00270 #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
00271 #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
00272 #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
00273 #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
00274 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
00275 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
00276 
00277 /* Cast-Rank Mode */
00278 #if defined(SWIG_CASTRANK_MODE)
00279 #  ifndef SWIG_TypeRank
00280 #    define SWIG_TypeRank             unsigned long
00281 #  endif
00282 #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
00283 #    define SWIG_MAXCASTRANK          (2)
00284 #  endif
00285 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
00286 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
00287 SWIGINTERNINLINE int SWIG_AddCast(int r) {
00288   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
00289 }
00290 SWIGINTERNINLINE int SWIG_CheckState(int r) {
00291   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
00292 }
00293 #else /* no cast-rank mode */
00294 #  define SWIG_AddCast(r) (r)
00295 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
00296 #endif
00297 
00298 
00299 #include <string.h>
00300 
00301 #ifdef __cplusplus
00302 extern "C" {
00303 #endif
00304 
00305 typedef void *(*swig_converter_func)(void *, int *);
00306 typedef struct swig_type_info *(*swig_dycast_func)(void **);
00307 
00308 /* Structure to store information on one type */
00309 typedef struct swig_type_info {
00310   const char             *name;                 /* mangled name of this type */
00311   const char             *str;                  /* human readable name of this type */
00312   swig_dycast_func        dcast;                /* dynamic cast function down a hierarchy */
00313   struct swig_cast_info  *cast;                 /* linked list of types that can cast into this type */
00314   void                   *clientdata;           /* language specific type data */
00315   int                    owndata;               /* flag if the structure owns the clientdata */
00316 } swig_type_info;
00317 
00318 /* Structure to store a type and conversion function used for casting */
00319 typedef struct swig_cast_info {
00320   swig_type_info         *type;                 /* pointer to type that is equivalent to this type */
00321   swig_converter_func     converter;            /* function to cast the void pointers */
00322   struct swig_cast_info  *next;                 /* pointer to next cast in linked list */
00323   struct swig_cast_info  *prev;                 /* pointer to the previous cast */
00324 } swig_cast_info;
00325 
00326 /* Structure used to store module information
00327  * Each module generates one structure like this, and the runtime collects
00328  * all of these structures and stores them in a circularly linked list.*/
00329 typedef struct swig_module_info {
00330   swig_type_info         **types;               /* Array of pointers to swig_type_info structures that are in this module */
00331   size_t                 size;                  /* Number of types in this module */
00332   struct swig_module_info *next;                /* Pointer to next element in circularly linked list */
00333   swig_type_info         **type_initial;        /* Array of initially generated type structures */
00334   swig_cast_info         **cast_initial;        /* Array of initially generated casting structures */
00335   void                    *clientdata;          /* Language specific module data */
00336 } swig_module_info;
00337 
00338 /*
00339   Compare two type names skipping the space characters, therefore
00340   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
00341 
00342   Return 0 when the two name types are equivalent, as in
00343   strncmp, but skipping ' '.
00344 */
00345 SWIGRUNTIME int
00346 SWIG_TypeNameComp(const char *f1, const char *l1,
00347                   const char *f2, const char *l2) {
00348   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
00349     while ((*f1 == ' ') && (f1 != l1)) ++f1;
00350     while ((*f2 == ' ') && (f2 != l2)) ++f2;
00351     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
00352   }
00353   return (int)((l1 - f1) - (l2 - f2));
00354 }
00355 
00356 /*
00357   Check type equivalence in a name list like <name1>|<name2>|...
00358   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
00359 */
00360 SWIGRUNTIME int
00361 SWIG_TypeCmp(const char *nb, const char *tb) {
00362   int equiv = 1;
00363   const char* te = tb + strlen(tb);
00364   const char* ne = nb;
00365   while (equiv != 0 && *ne) {
00366     for (nb = ne; *ne; ++ne) {
00367       if (*ne == '|') break;
00368     }
00369     equiv = SWIG_TypeNameComp(nb, ne, tb, te);
00370     if (*ne) ++ne;
00371   }
00372   return equiv;
00373 }
00374 
00375 /*
00376   Check type equivalence in a name list like <name1>|<name2>|...
00377   Return 0 if not equal, 1 if equal
00378 */
00379 SWIGRUNTIME int
00380 SWIG_TypeEquiv(const char *nb, const char *tb) {
00381   return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
00382 }
00383 
00384 /*
00385   Check the typename
00386 */
00387 SWIGRUNTIME swig_cast_info *
00388 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
00389   if (ty) {
00390     swig_cast_info *iter = ty->cast;
00391     while (iter) {
00392       if (strcmp(iter->type->name, c) == 0) {
00393         if (iter == ty->cast)
00394           return iter;
00395         /* Move iter to the top of the linked list */
00396         iter->prev->next = iter->next;
00397         if (iter->next)
00398           iter->next->prev = iter->prev;
00399         iter->next = ty->cast;
00400         iter->prev = 0;
00401         if (ty->cast) ty->cast->prev = iter;
00402         ty->cast = iter;
00403         return iter;
00404       }
00405       iter = iter->next;
00406     }
00407   }
00408   return 0;
00409 }
00410 
00411 /*
00412   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
00413 */
00414 SWIGRUNTIME swig_cast_info *
00415 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
00416   if (ty) {
00417     swig_cast_info *iter = ty->cast;
00418     while (iter) {
00419       if (iter->type == from) {
00420         if (iter == ty->cast)
00421           return iter;
00422         /* Move iter to the top of the linked list */
00423         iter->prev->next = iter->next;
00424         if (iter->next)
00425           iter->next->prev = iter->prev;
00426         iter->next = ty->cast;
00427         iter->prev = 0;
00428         if (ty->cast) ty->cast->prev = iter;
00429         ty->cast = iter;
00430         return iter;
00431       }
00432       iter = iter->next;
00433     }
00434   }
00435   return 0;
00436 }
00437 
00438 /*
00439   Cast a pointer up an inheritance hierarchy
00440 */
00441 SWIGRUNTIMEINLINE void *
00442 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
00443   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
00444 }
00445 
00446 /*
00447    Dynamic pointer casting. Down an inheritance hierarchy
00448 */
00449 SWIGRUNTIME swig_type_info *
00450 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
00451   swig_type_info *lastty = ty;
00452   if (!ty || !ty->dcast) return ty;
00453   while (ty && (ty->dcast)) {
00454     ty = (*ty->dcast)(ptr);
00455     if (ty) lastty = ty;
00456   }
00457   return lastty;
00458 }
00459 
00460 /*
00461   Return the name associated with this type
00462 */
00463 SWIGRUNTIMEINLINE const char *
00464 SWIG_TypeName(const swig_type_info *ty) {
00465   return ty->name;
00466 }
00467 
00468 /*
00469   Return the pretty name associated with this type,
00470   that is an unmangled type name in a form presentable to the user.
00471 */
00472 SWIGRUNTIME const char *
00473 SWIG_TypePrettyName(const swig_type_info *type) {
00474   /* The "str" field contains the equivalent pretty names of the
00475      type, separated by vertical-bar characters.  We choose
00476      to print the last name, as it is often (?) the most
00477      specific. */
00478   if (!type) return NULL;
00479   if (type->str != NULL) {
00480     const char *last_name = type->str;
00481     const char *s;
00482     for (s = type->str; *s; s++)
00483       if (*s == '|') last_name = s+1;
00484     return last_name;
00485   }
00486   else
00487     return type->name;
00488 }
00489 
00490 /*
00491    Set the clientdata field for a type
00492 */
00493 SWIGRUNTIME void
00494 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
00495   swig_cast_info *cast = ti->cast;
00496   /* if (ti->clientdata == clientdata) return; */
00497   ti->clientdata = clientdata;
00498 
00499   while (cast) {
00500     if (!cast->converter) {
00501       swig_type_info *tc = cast->type;
00502       if (!tc->clientdata) {
00503         SWIG_TypeClientData(tc, clientdata);
00504       }
00505     }
00506     cast = cast->next;
00507   }
00508 }
00509 SWIGRUNTIME void
00510 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
00511   SWIG_TypeClientData(ti, clientdata);
00512   ti->owndata = 1;
00513 }
00514 
00515 /*
00516   Search for a swig_type_info structure only by mangled name
00517   Search is a O(log #types)
00518 
00519   We start searching at module start, and finish searching when start == end.
00520   Note: if start == end at the beginning of the function, we go all the way around
00521   the circular list.
00522 */
00523 SWIGRUNTIME swig_type_info *
00524 SWIG_MangledTypeQueryModule(swig_module_info *start,
00525                             swig_module_info *end,
00526                             const char *name) {
00527   swig_module_info *iter = start;
00528   do {
00529     if (iter->size) {
00530       size_t l = 0;
00531       size_t r = iter->size - 1;
00532       do {
00533         /* since l+r >= 0, we can (>> 1) instead (/ 2) */
00534         size_t i = (l + r) >> 1;
00535         const char *iname = iter->types[i]->name;
00536         if (iname) {
00537           int compare = strcmp(name, iname);
00538           if (compare == 0) {
00539             return iter->types[i];
00540           } else if (compare < 0) {
00541             if (i) {
00542               r = i - 1;
00543             } else {
00544               break;
00545             }
00546           } else if (compare > 0) {
00547             l = i + 1;
00548           }
00549         } else {
00550           break; /* should never happen */
00551         }
00552       } while (l <= r);
00553     }
00554     iter = iter->next;
00555   } while (iter != end);
00556   return 0;
00557 }
00558 
00559 /*
00560   Search for a swig_type_info structure for either a mangled name or a human readable name.
00561   It first searches the mangled names of the types, which is a O(log #types)
00562   If a type is not found it then searches the human readable names, which is O(#types).
00563 
00564   We start searching at module start, and finish searching when start == end.
00565   Note: if start == end at the beginning of the function, we go all the way around
00566   the circular list.
00567 */
00568 SWIGRUNTIME swig_type_info *
00569 SWIG_TypeQueryModule(swig_module_info *start,
00570                      swig_module_info *end,
00571                      const char *name) {
00572   /* STEP 1: Search the name field using binary search */
00573   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
00574   if (ret) {
00575     return ret;
00576   } else {
00577     /* STEP 2: If the type hasn't been found, do a complete search
00578        of the str field (the human readable name) */
00579     swig_module_info *iter = start;
00580     do {
00581       size_t i = 0;
00582       for (; i < iter->size; ++i) {
00583         if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
00584           return iter->types[i];
00585       }
00586       iter = iter->next;
00587     } while (iter != end);
00588   }
00589 
00590   /* neither found a match */
00591   return 0;
00592 }
00593 
00594 /*
00595    Pack binary data into a string
00596 */
00597 SWIGRUNTIME char *
00598 SWIG_PackData(char *c, void *ptr, size_t sz) {
00599   static const char hex[17] = "0123456789abcdef";
00600   const unsigned char *u = (unsigned char *) ptr;
00601   const unsigned char *eu =  u + sz;
00602   for (; u != eu; ++u) {
00603     unsigned char uu = *u;
00604     *(c++) = hex[(uu & 0xf0) >> 4];
00605     *(c++) = hex[uu & 0xf];
00606   }
00607   return c;
00608 }
00609 
00610 /*
00611    Unpack binary data from a string
00612 */
00613 SWIGRUNTIME const char *
00614 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
00615   unsigned char *u = (unsigned char *) ptr;
00616   const unsigned char *eu = u + sz;
00617   for (; u != eu; ++u) {
00618     char d = *(c++);
00619     unsigned char uu;
00620     if ((d >= '0') && (d <= '9'))
00621       uu = ((d - '0') << 4);
00622     else if ((d >= 'a') && (d <= 'f'))
00623       uu = ((d - ('a'-10)) << 4);
00624     else
00625       return (char *) 0;
00626     d = *(c++);
00627     if ((d >= '0') && (d <= '9'))
00628       uu |= (d - '0');
00629     else if ((d >= 'a') && (d <= 'f'))
00630       uu |= (d - ('a'-10));
00631     else
00632       return (char *) 0;
00633     *u = uu;
00634   }
00635   return c;
00636 }
00637 
00638 /*
00639    Pack 'void *' into a string buffer.
00640 */
00641 SWIGRUNTIME char *
00642 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
00643   char *r = buff;
00644   if ((2*sizeof(void *) + 2) > bsz) return 0;
00645   *(r++) = '_';
00646   r = SWIG_PackData(r,&ptr,sizeof(void *));
00647   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
00648   strcpy(r,name);
00649   return buff;
00650 }
00651 
00652 SWIGRUNTIME const char *
00653 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
00654   if (*c != '_') {
00655     if (strcmp(c,"NULL") == 0) {
00656       *ptr = (void *) 0;
00657       return name;
00658     } else {
00659       return 0;
00660     }
00661   }
00662   return SWIG_UnpackData(++c,ptr,sizeof(void *));
00663 }
00664 
00665 SWIGRUNTIME char *
00666 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
00667   char *r = buff;
00668   size_t lname = (name ? strlen(name) : 0);
00669   if ((2*sz + 2 + lname) > bsz) return 0;
00670   *(r++) = '_';
00671   r = SWIG_PackData(r,ptr,sz);
00672   if (lname) {
00673     strncpy(r,name,lname+1);
00674   } else {
00675     *r = 0;
00676   }
00677   return buff;
00678 }
00679 
00680 SWIGRUNTIME const char *
00681 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
00682   if (*c != '_') {
00683     if (strcmp(c,"NULL") == 0) {
00684       memset(ptr,0,sz);
00685       return name;
00686     } else {
00687       return 0;
00688     }
00689   }
00690   return SWIG_UnpackData(++c,ptr,sz);
00691 }
00692 
00693 #ifdef __cplusplus
00694 }
00695 #endif
00696 
00697 /* -----------------------------------------------------------------------------
00698  * luarun.swg
00699  *
00700  * This file contains the runtime support for Lua modules
00701  * and includes code for managing global variables and pointer
00702  * type checking.
00703  * ----------------------------------------------------------------------------- */
00704 
00705 #ifdef __cplusplus
00706 extern "C" {
00707 #endif
00708 
00709 #include "lua.h"
00710 #include "lauxlib.h"
00711 #include <stdlib.h>  /* for malloc */
00712 #include <assert.h>  /* for a few sanity tests */
00713 
00714 /* -----------------------------------------------------------------------------
00715  * Lua flavors
00716  * ----------------------------------------------------------------------------- */
00717 
00718 #define SWIG_LUA_FLAVOR_LUA 1
00719 #define SWIG_LUA_FLAVOR_ELUA 2
00720 #define SWIG_LUA_FLAVOR_ELUAC 3
00721 
00722 #if !defined(SWIG_LUA_TARGET)
00723 # error SWIG_LUA_TARGET not defined
00724 #endif
00725 
00726 #if defined(SWIG_LUA_ELUA_EMULATE)
00727 
00728 struct swig_elua_entry;
00729 
00730 typedef struct swig_elua_key {
00731   int type;
00732   union {
00733     const char* strkey;
00734     lua_Number numkey;
00735   } key;
00736 } swig_elua_key;
00737 
00738 typedef struct swig_elua_val {
00739   int type;
00740   union {
00741     lua_Number number;
00742     const struct swig_elua_entry *table;
00743     const char *string;
00744     lua_CFunction function;
00745     struct {
00746       char member;
00747       long lvalue;
00748       void *pvalue;
00749       swig_type_info **ptype;
00750     } userdata;
00751   } value;
00752 } swig_elua_val;
00753 
00754 typedef struct swig_elua_entry {
00755   swig_elua_key key;
00756   swig_elua_val value;
00757 } swig_elua_entry;
00758 
00759 #define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} }
00760 #define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} }
00761 #define LNILKEY {LUA_TNIL, {.strkey = 0} }
00762 
00763 #define LNUMVAL(x) {LUA_TNUMBER, {.number = x} }
00764 #define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} }
00765 #define LROVAL(x) {LUA_TTABLE, {.table = x} }
00766 #define LNILVAL {LUA_TNIL, {.string = 0} }
00767 #define LSTRVAL(x) {LUA_TSTRING, {.string = x} }
00768 
00769 #define LUA_REG_TYPE swig_elua_entry
00770 
00771 #define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable"
00772 
00773 #define lua_pushrotable(L,p)\
00774   lua_newtable(L);\
00775   assert(p);\
00776   SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p));
00777 
00778 #define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
00779   LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } }
00780 
00781 #define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\
00782   LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } }
00783 #endif
00784 
00785 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
00786 #  define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
00787 #  define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
00788 #  define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
00789 #  define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
00790     /* Those two types of constants are not supported in elua */
00791 
00792 #ifndef SWIG_LUA_CONSTTAB_POINTER
00793 #warning eLua does not support pointers as constants. By default, nil will be used as value
00794 #define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL
00795 #endif
00796 
00797 #ifndef SWIG_LUA_CONSTTAB_BINARY
00798 #warning eLua does not support pointers to member as constants. By default, nil will be used as value
00799 #define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL
00800 #endif
00801 #else /* SWIG_LUA_FLAVOR_LUA */
00802 #  define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
00803 #  define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
00804 #  define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
00805 #  define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
00806 #  define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
00807        SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D
00808 #  define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\
00809        SWIG_LUA_BINARY,  (char *)B, S, 0, (void *)C, &D
00810 #endif
00811 
00812 #ifndef SWIG_LUA_ELUA_EMULATE
00813 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
00814 #  define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
00815 #  define LSTRVAL LRO_STRVAL
00816 #endif
00817 #endif /* SWIG_LUA_ELUA_EMULATE*/
00818 
00819 #ifndef SWIG_LUA_ELUA_EMULATE
00820 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
00821 
00822 #ifndef MIN_OPT_LEVEL
00823 #define MIN_OPT_LEVEL 2
00824 #endif
00825 
00826 #include "lrodefs.h"
00827 #include "lrotable.h"
00828 #endif
00829 #endif /* SWIG_LUA_ELUA_EMULATE*/
00830 /* -----------------------------------------------------------------------------
00831  * compatibility defines
00832  * ----------------------------------------------------------------------------- */
00833 
00834 /* History of Lua C API length functions:  In Lua 5.0 (and before?)
00835    there was "lua_strlen".  In Lua 5.1, this was renamed "lua_objlen",
00836    but a compatibility define of "lua_strlen" was added.  In Lua 5.2,
00837    this function was again renamed, to "lua_rawlen" (to emphasize that
00838    it doesn't call the "__len" metamethod), and the compatibility
00839    define of lua_strlen was removed.  All SWIG uses have been updated
00840    to "lua_rawlen", and we add our own defines of that here for older
00841    versions of Lua.  */
00842 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
00843 # define lua_rawlen lua_strlen
00844 #elif LUA_VERSION_NUM == 501
00845 # define lua_rawlen lua_objlen
00846 #endif
00847 
00848 
00849 /* lua_pushglobaltable is the recommended "future-proof" way to get
00850    the global table for Lua 5.2 and later.  Here we define
00851    lua_pushglobaltable ourselves for Lua versions before 5.2.  */
00852 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
00853 # define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
00854 #endif
00855 
00856 /* lua_absindex was introduced in Lua 5.2 */
00857 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
00858 # define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1)
00859 #endif
00860 
00861 /* lua_rawsetp was introduced in Lua 5.2 */
00862 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
00863 #define lua_rawsetp(L,index,ptr)\
00864   lua_pushlightuserdata(L,(void*)(ptr));\
00865   lua_insert(L,-2);\
00866   lua_rawset(L,index);
00867 
00868 #define lua_rawgetp(L,index,ptr)\
00869   lua_pushlightuserdata(L,(void*)(ptr));\
00870   lua_rawget(L,index);
00871 
00872 #endif
00873 
00874 /* --------------------------------------------------------------------------
00875  * Helper functions for error handling
00876  * -------------------------------------------------------------------------- */
00877 
00878 /* Push the string STR on the Lua stack, like lua_pushstring, but
00879    prefixed with the the location of the innermost Lua call-point
00880    (as formated by luaL_where).  */
00881 SWIGRUNTIME void
00882 SWIG_Lua_pusherrstring (lua_State *L, const char *str)
00883 {
00884   luaL_where (L, 1);
00885   lua_pushstring (L, str);
00886   lua_concat (L, 2);
00887 }
00888 
00889 /* Push a formatted string generated from FMT and following args on
00890    the Lua stack, like lua_pushfstring, but prefixed with the the
00891    location of the innermost Lua call-point (as formated by luaL_where).  */
00892 SWIGRUNTIME void
00893 SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...)
00894 {
00895   va_list argp;
00896   va_start(argp, fmt);
00897   luaL_where(L, 1);
00898   lua_pushvfstring(L, fmt, argp);
00899   va_end(argp);
00900   lua_concat(L, 2);
00901 }
00902 
00903 
00904 /* -----------------------------------------------------------------------------
00905  * global swig types
00906  * ----------------------------------------------------------------------------- */
00907 /* Constant table */
00908 #define SWIG_LUA_INT     1
00909 #define SWIG_LUA_FLOAT   2
00910 #define SWIG_LUA_STRING  3
00911 #define SWIG_LUA_POINTER 4
00912 #define SWIG_LUA_BINARY  5
00913 #define SWIG_LUA_CHAR    6
00914 
00915 /* Structure for variable linking table */
00916 typedef struct {
00917   const char *name;
00918   lua_CFunction get;
00919   lua_CFunction set;
00920 } swig_lua_var_info;
00921 
00922 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
00923 typedef const LUA_REG_TYPE swig_lua_method;
00924 typedef const LUA_REG_TYPE swig_lua_const_info;
00925 #else /* Normal lua */
00926 typedef luaL_Reg swig_lua_method;
00927 
00928 /* Constant information structure */
00929 typedef struct {
00930     int type;
00931     char *name;
00932     long lvalue;
00933     double dvalue;
00934     void   *pvalue;
00935     swig_type_info **ptype;
00936 } swig_lua_const_info;
00937 
00938 #endif
00939 
00940 typedef struct {
00941   const char     *name;
00942   lua_CFunction   getmethod;
00943   lua_CFunction   setmethod;
00944 } swig_lua_attribute;
00945 
00946 
00947 struct swig_lua_class;
00948 /* Can be used to create namespaces. Currently used to wrap class static methods/variables/constants */
00949 typedef struct swig_lua_namespace {
00950   const char            *name;
00951   swig_lua_method       *ns_methods;
00952   swig_lua_attribute    *ns_attributes;
00953   swig_lua_const_info   *ns_constants;
00954   struct swig_lua_class        **ns_classes;
00955   struct swig_lua_namespace    **ns_namespaces;
00956 } swig_lua_namespace;
00957 
00958 typedef struct swig_lua_class {
00959   const char    *name; /* Name that this class has in Lua */
00960   const char    *fqname; /* Fully qualified name - Scope + class name */
00961   swig_type_info   **type;
00962   lua_CFunction  constructor;
00963   void    (*destructor)(void *);
00964   swig_lua_method   *methods;
00965   swig_lua_attribute     *attributes;
00966   swig_lua_namespace    *cls_static;
00967   swig_lua_method   *metatable; /* 0 for -eluac */
00968   struct swig_lua_class **bases;
00969   const char **base_names;
00970 } swig_lua_class;
00971 
00972 /* this is the struct for wrapping all pointers in SwigLua
00973 */
00974 typedef struct {
00975   swig_type_info   *type;
00976   int     own;  /* 1 if owned & must be destroyed */
00977   void        *ptr;
00978 } swig_lua_userdata;
00979 
00980 /* this is the struct for wrapping arbitrary packed binary data
00981 (currently it is only used for member function pointers)
00982 the data ordering is similar to swig_lua_userdata, but it is currently not possible
00983 to tell the two structures apart within SWIG, other than by looking at the type
00984 */
00985 typedef struct {
00986   swig_type_info   *type;
00987   int     own;  /* 1 if owned & must be destroyed */
00988   char data[1];       /* arbitary amount of data */    
00989 } swig_lua_rawdata;
00990 
00991 /* Common SWIG API */
00992 #define SWIG_NewPointerObj(L, ptr, type, owner)       SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
00993 #define SWIG_ConvertPtr(L,idx, ptr, type, flags)    SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
00994 #define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname)  SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
00995 /* for C++ member pointers, ie, member methods */
00996 #define SWIG_ConvertMember(L, idx, ptr, sz, ty)       SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
00997 #define SWIG_NewMemberObj(L, ptr, sz, type)      SWIG_Lua_NewPackedObj(L, ptr, sz, type)
00998 
00999 /* Runtime API */
01000 #define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
01001 #define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
01002 #define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
01003 
01004 /* Contract support */
01005 #define SWIG_contract_assert(expr, msg)  \
01006   if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else
01007 
01008 
01009 /* helper #defines */
01010 #define SWIG_fail {goto fail;}
01011 #define SWIG_fail_arg(func_name,argnum,type) \
01012   {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
01013   func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
01014   goto fail;}
01015 #define SWIG_fail_ptr(func_name,argnum,type) \
01016   SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
01017 #define SWIG_check_num_args(func_name,a,b) \
01018   if (lua_gettop(L)<a || lua_gettop(L)>b) \
01019   {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
01020   goto fail;}
01021 
01022 
01023 #define SWIG_Lua_get_table(L,n) \
01024   (lua_pushstring(L, n), lua_rawget(L,-2))
01025 
01026 #define SWIG_Lua_add_function(L,n,f) \
01027   (lua_pushstring(L, n), \
01028       lua_pushcfunction(L, f), \
01029       lua_rawset(L,-3))
01030 
01031 #define SWIG_Lua_add_boolean(L,n,b) \
01032   (lua_pushstring(L, n), \
01033       lua_pushboolean(L, b), \
01034       lua_rawset(L,-3))
01035 
01036 /* special helper for allowing 'nil' for usertypes */
01037 #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
01038 
01039 #ifdef __cplusplus
01040 /* Special helper for member function pointers 
01041 it gets the address, casts it, then dereferences it */
01042 /*#define SWIG_mem_fn_as_voidptr(a)  (*((char**)&(a))) */
01043 #endif
01044 
01045 /* storing/access of swig_module_info */
01046 SWIGRUNTIME swig_module_info *
01047 SWIG_Lua_GetModule(lua_State *L) {
01048   swig_module_info *ret = 0;
01049   lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
01050   lua_rawget(L,LUA_REGISTRYINDEX);
01051   if (lua_islightuserdata(L,-1))
01052     ret=(swig_module_info*)lua_touserdata(L,-1);
01053   lua_pop(L,1);  /* tidy */
01054   return ret;
01055 }
01056 
01057 SWIGRUNTIME void
01058 SWIG_Lua_SetModule(lua_State *L, swig_module_info *module) {
01059   /* add this all into the Lua registry: */
01060   lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
01061   lua_pushlightuserdata(L,(void*)module);
01062   lua_rawset(L,LUA_REGISTRYINDEX);
01063 }
01064 
01065 /* -----------------------------------------------------------------------------
01066  * global variable support code: modules
01067  * ----------------------------------------------------------------------------- */
01068 
01069 /* this function is called when trying to set an immutable.
01070 default action is to print an error.
01071 This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
01072 SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L)
01073 {
01074 /*  there should be 1 param passed in: the new value */
01075 #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
01076   lua_pop(L,1);  /* remove it */
01077   luaL_error(L,"This variable is immutable");
01078 #endif
01079     return 0;   /* should not return anything */
01080 }
01081 
01082 #ifdef SWIG_LUA_ELUA_EMULATE
01083 
01084 SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own);
01085 SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type);
01086 static int swig_lua_elua_emulate_unique_key;
01087 
01088 /* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */
01089 SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table)
01090 {
01091   int i, table_parsed, parsed_tables_array, target_table;
01092   assert(lua_istable(L,-1));
01093   target_table = lua_gettop(L);
01094   /* Get the registry where we put all parsed tables to avoid loops */
01095   lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
01096   if(lua_isnil(L,-1)) {
01097     lua_pop(L,1);
01098     lua_newtable(L);
01099     lua_pushvalue(L,-1);
01100     lua_rawsetp(L,LUA_REGISTRYINDEX,(void*)(&swig_lua_elua_emulate_unique_key));
01101   }
01102   parsed_tables_array = lua_gettop(L);
01103   lua_pushvalue(L,target_table);
01104   lua_rawsetp(L, parsed_tables_array, table);
01105   table_parsed = 0;
01106   const int SWIGUNUSED pairs_start = lua_gettop(L);
01107   for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++)
01108   {
01109     const swig_elua_entry *entry = table + i;
01110     int is_metatable = 0;
01111     switch(entry->key.type) {
01112       case LUA_TSTRING:
01113         lua_pushstring(L,entry->key.key.strkey);
01114         if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0)
01115           is_metatable = 1;
01116         break;
01117       case  LUA_TNUMBER:
01118         lua_pushnumber(L,entry->key.key.numkey);
01119         break;
01120       case LUA_TNIL:
01121         lua_pushnil(L);
01122         break;
01123       default:
01124         assert(0);
01125     }
01126     switch(entry->value.type) {
01127       case LUA_TSTRING:
01128         lua_pushstring(L,entry->value.value.string);
01129         break;
01130       case  LUA_TNUMBER:
01131         lua_pushnumber(L,entry->value.value.number);
01132         break;
01133       case LUA_TFUNCTION:
01134         lua_pushcfunction(L,entry->value.value.function);
01135         break;
01136       case LUA_TTABLE:
01137         lua_rawgetp(L,parsed_tables_array, entry->value.value.table);
01138         table_parsed = !lua_isnil(L,-1);
01139         if(!table_parsed) {
01140           lua_pop(L,1); /*remove nil */
01141           lua_newtable(L);
01142           SWIG_Lua_elua_emulate_register(L,entry->value.value.table);
01143         } 
01144         if(is_metatable) {
01145           assert(lua_istable(L,-1));
01146           lua_pushvalue(L,-1);
01147           lua_setmetatable(L,target_table);
01148         }
01149 
01150         break;
01151       case LUA_TUSERDATA:
01152         if(entry->value.value.userdata.member) 
01153           SWIG_NewMemberObj(L,entry->value.value.userdata.pvalue,
01154               entry->value.value.userdata.lvalue,
01155               *(entry->value.value.userdata.ptype));
01156         else 
01157           SWIG_NewPointerObj(L,entry->value.value.userdata.pvalue,
01158               *(entry->value.value.userdata.ptype),0);
01159         break;
01160       case LUA_TNIL:
01161         lua_pushnil(L);
01162         break;
01163       default:
01164         assert(0);
01165     }
01166     assert(lua_gettop(L) == pairs_start + 2);
01167     lua_rawset(L,target_table);
01168   }
01169   lua_pop(L,1); /* Removing parsed tables storage */
01170   assert(lua_gettop(L) == target_table);
01171 }
01172 
01173 SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L)
01174 {
01175   lua_pushnil(L);
01176   lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
01177 }
01178 
01179 SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L);
01180 
01181 SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L)
01182 {
01183   SWIG_check_num_args("getmetatable(SWIG eLua emulation)", 1, 1);
01184   SWIG_Lua_get_class_registry(L);
01185   lua_getfield(L,-1,"lua_getmetatable");
01186   lua_remove(L,-2); /* remove the registry*/
01187   assert(!lua_isnil(L,-1));
01188   lua_pushvalue(L,1);
01189   assert(lua_gettop(L) == 3); /* object | function | object again */
01190   lua_call(L,1,1);
01191   if(!lua_isnil(L,-1)) /*There is an ordinary metatable */
01192     return 1;
01193   /*if it is a table, then emulate elua behaviour - check for __metatable attribute of a table*/
01194   assert(lua_gettop(L) == 2);
01195   if(lua_istable(L,-2)) {
01196     lua_pop(L,1); /*remove the nil*/
01197     lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY);
01198   }
01199   assert(lua_gettop(L) == 2);
01200   return 1;
01201   
01202 fail:
01203   lua_error(L);
01204   return 0;
01205 }
01206 
01207 SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L)
01208 {
01209   SWIG_Lua_get_class_registry(L);
01210   lua_pushglobaltable(L);
01211   lua_pushstring(L,"lua_getmetatable");
01212   lua_getfield(L,-2,"getmetatable");
01213   assert(!lua_isnil(L,-1));
01214   lua_rawset(L,-4);
01215   lua_pushstring(L, "getmetatable");
01216   lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable);
01217   lua_rawset(L,-3);
01218   lua_pop(L,2);
01219       
01220 }
01221 /* END OF REMOVE */
01222 
01223 #endif
01224 /* -----------------------------------------------------------------------------
01225  * global variable support code: namespaces and modules (which are the same thing)
01226  * ----------------------------------------------------------------------------- */
01227 
01228 SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L)
01229 {
01230 /*  there should be 2 params passed in
01231   (1) table (not the meta table)
01232   (2) string name of the attribute
01233 */
01234   assert(lua_istable(L,-2));  /* just in case */
01235   lua_getmetatable(L,-2);
01236   assert(lua_istable(L,-1));
01237   SWIG_Lua_get_table(L,".get"); /* find the .get table */
01238   assert(lua_istable(L,-1));
01239   /* look for the key in the .get table */
01240   lua_pushvalue(L,2);  /* key */
01241   lua_rawget(L,-2);
01242   lua_remove(L,-2); /* stack tidy, remove .get table */
01243   if (lua_iscfunction(L,-1))
01244   {  /* found it so call the fn & return its value */
01245     lua_call(L,0,1);  /* 1 value in (userdata),1 out (result) */
01246     lua_remove(L,-2); /* stack tidy, remove metatable */
01247     return 1;
01248   }
01249   lua_pop(L,1);  /* remove whatever was there */
01250   /* ok, so try the .fn table */
01251   SWIG_Lua_get_table(L,".fn"); /* find the .get table */
01252   assert(lua_istable(L,-1));  /* just in case */
01253   lua_pushvalue(L,2);  /* key */
01254   lua_rawget(L,-2);  /* look for the fn */
01255   lua_remove(L,-2); /* stack tidy, remove .fn table */
01256   if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */
01257   {  /* found it so return the fn & let lua call it */
01258     lua_remove(L,-2); /* stack tidy, remove metatable */
01259     return 1;
01260   }
01261   lua_pop(L,1);  /* remove whatever was there */
01262   return 0;
01263 }
01264 
01265 SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L)
01266 {
01267 /*  there should be 3 params passed in
01268   (1) table (not the meta table)
01269   (2) string name of the attribute
01270   (3) any for the new value
01271 */
01272 
01273   assert(lua_istable(L,1));
01274   lua_getmetatable(L,1);    /* get the meta table */
01275   assert(lua_istable(L,-1));
01276 
01277   SWIG_Lua_get_table(L,".set"); /* find the .set table */
01278   if (lua_istable(L,-1))
01279   {
01280     /* look for the key in the .set table */
01281     lua_pushvalue(L,2);  /* key */
01282     lua_rawget(L,-2);
01283     if (lua_iscfunction(L,-1))
01284     {  /* found it so call the fn & return its value */
01285       lua_pushvalue(L,3);  /* value */
01286       lua_call(L,1,0);
01287       return 0;
01288     }
01289     lua_pop(L,1);  /* remove the value */
01290   }
01291   lua_pop(L,1);  /* remove the value .set table */
01292   lua_pop(L,1); /* remote metatable */
01293   lua_rawset(L,-3);
01294   return 0;
01295 }
01296 
01297 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */
01298 SWIGINTERN void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]); /* forward declaration */
01299 SWIGINTERN void  SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn); /* forward declaration */
01300 SWIGINTERN void  SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss);
01301 
01302 /* helper function - register namespace methods and attributes into namespace */
01303 SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns)
01304 {
01305   int i;
01306   /* There must be namespace table (not metatable) at the top of the stack */
01307   assert(lua_istable(L,-1));
01308   SWIG_Lua_InstallConstants(L, ns->ns_constants);
01309 
01310   /* add methods to the namespace/module table */
01311   for(i=0;ns->ns_methods[i].name;i++){
01312     SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].func);
01313   }
01314   lua_getmetatable(L,-1);
01315 
01316   /* add fns */
01317   for(i=0;ns->ns_attributes[i].name;i++){
01318     SWIG_Lua_add_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod);
01319   }
01320 
01321   /* clear stack - remove metatble */
01322   lua_pop(L,1);
01323   return 0;
01324 }
01325 
01326 /* Register all classes in the namespace */
01327 SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns)
01328 {
01329   swig_lua_class **classes;
01330 
01331   /* There must be a module/namespace table at the top of the stack */
01332   assert(lua_istable(L,-1));
01333 
01334   classes = ns->ns_classes;
01335 
01336   if( classes != 0 ) {
01337     while(*classes != 0) {
01338       SWIG_Lua_class_register(L, *classes);
01339       classes++;
01340     }
01341   }
01342 }
01343 
01344 /* Helper function. Creates namespace table and adds it to module table
01345    if 'reg' is true, then will register namespace table to parent one (must be on top of the stack
01346    when function is called).
01347    Function always returns newly registered table on top of the stack.
01348 */
01349 SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg)
01350 {
01351   swig_lua_namespace **sub_namespace;
01352   /* 1 argument - table on the top of the stack */
01353   const int SWIGUNUSED begin = lua_gettop(L);
01354   assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table or parent namespace table */
01355   lua_checkstack(L,5);
01356   lua_newtable(L); /* namespace itself */
01357   lua_newtable(L); /* metatable for namespace */
01358 
01359   /* add a table called ".get" */
01360   lua_pushstring(L,".get");
01361   lua_newtable(L);
01362   lua_rawset(L,-3);
01363   /* add a table called ".set" */
01364   lua_pushstring(L,".set");
01365   lua_newtable(L);
01366   lua_rawset(L,-3);
01367   /* add a table called ".fn" */
01368   lua_pushstring(L,".fn");
01369   lua_newtable(L);
01370   lua_rawset(L,-3);
01371 
01372   /* add accessor fns for using the .get,.set&.fn */
01373   SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get);
01374   SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set);
01375 
01376   lua_setmetatable(L,-2); /* set metatable */
01377 
01378   /* Register all functions, variables etc */
01379   SWIG_Lua_add_namespace_details(L,ns);
01380   /* Register classes */
01381   SWIG_Lua_add_namespace_classes(L,ns);
01382 
01383   sub_namespace = ns->ns_namespaces;
01384   if( sub_namespace != 0) {
01385     while(*sub_namespace != 0) {
01386       SWIG_Lua_namespace_register(L, *sub_namespace, 1);
01387       lua_pop(L,1); /* removing sub-namespace table */
01388       sub_namespace++;
01389     }
01390   }
01391 
01392   if (reg) {
01393     lua_pushstring(L,ns->name);
01394     lua_pushvalue(L,-2);
01395     lua_rawset(L,-4); /* add namespace to module table */
01396   }
01397   assert(lua_gettop(L) == begin+1);
01398 }
01399 #endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */
01400 
01401 /* -----------------------------------------------------------------------------
01402  * global variable support code: classes
01403  * ----------------------------------------------------------------------------- */
01404 
01405 SWIGINTERN void  SWIG_Lua_get_class_metatable(lua_State *L,const char *cname);
01406 
01407 typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret);
01408 
01409 SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED swig_type,
01410   int first_arg, swig_lua_base_iterator_func func, int  *const ret)
01411 {
01412     /* first_arg - position of the object in stack. Everything that is above are arguments
01413      * and is passed to every evocation of the func */
01414     int last_arg = lua_gettop(L);/* position of last argument */
01415     int original_metatable = last_arg + 1;
01416     size_t bases_count;
01417     int result = SWIG_ERROR;
01418     int bases_table;
01419     (void)swig_type;
01420     lua_getmetatable(L,first_arg);
01421 
01422     /* initialise base search */
01423 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
01424     SWIG_Lua_get_table(L,".bases");
01425     assert(lua_istable(L,-1));
01426     bases_count = lua_rawlen(L,-1);
01427     bases_table = lua_gettop(L);
01428 #else
01429     /* In elua .bases table doesn't exist. Use table from swig_lua_class */
01430     (void)bases_table;
01431     assert(swig_type!=0);
01432     swig_module_info *module=SWIG_GetModule(L);
01433     swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases;
01434     const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names;
01435     bases_count = 0;
01436     for(;base_names[bases_count];
01437       bases_count++);/* get length of bases */
01438 #endif
01439 
01440     if(ret)
01441       *ret = 0;
01442     if(bases_count>0)
01443     {
01444       int to_remove;
01445       size_t i;
01446       int j;
01447       int subcall_last_arg;
01448       int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */
01449       int valid = 1;
01450       swig_type_info *base_swig_type = 0;
01451       for(j=first_arg;j<=last_arg;j++)
01452         lua_pushvalue(L,j);
01453       subcall_last_arg = lua_gettop(L);
01454 
01455       /* Trick: temporarily replacing original metatable with metatable for base class and call getter */
01456       for(i=0;i<bases_count;i++) {
01457         /* Iteration through class bases */
01458 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
01459         lua_rawgeti(L,bases_table,i+1);
01460         base_swig_type = 0;
01461         if(lua_isnil(L,-1)) {
01462           valid = 0;
01463           lua_pop(L,1);
01464         } else {
01465           valid = 1;
01466         }
01467 #else /* In elua .bases table doesn't exist. Use table from swig_lua_class */
01468         swig_lua_class *base_class = bases[i];
01469         if(!base_class) {
01470           valid = 0;
01471         } else {
01472           valid = 1;
01473           SWIG_Lua_get_class_metatable(L,base_class->fqname);
01474           base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]);
01475           assert(base_swig_type != 0);
01476         }
01477 #endif
01478 
01479         if(!valid)
01480           continue;
01481         assert(lua_isuserdata(L, subcall_first_arg));
01482         assert(lua_istable(L,-1));
01483         lua_setmetatable(L,subcall_first_arg); /* Set new metatable */
01484         assert(lua_gettop(L) == subcall_last_arg);
01485         result = func(L, base_swig_type,subcall_first_arg, ret); /* Forward call */
01486         if(result != SWIG_ERROR) {
01487           break;
01488         }
01489       }
01490       /* Restore original metatable */
01491       lua_pushvalue(L,original_metatable);
01492       lua_setmetatable(L,first_arg);
01493       /* Clear - remove everything between last_arg and subcall_last_arg including */
01494       to_remove = subcall_last_arg - last_arg;
01495       for(j=0;j<to_remove;j++)
01496         lua_remove(L,last_arg+1);
01497     } else {
01498       /* Remove everything after last_arg */
01499       lua_pop(L, lua_gettop(L) - last_arg);
01500     }
01501     if(ret) assert(lua_gettop(L) == last_arg + *ret);
01502     return result;
01503 }
01504 
01505 /* The class.get method helper, performs the lookup of class attributes.
01506  * It returns an error code. Number of function return values is passed inside 'ret'.
01507  * first_arg is not used in this function because function always has 2 arguments.
01508  */
01509 SWIGINTERN int  SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret)
01510 {
01511 /*  there should be 2 params passed in
01512   (1) userdata (not the meta table)
01513   (2) string name of the attribute
01514 */
01515   int bases_search_result;
01516   int substack_start = lua_gettop(L)-2;
01517   assert(first_arg == substack_start+1);
01518   lua_checkstack(L,5);
01519   assert(lua_isuserdata(L,-2));  /* just in case */
01520   lua_getmetatable(L,-2);    /* get the meta table */
01521   assert(lua_istable(L,-1));  /* just in case */
01522   SWIG_Lua_get_table(L,".get"); /* find the .get table */
01523   assert(lua_istable(L,-1));  /* just in case */
01524   /* look for the key in the .get table */
01525   lua_pushvalue(L,substack_start+2);  /* key */
01526   lua_rawget(L,-2);
01527   lua_remove(L,-2); /* stack tidy, remove .get table */
01528   if (lua_iscfunction(L,-1))
01529   {  /* found it so call the fn & return its value */
01530     lua_pushvalue(L,substack_start+1);  /* the userdata */
01531     lua_call(L,1,1);  /* 1 value in (userdata),1 out (result) */
01532     lua_remove(L,-2); /* stack tidy, remove metatable */
01533     if(ret)
01534       *ret = 1;
01535     return SWIG_OK;
01536   }
01537   lua_pop(L,1);  /* remove whatever was there */
01538   /* ok, so try the .fn table */
01539   SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
01540   assert(lua_istable(L,-1));  /* just in case */
01541   lua_pushvalue(L,substack_start+2);  /* key */
01542   lua_rawget(L,-2);  /* look for the fn */
01543   lua_remove(L,-2); /* stack tidy, remove .fn table */
01544   if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
01545   {  /* found it so return the fn & let lua call it */
01546     lua_remove(L,-2); /* stack tidy, remove metatable */
01547     if(ret)
01548       *ret = 1;
01549     return SWIG_OK;
01550   }
01551   lua_pop(L,1);  /* remove whatever was there */
01552   /* NEW: looks for the __getitem() fn
01553   this is a user provided get fn */
01554   SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
01555   if (lua_iscfunction(L,-1))  /* if its there */
01556   {  /* found it so call the fn & return its value */
01557     lua_pushvalue(L,substack_start+1);  /* the userdata */
01558     lua_pushvalue(L,substack_start+2);  /* the parameter */
01559     lua_call(L,2,1);  /* 2 value in (userdata),1 out (result) */
01560     lua_remove(L,-2); /* stack tidy, remove metatable */
01561     if(ret) *ret = 1;
01562     return SWIG_OK;
01563   }
01564   lua_pop(L,1);
01565   /* Remove the metatable */
01566   lua_pop(L,1);
01567   /* Search in base classes */
01568   bases_search_result = SWIG_Lua_iterate_bases(L,type,substack_start+1,SWIG_Lua_class_do_get,ret);
01569   return bases_search_result;  /* sorry not known */
01570 }
01571 
01572 /* the class.get method, performs the lookup of class attributes
01573  */
01574 SWIGINTERN int  SWIG_Lua_class_get(lua_State *L)
01575 {
01576 /*  there should be 2 params passed in
01577   (1) userdata (not the meta table)
01578   (2) string name of the attribute
01579 */
01580   int result;
01581   swig_lua_userdata *usr;
01582   swig_type_info *type;
01583   int ret = 0;
01584   assert(lua_isuserdata(L,1));
01585   usr=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
01586   type = usr->type;
01587   result = SWIG_Lua_class_do_get(L,type,1,&ret);
01588   if(result == SWIG_OK)
01589     return ret;
01590 
01591   return 0;
01592 }
01593 
01594 /* helper for the class.set method, performs the lookup of class attributes
01595  * It returns error code. Number of function return values is passed inside 'ret'
01596  */
01597 SWIGINTERN int  SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret)
01598 {
01599 /*  there should be 3 params passed in
01600   (1) table (not the meta table)
01601   (2) string name of the attribute
01602   (3) any for the new value
01603   */
01604 
01605   int bases_search_result;
01606   int substack_start = lua_gettop(L) - 3;
01607   lua_checkstack(L,5);
01608   assert(lua_isuserdata(L,substack_start+1));  /* just in case */
01609   lua_getmetatable(L,substack_start+1);    /* get the meta table */
01610   assert(lua_istable(L,-1));  /* just in case */
01611   if(ret)
01612     *ret = 0; /* it is setter - number of return values is always 0 */
01613 
01614   SWIG_Lua_get_table(L,".set"); /* find the .set table */
01615   if (lua_istable(L,-1))
01616   {
01617     /* look for the key in the .set table */
01618     lua_pushvalue(L,substack_start+2);  /* key */
01619     lua_rawget(L,-2);
01620     lua_remove(L,-2); /* tidy stack, remove .set table */
01621     if (lua_iscfunction(L,-1))
01622     {  /* found it so call the fn & return its value */
01623       lua_pushvalue(L,substack_start+1);  /* userdata */
01624       lua_pushvalue(L,substack_start+3);  /* value */
01625       lua_call(L,2,0);
01626       lua_remove(L,substack_start+4); /*remove metatable*/
01627       return SWIG_OK;
01628     }
01629     lua_pop(L,1);  /* remove the value */
01630   } else {
01631     lua_pop(L,1);  /* remove the answer for .set table request*/
01632   }
01633   /* NEW: looks for the __setitem() fn
01634   this is a user provided set fn */
01635   SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
01636   if (lua_iscfunction(L,-1))  /* if its there */
01637   {  /* found it so call the fn & return its value */
01638     lua_pushvalue(L,substack_start+1);  /* the userdata */
01639     lua_pushvalue(L,substack_start+2);  /* the parameter */
01640     lua_pushvalue(L,substack_start+3);  /* the value */
01641     lua_call(L,3,0);  /* 3 values in ,0 out */
01642     lua_remove(L,-2); /* stack tidy, remove metatable */
01643     return SWIG_OK;
01644   }
01645   lua_pop(L,1); /* remove value */
01646 
01647   lua_pop(L,1); /* remove metatable */
01648   /* Search among bases */
01649   bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret);
01650   if(ret)
01651     assert(*ret == 0);
01652   assert(lua_gettop(L) == substack_start + 3);
01653   return bases_search_result;
01654 }
01655 
01656 /* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly
01657  * handles return values.
01658  */
01659 SWIGINTERN int  SWIG_Lua_class_set(lua_State *L)
01660 {
01661 /*  There should be 3 params passed in
01662   (1) table (not the meta table)
01663   (2) string name of the attribute
01664   (3) any for the new value
01665   */
01666   int ret = 0;
01667   int result;
01668   swig_lua_userdata *usr;
01669   swig_type_info *type;
01670   assert(lua_isuserdata(L,1));
01671   usr=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
01672   type = usr->type;
01673   result = SWIG_Lua_class_do_set(L,type,1,&ret);
01674   if(result != SWIG_OK) {
01675    SWIG_Lua_pushferrstring(L,"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method.");
01676    lua_error(L);
01677   } else {
01678     assert(ret==0);
01679   }
01680   return 0;
01681 }
01682 
01683 /* the class.destruct method called by the interpreter */
01684 SWIGINTERN int  SWIG_Lua_class_destruct(lua_State *L)
01685 {
01686 /*  there should be 1 params passed in
01687   (1) userdata (not the meta table) */
01688   swig_lua_userdata *usr;
01689   swig_lua_class *clss;
01690   assert(lua_isuserdata(L,-1));  /* just in case */
01691   usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */
01692   /* if must be destroyed & has a destructor */
01693   if (usr->own) /* if must be destroyed */
01694   {
01695     clss=(swig_lua_class*)usr->type->clientdata;  /* get the class */
01696     if (clss && clss->destructor)  /* there is a destroy fn */
01697     {
01698       clss->destructor(usr->ptr);  /* bye bye */
01699     }
01700   }
01701   return 0;
01702 }
01703 
01704 /* the class.__tostring method called by the interpreter and print */
01705 SWIGINTERN int  SWIG_Lua_class_tostring(lua_State *L)
01706 {
01707 /*  there should be 1 param passed in
01708   (1) userdata (not the metatable) */
01709   const char *className;
01710   void* userData;
01711   assert(lua_isuserdata(L,1));  /* just in case */
01712   userData = lua_touserdata(L,1); /* get the userdata address for later */
01713   lua_getmetatable(L,1);    /* get the meta table */
01714   assert(lua_istable(L,-1));  /* just in case */
01715 
01716   lua_getfield(L, -1, ".type");
01717   className = lua_tostring(L, -1);
01718 
01719   lua_pushfstring(L, "<%s userdata: %p>", className, userData);
01720   return 1;
01721 }
01722 
01723 /* to manually disown some userdata */
01724 SWIGINTERN int  SWIG_Lua_class_disown(lua_State *L)
01725 {
01726 /*  there should be 1 params passed in
01727   (1) userdata (not the meta table) */
01728   swig_lua_userdata *usr;
01729   assert(lua_isuserdata(L,-1));  /* just in case */
01730   usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */
01731   
01732   usr->own = 0; /* clear our ownership */
01733   return 0;
01734 }
01735 
01736 /* lua callable function to compare userdata's value
01737 the issue is that two userdata may point to the same thing
01738 but to lua, they are different objects */
01739 SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L)
01740 {
01741   int result;
01742   swig_lua_userdata *usr1,*usr2;
01743   if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2))  /* just in case */
01744     return 0;  /* nil reply */
01745   usr1=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
01746   usr2=(swig_lua_userdata*)lua_touserdata(L,2);  /* get data */
01747   /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/
01748   result=(usr1->ptr==usr2->ptr);
01749    lua_pushboolean(L,result);
01750   return 1;
01751 }
01752 
01753 /* populate table at the top of the stack with metamethods that ought to be inherited */
01754 SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L)
01755 {
01756   SWIG_Lua_add_boolean(L, "__add", 1);
01757   SWIG_Lua_add_boolean(L, "__sub", 1);
01758   SWIG_Lua_add_boolean(L, "__mul", 1);
01759   SWIG_Lua_add_boolean(L, "__div", 1);
01760   SWIG_Lua_add_boolean(L, "__mod", 1);
01761   SWIG_Lua_add_boolean(L, "__pow", 1);
01762   SWIG_Lua_add_boolean(L, "__unm", 1);
01763   SWIG_Lua_add_boolean(L, "__len", 1 );
01764   SWIG_Lua_add_boolean(L, "__concat", 1 );
01765   SWIG_Lua_add_boolean(L, "__eq", 1);
01766   SWIG_Lua_add_boolean(L, "__lt", 1);
01767   SWIG_Lua_add_boolean(L, "__le", 1);
01768   SWIG_Lua_add_boolean(L, "__call", 1);
01769   SWIG_Lua_add_boolean(L, "__tostring", 1);
01770   SWIG_Lua_add_boolean(L, "__gc", 0);
01771 }
01772 
01773 /* creates the swig registry */
01774 SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L)
01775 {
01776   /* create main SWIG registry table */
01777   lua_pushstring(L,"SWIG");
01778   lua_newtable(L);
01779   /* populate it with some predefined data */
01780 
01781   /* .library table. Placeholder */
01782   lua_pushstring(L,".library");
01783   lua_newtable(L);
01784   {
01785     /* list of metamethods that class inherits from its bases */
01786     lua_pushstring(L,"inheritable_metamethods");
01787     lua_newtable(L);
01788     /* populate with list of metamethods */
01789     SWIG_Lua_populate_inheritable_metamethods(L);
01790     lua_rawset(L,-3);
01791   }
01792   lua_rawset(L,-3);
01793 
01794   lua_rawset(L,LUA_REGISTRYINDEX);
01795 }
01796 
01797 /* gets the swig registry (or creates it) */
01798 SWIGINTERN void  SWIG_Lua_get_class_registry(lua_State *L)
01799 {
01800   /* add this all into the swig registry: */
01801   lua_pushstring(L,"SWIG");
01802   lua_rawget(L,LUA_REGISTRYINDEX);  /* get the registry */
01803   if (!lua_istable(L,-1))  /* not there */
01804   {  /* must be first time, so add it */
01805     lua_pop(L,1);  /* remove the result */
01806     SWIG_Lua_create_class_registry(L);
01807     /* then get it */
01808     lua_pushstring(L,"SWIG");
01809     lua_rawget(L,LUA_REGISTRYINDEX);
01810   }
01811 }
01812 
01813 SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L)
01814 {
01815   SWIG_Lua_get_class_registry(L);
01816   lua_pushstring(L, ".library");
01817   lua_rawget(L,-2);
01818   assert( !lua_isnil(L,-1) );
01819   lua_pushstring(L, "inheritable_metamethods");
01820   lua_rawget(L,-2);
01821 
01822   /* Remove class registry and library table */
01823   lua_remove(L,-2);
01824   lua_remove(L,-2);
01825 }
01826 
01827 /* Helper function to get the classes metatable from the register */
01828 SWIGINTERN void  SWIG_Lua_get_class_metatable(lua_State *L,const char *cname)
01829 {
01830   SWIG_Lua_get_class_registry(L);  /* get the registry */
01831   lua_pushstring(L,cname);  /* get the name */
01832   lua_rawget(L,-2);    /* get it */
01833   lua_remove(L,-2);    /* tidy up (remove registry) */
01834 }
01835 
01836 /* Set up the base classes pointers.
01837 Each class structure has a list of pointers to the base class structures.
01838 This function fills them.
01839 It cannot be done at compile time, as this will not work with hireachies
01840 spread over more than one swig file. 
01841 Therefore it must be done at runtime, querying the SWIG type system.
01842 */
01843 SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss)
01844 {
01845   int i=0;
01846   swig_module_info *module=SWIG_GetModule(L);
01847   for(i=0;clss->base_names[i];i++)
01848   {
01849     if (clss->bases[i]==0) /* not found yet */
01850     {
01851       /* lookup and cache the base class */
01852       swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
01853       if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
01854     }
01855   }
01856 }
01857 
01858 #if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
01859 /* Merges two tables  */
01860 SWIGINTERN int SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source)
01861 {
01862   /* iterating */
01863   lua_pushnil(L);
01864   while (lua_next(L,source) != 0) {
01865     /* -1 - value, -2 - index */
01866     /* have to copy to assign */
01867     lua_pushvalue(L,-2); /* copy of index */
01868     lua_pushvalue(L,-2); /* copy of value */
01869     lua_rawset(L, target);
01870     lua_pop(L,1);
01871     /* only key is left */
01872   }
01873 }
01874 
01875 /* Merges two tables with given name. original - index of target metatable, base - index of source metatable */
01876 SWIGINTERN int SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base)
01877 {
01878   /* push original[name], then base[name] */
01879   lua_pushstring(L,name);
01880   lua_rawget(L,original);
01881   int original_table = lua_gettop(L);
01882   lua_pushstring(L,name);
01883   lua_rawget(L,base);
01884   int base_table = lua_gettop(L);
01885   SWIG_Lua_merge_tables_by_index(L, original_table, base_table);
01886   /* clearing stack */
01887   lua_pop(L,2);
01888 }
01889 
01890 /* Function takes all symbols from base and adds it to derived class. It's just a helper. */
01891 SWIGINTERN int SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls)
01892 {
01893   /* There is one parameter - original, i.e. 'derived' class metatable */
01894   assert(lua_istable(L,-1));
01895   int original = lua_gettop(L);
01896   SWIG_Lua_get_class_metatable(L,base_cls->fqname);
01897   int base = lua_gettop(L);
01898   SWIG_Lua_merge_tables(L, ".fn", original, base );
01899   SWIG_Lua_merge_tables(L, ".set", original, base );
01900   SWIG_Lua_merge_tables(L, ".get", original, base );
01901   lua_pop(L,1);
01902 }
01903 
01904 /* Function squashes all symbols from 'clss' bases into itself */
01905 SWIGINTERN int  SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss)
01906 {
01907   int i;
01908   SWIG_Lua_get_class_metatable(L,clss->fqname);
01909   for(i=0;clss->base_names[i];i++)
01910   {
01911     if (clss->bases[i]==0) /* Somehow it's not found. Skip it */
01912       continue;
01913     /* Thing is: all bases are already registered. Thus they have already executed
01914      * this function. So we just need to squash them into us, because their bases
01915      * are already squashed into them. No need for recursion here!
01916      */
01917     SWIG_Lua_class_squash_base(L, clss->bases[i]);
01918   }
01919   lua_pop(L,1); /*tidy stack*/
01920 }
01921 #endif
01922 
01923 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */
01924 /* helper add a variable to a registered class */
01925 SWIGINTERN void  SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn)
01926 {
01927   assert(lua_istable(L,-1));  /* just in case */
01928   SWIG_Lua_get_table(L,".get"); /* find the .get table */
01929   assert(lua_istable(L,-1));  /* just in case */
01930   SWIG_Lua_add_function(L,name,getFn);
01931   lua_pop(L,1);       /* tidy stack (remove table) */
01932   if (setFn)
01933   {
01934     SWIG_Lua_get_table(L,".set"); /* find the .set table */
01935     assert(lua_istable(L,-1));  /* just in case */
01936     SWIG_Lua_add_function(L,name,setFn);
01937     lua_pop(L,1);       /* tidy stack (remove table) */
01938   }
01939 }
01940 
01941 /* helper to recursively add class static details (static attributes, operations and constants) */
01942 SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss)
01943 {
01944   int i = 0;
01945   /* The class namespace table must be on the top of the stack */
01946   assert(lua_istable(L,-1));
01947   /* call all the base classes first: we can then override these later: */
01948   for(i=0;clss->bases[i];i++)
01949   {
01950     SWIG_Lua_add_class_static_details(L,clss->bases[i]);
01951   }
01952 
01953   SWIG_Lua_add_namespace_details(L, clss->cls_static);
01954 }
01955 
01956 SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss); /* forward declaration */
01957 
01958 /* helper to recursively add class details (attributes & operations) */
01959 SWIGINTERN void  SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss)
01960 {
01961   int i;
01962   size_t bases_count = 0;
01963   /* Add bases to .bases table */
01964   SWIG_Lua_get_table(L,".bases");
01965   assert(lua_istable(L,-1));  /* just in case */
01966   for(i=0;clss->bases[i];i++)
01967   {
01968     SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname);
01969     /* Base class must be already registered */
01970     assert(lua_istable(L,-1));
01971     lua_rawseti(L,-2,i+1); /* In lua indexing starts from 1 */
01972     bases_count++;
01973   }
01974   assert(lua_rawlen(L,-1) == bases_count);
01975   lua_pop(L,1); /* remove .bases table */
01976   /* add attributes */
01977   for(i=0;clss->attributes[i].name;i++){
01978     SWIG_Lua_add_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
01979   }
01980   /* add methods to the metatable */
01981   SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
01982   assert(lua_istable(L,-1));  /* just in case */
01983   for(i=0;clss->methods[i].name;i++){
01984     SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].func);
01985   }
01986   lua_pop(L,1);       /* tidy stack (remove table) */
01987   /* add operator overloads
01988     This adds methods from metatable array to metatable. Can mess up garbage
01989     collectind if someone defines __gc method
01990     */
01991   if(clss->metatable) {
01992     for(i=0;clss->metatable[i].name;i++) {
01993       SWIG_Lua_add_function(L,clss->metatable[i].name,clss->metatable[i].func);
01994     }
01995   }
01996 
01997 #if !defined(SWIG_LUA_SQUASH_BASES)
01998   /* Adding metamethods that are defined in base classes. If bases were squashed
01999    * then it is obviously unnecessary
02000    */
02001   SWIG_Lua_add_class_user_metamethods(L, clss);
02002 #endif
02003 }
02004 
02005 /* Helpers to add user defined class metamedhods - __add, __sub etc. The helpers are needed
02006    for the following issue: Lua runtime checks for metamethod existence with rawget function
02007    ignoring our SWIG-provided __index and __newindex functions. Thus our inheritance-aware method
02008    search algorithm doesn't work in such case. (Not to say that Lua runtime queries metamethod directly
02009    in metatable and not in object).
02010    Current solution is this: if somewhere in hierarchy metamethod __x is defined, then all descendants
02011    are automatically given a special proxy __x that calls the real __x method.
02012    Obvious idea - to copy __x instead of creating __x-proxy is wrong because if someone changes __x in runtime,
02013    those changes must be reflected in all descendants.
02014 */
02015 
02016 SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/
02017 
02018 /* The real function that resolves a metamethod.
02019  * Function searches given class and all it's bases(recursively) for first instance of something that is
02020  * not equal to SWIG_Lua_resolve_metatmethod. (Almost always this 'something' is actual metamethod implementation
02021  * and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the
02022  * answer.
02023  * Returns 1 if found, 0 otherwise.
02024  * clss is class which metatable we will search for method
02025  * metamethod_name_idx is index in L where metamethod name (as string) lies
02026  * skip_check allows to skip searching metamethod in givel clss and immideatelly go to searching in bases. skip_check
02027  * is not caried to subsequent recursive calls - false is always passed. It is set to true only at first call from
02028  * SWIG_Lua_resolve_metamethod
02029  * */
02030 SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx,
02031     int skip_check)
02032 {
02033   /* This function is called recursively */
02034   int result = 0;
02035   int i = 0;
02036 
02037   if (!skip_check) {
02038     SWIG_Lua_get_class_metatable(L, clss->fqname);
02039     lua_pushvalue(L, metamethod_name_idx);
02040     lua_rawget(L,-2);
02041     /* If this is cfunction and it is equal to SWIG_Lua_resolve_metamethod then
02042      * this isn't the function we are looking for :)
02043      * lua_tocfunction will return NULL if not cfunction
02044      */
02045     if (!lua_isnil(L,-1) && lua_tocfunction(L,-1) != SWIG_Lua_resolve_metamethod ) {
02046       lua_remove(L,-2); /* removing class metatable */
02047       return 1;
02048     }
02049     lua_pop(L,2); /* remove class metatable and query result */
02050   }
02051 
02052   /* Forwarding calls to bases */
02053   for(i=0;clss->bases[i];i++)
02054   {
02055     result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0);
02056     if (result)
02057       break;
02058   }
02059 
02060   return result;
02061 }
02062 
02063 /* The proxy function for metamethod. All parameters are passed as cclosure. Searches for actual method
02064  * and calls it */
02065 SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L)
02066 {
02067   int numargs;
02068   int metamethod_name_idx;
02069   const swig_lua_class* clss;
02070   int result;
02071 
02072   lua_checkstack(L,5);
02073   numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */
02074   
02075   /* Get upvalues from closure */
02076   lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/
02077   metamethod_name_idx = lua_gettop(L);
02078   
02079   lua_pushvalue(L, lua_upvalueindex(2));
02080   clss = (const swig_lua_class*)(lua_touserdata(L,-1));
02081   lua_pop(L,1); /* remove lightuserdata with clss from stack */
02082 
02083   /* Actual work */
02084   result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1);
02085   if (!result) {
02086    SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation.");
02087    lua_error(L);
02088    return 0;
02089   }
02090 
02091   lua_remove(L,-2); /* remove metamethod key */
02092   lua_insert(L,1); /* move function to correct position */
02093   lua_call(L, numargs, LUA_MULTRET);
02094   return lua_gettop(L); /* return all results */
02095 }
02096 
02097 
02098 /* If given metamethod must be present in given class, then creates appropriate proxy
02099  * Returns 1 if successfully added, 0 if not added because no base class has it, -1
02100  * if method is defined in the class metatable itself
02101  */
02102 SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index)
02103 {
02104   int key_index;
02105   int success = 0;
02106   int i = 0;
02107 
02108   /* metamethod name - on the top of the stack */
02109   assert(lua_isstring(L,-1));
02110   
02111   key_index = lua_gettop(L);
02112 
02113   /* Check whether method is already defined in metatable */
02114   lua_pushvalue(L,key_index); /* copy of the key */
02115   lua_gettable(L,metatable_index);
02116   if( !lua_isnil(L,-1) ) {
02117     lua_pop(L,1);
02118     return -1;
02119   }
02120   lua_pop(L,1); 
02121 
02122   /* Iterating over immediate bases */
02123   for(i=0;clss->bases[i];i++)
02124   {
02125     const swig_lua_class *base = clss->bases[i];
02126     SWIG_Lua_get_class_metatable(L, base->fqname);
02127     lua_pushvalue(L, key_index);
02128     lua_rawget(L, -2);
02129     if( !lua_isnil(L,-1) ) {
02130       lua_pushvalue(L, key_index); 
02131 
02132       /* Add proxy function */
02133       lua_pushvalue(L, key_index); /* first closure value is function name */
02134       lua_pushlightuserdata(L, clss); /* second closure value is swig_lua_class structure */
02135       lua_pushcclosure(L, SWIG_Lua_resolve_metamethod, 2);
02136       
02137       lua_rawset(L, metatable_index);
02138       success = 1;
02139     }
02140     lua_pop(L,1); /* remove function or nil */
02141     lua_pop(L,1); /* remove base class metatable */
02142 
02143     if( success )
02144       break;
02145   }
02146 
02147   return success; 
02148 }
02149 
02150 SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss)
02151 {
02152   int metatable_index;
02153   int metamethods_info_index;
02154   int tostring_undefined;
02155   int eq_undefined = 0;
02156 
02157   SWIG_Lua_get_class_metatable(L, clss->fqname);
02158   metatable_index = lua_gettop(L);
02159   SWIG_Lua_get_inheritable_metamethods(L);
02160   assert(lua_istable(L,-1));
02161   metamethods_info_index = lua_gettop(L);
02162   lua_pushnil(L); /* first key */
02163   while(lua_next(L, metamethods_info_index) != 0 ) {
02164     /* key at index -2, value at index -1 */
02165     const int is_inheritable = lua_toboolean(L,-2);
02166     lua_pop(L,1); /* remove value - we don't need it anymore */
02167 
02168     if(is_inheritable) { /* if metamethod is inheritable */
02169       SWIG_Lua_add_class_user_metamethod(L,clss,metatable_index);
02170     }
02171   }
02172 
02173   lua_pop(L,1); /* remove inheritable metatmethods table */
02174 
02175   /* Special handling for __tostring method */
02176   lua_pushstring(L, "__tostring");
02177   lua_pushvalue(L,-1);
02178   lua_rawget(L,metatable_index);
02179   tostring_undefined = lua_isnil(L,-1);
02180   lua_pop(L,1);
02181   if( tostring_undefined ) {
02182     lua_pushcfunction(L, SWIG_Lua_class_tostring);
02183     lua_rawset(L, metatable_index);
02184   } else {
02185     lua_pop(L,1); /* remove copy of the key */
02186   }
02187 
02188   /* Special handling for __eq method */
02189   lua_pushstring(L, "__eq");
02190   lua_pushvalue(L,-1);
02191   lua_rawget(L,metatable_index);
02192   eq_undefined = lua_isnil(L,-1);
02193   lua_pop(L,1);
02194   if( eq_undefined ) {
02195     lua_pushcfunction(L, SWIG_Lua_class_equal);
02196     lua_rawset(L, metatable_index);
02197   } else {
02198     lua_pop(L,1); /* remove copy of the key */
02199   }
02200   /* Warning: __index and __newindex are SWIG-defined. For user-defined operator[]
02201    * a __getitem/__setitem method should be defined
02202    */
02203   lua_pop(L,1); /* pop class metatable */
02204 }
02205 
02206 /* Register class static methods,attributes etc as well as constructor proxy */
02207 SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss)
02208 {
02209   const int SWIGUNUSED begin = lua_gettop(L);
02210   lua_checkstack(L,5); /* just in case */
02211   assert(lua_istable(L,-1));  /* just in case */
02212   assert(strcmp(clss->name, clss->cls_static->name) == 0); /* in class those 2 must be equal */
02213 
02214   SWIG_Lua_namespace_register(L,clss->cls_static, 1);
02215 
02216   assert(lua_istable(L,-1)); /* just in case */
02217 
02218   /*  add its constructor to module with the name of the class
02219   so you can do MyClass(...) as well as new_MyClass(...)
02220   BUT only if a constructor is defined
02221   (this overcomes the problem of pure virtual classes without constructors)*/
02222   if (clss->constructor)
02223   {
02224     lua_getmetatable(L,-1);
02225     assert(lua_istable(L,-1)); /* just in case */
02226     SWIG_Lua_add_function(L,"__call", clss->constructor);
02227     lua_pop(L,1);
02228   }
02229 
02230   assert(lua_istable(L,-1)); /* just in case */
02231   SWIG_Lua_add_class_static_details(L, clss);
02232 
02233   /* clear stack */
02234   lua_pop(L,1);
02235   assert( lua_gettop(L) == begin );
02236 }
02237 
02238 /* Performs the instance (non-static) class registration process. Metatable for class is created
02239  * and added to the class registry.
02240  */
02241 SWIGINTERN void  SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss)
02242 {
02243   const int SWIGUNUSED begin = lua_gettop(L);
02244   int i;
02245   /* if name already there (class is already registered) then do nothing */
02246   SWIG_Lua_get_class_registry(L);  /* get the registry */
02247   lua_pushstring(L,clss->fqname);  /* get the name */
02248   lua_rawget(L,-2);
02249   if(!lua_isnil(L,-1)) {
02250     lua_pop(L,2);
02251     assert(lua_gettop(L)==begin);
02252     return;
02253   }
02254   lua_pop(L,2); /* tidy stack */
02255   /* Recursively initialize all bases */
02256   for(i=0;clss->bases[i];i++)
02257   {
02258     SWIG_Lua_class_register_instance(L,clss->bases[i]);
02259   }
02260   /* Again, get registry and push name */
02261   SWIG_Lua_get_class_registry(L);  /* get the registry */
02262   lua_pushstring(L,clss->fqname);  /* get the name */
02263   lua_newtable(L);    /* create the metatable */
02264 #if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
02265   /* If squashing is requested, then merges all bases metatable into this one.
02266    * It would get us all special methods: __getitem, __add etc.
02267    * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away
02268    */
02269   {
02270     int new_metatable_index = lua_absindex(L,-1);
02271     for(i=0;clss->bases[i];i++)
02272     {
02273       int base_metatable;
02274       SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname);
02275       base_metatable = lua_absindex(L,-1);
02276       SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable);
02277       lua_pop(L,1);
02278     }
02279   }
02280   /* And now we will overwrite all incorrectly set data */
02281 #endif
02282   /* add string of class name called ".type" */
02283   lua_pushstring(L,".type");
02284   lua_pushstring(L,clss->fqname);
02285   lua_rawset(L,-3);
02286   /* add a table called bases */
02287   lua_pushstring(L,".bases");
02288   lua_newtable(L);
02289   lua_rawset(L,-3);
02290   /* add a table called ".get" */
02291   lua_pushstring(L,".get");
02292   lua_newtable(L);
02293   lua_rawset(L,-3);
02294   /* add a table called ".set" */
02295   lua_pushstring(L,".set");
02296   lua_newtable(L);
02297   lua_rawset(L,-3);
02298   /* add a table called ".fn" */
02299   lua_pushstring(L,".fn");
02300   lua_newtable(L);
02301   /* add manual disown method */
02302   SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown);
02303   lua_rawset(L,-3);
02304   /* add accessor fns for using the .get,.set&.fn */
02305   SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
02306   SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
02307   SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
02308   /* add it */
02309   lua_rawset(L,-3);  /* metatable into registry */
02310   lua_pop(L,1);      /* tidy stack (remove registry) */
02311   assert(lua_gettop(L) == begin);
02312 
02313 #if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
02314   /* Now merge all symbols from .fn, .set, .get etc from bases to our tables */
02315   SWIG_Lua_class_squash_bases(L,clss);
02316 #endif
02317   SWIG_Lua_get_class_metatable(L,clss->fqname);
02318   SWIG_Lua_add_class_instance_details(L,clss);  /* recursive adding of details (atts & ops) */
02319   lua_pop(L,1);      /* tidy stack (remove class metatable) */
02320   assert( lua_gettop(L) == begin );
02321 }
02322 
02323 SWIGINTERN void  SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss)
02324 {
02325   int SWIGUNUSED begin;
02326   assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */
02327   SWIG_Lua_class_register_instance(L,clss);
02328   SWIG_Lua_class_register_static(L,clss);
02329 
02330   /* Add links from static part to instance part and vice versa */
02331   /* [SWIG registry]                                   [Module]
02332    *    "MyClass" ----> [MyClass metatable] <=====     "MyClass" -+> [static part]
02333    *                     ".get" ----> ...        |                |     getmetatable()----|
02334    *                     ".set" ----> ...        |                |                       |
02335    *                     ".static" --------------)----------------/           [static part metatable]
02336    *                                             |                                ".get" --> ...
02337    *                                             |                                ".set" --> ....
02338    *                                             |=============================== ".instance"
02339    */
02340   begin = lua_gettop(L);
02341   lua_pushstring(L,clss->cls_static->name);
02342   lua_rawget(L,-2); /* get class static table */
02343   assert(lua_istable(L,-1));
02344   lua_getmetatable(L,-1);
02345   assert(lua_istable(L,-1)); /* get class static metatable */
02346   lua_pushstring(L,".instance"); /* prepare key */
02347 
02348   SWIG_Lua_get_class_metatable(L,clss->fqname); /* get class metatable */
02349   assert(lua_istable(L,-1));
02350   lua_pushstring(L,".static"); /* prepare key */
02351   lua_pushvalue(L, -4); /* push static class TABLE */
02352   assert(lua_istable(L,-1));
02353   lua_rawset(L,-3); /* assign static class table(!NOT metatable) as ".static" member of class metatable */
02354   lua_rawset(L,-3); /* assign class metatable as ".instance" member of class static METATABLE */
02355   lua_pop(L,2);
02356   assert(lua_gettop(L) == begin);
02357 }
02358 #endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */
02359 
02360 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
02361 SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss)
02362 {
02363   const int SWIGUNUSED begin = lua_gettop(L);
02364   int i;
02365   /* if name already there (class is already registered) then do nothing */
02366   SWIG_Lua_get_class_registry(L);  /* get the registry */
02367   lua_pushstring(L,clss->fqname);  /* get the name */
02368   lua_rawget(L,-2);
02369   if(!lua_isnil(L,-1)) {
02370     lua_pop(L,2);
02371     assert(lua_gettop(L)==begin);
02372     return;
02373   }
02374   lua_pop(L,2); /* tidy stack */
02375   /* Recursively initialize all bases */
02376   for(i=0;clss->bases[i];i++)
02377   {
02378     SWIG_Lua_elua_class_register_instance(L,clss->bases[i]);
02379   }
02380   /* Again, get registry and push name */
02381   SWIG_Lua_get_class_registry(L);  /* get the registry */
02382   lua_pushstring(L,clss->fqname);  /* get the name */
02383   assert(clss->metatable);
02384   lua_pushrotable(L, (void*)(clss->metatable));    /* create the metatable */
02385   lua_rawset(L,-3);
02386   lua_pop(L,1);
02387   assert(lua_gettop(L) == begin);
02388 }
02389 #endif /* elua && eluac */
02390 
02391 /* -----------------------------------------------------------------------------
02392  * Class/structure conversion fns
02393  * ----------------------------------------------------------------------------- */
02394 
02395 /* helper to add metatable to new lua object */
02396 SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L,swig_type_info *type)
02397 {
02398   if (type->clientdata)  /* there is clientdata: so add the metatable */
02399   {
02400     SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->fqname);
02401     if (lua_istable(L,-1))
02402     {
02403       lua_setmetatable(L,-2);
02404     }
02405     else
02406     {
02407       lua_pop(L,1);
02408     }
02409   }
02410 }
02411 
02412 /* pushes a new object into the lua stack */
02413 SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own)
02414 {
02415   swig_lua_userdata *usr;
02416   if (!ptr){
02417     lua_pushnil(L);
02418     return;
02419   }
02420   usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata));  /* get data */
02421   usr->ptr=ptr;  /* set the ptr */
02422   usr->type=type;
02423   usr->own=own;
02424 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
02425   SWIG_Lua_AddMetatable(L,type); /* add metatable */
02426 #endif
02427 }
02428 
02429 /* takes a object from the lua stack & converts it into an object of the correct type
02430  (if possible) */
02431 SWIGRUNTIME int  SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type_info *type,int flags)
02432 {
02433   swig_lua_userdata *usr;
02434   swig_cast_info *cast;
02435   if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;}    /* special case: lua nil => NULL pointer */
02436   usr=(swig_lua_userdata*)lua_touserdata(L,index);  /* get data */
02437   if (usr)
02438   {
02439     if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
02440     {
02441         usr->own=0;
02442     }
02443     if (!type)            /* special cast void*, no casting fn */
02444     {
02445       *ptr=usr->ptr;
02446       return SWIG_OK; /* ok */
02447     }
02448     cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */
02449     if (cast)
02450     {
02451       int newmemory = 0;
02452       *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
02453       assert(!newmemory); /* newmemory handling not yet implemented */
02454       return SWIG_OK;  /* ok */
02455     }
02456   }
02457   return SWIG_ERROR;  /* error */
02458 }
02459 
02460 SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State *L,int index,swig_type_info *type,int flags,
02461        int argnum,const char *func_name){
02462   void *result;
02463   if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
02464     luaL_error (L,"Error in %s, expected a %s at argument number %d\n",
02465                 func_name,(type && type->str)?type->str:"void*",argnum);
02466   }
02467   return result;
02468 }
02469 
02470 /* pushes a packed userdata. user for member fn pointers only */
02471 SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type)
02472 {
02473   swig_lua_rawdata *raw;
02474   assert(ptr); /* not acceptable to pass in a NULL value */
02475   raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size);  /* alloc data */
02476   raw->type=type;
02477   raw->own=0;
02478   memcpy(raw->data,ptr,size); /* copy the data */
02479   SWIG_Lua_AddMetatable(L,type); /* add metatable */
02480 }
02481     
02482 /* converts a packed userdata. user for member fn pointers only */
02483 SWIGRUNTIME int  SWIG_Lua_ConvertPacked(lua_State *L,int index,void *ptr,size_t size,swig_type_info *type)
02484 {
02485   swig_lua_rawdata *raw;
02486   raw=(swig_lua_rawdata*)lua_touserdata(L,index);  /* get data */
02487   if (!raw) return SWIG_ERROR;  /* error */
02488   if (type==0 || type==raw->type) /* void* or identical type */
02489   {
02490     memcpy(ptr,raw->data,size); /* copy it */
02491     return SWIG_OK; /* ok */
02492   }
02493   return SWIG_ERROR;  /* error */
02494 }
02495 
02496 /* a function to get the typestring of a piece of data */
02497 SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
02498 {
02499   swig_lua_userdata *usr;
02500   if (lua_isuserdata(L,tp))
02501   {
02502     usr=(swig_lua_userdata*)lua_touserdata(L,tp);  /* get data */
02503     if (usr && usr->type && usr->type->str)
02504       return usr->type->str;
02505     return "userdata (unknown type)";
02506   }
02507   return lua_typename(L,lua_type(L,tp));
02508 }
02509 
02510 /* lua callable function to get the userdata's type */
02511 SWIGRUNTIME int SWIG_Lua_type(lua_State *L)
02512 {
02513   lua_pushstring(L,SWIG_Lua_typename(L,1));
02514   return 1;
02515 }
02516 
02517 /* -----------------------------------------------------------------------------
02518  * global variable support code: class/struct typemap functions
02519  * ----------------------------------------------------------------------------- */
02520 
02521 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
02522 /* Install Constants */
02523 SWIGINTERN void
02524 SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) {
02525   int i;
02526   for (i = 0; constants[i].type; i++) {
02527     switch(constants[i].type) {
02528     case SWIG_LUA_INT:
02529       lua_pushstring(L,constants[i].name);
02530       lua_pushnumber(L,(lua_Number)constants[i].lvalue);
02531       lua_rawset(L,-3);
02532       break;
02533     case SWIG_LUA_FLOAT:
02534       lua_pushstring(L,constants[i].name);
02535       lua_pushnumber(L,(lua_Number)constants[i].dvalue);
02536       lua_rawset(L,-3);
02537       break;
02538     case SWIG_LUA_CHAR:
02539       lua_pushstring(L,constants[i].name);
02540       lua_pushfstring(L,"%c",(char)constants[i].lvalue);
02541       lua_rawset(L,-3);
02542       break;
02543     case SWIG_LUA_STRING:
02544       lua_pushstring(L,constants[i].name);
02545       lua_pushstring(L,(char *) constants[i].pvalue);
02546       lua_rawset(L,-3);
02547       break;
02548     case SWIG_LUA_POINTER:
02549       lua_pushstring(L,constants[i].name);
02550       SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
02551       lua_rawset(L,-3);
02552       break;
02553     case SWIG_LUA_BINARY:
02554       lua_pushstring(L,constants[i].name);
02555       SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
02556       lua_rawset(L,-3);
02557       break;
02558     default:
02559       break;
02560     }
02561   }
02562 }
02563 #endif
02564 
02565 /* -----------------------------------------------------------------------------
02566  * executing lua code from within the wrapper
02567  * ----------------------------------------------------------------------------- */
02568 
02569 #ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
02570 #define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
02571 #endif
02572 /* Executes a C string in Lua which is a really simple way of calling lua from C
02573 Unfortunately lua keeps changing its APIs, so we need a conditional compile
02574 In lua 5.0.X it's lua_dostring()
02575 In lua 5.1.X it's luaL_dostring()
02576 */
02577 SWIGINTERN int 
02578 SWIG_Lua_dostring(lua_State *L, const char *str) {
02579   int ok,top;
02580   if (str==0 || str[0]==0) return 0; /* nothing to do */
02581   top=lua_gettop(L); /* save stack */
02582 #if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
02583   ok=luaL_dostring(L,str);      /* looks like this is lua 5.1.X or later, good */
02584 #else
02585   ok=lua_dostring(L,str);       /* might be lua 5.0.x, using lua_dostring */
02586 #endif
02587   if (ok!=0) {
02588     SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
02589   }
02590   lua_settop(L,top); /* restore the stack */
02591   return ok;
02592 }    
02593 
02594 #ifdef __cplusplus
02595 }
02596 #endif
02597 
02598 /* ------------------------------ end luarun.swg  ------------------------------ */
02599 
02600 
02601 /* -------- TYPES TABLE (BEGIN) -------- */
02602 
02603 #define SWIGTYPE_p_PLGraphicsIn swig_types[0]
02604 #define SWIGTYPE_p_char swig_types[1]
02605 #define SWIGTYPE_p_double swig_types[2]
02606 #define SWIGTYPE_p_f_double_double__int swig_types[3]
02607 #define SWIGTYPE_p_f_double_double_p_double_p_double_p_void__void swig_types[4]
02608 #define SWIGTYPE_p_f_int_double_p_char_int_p_void__void swig_types[5]
02609 #define SWIGTYPE_p_f_int_p_double_p_double__void swig_types[6]
02610 #define SWIGTYPE_p_f_int_p_q_const__double_p_q_const__double__void swig_types[7]
02611 #define SWIGTYPE_p_int swig_types[8]
02612 #define SWIGTYPE_p_p_char swig_types[9]
02613 #define SWIGTYPE_p_p_double swig_types[10]
02614 #define SWIGTYPE_p_unsigned_int swig_types[11]
02615 static swig_type_info *swig_types[13];
02616 static swig_module_info swig_module = {swig_types, 12, 0, 0, 0, 0};
02617 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
02618 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
02619 
02620 /* -------- TYPES TABLE (END) -------- */
02621 
02622 #define SWIG_name      "plplotluac"
02623 #define SWIG_init      luaopen_plplotluac
02624 #define SWIG_init_user luaopen_plplotluac_user
02625 
02626 #define SWIG_LUACODE   luaopen_plplotluac_luacode
02627 
02628 #include "plplotP.h"
02629 
02630 
02631 #define LUA_ALLOC_ARRAY( TYPE, LEN )    (TYPE *) malloc( LEN * sizeof ( TYPE ) )
02632 #define LUA_FREE_ARRAY( PTR )           if ( PTR ) { free( PTR ); PTR = NULL;}
02633 
02634 // super macro to declare array typemap helper fns
02635     SWIGINTERN int SWIG_itable_size( lua_State* L, int index );
02636 #define LUA_DECLARE_TYPEMAP_ARR_FN( NAME, TYPE )                                                        \
02637     SWIGINTERN int LUA_read_ ## NAME ## _num_array( lua_State * L, int index, TYPE * array, int size ){ \
02638         int i;                                                                                          \
02639         for ( i = 0; i < size; i++ ) {                                                                  \
02640             lua_rawgeti( L, index, i + 1 );                                                             \
02641             if ( lua_isnumber( L, -1 ) ) {                                                              \
02642                 array[i] = (TYPE) lua_tonumber( L, -1 );                                                \
02643             } else {                                                                                    \
02644                 lua_pop( L, 1 );                                                                        \
02645                 return 0;                                                                               \
02646             }                                                                                           \
02647             lua_pop( L, 1 );                                                                            \
02648         }                                                                                               \
02649         return 1;                                                                                       \
02650     }                                                                                                   \
02651     SWIGINTERN TYPE* LUA_get_ ## NAME ## _num_array_var( lua_State * L, int index, int* size )          \
02652     {                                                                                                   \
02653         TYPE *array;                                                                                    \
02654         if ( !lua_istable( L, index ) ) {                                                               \
02655             lua_pushstring( L, "expected a table" );                                                    \
02656             return 0;                                                                                   \
02657         }                                                                                               \
02658         *size = SWIG_itable_size( L, index );                                                           \
02659         if ( *size < 1 ) {                                                                              \
02660             array    = LUA_ALLOC_ARRAY( TYPE, 1 );                                                      \
02661             array[0] = (TYPE) 0;                                                                        \
02662             return array;                                                                               \
02663         }                                                                                               \
02664         array = LUA_ALLOC_ARRAY( TYPE, *size );                                                         \
02665         if ( !LUA_read_ ## NAME ## _num_array( L, index, array, *size ) ) {                             \
02666             lua_pushstring( L, "table must contain numbers" );                                          \
02667             LUA_FREE_ARRAY( array );                                                                    \
02668             return 0;                                                                                   \
02669         }                                                                                               \
02670         return array;                                                                                   \
02671     }
02672 
02673     LUA_DECLARE_TYPEMAP_ARR_FN( double, double );
02674     LUA_DECLARE_TYPEMAP_ARR_FN( int, int );
02675 
02676 
02677     static PLINT Alen = 0;
02678     static PLINT Xlen = 0, Ylen = 0;
02679 
02680 
02681 #ifdef __cplusplus      /* generic alloc/dealloc fns*/
02682 #define SWIG_ALLOC_ARRAY(TYPE,LEN)      new TYPE[LEN]
02683 #define SWIG_FREE_ARRAY(PTR)            delete[] PTR
02684 #else
02685 #define SWIG_ALLOC_ARRAY(TYPE,LEN)      (TYPE *)malloc(LEN*sizeof(TYPE))
02686 #define SWIG_FREE_ARRAY(PTR)            free(PTR)
02687 #endif
02688 /* counting the size of arrays:*/
02689 SWIGINTERN int SWIG_itable_size(lua_State* L, int index)
02690 {
02691         int n=0;
02692         while(1){
02693                 lua_rawgeti(L,index,n+1);
02694                 if (lua_isnil(L,-1))break;
02695                 ++n;
02696                 lua_pop(L,1);
02697         }
02698         lua_pop(L,1);
02699         return n;
02700 }
02701 
02702 SWIGINTERN int SWIG_table_size(lua_State* L, int index)
02703 {
02704         int n=0;
02705         lua_pushnil(L);  /* first key*/
02706         while (lua_next(L, index) != 0) {
02707                 ++n;
02708                 lua_pop(L, 1);  /* removes `value'; keeps `key' for next iteration*/
02709         }
02710         return n;
02711 }
02712 
02713 /* super macro to declare array typemap helper fns */
02714 #define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\
02715         SWIGINTERN int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\
02716                 int i;\
02717                 for (i = 0; i < size; i++) {\
02718                         lua_rawgeti(L,index,i+1);\
02719                         if (lua_isnumber(L,-1)){\
02720                                 array[i] = (TYPE)lua_tonumber(L,-1);\
02721                         } else {\
02722                                 lua_pop(L,1);\
02723                                 return 0;\
02724                         }\
02725                         lua_pop(L,1);\
02726                 }\
02727                 return 1;\
02728         }\
02729         SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\
02730                 TYPE *array;\
02731                 if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\
02732                         SWIG_Lua_pushferrstring(L,"expected a table of size %d",size);\
02733                         return 0;\
02734                 }\
02735                 array=SWIG_ALLOC_ARRAY(TYPE,size);\
02736                 if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\
02737                         SWIG_Lua_pusherrstring(L,"table must contain numbers");\
02738                         SWIG_FREE_ARRAY(array);\
02739                         return 0;\
02740                 }\
02741                 return array;\
02742         }\
02743         SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\
02744         {\
02745                 TYPE *array;\
02746                 if (!lua_istable(L,index)) {\
02747                         SWIG_Lua_pusherrstring(L,"expected a table");\
02748                         return 0;\
02749                 }\
02750                 *size=SWIG_itable_size(L,index);\
02751                 if (*size<1){\
02752                         SWIG_Lua_pusherrstring(L,"table appears to be empty");\
02753                         return 0;\
02754                 }\
02755                 array=SWIG_ALLOC_ARRAY(TYPE,*size);\
02756                 if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\
02757                         SWIG_Lua_pusherrstring(L,"table must contain numbers");\
02758                         SWIG_FREE_ARRAY(array);\
02759                         return 0;\
02760                 }\
02761                 return array;\
02762         }\
02763         SWIGINTERN void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\
02764                 int i;\
02765                 lua_newtable(L);\
02766                 for (i = 0; i < size; i++){\
02767                         lua_pushnumber(L,(lua_Number)array[i]);\
02768                         lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ \
02769                 }\
02770         }
02771 
02772 SWIG_DECLARE_TYPEMAP_ARR_FN(schar,signed char)
02773 SWIG_DECLARE_TYPEMAP_ARR_FN(uchar,unsigned char)
02774 SWIG_DECLARE_TYPEMAP_ARR_FN(int,int)
02775 SWIG_DECLARE_TYPEMAP_ARR_FN(uint,unsigned int)
02776 SWIG_DECLARE_TYPEMAP_ARR_FN(short,short)
02777 SWIG_DECLARE_TYPEMAP_ARR_FN(ushort,unsigned short)
02778 SWIG_DECLARE_TYPEMAP_ARR_FN(long,long)
02779 SWIG_DECLARE_TYPEMAP_ARR_FN(ulong,unsigned long)
02780 SWIG_DECLARE_TYPEMAP_ARR_FN(float,float)
02781 SWIG_DECLARE_TYPEMAP_ARR_FN(double,double)
02782 
02783 SWIGINTERN int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){
02784         int i;
02785         for (i = 0; i < size; i++) {
02786                 lua_rawgeti(L,index,i+1);
02787                 if (!lua_isuserdata(L,-1) || SWIG_ConvertPtr(L,-1,&array[i],type,0)==-1){
02788                         lua_pop(L,1);
02789                         return 0;
02790                 }
02791                 lua_pop(L,1);
02792         }
02793         return 1;
02794 }
02795 SWIGINTERN void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){
02796         void **array;
02797         if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {
02798                 SWIG_Lua_pushferrstring(L,"expected a table of size %d",size);
02799                 return 0;
02800         }
02801         array=SWIG_ALLOC_ARRAY(void*,size);
02802         if (!SWIG_read_ptr_array(L,index,array,size,type)){
02803                 SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name);
02804                 SWIG_FREE_ARRAY(array);
02805                 return 0;
02806         }
02807         return array;
02808 }
02809 SWIGINTERN void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){
02810         void **array;
02811         if (!lua_istable(L,index)) {
02812                 SWIG_Lua_pusherrstring(L,"expected a table");
02813                 return 0;
02814         }
02815         *size=SWIG_itable_size(L,index);
02816         if (*size<1){
02817                 SWIG_Lua_pusherrstring(L,"table appears to be empty");
02818                 return 0;
02819         }
02820         array=SWIG_ALLOC_ARRAY(void*,*size);
02821         if (!SWIG_read_ptr_array(L,index,array,*size,type)){
02822                 SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name);
02823                 SWIG_FREE_ARRAY(array);
02824                 return 0;
02825         }
02826         return array;
02827 }
02828 SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){
02829         int i;
02830         lua_newtable(L);
02831         for (i = 0; i < size; i++){
02832                 SWIG_NewPointerObj(L,array[i],type,own);
02833                 lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/
02834         }
02835 }
02836 
02837 
02838     PLFLT** read_double_Matrix( lua_State* L, int index, int* nx, int *ny );
02839 
02840     PLFLT** read_double_Matrix( lua_State* L, int index, int* nx, int *ny )
02841     {
02842         int  i, j;
02843         PLFLT** matrix;
02844 
02845         *nx = 0;
02846         *ny = 0;
02847 
02848         if ( !lua_istable( L, index ) )
02849         {
02850             lua_pushstring( L, "expected a table" );
02851             return NULL;
02852         }
02853         *nx = SWIG_itable_size( L, index );
02854         if ( *nx < 1 )
02855         {
02856             lua_pushstring( L, "table appears to be empty" );
02857             return NULL;
02858         }
02859         matrix = LUA_ALLOC_ARRAY( PLFLT *, *nx );
02860         for ( i = 0; i < *nx; i++ )
02861             matrix[i] = NULL;
02862 
02863         lua_rawgeti( L, index, 1 );
02864         if ( !lua_istable( L, -1 ) )
02865         {
02866             lua_pop( L, 1 );
02867             lua_pushstring( L, "expected a table" );
02868             LUA_FREE_ARRAY( matrix );
02869             return NULL;
02870         }
02871         *ny = SWIG_itable_size( L, -1 );
02872         if ( *ny < 1 )
02873         {
02874             lua_pushstring( L, "table appears to be empty" );
02875             LUA_FREE_ARRAY( matrix );
02876             return NULL;
02877         }
02878         lua_pop( L, 1 );
02879 
02880         for ( i = 0; i < *nx; i++ )
02881         {
02882             lua_rawgeti( L, index, i + 1 );
02883             if ( !lua_istable( L, -1 ) )
02884             {
02885                 lua_pop( L, 1 );
02886                 lua_pushstring( L, "expected a table" );
02887                 for ( j = 0; j < *ny; j++ )
02888                     LUA_FREE_ARRAY( matrix[j] );
02889                 LUA_FREE_ARRAY( matrix );
02890                 return NULL;
02891             }
02892             if ( *ny != SWIG_itable_size( L, -1 ) )
02893             {
02894                 lua_pop( L, 1 );
02895                 lua_pushstring( L, "inconsistent table sizes" );
02896                 for ( j = 0; j < i; j++ )
02897                     LUA_FREE_ARRAY( matrix[j] );
02898                 LUA_FREE_ARRAY( matrix );
02899                 return NULL;
02900             }
02901             matrix[i] = LUA_ALLOC_ARRAY( PLFLT, *ny );
02902             for ( j = 0; j < *ny; j++ )
02903             {
02904                 lua_rawgeti( L, -1, j + 1 );
02905                 if ( lua_isnumber( L, -1 ) )
02906                 {
02907                     matrix[i][j] = (PLFLT) lua_tonumber( L, -1 );
02908                 }
02909                 else
02910                 {
02911                     lua_pop( L, 1 );
02912                     lua_pushstring( L, "table must contain numbers" );
02913                     for ( j = 0; j < i + 1; j++ )
02914                         LUA_FREE_ARRAY( matrix[j] );
02915                     LUA_FREE_ARRAY( matrix );
02916                     return NULL;
02917                 }
02918                 lua_pop( L, 1 );
02919             }
02920             lua_pop( L, 1 );
02921         }
02922 
02923         return matrix;
02924     }
02925 
02926 
02927     void mapform( PLINT n, PLFLT* x, PLFLT* y );
02928 
02929     static lua_State* myL = NULL;
02930     static char     mapform_funcstr[255];
02931 
02932     void mapform( PLINT n, PLFLT* x, PLFLT* y )
02933     {
02934         PLFLT *xtemp, *ytemp;
02935         int   len, i;
02936 
02937         // check Lua state
02938         if ( myL == NULL )
02939         {
02940             fprintf( stderr, "Lua state is not set!" );
02941             return;
02942         }
02943 
02944         // push functions and arguments
02945         lua_getglobal( myL, mapform_funcstr );    // function to be called
02946         lua_pushnumber( myL, n );                 // push 1st argument
02947         SWIG_write_double_num_array( myL, x, n ); // push 2nd argument
02948         SWIG_write_double_num_array( myL, y, n ); // push 3rd argument
02949 
02950         // do the call (3 arguments, 2 result)
02951         if ( lua_pcall( myL, 3, 2, 0 ) != 0 )
02952             fprintf( stderr, "error running function `%s':%s",
02953                 mapform_funcstr, lua_tostring( myL, -1 ) );
02954 
02955         // retrieve results
02956         if ( !lua_istable( myL, -2 ) )
02957         {
02958             fprintf( stderr, "function `%s' must return a table as 1st result", mapform_funcstr );
02959             return;
02960         }
02961         if ( !lua_istable( myL, -1 ) )
02962         {
02963             fprintf( stderr, "function `%s' must return a table as 2nd result", mapform_funcstr );
02964             return;
02965         }
02966         xtemp = (PLFLT *) LUA_get_double_num_array_var( myL, -2, &len );
02967         if ( !xtemp || len != n )
02968         {
02969             fprintf( stderr, "function `%s' must return a table of length%d", mapform_funcstr, n );
02970             return;
02971         }
02972         for ( i = 0; i < n; i++ )
02973             x[i] = xtemp[i];
02974         LUA_FREE_ARRAY( xtemp );
02975 
02976         ytemp = (PLFLT *) LUA_get_double_num_array_var( myL, -1, &len );
02977         if ( !ytemp || len != n )
02978         {
02979             fprintf( stderr, "function `%s' must return a table of length%d", mapform_funcstr, n );
02980             return;
02981         }
02982         for ( i = 0; i < n; i++ )
02983             y[i] = ytemp[i];
02984         LUA_FREE_ARRAY( ytemp );
02985 
02986         lua_pop( myL, 2 ); // pop returned values
02987 
02988         return;
02989     }
02990 
02991 
02992     typedef PLINT ( *defined_func )( PLFLT, PLFLT );
02993     typedef void ( *fill_func )( PLINT, const PLFLT*, const PLFLT* );
02994     typedef void ( *pltr_func )( PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer );
02995     typedef void ( *ct_func )( PLFLT, PLFLT, PLFLT *, PLFLT*, PLPointer );
02996     typedef void ( *mapform_func )( PLINT, PLFLT *, PLFLT* );
02997     typedef PLFLT ( *f2eval_func )( PLINT, PLINT, PLPointer );
02998     typedef void ( *label_func )( PLINT, PLFLT, char*, PLINT, PLPointer );
02999 
03000 // Function prototypes
03001     void mypltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void * pltr_data );
03002     void myct( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void * pltr_data );
03003     void mylabel( PLINT axis, PLFLT value, char* label, PLINT length, PLPointer data );
03004 
03005     static char mypltr_funcstr[255];
03006 
03007 // This is the callback that gets handed to the C code.
03008 //   It, in turn, calls the Lua callback
03009     void mypltr( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void * PL_UNUSED( pltr_data ) )
03010     {
03011         *tx = 0;
03012         *ty = 0;
03013 
03014         // check Lua state
03015         if ( myL == NULL )
03016         {
03017             fprintf( stderr, "Lua state is not set!" );
03018             return;
03019         }
03020 
03021         // push functions and arguments
03022         lua_getglobal( myL, mypltr_funcstr ); // function to be called
03023         lua_pushnumber( myL, x );             // push 1st argument
03024         lua_pushnumber( myL, y );             // push 2nd argument
03025 
03026         // do the call (2 arguments, 2 result)
03027         if ( lua_pcall( myL, 2, 2, 0 ) != 0 )
03028             fprintf( stderr, "error running function `%s':%s",
03029                 mypltr_funcstr, lua_tostring( myL, -1 ) );
03030 
03031         // retrieve results
03032         if ( !lua_isnumber( myL, -2 ) )
03033         {
03034             fprintf( stderr, "function `%s' must return a number as 1st result", mypltr_funcstr );
03035             return;
03036         }
03037         if ( !lua_isnumber( myL, -1 ) )
03038         {
03039             fprintf( stderr, "function `%s' must return a number as 2nd result", mypltr_funcstr );
03040             return;
03041         }
03042         *tx = lua_tonumber( myL, -2 );
03043         *ty = lua_tonumber( myL, -1 );
03044         lua_pop( myL, 2 ); // pop returned values
03045 
03046         return;
03047     }
03048 
03049     static char myct_funcstr[255];
03050 
03051 // This is the callback that gets handed to the C code.
03052 //   It, in turn, calls the Lua callback
03053     void myct( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, void * PL_UNUSED( pltr_data ) )
03054     {
03055         *tx = 0;
03056         *ty = 0;
03057 
03058         // check Lua state
03059         if ( myL == NULL )
03060         {
03061             fprintf( stderr, "Lua state is not set!" );
03062             return;
03063         }
03064 
03065         // push functions and arguments
03066         lua_getglobal( myL, myct_funcstr ); // function to be called
03067         lua_pushnumber( myL, x );           // push 1st argument
03068         lua_pushnumber( myL, y );           // push 2nd argument
03069 
03070         // do the call (2 arguments, 2 result)
03071         if ( lua_pcall( myL, 2, 2, 0 ) != 0 )
03072             fprintf( stderr, "error running function `%s':%s",
03073                 myct_funcstr, lua_tostring( myL, -1 ) );
03074 
03075         // retrieve results
03076         if ( !lua_isnumber( myL, -2 ) )
03077         {
03078             fprintf( stderr, "function `%s' must return a number as 1st result", myct_funcstr );
03079             return;
03080         }
03081         if ( !lua_isnumber( myL, -1 ) )
03082         {
03083             fprintf( stderr, "function `%s' must return a number as 2nd result", myct_funcstr );
03084             return;
03085         }
03086         *tx = lua_tonumber( myL, -2 );
03087         *ty = lua_tonumber( myL, -1 );
03088         lua_pop( myL, 2 ); // pop returned values
03089 
03090         return;
03091     }
03092 
03093     static char mylabel_funcstr[255];
03094 
03095     void mylabel( PLINT axis, PLFLT value, char* label, PLINT length, PLPointer PL_UNUSED( data ) )
03096     {
03097         // check Lua state
03098         if ( myL == NULL )
03099         {
03100             fprintf( stderr, "Lua state is not set!" );
03101             return;
03102         }
03103 
03104         // push functions and arguments
03105         lua_getglobal( myL, mylabel_funcstr ); // function to be called
03106         lua_pushnumber( myL, axis );           // push 1st argument
03107         lua_pushnumber( myL, value );          // push 1st argument
03108 
03109         // do the call (2 arguments, 1 result)
03110         if ( lua_pcall( myL, 2, 1, 0 ) != 0 )
03111             fprintf( stderr, "error running function `%s':%s",
03112                 mylabel_funcstr, lua_tostring( myL, -1 ) );
03113 
03114         // retrieve results
03115         if ( !lua_isstring( myL, -1 ) )
03116         {
03117             fprintf( stderr, "function `%s' must return a string as result", mylabel_funcstr );
03118             return;
03119         }
03120         strncpy( label, lua_tostring( myL, -1 ), length );
03121 
03122         lua_pop( myL, 1 ); // pop returned values
03123 
03124         return;
03125     }
03126 
03127 
03128 SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) {
03129   int ret = lua_isstring(L, idx);
03130   if (!ret)
03131    ret = lua_isnil(L, idx);
03132   return ret;
03133 }
03134 
03135 #ifdef __cplusplus
03136 extern "C" {
03137 #endif
03138 static int _wrap_PLGraphicsIn_type_set(lua_State* L) {
03139   int SWIG_arg = 0;
03140   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03141   int arg2 ;
03142   
03143   SWIG_check_num_args("PLGraphicsIn::type",2,2)
03144   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::type",1,"PLGraphicsIn *");
03145   if(!lua_isnumber(L,2)) SWIG_fail_arg("PLGraphicsIn::type",2,"int");
03146   
03147   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03148     SWIG_fail_ptr("PLGraphicsIn_type_set",1,SWIGTYPE_p_PLGraphicsIn);
03149   }
03150   
03151   arg2 = (int)lua_tonumber(L, 2);
03152   if (arg1) (arg1)->type = arg2;
03153   
03154   return SWIG_arg;
03155   
03156   if(0) SWIG_fail;
03157   
03158 fail:
03159   lua_error(L);
03160   return SWIG_arg;
03161 }
03162 
03163 
03164 static int _wrap_PLGraphicsIn_type_get(lua_State* L) {
03165   int SWIG_arg = 0;
03166   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03167   int result;
03168   
03169   SWIG_check_num_args("PLGraphicsIn::type",1,1)
03170   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::type",1,"PLGraphicsIn *");
03171   
03172   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03173     SWIG_fail_ptr("PLGraphicsIn_type_get",1,SWIGTYPE_p_PLGraphicsIn);
03174   }
03175   
03176   result = (int) ((arg1)->type);
03177   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
03178   return SWIG_arg;
03179   
03180   if(0) SWIG_fail;
03181   
03182 fail:
03183   lua_error(L);
03184   return SWIG_arg;
03185 }
03186 
03187 
03188 static int _wrap_PLGraphicsIn_state_set(lua_State* L) {
03189   int SWIG_arg = 0;
03190   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03191   unsigned int arg2 ;
03192   
03193   SWIG_check_num_args("PLGraphicsIn::state",2,2)
03194   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::state",1,"PLGraphicsIn *");
03195   if(!lua_isnumber(L,2)) SWIG_fail_arg("PLGraphicsIn::state",2,"unsigned int");
03196   
03197   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03198     SWIG_fail_ptr("PLGraphicsIn_state_set",1,SWIGTYPE_p_PLGraphicsIn);
03199   }
03200   
03201   SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
03202   arg2 = (unsigned int)lua_tonumber(L, 2);
03203   if (arg1) (arg1)->state = arg2;
03204   
03205   return SWIG_arg;
03206   
03207   if(0) SWIG_fail;
03208   
03209 fail:
03210   lua_error(L);
03211   return SWIG_arg;
03212 }
03213 
03214 
03215 static int _wrap_PLGraphicsIn_state_get(lua_State* L) {
03216   int SWIG_arg = 0;
03217   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03218   unsigned int result;
03219   
03220   SWIG_check_num_args("PLGraphicsIn::state",1,1)
03221   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::state",1,"PLGraphicsIn *");
03222   
03223   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03224     SWIG_fail_ptr("PLGraphicsIn_state_get",1,SWIGTYPE_p_PLGraphicsIn);
03225   }
03226   
03227   result = (unsigned int) ((arg1)->state);
03228   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
03229   return SWIG_arg;
03230   
03231   if(0) SWIG_fail;
03232   
03233 fail:
03234   lua_error(L);
03235   return SWIG_arg;
03236 }
03237 
03238 
03239 static int _wrap_PLGraphicsIn_keysym_set(lua_State* L) {
03240   int SWIG_arg = 0;
03241   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03242   unsigned int arg2 ;
03243   
03244   SWIG_check_num_args("PLGraphicsIn::keysym",2,2)
03245   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::keysym",1,"PLGraphicsIn *");
03246   if(!lua_isnumber(L,2)) SWIG_fail_arg("PLGraphicsIn::keysym",2,"unsigned int");
03247   
03248   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03249     SWIG_fail_ptr("PLGraphicsIn_keysym_set",1,SWIGTYPE_p_PLGraphicsIn);
03250   }
03251   
03252   SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
03253   arg2 = (unsigned int)lua_tonumber(L, 2);
03254   if (arg1) (arg1)->keysym = arg2;
03255   
03256   return SWIG_arg;
03257   
03258   if(0) SWIG_fail;
03259   
03260 fail:
03261   lua_error(L);
03262   return SWIG_arg;
03263 }
03264 
03265 
03266 static int _wrap_PLGraphicsIn_keysym_get(lua_State* L) {
03267   int SWIG_arg = 0;
03268   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03269   unsigned int result;
03270   
03271   SWIG_check_num_args("PLGraphicsIn::keysym",1,1)
03272   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::keysym",1,"PLGraphicsIn *");
03273   
03274   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03275     SWIG_fail_ptr("PLGraphicsIn_keysym_get",1,SWIGTYPE_p_PLGraphicsIn);
03276   }
03277   
03278   result = (unsigned int) ((arg1)->keysym);
03279   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
03280   return SWIG_arg;
03281   
03282   if(0) SWIG_fail;
03283   
03284 fail:
03285   lua_error(L);
03286   return SWIG_arg;
03287 }
03288 
03289 
03290 static int _wrap_PLGraphicsIn_button_set(lua_State* L) {
03291   int SWIG_arg = 0;
03292   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03293   unsigned int arg2 ;
03294   
03295   SWIG_check_num_args("PLGraphicsIn::button",2,2)
03296   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::button",1,"PLGraphicsIn *");
03297   if(!lua_isnumber(L,2)) SWIG_fail_arg("PLGraphicsIn::button",2,"unsigned int");
03298   
03299   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03300     SWIG_fail_ptr("PLGraphicsIn_button_set",1,SWIGTYPE_p_PLGraphicsIn);
03301   }
03302   
03303   SWIG_contract_assert((lua_tonumber(L,2)>=0),"number must not be negative")
03304   arg2 = (unsigned int)lua_tonumber(L, 2);
03305   if (arg1) (arg1)->button = arg2;
03306   
03307   return SWIG_arg;
03308   
03309   if(0) SWIG_fail;
03310   
03311 fail:
03312   lua_error(L);
03313   return SWIG_arg;
03314 }
03315 
03316 
03317 static int _wrap_PLGraphicsIn_button_get(lua_State* L) {
03318   int SWIG_arg = 0;
03319   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03320   unsigned int result;
03321   
03322   SWIG_check_num_args("PLGraphicsIn::button",1,1)
03323   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::button",1,"PLGraphicsIn *");
03324   
03325   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03326     SWIG_fail_ptr("PLGraphicsIn_button_get",1,SWIGTYPE_p_PLGraphicsIn);
03327   }
03328   
03329   result = (unsigned int) ((arg1)->button);
03330   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
03331   return SWIG_arg;
03332   
03333   if(0) SWIG_fail;
03334   
03335 fail:
03336   lua_error(L);
03337   return SWIG_arg;
03338 }
03339 
03340 
03341 static int _wrap_PLGraphicsIn_subwindow_set(lua_State* L) {
03342   int SWIG_arg = 0;
03343   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03344   PLINT arg2 ;
03345   
03346   SWIG_check_num_args("PLGraphicsIn::subwindow",2,2)
03347   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::subwindow",1,"PLGraphicsIn *");
03348   if(!lua_isnumber(L,2)) SWIG_fail_arg("PLGraphicsIn::subwindow",2,"PLINT");
03349   
03350   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03351     SWIG_fail_ptr("PLGraphicsIn_subwindow_set",1,SWIGTYPE_p_PLGraphicsIn);
03352   }
03353   
03354   arg2 = (PLINT)lua_tonumber(L, 2);
03355   if (arg1) (arg1)->subwindow = arg2;
03356   
03357   return SWIG_arg;
03358   
03359   if(0) SWIG_fail;
03360   
03361 fail:
03362   lua_error(L);
03363   return SWIG_arg;
03364 }
03365 
03366 
03367 static int _wrap_PLGraphicsIn_subwindow_get(lua_State* L) {
03368   int SWIG_arg = 0;
03369   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03370   PLINT result;
03371   
03372   SWIG_check_num_args("PLGraphicsIn::subwindow",1,1)
03373   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::subwindow",1,"PLGraphicsIn *");
03374   
03375   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03376     SWIG_fail_ptr("PLGraphicsIn_subwindow_get",1,SWIGTYPE_p_PLGraphicsIn);
03377   }
03378   
03379   result = (PLINT) ((arg1)->subwindow);
03380   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
03381   return SWIG_arg;
03382   
03383   if(0) SWIG_fail;
03384   
03385 fail:
03386   lua_error(L);
03387   return SWIG_arg;
03388 }
03389 
03390 
03391 static int _wrap_PLGraphicsIn_string_set(lua_State* L) {
03392   int SWIG_arg = 0;
03393   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03394   char *arg2 ;
03395   
03396   SWIG_check_num_args("PLGraphicsIn::string",2,2)
03397   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::string",1,"PLGraphicsIn *");
03398   if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("PLGraphicsIn::string",2,"char [16]");
03399   
03400   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03401     SWIG_fail_ptr("PLGraphicsIn_string_set",1,SWIGTYPE_p_PLGraphicsIn);
03402   }
03403   
03404   arg2 = (char *)lua_tostring(L, 2);
03405   {
03406     if(arg2) {
03407       strncpy((char*)arg1->string, (const char *)arg2, 16-1);
03408       arg1->string[16-1] = 0;
03409     } else {
03410       arg1->string[0] = 0;
03411     }
03412   }
03413   
03414   return SWIG_arg;
03415   
03416   if(0) SWIG_fail;
03417   
03418 fail:
03419   lua_error(L);
03420   return SWIG_arg;
03421 }
03422 
03423 
03424 static int _wrap_PLGraphicsIn_string_get(lua_State* L) {
03425   int SWIG_arg = 0;
03426   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03427   char *result = 0 ;
03428   
03429   SWIG_check_num_args("PLGraphicsIn::string",1,1)
03430   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::string",1,"PLGraphicsIn *");
03431   
03432   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03433     SWIG_fail_ptr("PLGraphicsIn_string_get",1,SWIGTYPE_p_PLGraphicsIn);
03434   }
03435   
03436   result = (char *)(char *) ((arg1)->string);
03437   lua_pushstring(L,(const char *)result); SWIG_arg++;
03438   return SWIG_arg;
03439   
03440   if(0) SWIG_fail;
03441   
03442 fail:
03443   lua_error(L);
03444   return SWIG_arg;
03445 }
03446 
03447 
03448 static int _wrap_PLGraphicsIn_pX_set(lua_State* L) {
03449   int SWIG_arg = 0;
03450   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03451   int arg2 ;
03452   
03453   SWIG_check_num_args("PLGraphicsIn::pX",2,2)
03454   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::pX",1,"PLGraphicsIn *");
03455   if(!lua_isnumber(L,2)) SWIG_fail_arg("PLGraphicsIn::pX",2,"int");
03456   
03457   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03458     SWIG_fail_ptr("PLGraphicsIn_pX_set",1,SWIGTYPE_p_PLGraphicsIn);
03459   }
03460   
03461   arg2 = (int)lua_tonumber(L, 2);
03462   if (arg1) (arg1)->pX = arg2;
03463   
03464   return SWIG_arg;
03465   
03466   if(0) SWIG_fail;
03467   
03468 fail:
03469   lua_error(L);
03470   return SWIG_arg;
03471 }
03472 
03473 
03474 static int _wrap_PLGraphicsIn_pX_get(lua_State* L) {
03475   int SWIG_arg = 0;
03476   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03477   int result;
03478   
03479   SWIG_check_num_args("PLGraphicsIn::pX",1,1)
03480   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::pX",1,"PLGraphicsIn *");
03481   
03482   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03483     SWIG_fail_ptr("PLGraphicsIn_pX_get",1,SWIGTYPE_p_PLGraphicsIn);
03484   }
03485   
03486   result = (int) ((arg1)->pX);
03487   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
03488   return SWIG_arg;
03489   
03490   if(0) SWIG_fail;
03491   
03492 fail:
03493   lua_error(L);
03494   return SWIG_arg;
03495 }
03496 
03497 
03498 static int _wrap_PLGraphicsIn_pY_set(lua_State* L) {
03499   int SWIG_arg = 0;
03500   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03501   int arg2 ;
03502   
03503   SWIG_check_num_args("PLGraphicsIn::pY",2,2)
03504   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::pY",1,"PLGraphicsIn *");
03505   if(!lua_isnumber(L,2)) SWIG_fail_arg("PLGraphicsIn::pY",2,"int");
03506   
03507   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03508     SWIG_fail_ptr("PLGraphicsIn_pY_set",1,SWIGTYPE_p_PLGraphicsIn);
03509   }
03510   
03511   arg2 = (int)lua_tonumber(L, 2);
03512   if (arg1) (arg1)->pY = arg2;
03513   
03514   return SWIG_arg;
03515   
03516   if(0) SWIG_fail;
03517   
03518 fail:
03519   lua_error(L);
03520   return SWIG_arg;
03521 }
03522 
03523 
03524 static int _wrap_PLGraphicsIn_pY_get(lua_State* L) {
03525   int SWIG_arg = 0;
03526   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03527   int result;
03528   
03529   SWIG_check_num_args("PLGraphicsIn::pY",1,1)
03530   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::pY",1,"PLGraphicsIn *");
03531   
03532   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03533     SWIG_fail_ptr("PLGraphicsIn_pY_get",1,SWIGTYPE_p_PLGraphicsIn);
03534   }
03535   
03536   result = (int) ((arg1)->pY);
03537   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
03538   return SWIG_arg;
03539   
03540   if(0) SWIG_fail;
03541   
03542 fail:
03543   lua_error(L);
03544   return SWIG_arg;
03545 }
03546 
03547 
03548 static int _wrap_PLGraphicsIn_dX_set(lua_State* L) {
03549   int SWIG_arg = 0;
03550   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03551   PLFLT arg2 ;
03552   
03553   SWIG_check_num_args("PLGraphicsIn::dX",2,2)
03554   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::dX",1,"PLGraphicsIn *");
03555   if(!lua_isnumber(L,2)) SWIG_fail_arg("PLGraphicsIn::dX",2,"PLFLT");
03556   
03557   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03558     SWIG_fail_ptr("PLGraphicsIn_dX_set",1,SWIGTYPE_p_PLGraphicsIn);
03559   }
03560   
03561   arg2 = (PLFLT)lua_tonumber(L, 2);
03562   if (arg1) (arg1)->dX = arg2;
03563   
03564   return SWIG_arg;
03565   
03566   if(0) SWIG_fail;
03567   
03568 fail:
03569   lua_error(L);
03570   return SWIG_arg;
03571 }
03572 
03573 
03574 static int _wrap_PLGraphicsIn_dX_get(lua_State* L) {
03575   int SWIG_arg = 0;
03576   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03577   PLFLT result;
03578   
03579   SWIG_check_num_args("PLGraphicsIn::dX",1,1)
03580   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::dX",1,"PLGraphicsIn *");
03581   
03582   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03583     SWIG_fail_ptr("PLGraphicsIn_dX_get",1,SWIGTYPE_p_PLGraphicsIn);
03584   }
03585   
03586   result = (PLFLT) ((arg1)->dX);
03587   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
03588   return SWIG_arg;
03589   
03590   if(0) SWIG_fail;
03591   
03592 fail:
03593   lua_error(L);
03594   return SWIG_arg;
03595 }
03596 
03597 
03598 static int _wrap_PLGraphicsIn_dY_set(lua_State* L) {
03599   int SWIG_arg = 0;
03600   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03601   PLFLT arg2 ;
03602   
03603   SWIG_check_num_args("PLGraphicsIn::dY",2,2)
03604   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::dY",1,"PLGraphicsIn *");
03605   if(!lua_isnumber(L,2)) SWIG_fail_arg("PLGraphicsIn::dY",2,"PLFLT");
03606   
03607   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03608     SWIG_fail_ptr("PLGraphicsIn_dY_set",1,SWIGTYPE_p_PLGraphicsIn);
03609   }
03610   
03611   arg2 = (PLFLT)lua_tonumber(L, 2);
03612   if (arg1) (arg1)->dY = arg2;
03613   
03614   return SWIG_arg;
03615   
03616   if(0) SWIG_fail;
03617   
03618 fail:
03619   lua_error(L);
03620   return SWIG_arg;
03621 }
03622 
03623 
03624 static int _wrap_PLGraphicsIn_dY_get(lua_State* L) {
03625   int SWIG_arg = 0;
03626   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03627   PLFLT result;
03628   
03629   SWIG_check_num_args("PLGraphicsIn::dY",1,1)
03630   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::dY",1,"PLGraphicsIn *");
03631   
03632   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03633     SWIG_fail_ptr("PLGraphicsIn_dY_get",1,SWIGTYPE_p_PLGraphicsIn);
03634   }
03635   
03636   result = (PLFLT) ((arg1)->dY);
03637   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
03638   return SWIG_arg;
03639   
03640   if(0) SWIG_fail;
03641   
03642 fail:
03643   lua_error(L);
03644   return SWIG_arg;
03645 }
03646 
03647 
03648 static int _wrap_PLGraphicsIn_wX_set(lua_State* L) {
03649   int SWIG_arg = 0;
03650   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03651   PLFLT arg2 ;
03652   
03653   SWIG_check_num_args("PLGraphicsIn::wX",2,2)
03654   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::wX",1,"PLGraphicsIn *");
03655   if(!lua_isnumber(L,2)) SWIG_fail_arg("PLGraphicsIn::wX",2,"PLFLT");
03656   
03657   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03658     SWIG_fail_ptr("PLGraphicsIn_wX_set",1,SWIGTYPE_p_PLGraphicsIn);
03659   }
03660   
03661   arg2 = (PLFLT)lua_tonumber(L, 2);
03662   if (arg1) (arg1)->wX = arg2;
03663   
03664   return SWIG_arg;
03665   
03666   if(0) SWIG_fail;
03667   
03668 fail:
03669   lua_error(L);
03670   return SWIG_arg;
03671 }
03672 
03673 
03674 static int _wrap_PLGraphicsIn_wX_get(lua_State* L) {
03675   int SWIG_arg = 0;
03676   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03677   PLFLT result;
03678   
03679   SWIG_check_num_args("PLGraphicsIn::wX",1,1)
03680   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::wX",1,"PLGraphicsIn *");
03681   
03682   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03683     SWIG_fail_ptr("PLGraphicsIn_wX_get",1,SWIGTYPE_p_PLGraphicsIn);
03684   }
03685   
03686   result = (PLFLT) ((arg1)->wX);
03687   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
03688   return SWIG_arg;
03689   
03690   if(0) SWIG_fail;
03691   
03692 fail:
03693   lua_error(L);
03694   return SWIG_arg;
03695 }
03696 
03697 
03698 static int _wrap_PLGraphicsIn_wY_set(lua_State* L) {
03699   int SWIG_arg = 0;
03700   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03701   PLFLT arg2 ;
03702   
03703   SWIG_check_num_args("PLGraphicsIn::wY",2,2)
03704   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::wY",1,"PLGraphicsIn *");
03705   if(!lua_isnumber(L,2)) SWIG_fail_arg("PLGraphicsIn::wY",2,"PLFLT");
03706   
03707   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03708     SWIG_fail_ptr("PLGraphicsIn_wY_set",1,SWIGTYPE_p_PLGraphicsIn);
03709   }
03710   
03711   arg2 = (PLFLT)lua_tonumber(L, 2);
03712   if (arg1) (arg1)->wY = arg2;
03713   
03714   return SWIG_arg;
03715   
03716   if(0) SWIG_fail;
03717   
03718 fail:
03719   lua_error(L);
03720   return SWIG_arg;
03721 }
03722 
03723 
03724 static int _wrap_PLGraphicsIn_wY_get(lua_State* L) {
03725   int SWIG_arg = 0;
03726   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
03727   PLFLT result;
03728   
03729   SWIG_check_num_args("PLGraphicsIn::wY",1,1)
03730   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("PLGraphicsIn::wY",1,"PLGraphicsIn *");
03731   
03732   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
03733     SWIG_fail_ptr("PLGraphicsIn_wY_get",1,SWIGTYPE_p_PLGraphicsIn);
03734   }
03735   
03736   result = (PLFLT) ((arg1)->wY);
03737   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
03738   return SWIG_arg;
03739   
03740   if(0) SWIG_fail;
03741   
03742 fail:
03743   lua_error(L);
03744   return SWIG_arg;
03745 }
03746 
03747 
03748 static int _wrap_new_PLGraphicsIn(lua_State* L) {
03749   int SWIG_arg = 0;
03750   PLGraphicsIn *result = 0 ;
03751   
03752   SWIG_check_num_args("PLGraphicsIn::PLGraphicsIn",0,0)
03753   result = (PLGraphicsIn *)calloc(1, sizeof(PLGraphicsIn));
03754   SWIG_NewPointerObj(L,result,SWIGTYPE_p_PLGraphicsIn,1); SWIG_arg++; 
03755   return SWIG_arg;
03756   
03757   if(0) SWIG_fail;
03758   
03759 fail:
03760   lua_error(L);
03761   return SWIG_arg;
03762 }
03763 
03764 
03765 static void swig_delete_PLGraphicsIn(void *obj) {
03766 PLGraphicsIn *arg1 = (PLGraphicsIn *) obj;
03767 free((char *) arg1);
03768 }
03769 static int _proxy__wrap_new_PLGraphicsIn(lua_State *L) {
03770     assert(lua_istable(L,1));
03771     lua_pushcfunction(L,_wrap_new_PLGraphicsIn);
03772     assert(!lua_isnil(L,-1));
03773     lua_replace(L,1); /* replace our table with real constructor */
03774     lua_call(L,lua_gettop(L)-1,1);
03775     return 1;
03776 }
03777 static swig_lua_attribute swig_PLGraphicsIn_attributes[] = {
03778     { "type", _wrap_PLGraphicsIn_type_get, _wrap_PLGraphicsIn_type_set },
03779     { "state", _wrap_PLGraphicsIn_state_get, _wrap_PLGraphicsIn_state_set },
03780     { "keysym", _wrap_PLGraphicsIn_keysym_get, _wrap_PLGraphicsIn_keysym_set },
03781     { "button", _wrap_PLGraphicsIn_button_get, _wrap_PLGraphicsIn_button_set },
03782     { "subwindow", _wrap_PLGraphicsIn_subwindow_get, _wrap_PLGraphicsIn_subwindow_set },
03783     { "string", _wrap_PLGraphicsIn_string_get, _wrap_PLGraphicsIn_string_set },
03784     { "pX", _wrap_PLGraphicsIn_pX_get, _wrap_PLGraphicsIn_pX_set },
03785     { "pY", _wrap_PLGraphicsIn_pY_get, _wrap_PLGraphicsIn_pY_set },
03786     { "dX", _wrap_PLGraphicsIn_dX_get, _wrap_PLGraphicsIn_dX_set },
03787     { "dY", _wrap_PLGraphicsIn_dY_get, _wrap_PLGraphicsIn_dY_set },
03788     { "wX", _wrap_PLGraphicsIn_wX_get, _wrap_PLGraphicsIn_wX_set },
03789     { "wY", _wrap_PLGraphicsIn_wY_get, _wrap_PLGraphicsIn_wY_set },
03790     {0,0,0}
03791 };
03792 static swig_lua_method swig_PLGraphicsIn_methods[]= {
03793     {0,0}
03794 };
03795 static swig_lua_method swig_PLGraphicsIn_meta[] = {
03796     {0,0}
03797 };
03798 
03799 static swig_lua_attribute swig_PLGraphicsIn_Sf_SwigStatic_attributes[] = {
03800     {0,0,0}
03801 };
03802 static swig_lua_const_info swig_PLGraphicsIn_Sf_SwigStatic_constants[]= {
03803     {0,0,0,0,0,0}
03804 };
03805 static swig_lua_method swig_PLGraphicsIn_Sf_SwigStatic_methods[]= {
03806     {0,0}
03807 };
03808 static swig_lua_class* swig_PLGraphicsIn_Sf_SwigStatic_classes[]= {
03809     0
03810 };
03811 
03812 static swig_lua_namespace swig_PLGraphicsIn_Sf_SwigStatic = {
03813     "PLGraphicsIn",
03814     swig_PLGraphicsIn_Sf_SwigStatic_methods,
03815     swig_PLGraphicsIn_Sf_SwigStatic_attributes,
03816     swig_PLGraphicsIn_Sf_SwigStatic_constants,
03817     swig_PLGraphicsIn_Sf_SwigStatic_classes,
03818     0
03819 };
03820 static swig_lua_class *swig_PLGraphicsIn_bases[] = {0};
03821 static const char *swig_PLGraphicsIn_base_names[] = {0};
03822 static swig_lua_class _wrap_class_PLGraphicsIn = { "PLGraphicsIn", "PLGraphicsIn", &SWIGTYPE_p_PLGraphicsIn,_proxy__wrap_new_PLGraphicsIn, swig_delete_PLGraphicsIn, swig_PLGraphicsIn_methods, swig_PLGraphicsIn_attributes, &swig_PLGraphicsIn_Sf_SwigStatic, swig_PLGraphicsIn_meta, swig_PLGraphicsIn_bases, swig_PLGraphicsIn_base_names };
03823 
03824 static int _wrap_setcontlabelformat(lua_State* L) {
03825   int SWIG_arg = 0;
03826   PLINT arg1 ;
03827   PLINT arg2 ;
03828   
03829   SWIG_check_num_args("pl_setcontlabelformat",2,2)
03830   if(!lua_isnumber(L,1)) SWIG_fail_arg("pl_setcontlabelformat",1,"PLINT");
03831   if(!lua_isnumber(L,2)) SWIG_fail_arg("pl_setcontlabelformat",2,"PLINT");
03832   arg1 = (PLINT)lua_tonumber(L, 1);
03833   arg2 = (PLINT)lua_tonumber(L, 2);
03834   pl_setcontlabelformat(arg1,arg2);
03835   
03836   return SWIG_arg;
03837   
03838   if(0) SWIG_fail;
03839   
03840 fail:
03841   lua_error(L);
03842   return SWIG_arg;
03843 }
03844 
03845 
03846 static int _wrap_setcontlabelparam(lua_State* L) {
03847   int SWIG_arg = 0;
03848   PLFLT arg1 ;
03849   PLFLT arg2 ;
03850   PLFLT arg3 ;
03851   PLINT arg4 ;
03852   
03853   SWIG_check_num_args("pl_setcontlabelparam",4,4)
03854   if(!lua_isnumber(L,1)) SWIG_fail_arg("pl_setcontlabelparam",1,"PLFLT");
03855   if(!lua_isnumber(L,2)) SWIG_fail_arg("pl_setcontlabelparam",2,"PLFLT");
03856   if(!lua_isnumber(L,3)) SWIG_fail_arg("pl_setcontlabelparam",3,"PLFLT");
03857   if(!lua_isnumber(L,4)) SWIG_fail_arg("pl_setcontlabelparam",4,"PLINT");
03858   arg1 = (PLFLT)lua_tonumber(L, 1);
03859   arg2 = (PLFLT)lua_tonumber(L, 2);
03860   arg3 = (PLFLT)lua_tonumber(L, 3);
03861   arg4 = (PLINT)lua_tonumber(L, 4);
03862   pl_setcontlabelparam(arg1,arg2,arg3,arg4);
03863   
03864   return SWIG_arg;
03865   
03866   if(0) SWIG_fail;
03867   
03868 fail:
03869   lua_error(L);
03870   return SWIG_arg;
03871 }
03872 
03873 
03874 static int _wrap_adv(lua_State* L) {
03875   int SWIG_arg = 0;
03876   PLINT arg1 ;
03877   
03878   SWIG_check_num_args("pladv",1,1)
03879   if(!lua_isnumber(L,1)) SWIG_fail_arg("pladv",1,"PLINT");
03880   arg1 = (PLINT)lua_tonumber(L, 1);
03881   pladv(arg1);
03882   
03883   return SWIG_arg;
03884   
03885   if(0) SWIG_fail;
03886   
03887 fail:
03888   lua_error(L);
03889   return SWIG_arg;
03890 }
03891 
03892 
03893 static int _wrap_arc(lua_State* L) {
03894   int SWIG_arg = 0;
03895   PLFLT arg1 ;
03896   PLFLT arg2 ;
03897   PLFLT arg3 ;
03898   PLFLT arg4 ;
03899   PLFLT arg5 ;
03900   PLFLT arg6 ;
03901   PLFLT arg7 ;
03902   PLBOOL arg8 ;
03903   
03904   SWIG_check_num_args("plarc",8,8)
03905   if(!lua_isnumber(L,1)) SWIG_fail_arg("plarc",1,"PLFLT");
03906   if(!lua_isnumber(L,2)) SWIG_fail_arg("plarc",2,"PLFLT");
03907   if(!lua_isnumber(L,3)) SWIG_fail_arg("plarc",3,"PLFLT");
03908   if(!lua_isnumber(L,4)) SWIG_fail_arg("plarc",4,"PLFLT");
03909   if(!lua_isnumber(L,5)) SWIG_fail_arg("plarc",5,"PLFLT");
03910   if(!lua_isnumber(L,6)) SWIG_fail_arg("plarc",6,"PLFLT");
03911   if(!lua_isnumber(L,7)) SWIG_fail_arg("plarc",7,"PLFLT");
03912   if(!lua_isnumber(L,8)) SWIG_fail_arg("plarc",8,"PLBOOL");
03913   arg1 = (PLFLT)lua_tonumber(L, 1);
03914   arg2 = (PLFLT)lua_tonumber(L, 2);
03915   arg3 = (PLFLT)lua_tonumber(L, 3);
03916   arg4 = (PLFLT)lua_tonumber(L, 4);
03917   arg5 = (PLFLT)lua_tonumber(L, 5);
03918   arg6 = (PLFLT)lua_tonumber(L, 6);
03919   arg7 = (PLFLT)lua_tonumber(L, 7);
03920   arg8 = (PLBOOL)lua_tonumber(L, 8);
03921   plarc(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
03922   
03923   return SWIG_arg;
03924   
03925   if(0) SWIG_fail;
03926   
03927 fail:
03928   lua_error(L);
03929   return SWIG_arg;
03930 }
03931 
03932 
03933 static int _wrap_axes(lua_State* L) {
03934   int SWIG_arg = 0;
03935   PLFLT arg1 ;
03936   PLFLT arg2 ;
03937   char *arg3 = (char *) 0 ;
03938   PLFLT arg4 ;
03939   PLINT arg5 ;
03940   char *arg6 = (char *) 0 ;
03941   PLFLT arg7 ;
03942   PLINT arg8 ;
03943   
03944   SWIG_check_num_args("plaxes",8,8)
03945   if(!lua_isnumber(L,1)) SWIG_fail_arg("plaxes",1,"PLFLT");
03946   if(!lua_isnumber(L,2)) SWIG_fail_arg("plaxes",2,"PLFLT");
03947   if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("plaxes",3,"char const *");
03948   if(!lua_isnumber(L,4)) SWIG_fail_arg("plaxes",4,"PLFLT");
03949   if(!lua_isnumber(L,5)) SWIG_fail_arg("plaxes",5,"PLINT");
03950   if(!SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("plaxes",6,"char const *");
03951   if(!lua_isnumber(L,7)) SWIG_fail_arg("plaxes",7,"PLFLT");
03952   if(!lua_isnumber(L,8)) SWIG_fail_arg("plaxes",8,"PLINT");
03953   arg1 = (PLFLT)lua_tonumber(L, 1);
03954   arg2 = (PLFLT)lua_tonumber(L, 2);
03955   arg3 = (char *)lua_tostring(L, 3);
03956   arg4 = (PLFLT)lua_tonumber(L, 4);
03957   arg5 = (PLINT)lua_tonumber(L, 5);
03958   arg6 = (char *)lua_tostring(L, 6);
03959   arg7 = (PLFLT)lua_tonumber(L, 7);
03960   arg8 = (PLINT)lua_tonumber(L, 8);
03961   plaxes(arg1,arg2,(char const *)arg3,arg4,arg5,(char const *)arg6,arg7,arg8);
03962   
03963   return SWIG_arg;
03964   
03965   if(0) SWIG_fail;
03966   
03967 fail:
03968   lua_error(L);
03969   return SWIG_arg;
03970 }
03971 
03972 
03973 static int _wrap_bin(lua_State* L) {
03974   int SWIG_arg = 0;
03975   PLINT arg1 ;
03976   PLFLT *arg2 = (PLFLT *) 0 ;
03977   PLFLT *arg3 = (PLFLT *) 0 ;
03978   PLINT arg4 ;
03979   int temp3 ;
03980   
03981   SWIG_check_num_args("plbin",3,3)
03982   if(!lua_isnumber(L,3)) SWIG_fail_arg("plbin",3,"PLINT");
03983   {
03984     int temp;
03985     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
03986     if ( !arg2 )
03987     SWIG_fail;
03988     arg1 = Alen = temp;
03989   }
03990   {
03991     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
03992     if ( !arg3 )
03993     SWIG_fail;
03994     if ( temp3 != Alen )
03995     {
03996       lua_pushfstring( L, "Tables must be of same length." );
03997       SWIG_fail;
03998     }
03999   }
04000   arg4 = (PLINT)lua_tonumber(L, 3);
04001   plbin(arg1,(double const *)arg2,(double const *)arg3,arg4);
04002   
04003   {
04004     LUA_FREE_ARRAY( arg2 );
04005   }
04006   {
04007     LUA_FREE_ARRAY( arg3 ); 
04008   }
04009   return SWIG_arg;
04010   
04011   if(0) SWIG_fail;
04012   
04013 fail:
04014   {
04015     LUA_FREE_ARRAY( arg2 );
04016   }
04017   {
04018     LUA_FREE_ARRAY( arg3 ); 
04019   }
04020   lua_error(L);
04021   return SWIG_arg;
04022 }
04023 
04024 
04025 static int _wrap_btime(lua_State* L) {
04026   int SWIG_arg = 0;
04027   PLINT *arg1 = (PLINT *) 0 ;
04028   PLINT *arg2 = (PLINT *) 0 ;
04029   PLINT *arg3 = (PLINT *) 0 ;
04030   PLINT *arg4 = (PLINT *) 0 ;
04031   PLINT *arg5 = (PLINT *) 0 ;
04032   PLFLT *arg6 = (PLFLT *) 0 ;
04033   PLFLT arg7 ;
04034   PLINT temp1 ;
04035   PLINT temp2 ;
04036   PLINT temp3 ;
04037   PLINT temp4 ;
04038   PLINT temp5 ;
04039   PLFLT temp6 ;
04040   
04041   arg1 = &temp1; 
04042   arg2 = &temp2; 
04043   arg3 = &temp3; 
04044   arg4 = &temp4; 
04045   arg5 = &temp5; 
04046   arg6 = &temp6; 
04047   SWIG_check_num_args("plbtime",1,1)
04048   if(!lua_isnumber(L,1)) SWIG_fail_arg("plbtime",1,"PLFLT");
04049   arg7 = (PLFLT)lua_tonumber(L, 1);
04050   plbtime(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
04051   
04052   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
04053   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
04054   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
04055   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
04056   lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
04057   lua_pushnumber(L, (lua_Number) *arg6); SWIG_arg++;
04058   return SWIG_arg;
04059   
04060   if(0) SWIG_fail;
04061   
04062 fail:
04063   lua_error(L);
04064   return SWIG_arg;
04065 }
04066 
04067 
04068 static int _wrap_bop(lua_State* L) {
04069   int SWIG_arg = 0;
04070   
04071   SWIG_check_num_args("plbop",0,0)
04072   plbop();
04073   
04074   return SWIG_arg;
04075   
04076   if(0) SWIG_fail;
04077   
04078 fail:
04079   lua_error(L);
04080   return SWIG_arg;
04081 }
04082 
04083 
04084 static int _wrap_box(lua_State* L) {
04085   int SWIG_arg = 0;
04086   char *arg1 = (char *) 0 ;
04087   PLFLT arg2 ;
04088   PLINT arg3 ;
04089   char *arg4 = (char *) 0 ;
04090   PLFLT arg5 ;
04091   PLINT arg6 ;
04092   
04093   SWIG_check_num_args("plbox",6,6)
04094   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plbox",1,"char const *");
04095   if(!lua_isnumber(L,2)) SWIG_fail_arg("plbox",2,"PLFLT");
04096   if(!lua_isnumber(L,3)) SWIG_fail_arg("plbox",3,"PLINT");
04097   if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("plbox",4,"char const *");
04098   if(!lua_isnumber(L,5)) SWIG_fail_arg("plbox",5,"PLFLT");
04099   if(!lua_isnumber(L,6)) SWIG_fail_arg("plbox",6,"PLINT");
04100   arg1 = (char *)lua_tostring(L, 1);
04101   arg2 = (PLFLT)lua_tonumber(L, 2);
04102   arg3 = (PLINT)lua_tonumber(L, 3);
04103   arg4 = (char *)lua_tostring(L, 4);
04104   arg5 = (PLFLT)lua_tonumber(L, 5);
04105   arg6 = (PLINT)lua_tonumber(L, 6);
04106   plbox((char const *)arg1,arg2,arg3,(char const *)arg4,arg5,arg6);
04107   
04108   return SWIG_arg;
04109   
04110   if(0) SWIG_fail;
04111   
04112 fail:
04113   lua_error(L);
04114   return SWIG_arg;
04115 }
04116 
04117 
04118 static int _wrap_box3(lua_State* L) {
04119   int SWIG_arg = 0;
04120   char *arg1 = (char *) 0 ;
04121   char *arg2 = (char *) 0 ;
04122   PLFLT arg3 ;
04123   PLINT arg4 ;
04124   char *arg5 = (char *) 0 ;
04125   char *arg6 = (char *) 0 ;
04126   PLFLT arg7 ;
04127   PLINT arg8 ;
04128   char *arg9 = (char *) 0 ;
04129   char *arg10 = (char *) 0 ;
04130   PLFLT arg11 ;
04131   PLINT arg12 ;
04132   
04133   SWIG_check_num_args("plbox3",12,12)
04134   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plbox3",1,"char const *");
04135   if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("plbox3",2,"char const *");
04136   if(!lua_isnumber(L,3)) SWIG_fail_arg("plbox3",3,"PLFLT");
04137   if(!lua_isnumber(L,4)) SWIG_fail_arg("plbox3",4,"PLINT");
04138   if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("plbox3",5,"char const *");
04139   if(!SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("plbox3",6,"char const *");
04140   if(!lua_isnumber(L,7)) SWIG_fail_arg("plbox3",7,"PLFLT");
04141   if(!lua_isnumber(L,8)) SWIG_fail_arg("plbox3",8,"PLINT");
04142   if(!SWIG_lua_isnilstring(L,9)) SWIG_fail_arg("plbox3",9,"char const *");
04143   if(!SWIG_lua_isnilstring(L,10)) SWIG_fail_arg("plbox3",10,"char const *");
04144   if(!lua_isnumber(L,11)) SWIG_fail_arg("plbox3",11,"PLFLT");
04145   if(!lua_isnumber(L,12)) SWIG_fail_arg("plbox3",12,"PLINT");
04146   arg1 = (char *)lua_tostring(L, 1);
04147   arg2 = (char *)lua_tostring(L, 2);
04148   arg3 = (PLFLT)lua_tonumber(L, 3);
04149   arg4 = (PLINT)lua_tonumber(L, 4);
04150   arg5 = (char *)lua_tostring(L, 5);
04151   arg6 = (char *)lua_tostring(L, 6);
04152   arg7 = (PLFLT)lua_tonumber(L, 7);
04153   arg8 = (PLINT)lua_tonumber(L, 8);
04154   arg9 = (char *)lua_tostring(L, 9);
04155   arg10 = (char *)lua_tostring(L, 10);
04156   arg11 = (PLFLT)lua_tonumber(L, 11);
04157   arg12 = (PLINT)lua_tonumber(L, 12);
04158   plbox3((char const *)arg1,(char const *)arg2,arg3,arg4,(char const *)arg5,(char const *)arg6,arg7,arg8,(char const *)arg9,(char const *)arg10,arg11,arg12);
04159   
04160   return SWIG_arg;
04161   
04162   if(0) SWIG_fail;
04163   
04164 fail:
04165   lua_error(L);
04166   return SWIG_arg;
04167 }
04168 
04169 
04170 static int _wrap_calc_world(lua_State* L) {
04171   int SWIG_arg = 0;
04172   PLFLT arg1 ;
04173   PLFLT arg2 ;
04174   PLFLT *arg3 = (PLFLT *) 0 ;
04175   PLFLT *arg4 = (PLFLT *) 0 ;
04176   PLINT *arg5 = (PLINT *) 0 ;
04177   PLFLT temp3 ;
04178   PLFLT temp4 ;
04179   PLINT temp5 ;
04180   
04181   arg3 = &temp3; 
04182   arg4 = &temp4; 
04183   arg5 = &temp5; 
04184   SWIG_check_num_args("plcalc_world",2,2)
04185   if(!lua_isnumber(L,1)) SWIG_fail_arg("plcalc_world",1,"PLFLT");
04186   if(!lua_isnumber(L,2)) SWIG_fail_arg("plcalc_world",2,"PLFLT");
04187   arg1 = (PLFLT)lua_tonumber(L, 1);
04188   arg2 = (PLFLT)lua_tonumber(L, 2);
04189   plcalc_world(arg1,arg2,arg3,arg4,arg5);
04190   
04191   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
04192   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
04193   lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
04194   return SWIG_arg;
04195   
04196   if(0) SWIG_fail;
04197   
04198 fail:
04199   lua_error(L);
04200   return SWIG_arg;
04201 }
04202 
04203 
04204 static int _wrap_clear(lua_State* L) {
04205   int SWIG_arg = 0;
04206   
04207   SWIG_check_num_args("plclear",0,0)
04208   plclear();
04209   
04210   return SWIG_arg;
04211   
04212   if(0) SWIG_fail;
04213   
04214 fail:
04215   lua_error(L);
04216   return SWIG_arg;
04217 }
04218 
04219 
04220 static int _wrap_col0(lua_State* L) {
04221   int SWIG_arg = 0;
04222   PLINT arg1 ;
04223   
04224   SWIG_check_num_args("plcol0",1,1)
04225   if(!lua_isnumber(L,1)) SWIG_fail_arg("plcol0",1,"PLINT");
04226   arg1 = (PLINT)lua_tonumber(L, 1);
04227   plcol0(arg1);
04228   
04229   return SWIG_arg;
04230   
04231   if(0) SWIG_fail;
04232   
04233 fail:
04234   lua_error(L);
04235   return SWIG_arg;
04236 }
04237 
04238 
04239 static int _wrap_col1(lua_State* L) {
04240   int SWIG_arg = 0;
04241   PLFLT arg1 ;
04242   
04243   SWIG_check_num_args("plcol1",1,1)
04244   if(!lua_isnumber(L,1)) SWIG_fail_arg("plcol1",1,"PLFLT");
04245   arg1 = (PLFLT)lua_tonumber(L, 1);
04246   plcol1(arg1);
04247   
04248   return SWIG_arg;
04249   
04250   if(0) SWIG_fail;
04251   
04252 fail:
04253   lua_error(L);
04254   return SWIG_arg;
04255 }
04256 
04257 
04258 static int _wrap_configtime(lua_State* L) {
04259   int SWIG_arg = 0;
04260   PLFLT arg1 ;
04261   PLFLT arg2 ;
04262   PLFLT arg3 ;
04263   PLINT arg4 ;
04264   PLBOOL arg5 ;
04265   PLINT arg6 ;
04266   PLINT arg7 ;
04267   PLINT arg8 ;
04268   PLINT arg9 ;
04269   PLINT arg10 ;
04270   PLFLT arg11 ;
04271   
04272   SWIG_check_num_args("plconfigtime",11,11)
04273   if(!lua_isnumber(L,1)) SWIG_fail_arg("plconfigtime",1,"PLFLT");
04274   if(!lua_isnumber(L,2)) SWIG_fail_arg("plconfigtime",2,"PLFLT");
04275   if(!lua_isnumber(L,3)) SWIG_fail_arg("plconfigtime",3,"PLFLT");
04276   if(!lua_isnumber(L,4)) SWIG_fail_arg("plconfigtime",4,"PLINT");
04277   if(!lua_isnumber(L,5)) SWIG_fail_arg("plconfigtime",5,"PLBOOL");
04278   if(!lua_isnumber(L,6)) SWIG_fail_arg("plconfigtime",6,"PLINT");
04279   if(!lua_isnumber(L,7)) SWIG_fail_arg("plconfigtime",7,"PLINT");
04280   if(!lua_isnumber(L,8)) SWIG_fail_arg("plconfigtime",8,"PLINT");
04281   if(!lua_isnumber(L,9)) SWIG_fail_arg("plconfigtime",9,"PLINT");
04282   if(!lua_isnumber(L,10)) SWIG_fail_arg("plconfigtime",10,"PLINT");
04283   if(!lua_isnumber(L,11)) SWIG_fail_arg("plconfigtime",11,"PLFLT");
04284   arg1 = (PLFLT)lua_tonumber(L, 1);
04285   arg2 = (PLFLT)lua_tonumber(L, 2);
04286   arg3 = (PLFLT)lua_tonumber(L, 3);
04287   arg4 = (PLINT)lua_tonumber(L, 4);
04288   arg5 = (PLBOOL)lua_tonumber(L, 5);
04289   arg6 = (PLINT)lua_tonumber(L, 6);
04290   arg7 = (PLINT)lua_tonumber(L, 7);
04291   arg8 = (PLINT)lua_tonumber(L, 8);
04292   arg9 = (PLINT)lua_tonumber(L, 9);
04293   arg10 = (PLINT)lua_tonumber(L, 10);
04294   arg11 = (PLFLT)lua_tonumber(L, 11);
04295   plconfigtime(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11);
04296   
04297   return SWIG_arg;
04298   
04299   if(0) SWIG_fail;
04300   
04301 fail:
04302   lua_error(L);
04303   return SWIG_arg;
04304 }
04305 
04306 
04307 static int _wrap_cont(lua_State* L) {
04308   int SWIG_arg = 0;
04309   PLFLT **arg1 = (PLFLT **) 0 ;
04310   PLINT arg2 ;
04311   PLINT arg3 ;
04312   PLINT arg4 ;
04313   PLINT arg5 ;
04314   PLINT arg6 ;
04315   PLINT arg7 ;
04316   PLFLT *arg8 = (PLFLT *) 0 ;
04317   PLINT arg9 ;
04318   pltr_func arg10 = (pltr_func) 0 ;
04319   PLPointer arg11 = (PLPointer) 0 ;
04320   int ii1 ;
04321   PLcGrid cgrid111 ;
04322   PLcGrid2 cgrid211 ;
04323   
04324   {
04325     cgrid111.xg = cgrid111.yg = cgrid111.zg = NULL;
04326     cgrid111.nx = cgrid111.ny = cgrid111.nz = 0;
04327     cgrid211.xg = cgrid211.yg = cgrid211.zg = NULL;
04328     cgrid211.nx = cgrid211.ny = 0;
04329   }
04330   {
04331     arg10 = NULL;
04332   }
04333   {
04334     arg11 = NULL;
04335   }
04336   SWIG_check_num_args("plcont",6,8)
04337   if(!lua_isnumber(L,2)) SWIG_fail_arg("plcont",2,"PLINT");
04338   if(!lua_isnumber(L,3)) SWIG_fail_arg("plcont",3,"PLINT");
04339   if(!lua_isnumber(L,4)) SWIG_fail_arg("plcont",4,"PLINT");
04340   if(!lua_isnumber(L,5)) SWIG_fail_arg("plcont",5,"PLINT");
04341   {
04342     int jj;
04343     
04344     arg1 = read_double_Matrix( L, 1, &ii1, &jj );
04345     if ( !arg1 )
04346     SWIG_fail;
04347     Xlen = arg2 = ii1;
04348     Ylen = arg3 = jj;
04349   }
04350   arg4 = (PLINT)lua_tonumber(L, 2);
04351   arg5 = (PLINT)lua_tonumber(L, 3);
04352   arg6 = (PLINT)lua_tonumber(L, 4);
04353   arg7 = (PLINT)lua_tonumber(L, 5);
04354   {
04355     int temp;
04356     arg8 = (PLFLT *) LUA_get_double_num_array_var( L, 6, &temp );
04357     if ( !arg8 )
04358     SWIG_fail;
04359     arg9 = Alen = temp;
04360   }
04361   if(lua_gettop(L)>=7){
04362     {
04363       arg10 = NULL;
04364       mypltr_funcstr[0] = '\0';
04365       
04366       if ( lua_isstring( L, 7 ) )
04367       {
04368         const char* funcstr = lua_tostring( L, 7 );
04369         if ( strcmp( "pltr0", funcstr ) == 0 )
04370         {
04371           arg10 = pltr0;
04372         }
04373         else if ( strcmp( "pltr1", funcstr ) == 0 )
04374         {
04375           arg10 = pltr1;
04376         }
04377         else if ( strcmp( "pltr2", funcstr ) == 0 )
04378         {
04379           arg10 = pltr2;
04380         }
04381         else
04382         {
04383           arg10 = mypltr;
04384           strncpy( mypltr_funcstr, funcstr, 255 );
04385           myL = L;
04386         }
04387       }
04388       else
04389       SWIG_fail_arg( "cont", 10, "pltr_func" );
04390     }
04391   }
04392   if(lua_gettop(L)>=8){
04393     {
04394       int nx, ny;
04395       int gridmode = 0;
04396       
04397       lua_pushstring( L, "xg" );
04398       lua_gettable( L, 8 );
04399       if ( !lua_istable( L, -1 ) )
04400       {
04401         lua_pop( L, 1 ); // pop "xg"
04402         lua_pushstring( L, "expected a table xg" );
04403         SWIG_fail;
04404       }
04405       lua_rawgeti( L, -1, 1 );
04406       if ( lua_istable( L, -1 ) )
04407       gridmode = 2; // two dimensional array
04408       else if ( lua_isnumber( L, -1 ) )
04409       gridmode = 1; // one dimensional array
04410       else
04411       {
04412         lua_pop( L, 1 ); // pop "1"
04413         lua_pop( L, 1 ); // pop "xg"
04414         lua_pushstring( L, "expected a one or two dimensional array/table in xg" );
04415         SWIG_fail;
04416       }
04417       lua_pop( L, 1 ); // pop test element
04418       if ( gridmode == 1 )
04419       {
04420         cgrid111.xg = (PLFLT *) LUA_get_double_num_array_var( L, -1, &nx );
04421         if ( !cgrid111.xg )
04422         {
04423           lua_pop( L, 1 ); // pop "xg"
04424           SWIG_fail;
04425         }
04426         if ( nx != Xlen )
04427         {
04428           lua_pushfstring( L, "Table xg must be of length%d.", Xlen );
04429           SWIG_fail;
04430         }
04431         cgrid111.nx = nx;
04432       }
04433       else
04434       {
04435         cgrid211.xg = read_double_Matrix( L, -1, &nx, &ny );
04436         if ( !cgrid211.xg )
04437         {
04438           lua_pop( L, 1 ); // pop "xg"
04439           SWIG_fail;
04440         }
04441         if ( ( nx != Xlen ) || ( ny != Ylen ) )
04442         {
04443           lua_pop( L, 1 ); // pop "xg"
04444           lua_pushfstring( L, "Vectors must match matrix." );
04445           SWIG_fail;
04446         }
04447         cgrid211.nx = nx;
04448         cgrid211.ny = ny;
04449       }
04450       lua_pop( L, 1 ); // pop "xg"
04451       
04452       lua_pushstring( L, "yg" );
04453       lua_gettable( L, 8 );
04454       if ( !lua_istable( L, -1 ) )
04455       {
04456         lua_pop( L, 1 );
04457         lua_pushstring( L, "expected a table yg" );
04458         SWIG_fail;
04459       }
04460       lua_rawgeti( L, -1, 1 );
04461       if ( gridmode == 2 )
04462       {
04463         if ( !lua_istable( L, -1 ) )
04464         {
04465           lua_pop( L, 1 ); // pop "1"
04466           lua_pop( L, 1 ); // pop "yg"
04467           lua_pushstring( L, "expected a two dimensional array/table in yg" );
04468           SWIG_fail;
04469         }
04470       }
04471       else
04472       {
04473         if ( !lua_isnumber( L, -1 ) )
04474         {
04475           lua_pop( L, 1 ); // pop "1"
04476           lua_pop( L, 1 ); // pop "yg"
04477           lua_pushstring( L, "expected a one dimensional array/table in yg" );
04478           SWIG_fail;
04479         }
04480       }
04481       lua_pop( L, 1 ); // pop "1"
04482       if ( gridmode == 1 )
04483       {
04484         cgrid111.yg = (PLFLT *) LUA_get_double_num_array_var( L, -1, &ny );
04485         if ( !cgrid111.yg )
04486         {
04487           lua_pop( L, 1 ); // pop "yg"
04488           SWIG_fail;
04489         }
04490         if ( ny != Ylen )
04491         {
04492           lua_pushfstring( L, "Table yg must be of length%d.", Ylen );
04493           SWIG_fail;
04494         }
04495         cgrid111.ny = ny;
04496       }
04497       else
04498       {
04499         cgrid211.yg = read_double_Matrix( L, -1, &nx, &ny );
04500         if ( !cgrid211.yg )
04501         {
04502           lua_pop( L, 1 ); // pop "xg"
04503           SWIG_fail;
04504         }
04505         if ( ( nx != Xlen ) || ( ny != Ylen ) )
04506         {
04507           lua_pop( L, 1 ); // pop "xg"
04508           lua_pushfstring( L, "Vectors must match matrix." );
04509           SWIG_fail;
04510         }
04511         // cgrid211.nx/ny already set
04512       }
04513       lua_pop( L, 1 ); // pop "yg"
04514       
04515       if ( gridmode == 1 )
04516       arg11 = &cgrid111;
04517       else if ( gridmode == 2 )
04518       arg11 = &cgrid211;
04519     }
04520   }
04521   plcont((double const **)arg1,arg2,arg3,arg4,arg5,arg6,arg7,(double const *)arg8,arg9,arg10,arg11);
04522   
04523   {
04524     int i;
04525     
04526     if ( arg1 )
04527     {
04528       for ( i = 0; i < ii1; i++ )
04529       LUA_FREE_ARRAY( arg1[i] );
04530       LUA_FREE_ARRAY( arg1 );
04531     }
04532   }
04533   {
04534     LUA_FREE_ARRAY( arg8 );
04535   }
04536   {
04537     mypltr_funcstr[0] = '\0';
04538   }
04539   {
04540     int i;
04541     
04542     LUA_FREE_ARRAY( cgrid111.xg );
04543     LUA_FREE_ARRAY( cgrid111.yg );
04544     
04545     if ( cgrid211.xg )
04546     {
04547       for ( i = 0; i < Xlen; i++ )
04548       LUA_FREE_ARRAY( cgrid211.xg[i] );
04549       LUA_FREE_ARRAY( cgrid211.xg );
04550     }
04551     if ( cgrid211.yg )
04552     {
04553       for ( i = 0; i < Xlen; i++ )
04554       LUA_FREE_ARRAY( cgrid211.yg[i] );
04555       LUA_FREE_ARRAY( cgrid211.yg );
04556     }
04557   }
04558   return SWIG_arg;
04559   
04560   if(0) SWIG_fail;
04561   
04562 fail:
04563   {
04564     int i;
04565     
04566     if ( arg1 )
04567     {
04568       for ( i = 0; i < ii1; i++ )
04569       LUA_FREE_ARRAY( arg1[i] );
04570       LUA_FREE_ARRAY( arg1 );
04571     }
04572   }
04573   {
04574     LUA_FREE_ARRAY( arg8 );
04575   }
04576   {
04577     mypltr_funcstr[0] = '\0';
04578   }
04579   {
04580     int i;
04581     
04582     LUA_FREE_ARRAY( cgrid111.xg );
04583     LUA_FREE_ARRAY( cgrid111.yg );
04584     
04585     if ( cgrid211.xg )
04586     {
04587       for ( i = 0; i < Xlen; i++ )
04588       LUA_FREE_ARRAY( cgrid211.xg[i] );
04589       LUA_FREE_ARRAY( cgrid211.xg );
04590     }
04591     if ( cgrid211.yg )
04592     {
04593       for ( i = 0; i < Xlen; i++ )
04594       LUA_FREE_ARRAY( cgrid211.yg[i] );
04595       LUA_FREE_ARRAY( cgrid211.yg );
04596     }
04597   }
04598   lua_error(L);
04599   return SWIG_arg;
04600 }
04601 
04602 
04603 static int _wrap_ctime(lua_State* L) {
04604   int SWIG_arg = 0;
04605   PLINT arg1 ;
04606   PLINT arg2 ;
04607   PLINT arg3 ;
04608   PLINT arg4 ;
04609   PLINT arg5 ;
04610   PLFLT arg6 ;
04611   PLFLT *arg7 = (PLFLT *) 0 ;
04612   PLFLT temp7 ;
04613   
04614   arg7 = &temp7; 
04615   SWIG_check_num_args("plctime",6,6)
04616   if(!lua_isnumber(L,1)) SWIG_fail_arg("plctime",1,"PLINT");
04617   if(!lua_isnumber(L,2)) SWIG_fail_arg("plctime",2,"PLINT");
04618   if(!lua_isnumber(L,3)) SWIG_fail_arg("plctime",3,"PLINT");
04619   if(!lua_isnumber(L,4)) SWIG_fail_arg("plctime",4,"PLINT");
04620   if(!lua_isnumber(L,5)) SWIG_fail_arg("plctime",5,"PLINT");
04621   if(!lua_isnumber(L,6)) SWIG_fail_arg("plctime",6,"PLFLT");
04622   arg1 = (PLINT)lua_tonumber(L, 1);
04623   arg2 = (PLINT)lua_tonumber(L, 2);
04624   arg3 = (PLINT)lua_tonumber(L, 3);
04625   arg4 = (PLINT)lua_tonumber(L, 4);
04626   arg5 = (PLINT)lua_tonumber(L, 5);
04627   arg6 = (PLFLT)lua_tonumber(L, 6);
04628   plctime(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
04629   
04630   lua_pushnumber(L, (lua_Number) *arg7); SWIG_arg++;
04631   return SWIG_arg;
04632   
04633   if(0) SWIG_fail;
04634   
04635 fail:
04636   lua_error(L);
04637   return SWIG_arg;
04638 }
04639 
04640 
04641 static int _wrap_cpstrm(lua_State* L) {
04642   int SWIG_arg = 0;
04643   PLINT arg1 ;
04644   PLBOOL arg2 ;
04645   
04646   SWIG_check_num_args("plcpstrm",2,2)
04647   if(!lua_isnumber(L,1)) SWIG_fail_arg("plcpstrm",1,"PLINT");
04648   if(!lua_isnumber(L,2)) SWIG_fail_arg("plcpstrm",2,"PLBOOL");
04649   arg1 = (PLINT)lua_tonumber(L, 1);
04650   arg2 = (PLBOOL)lua_tonumber(L, 2);
04651   plcpstrm(arg1,arg2);
04652   
04653   return SWIG_arg;
04654   
04655   if(0) SWIG_fail;
04656   
04657 fail:
04658   lua_error(L);
04659   return SWIG_arg;
04660 }
04661 
04662 
04663 static int _wrap_plend(lua_State* L) {
04664   int SWIG_arg = 0;
04665   
04666   SWIG_check_num_args("plend",0,0)
04667   plend();
04668   
04669   return SWIG_arg;
04670   
04671   if(0) SWIG_fail;
04672   
04673 fail:
04674   lua_error(L);
04675   return SWIG_arg;
04676 }
04677 
04678 
04679 static int _wrap_plend1(lua_State* L) {
04680   int SWIG_arg = 0;
04681   
04682   SWIG_check_num_args("plend1",0,0)
04683   plend1();
04684   
04685   return SWIG_arg;
04686   
04687   if(0) SWIG_fail;
04688   
04689 fail:
04690   lua_error(L);
04691   return SWIG_arg;
04692 }
04693 
04694 
04695 static int _wrap_env(lua_State* L) {
04696   int SWIG_arg = 0;
04697   PLFLT arg1 ;
04698   PLFLT arg2 ;
04699   PLFLT arg3 ;
04700   PLFLT arg4 ;
04701   PLINT arg5 ;
04702   PLINT arg6 ;
04703   
04704   SWIG_check_num_args("plenv",6,6)
04705   if(!lua_isnumber(L,1)) SWIG_fail_arg("plenv",1,"PLFLT");
04706   if(!lua_isnumber(L,2)) SWIG_fail_arg("plenv",2,"PLFLT");
04707   if(!lua_isnumber(L,3)) SWIG_fail_arg("plenv",3,"PLFLT");
04708   if(!lua_isnumber(L,4)) SWIG_fail_arg("plenv",4,"PLFLT");
04709   if(!lua_isnumber(L,5)) SWIG_fail_arg("plenv",5,"PLINT");
04710   if(!lua_isnumber(L,6)) SWIG_fail_arg("plenv",6,"PLINT");
04711   arg1 = (PLFLT)lua_tonumber(L, 1);
04712   arg2 = (PLFLT)lua_tonumber(L, 2);
04713   arg3 = (PLFLT)lua_tonumber(L, 3);
04714   arg4 = (PLFLT)lua_tonumber(L, 4);
04715   arg5 = (PLINT)lua_tonumber(L, 5);
04716   arg6 = (PLINT)lua_tonumber(L, 6);
04717   plenv(arg1,arg2,arg3,arg4,arg5,arg6);
04718   
04719   return SWIG_arg;
04720   
04721   if(0) SWIG_fail;
04722   
04723 fail:
04724   lua_error(L);
04725   return SWIG_arg;
04726 }
04727 
04728 
04729 static int _wrap_env0(lua_State* L) {
04730   int SWIG_arg = 0;
04731   PLFLT arg1 ;
04732   PLFLT arg2 ;
04733   PLFLT arg3 ;
04734   PLFLT arg4 ;
04735   PLINT arg5 ;
04736   PLINT arg6 ;
04737   
04738   SWIG_check_num_args("plenv0",6,6)
04739   if(!lua_isnumber(L,1)) SWIG_fail_arg("plenv0",1,"PLFLT");
04740   if(!lua_isnumber(L,2)) SWIG_fail_arg("plenv0",2,"PLFLT");
04741   if(!lua_isnumber(L,3)) SWIG_fail_arg("plenv0",3,"PLFLT");
04742   if(!lua_isnumber(L,4)) SWIG_fail_arg("plenv0",4,"PLFLT");
04743   if(!lua_isnumber(L,5)) SWIG_fail_arg("plenv0",5,"PLINT");
04744   if(!lua_isnumber(L,6)) SWIG_fail_arg("plenv0",6,"PLINT");
04745   arg1 = (PLFLT)lua_tonumber(L, 1);
04746   arg2 = (PLFLT)lua_tonumber(L, 2);
04747   arg3 = (PLFLT)lua_tonumber(L, 3);
04748   arg4 = (PLFLT)lua_tonumber(L, 4);
04749   arg5 = (PLINT)lua_tonumber(L, 5);
04750   arg6 = (PLINT)lua_tonumber(L, 6);
04751   plenv0(arg1,arg2,arg3,arg4,arg5,arg6);
04752   
04753   return SWIG_arg;
04754   
04755   if(0) SWIG_fail;
04756   
04757 fail:
04758   lua_error(L);
04759   return SWIG_arg;
04760 }
04761 
04762 
04763 static int _wrap_eop(lua_State* L) {
04764   int SWIG_arg = 0;
04765   
04766   SWIG_check_num_args("pleop",0,0)
04767   pleop();
04768   
04769   return SWIG_arg;
04770   
04771   if(0) SWIG_fail;
04772   
04773 fail:
04774   lua_error(L);
04775   return SWIG_arg;
04776 }
04777 
04778 
04779 static int _wrap_errx(lua_State* L) {
04780   int SWIG_arg = 0;
04781   PLINT arg1 ;
04782   PLFLT *arg2 = (PLFLT *) 0 ;
04783   PLFLT *arg3 = (PLFLT *) 0 ;
04784   PLFLT *arg4 = (PLFLT *) 0 ;
04785   int temp3 ;
04786   int temp4 ;
04787   
04788   SWIG_check_num_args("plerrx",3,3)
04789   {
04790     int temp;
04791     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
04792     if ( !arg2 )
04793     SWIG_fail;
04794     arg1 = Alen = temp;
04795   }
04796   {
04797     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
04798     if ( !arg3 )
04799     SWIG_fail;
04800     if ( temp3 != Alen )
04801     {
04802       lua_pushfstring( L, "Tables must be of same length." );
04803       SWIG_fail;
04804     }
04805   }
04806   {
04807     arg4 = (PLFLT *) LUA_get_double_num_array_var( L, 3, &temp4 );
04808     if ( !arg4 )
04809     SWIG_fail;
04810     if ( temp4 != Alen )
04811     {
04812       lua_pushfstring( L, "Tables must be of same length." );
04813       SWIG_fail;
04814     }
04815   }
04816   plerrx(arg1,(double const *)arg2,(double const *)arg3,(double const *)arg4);
04817   
04818   {
04819     LUA_FREE_ARRAY( arg2 );
04820   }
04821   {
04822     LUA_FREE_ARRAY( arg3 ); 
04823   }
04824   {
04825     LUA_FREE_ARRAY( arg4 ); 
04826   }
04827   return SWIG_arg;
04828   
04829   if(0) SWIG_fail;
04830   
04831 fail:
04832   {
04833     LUA_FREE_ARRAY( arg2 );
04834   }
04835   {
04836     LUA_FREE_ARRAY( arg3 ); 
04837   }
04838   {
04839     LUA_FREE_ARRAY( arg4 ); 
04840   }
04841   lua_error(L);
04842   return SWIG_arg;
04843 }
04844 
04845 
04846 static int _wrap_erry(lua_State* L) {
04847   int SWIG_arg = 0;
04848   PLINT arg1 ;
04849   PLFLT *arg2 = (PLFLT *) 0 ;
04850   PLFLT *arg3 = (PLFLT *) 0 ;
04851   PLFLT *arg4 = (PLFLT *) 0 ;
04852   int temp3 ;
04853   int temp4 ;
04854   
04855   SWIG_check_num_args("plerry",3,3)
04856   {
04857     int temp;
04858     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
04859     if ( !arg2 )
04860     SWIG_fail;
04861     arg1 = Alen = temp;
04862   }
04863   {
04864     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
04865     if ( !arg3 )
04866     SWIG_fail;
04867     if ( temp3 != Alen )
04868     {
04869       lua_pushfstring( L, "Tables must be of same length." );
04870       SWIG_fail;
04871     }
04872   }
04873   {
04874     arg4 = (PLFLT *) LUA_get_double_num_array_var( L, 3, &temp4 );
04875     if ( !arg4 )
04876     SWIG_fail;
04877     if ( temp4 != Alen )
04878     {
04879       lua_pushfstring( L, "Tables must be of same length." );
04880       SWIG_fail;
04881     }
04882   }
04883   plerry(arg1,(double const *)arg2,(double const *)arg3,(double const *)arg4);
04884   
04885   {
04886     LUA_FREE_ARRAY( arg2 );
04887   }
04888   {
04889     LUA_FREE_ARRAY( arg3 ); 
04890   }
04891   {
04892     LUA_FREE_ARRAY( arg4 ); 
04893   }
04894   return SWIG_arg;
04895   
04896   if(0) SWIG_fail;
04897   
04898 fail:
04899   {
04900     LUA_FREE_ARRAY( arg2 );
04901   }
04902   {
04903     LUA_FREE_ARRAY( arg3 ); 
04904   }
04905   {
04906     LUA_FREE_ARRAY( arg4 ); 
04907   }
04908   lua_error(L);
04909   return SWIG_arg;
04910 }
04911 
04912 
04913 static int _wrap_famadv(lua_State* L) {
04914   int SWIG_arg = 0;
04915   
04916   SWIG_check_num_args("plfamadv",0,0)
04917   plfamadv();
04918   
04919   return SWIG_arg;
04920   
04921   if(0) SWIG_fail;
04922   
04923 fail:
04924   lua_error(L);
04925   return SWIG_arg;
04926 }
04927 
04928 
04929 static int _wrap_fill(lua_State* L) {
04930   int SWIG_arg = 0;
04931   PLINT arg1 ;
04932   PLFLT *arg2 = (PLFLT *) 0 ;
04933   PLFLT *arg3 = (PLFLT *) 0 ;
04934   int temp3 ;
04935   
04936   SWIG_check_num_args("plfill",2,2)
04937   {
04938     int temp;
04939     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
04940     if ( !arg2 )
04941     SWIG_fail;
04942     arg1 = Alen = temp;
04943   }
04944   {
04945     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
04946     if ( !arg3 )
04947     SWIG_fail;
04948     if ( temp3 != Alen )
04949     {
04950       lua_pushfstring( L, "Tables must be of same length." );
04951       SWIG_fail;
04952     }
04953   }
04954   plfill(arg1,(double const *)arg2,(double const *)arg3);
04955   
04956   {
04957     LUA_FREE_ARRAY( arg2 );
04958   }
04959   {
04960     LUA_FREE_ARRAY( arg3 ); 
04961   }
04962   return SWIG_arg;
04963   
04964   if(0) SWIG_fail;
04965   
04966 fail:
04967   {
04968     LUA_FREE_ARRAY( arg2 );
04969   }
04970   {
04971     LUA_FREE_ARRAY( arg3 ); 
04972   }
04973   lua_error(L);
04974   return SWIG_arg;
04975 }
04976 
04977 
04978 static int _wrap_fill3(lua_State* L) {
04979   int SWIG_arg = 0;
04980   PLINT arg1 ;
04981   PLFLT *arg2 = (PLFLT *) 0 ;
04982   PLFLT *arg3 = (PLFLT *) 0 ;
04983   PLFLT *arg4 = (PLFLT *) 0 ;
04984   int temp3 ;
04985   int temp4 ;
04986   
04987   SWIG_check_num_args("plfill3",3,3)
04988   {
04989     int temp;
04990     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
04991     if ( !arg2 )
04992     SWIG_fail;
04993     arg1 = Alen = temp;
04994   }
04995   {
04996     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
04997     if ( !arg3 )
04998     SWIG_fail;
04999     if ( temp3 != Alen )
05000     {
05001       lua_pushfstring( L, "Tables must be of same length." );
05002       SWIG_fail;
05003     }
05004   }
05005   {
05006     arg4 = (PLFLT *) LUA_get_double_num_array_var( L, 3, &temp4 );
05007     if ( !arg4 )
05008     SWIG_fail;
05009     if ( temp4 != Alen )
05010     {
05011       lua_pushfstring( L, "Tables must be of same length." );
05012       SWIG_fail;
05013     }
05014   }
05015   plfill3(arg1,(double const *)arg2,(double const *)arg3,(double const *)arg4);
05016   
05017   {
05018     LUA_FREE_ARRAY( arg2 );
05019   }
05020   {
05021     LUA_FREE_ARRAY( arg3 ); 
05022   }
05023   {
05024     LUA_FREE_ARRAY( arg4 ); 
05025   }
05026   return SWIG_arg;
05027   
05028   if(0) SWIG_fail;
05029   
05030 fail:
05031   {
05032     LUA_FREE_ARRAY( arg2 );
05033   }
05034   {
05035     LUA_FREE_ARRAY( arg3 ); 
05036   }
05037   {
05038     LUA_FREE_ARRAY( arg4 ); 
05039   }
05040   lua_error(L);
05041   return SWIG_arg;
05042 }
05043 
05044 
05045 static int _wrap_gradient(lua_State* L) {
05046   int SWIG_arg = 0;
05047   PLINT arg1 ;
05048   PLFLT *arg2 = (PLFLT *) 0 ;
05049   PLFLT *arg3 = (PLFLT *) 0 ;
05050   PLFLT arg4 ;
05051   int temp3 ;
05052   
05053   SWIG_check_num_args("plgradient",3,3)
05054   if(!lua_isnumber(L,3)) SWIG_fail_arg("plgradient",3,"PLFLT");
05055   {
05056     int temp;
05057     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
05058     if ( !arg2 )
05059     SWIG_fail;
05060     arg1 = Alen = temp;
05061   }
05062   {
05063     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
05064     if ( !arg3 )
05065     SWIG_fail;
05066     if ( temp3 != Alen )
05067     {
05068       lua_pushfstring( L, "Tables must be of same length." );
05069       SWIG_fail;
05070     }
05071   }
05072   arg4 = (PLFLT)lua_tonumber(L, 3);
05073   plgradient(arg1,(double const *)arg2,(double const *)arg3,arg4);
05074   
05075   {
05076     LUA_FREE_ARRAY( arg2 );
05077   }
05078   {
05079     LUA_FREE_ARRAY( arg3 ); 
05080   }
05081   return SWIG_arg;
05082   
05083   if(0) SWIG_fail;
05084   
05085 fail:
05086   {
05087     LUA_FREE_ARRAY( arg2 );
05088   }
05089   {
05090     LUA_FREE_ARRAY( arg3 ); 
05091   }
05092   lua_error(L);
05093   return SWIG_arg;
05094 }
05095 
05096 
05097 static int _wrap_flush(lua_State* L) {
05098   int SWIG_arg = 0;
05099   
05100   SWIG_check_num_args("plflush",0,0)
05101   plflush();
05102   
05103   return SWIG_arg;
05104   
05105   if(0) SWIG_fail;
05106   
05107 fail:
05108   lua_error(L);
05109   return SWIG_arg;
05110 }
05111 
05112 
05113 static int _wrap_font(lua_State* L) {
05114   int SWIG_arg = 0;
05115   PLINT arg1 ;
05116   
05117   SWIG_check_num_args("plfont",1,1)
05118   if(!lua_isnumber(L,1)) SWIG_fail_arg("plfont",1,"PLINT");
05119   arg1 = (PLINT)lua_tonumber(L, 1);
05120   plfont(arg1);
05121   
05122   return SWIG_arg;
05123   
05124   if(0) SWIG_fail;
05125   
05126 fail:
05127   lua_error(L);
05128   return SWIG_arg;
05129 }
05130 
05131 
05132 static int _wrap_fontld(lua_State* L) {
05133   int SWIG_arg = 0;
05134   PLINT arg1 ;
05135   
05136   SWIG_check_num_args("plfontld",1,1)
05137   if(!lua_isnumber(L,1)) SWIG_fail_arg("plfontld",1,"PLINT");
05138   arg1 = (PLINT)lua_tonumber(L, 1);
05139   plfontld(arg1);
05140   
05141   return SWIG_arg;
05142   
05143   if(0) SWIG_fail;
05144   
05145 fail:
05146   lua_error(L);
05147   return SWIG_arg;
05148 }
05149 
05150 
05151 static int _wrap_gchr(lua_State* L) {
05152   int SWIG_arg = 0;
05153   PLFLT *arg1 = (PLFLT *) 0 ;
05154   PLFLT *arg2 = (PLFLT *) 0 ;
05155   PLFLT temp1 ;
05156   PLFLT temp2 ;
05157   
05158   arg1 = &temp1; 
05159   arg2 = &temp2; 
05160   SWIG_check_num_args("plgchr",0,0)
05161   plgchr(arg1,arg2);
05162   
05163   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05164   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05165   return SWIG_arg;
05166   
05167   if(0) SWIG_fail;
05168   
05169 fail:
05170   lua_error(L);
05171   return SWIG_arg;
05172 }
05173 
05174 
05175 static int _wrap_gcol0(lua_State* L) {
05176   int SWIG_arg = 0;
05177   PLINT arg1 ;
05178   PLINT *arg2 = (PLINT *) 0 ;
05179   PLINT *arg3 = (PLINT *) 0 ;
05180   PLINT *arg4 = (PLINT *) 0 ;
05181   PLINT temp2 ;
05182   PLINT temp3 ;
05183   PLINT temp4 ;
05184   
05185   arg2 = &temp2; 
05186   arg3 = &temp3; 
05187   arg4 = &temp4; 
05188   SWIG_check_num_args("plgcol0",1,1)
05189   if(!lua_isnumber(L,1)) SWIG_fail_arg("plgcol0",1,"PLINT");
05190   arg1 = (PLINT)lua_tonumber(L, 1);
05191   plgcol0(arg1,arg2,arg3,arg4);
05192   
05193   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05194   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
05195   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
05196   return SWIG_arg;
05197   
05198   if(0) SWIG_fail;
05199   
05200 fail:
05201   lua_error(L);
05202   return SWIG_arg;
05203 }
05204 
05205 
05206 static int _wrap_gcol0a(lua_State* L) {
05207   int SWIG_arg = 0;
05208   PLINT arg1 ;
05209   PLINT *arg2 = (PLINT *) 0 ;
05210   PLINT *arg3 = (PLINT *) 0 ;
05211   PLINT *arg4 = (PLINT *) 0 ;
05212   PLFLT *arg5 = (PLFLT *) 0 ;
05213   PLINT temp2 ;
05214   PLINT temp3 ;
05215   PLINT temp4 ;
05216   PLFLT temp5 ;
05217   
05218   arg2 = &temp2; 
05219   arg3 = &temp3; 
05220   arg4 = &temp4; 
05221   arg5 = &temp5; 
05222   SWIG_check_num_args("plgcol0a",1,1)
05223   if(!lua_isnumber(L,1)) SWIG_fail_arg("plgcol0a",1,"PLINT");
05224   arg1 = (PLINT)lua_tonumber(L, 1);
05225   plgcol0a(arg1,arg2,arg3,arg4,arg5);
05226   
05227   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05228   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
05229   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
05230   lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
05231   return SWIG_arg;
05232   
05233   if(0) SWIG_fail;
05234   
05235 fail:
05236   lua_error(L);
05237   return SWIG_arg;
05238 }
05239 
05240 
05241 static int _wrap_gcolbg(lua_State* L) {
05242   int SWIG_arg = 0;
05243   PLINT *arg1 = (PLINT *) 0 ;
05244   PLINT *arg2 = (PLINT *) 0 ;
05245   PLINT *arg3 = (PLINT *) 0 ;
05246   PLINT temp1 ;
05247   PLINT temp2 ;
05248   PLINT temp3 ;
05249   
05250   arg1 = &temp1; 
05251   arg2 = &temp2; 
05252   arg3 = &temp3; 
05253   SWIG_check_num_args("plgcolbg",0,0)
05254   plgcolbg(arg1,arg2,arg3);
05255   
05256   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05257   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05258   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
05259   return SWIG_arg;
05260   
05261   if(0) SWIG_fail;
05262   
05263 fail:
05264   lua_error(L);
05265   return SWIG_arg;
05266 }
05267 
05268 
05269 static int _wrap_gcolbga(lua_State* L) {
05270   int SWIG_arg = 0;
05271   PLINT *arg1 = (PLINT *) 0 ;
05272   PLINT *arg2 = (PLINT *) 0 ;
05273   PLINT *arg3 = (PLINT *) 0 ;
05274   PLFLT *arg4 = (PLFLT *) 0 ;
05275   PLINT temp1 ;
05276   PLINT temp2 ;
05277   PLINT temp3 ;
05278   PLFLT temp4 ;
05279   
05280   arg1 = &temp1; 
05281   arg2 = &temp2; 
05282   arg3 = &temp3; 
05283   arg4 = &temp4; 
05284   SWIG_check_num_args("plgcolbga",0,0)
05285   plgcolbga(arg1,arg2,arg3,arg4);
05286   
05287   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05288   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05289   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
05290   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
05291   return SWIG_arg;
05292   
05293   if(0) SWIG_fail;
05294   
05295 fail:
05296   lua_error(L);
05297   return SWIG_arg;
05298 }
05299 
05300 
05301 static int _wrap_gcompression(lua_State* L) {
05302   int SWIG_arg = 0;
05303   PLINT *arg1 = (PLINT *) 0 ;
05304   PLINT temp1 ;
05305   
05306   arg1 = &temp1; 
05307   SWIG_check_num_args("plgcompression",0,0)
05308   plgcompression(arg1);
05309   
05310   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05311   return SWIG_arg;
05312   
05313   if(0) SWIG_fail;
05314   
05315 fail:
05316   lua_error(L);
05317   return SWIG_arg;
05318 }
05319 
05320 
05321 static int _wrap_gdev(lua_State* L) {
05322   int SWIG_arg = 0;
05323   char *arg1 = (char *) 0 ;
05324   char buff1[1000] ;
05325   
05326   {
05327     arg1 = buff1;
05328   }
05329   SWIG_check_num_args("plgdev",0,0)
05330   plgdev(arg1);
05331   
05332   {
05333     lua_pushstring( L, arg1 );
05334     SWIG_arg++;
05335   }
05336   return SWIG_arg;
05337   
05338   if(0) SWIG_fail;
05339   
05340 fail:
05341   lua_error(L);
05342   return SWIG_arg;
05343 }
05344 
05345 
05346 static int _wrap_gdidev(lua_State* L) {
05347   int SWIG_arg = 0;
05348   PLFLT *arg1 = (PLFLT *) 0 ;
05349   PLFLT *arg2 = (PLFLT *) 0 ;
05350   PLFLT *arg3 = (PLFLT *) 0 ;
05351   PLFLT *arg4 = (PLFLT *) 0 ;
05352   PLFLT temp1 ;
05353   PLFLT temp2 ;
05354   PLFLT temp3 ;
05355   PLFLT temp4 ;
05356   
05357   arg1 = &temp1; 
05358   arg2 = &temp2; 
05359   arg3 = &temp3; 
05360   arg4 = &temp4; 
05361   SWIG_check_num_args("plgdidev",0,0)
05362   plgdidev(arg1,arg2,arg3,arg4);
05363   
05364   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05365   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05366   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
05367   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
05368   return SWIG_arg;
05369   
05370   if(0) SWIG_fail;
05371   
05372 fail:
05373   lua_error(L);
05374   return SWIG_arg;
05375 }
05376 
05377 
05378 static int _wrap_gdiori(lua_State* L) {
05379   int SWIG_arg = 0;
05380   PLFLT *arg1 = (PLFLT *) 0 ;
05381   PLFLT temp1 ;
05382   
05383   arg1 = &temp1; 
05384   SWIG_check_num_args("plgdiori",0,0)
05385   plgdiori(arg1);
05386   
05387   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05388   return SWIG_arg;
05389   
05390   if(0) SWIG_fail;
05391   
05392 fail:
05393   lua_error(L);
05394   return SWIG_arg;
05395 }
05396 
05397 
05398 static int _wrap_gdiplt(lua_State* L) {
05399   int SWIG_arg = 0;
05400   PLFLT *arg1 = (PLFLT *) 0 ;
05401   PLFLT *arg2 = (PLFLT *) 0 ;
05402   PLFLT *arg3 = (PLFLT *) 0 ;
05403   PLFLT *arg4 = (PLFLT *) 0 ;
05404   PLFLT temp1 ;
05405   PLFLT temp2 ;
05406   PLFLT temp3 ;
05407   PLFLT temp4 ;
05408   
05409   arg1 = &temp1; 
05410   arg2 = &temp2; 
05411   arg3 = &temp3; 
05412   arg4 = &temp4; 
05413   SWIG_check_num_args("plgdiplt",0,0)
05414   plgdiplt(arg1,arg2,arg3,arg4);
05415   
05416   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05417   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05418   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
05419   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
05420   return SWIG_arg;
05421   
05422   if(0) SWIG_fail;
05423   
05424 fail:
05425   lua_error(L);
05426   return SWIG_arg;
05427 }
05428 
05429 
05430 static int _wrap_gfam(lua_State* L) {
05431   int SWIG_arg = 0;
05432   PLINT *arg1 = (PLINT *) 0 ;
05433   PLINT *arg2 = (PLINT *) 0 ;
05434   PLINT *arg3 = (PLINT *) 0 ;
05435   PLINT temp1 ;
05436   PLINT temp2 ;
05437   PLINT temp3 ;
05438   
05439   arg1 = &temp1; 
05440   arg2 = &temp2; 
05441   arg3 = &temp3; 
05442   SWIG_check_num_args("plgfam",0,0)
05443   plgfam(arg1,arg2,arg3);
05444   
05445   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05446   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05447   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
05448   return SWIG_arg;
05449   
05450   if(0) SWIG_fail;
05451   
05452 fail:
05453   lua_error(L);
05454   return SWIG_arg;
05455 }
05456 
05457 
05458 static int _wrap_gfci(lua_State* L) {
05459   int SWIG_arg = 0;
05460   PLUNICODE *arg1 = (PLUNICODE *) 0 ;
05461   PLUNICODE temp1 ;
05462   
05463   arg1 = &temp1; 
05464   SWIG_check_num_args("plgfci",0,0)
05465   plgfci(arg1);
05466   
05467   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05468   return SWIG_arg;
05469   
05470   if(0) SWIG_fail;
05471   
05472 fail:
05473   lua_error(L);
05474   return SWIG_arg;
05475 }
05476 
05477 
05478 static int _wrap_gfnam(lua_State* L) {
05479   int SWIG_arg = 0;
05480   char *arg1 = (char *) 0 ;
05481   char buff1[1000] ;
05482   
05483   {
05484     arg1 = buff1;
05485   }
05486   SWIG_check_num_args("plgfnam",0,0)
05487   plgfnam(arg1);
05488   
05489   {
05490     lua_pushstring( L, arg1 );
05491     SWIG_arg++;
05492   }
05493   return SWIG_arg;
05494   
05495   if(0) SWIG_fail;
05496   
05497 fail:
05498   lua_error(L);
05499   return SWIG_arg;
05500 }
05501 
05502 
05503 static int _wrap_gfont(lua_State* L) {
05504   int SWIG_arg = 0;
05505   PLINT *arg1 = (PLINT *) 0 ;
05506   PLINT *arg2 = (PLINT *) 0 ;
05507   PLINT *arg3 = (PLINT *) 0 ;
05508   PLINT temp1 ;
05509   PLINT temp2 ;
05510   PLINT temp3 ;
05511   
05512   arg1 = &temp1; 
05513   arg2 = &temp2; 
05514   arg3 = &temp3; 
05515   SWIG_check_num_args("plgfont",0,0)
05516   plgfont(arg1,arg2,arg3);
05517   
05518   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05519   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05520   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
05521   return SWIG_arg;
05522   
05523   if(0) SWIG_fail;
05524   
05525 fail:
05526   lua_error(L);
05527   return SWIG_arg;
05528 }
05529 
05530 
05531 static int _wrap_glevel(lua_State* L) {
05532   int SWIG_arg = 0;
05533   PLINT *arg1 = (PLINT *) 0 ;
05534   PLINT temp1 ;
05535   
05536   arg1 = &temp1; 
05537   SWIG_check_num_args("plglevel",0,0)
05538   plglevel(arg1);
05539   
05540   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05541   return SWIG_arg;
05542   
05543   if(0) SWIG_fail;
05544   
05545 fail:
05546   lua_error(L);
05547   return SWIG_arg;
05548 }
05549 
05550 
05551 static int _wrap_gpage(lua_State* L) {
05552   int SWIG_arg = 0;
05553   PLFLT *arg1 = (PLFLT *) 0 ;
05554   PLFLT *arg2 = (PLFLT *) 0 ;
05555   PLINT *arg3 = (PLINT *) 0 ;
05556   PLINT *arg4 = (PLINT *) 0 ;
05557   PLINT *arg5 = (PLINT *) 0 ;
05558   PLINT *arg6 = (PLINT *) 0 ;
05559   PLFLT temp1 ;
05560   PLFLT temp2 ;
05561   PLINT temp3 ;
05562   PLINT temp4 ;
05563   PLINT temp5 ;
05564   PLINT temp6 ;
05565   
05566   arg1 = &temp1; 
05567   arg2 = &temp2; 
05568   arg3 = &temp3; 
05569   arg4 = &temp4; 
05570   arg5 = &temp5; 
05571   arg6 = &temp6; 
05572   SWIG_check_num_args("plgpage",0,0)
05573   plgpage(arg1,arg2,arg3,arg4,arg5,arg6);
05574   
05575   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05576   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05577   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
05578   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
05579   lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
05580   lua_pushnumber(L, (lua_Number) *arg6); SWIG_arg++;
05581   return SWIG_arg;
05582   
05583   if(0) SWIG_fail;
05584   
05585 fail:
05586   lua_error(L);
05587   return SWIG_arg;
05588 }
05589 
05590 
05591 static int _wrap_gra(lua_State* L) {
05592   int SWIG_arg = 0;
05593   
05594   SWIG_check_num_args("plgra",0,0)
05595   plgra();
05596   
05597   return SWIG_arg;
05598   
05599   if(0) SWIG_fail;
05600   
05601 fail:
05602   lua_error(L);
05603   return SWIG_arg;
05604 }
05605 
05606 
05607 static int _wrap_griddata(lua_State* L) {
05608   int SWIG_arg = 0;
05609   PLFLT *arg1 = (PLFLT *) 0 ;
05610   PLFLT *arg2 = (PLFLT *) 0 ;
05611   PLFLT *arg3 = (PLFLT *) 0 ;
05612   PLINT arg4 ;
05613   PLFLT *arg5 = (PLFLT *) 0 ;
05614   PLINT arg6 ;
05615   PLFLT *arg7 = (PLFLT *) 0 ;
05616   PLINT arg8 ;
05617   PLFLT **arg9 = (PLFLT **) 0 ;
05618   PLINT arg10 ;
05619   PLFLT arg11 ;
05620   int temp2 ;
05621   
05622   SWIG_check_num_args("plgriddata",7,7)
05623   if(!lua_isnumber(L,6)) SWIG_fail_arg("plgriddata",6,"PLINT");
05624   if(!lua_isnumber(L,7)) SWIG_fail_arg("plgriddata",7,"PLFLT");
05625   {
05626     int temp;
05627     arg1 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
05628     if ( !arg1 )
05629     SWIG_fail;
05630     Alen = temp;
05631   }
05632   {
05633     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp2 );
05634     if ( !arg2 )
05635     SWIG_fail;
05636     if ( temp2 != Alen )
05637     {
05638       lua_pushfstring( L, "Tables must be of same length." );
05639       SWIG_fail;
05640     }
05641   }
05642   {
05643     int temp;
05644     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 3, &temp );
05645     if ( !arg3 )
05646     SWIG_fail;
05647     if ( temp != Alen )
05648     {
05649       lua_pushfstring( L, "Tables must be of same length." );
05650       SWIG_fail;
05651     }
05652     arg4 = temp;
05653   }
05654   {
05655     int temp;
05656     arg5 = (PLFLT *) LUA_get_double_num_array_var( L, 4, &temp );
05657     if ( !arg5 )
05658     SWIG_fail;
05659     arg6 = Xlen = temp;
05660   }
05661   {
05662     int temp, i;
05663     
05664     arg7 = (PLFLT *) LUA_get_double_num_array_var( L, 5, &temp );
05665     if ( !arg7 )
05666     SWIG_fail;
05667     arg8 = Ylen = temp;
05668     
05669     arg9 = LUA_ALLOC_ARRAY( PLFLT *, Xlen );
05670     if ( !arg9 )
05671     SWIG_fail;
05672     for ( i = 0; i < Xlen; i++ )
05673     arg9[i] = NULL;
05674     
05675     for ( i = 0; i < Xlen; i++ )
05676     {
05677       arg9[i] = LUA_ALLOC_ARRAY( PLFLT, Ylen );
05678       if ( !arg9[i] )
05679       SWIG_fail;
05680     }
05681   }
05682   arg10 = (PLINT)lua_tonumber(L, 6);
05683   arg11 = (PLFLT)lua_tonumber(L, 7);
05684   plgriddata((double const *)arg1,(double const *)arg2,(double const *)arg3,arg4,(double const *)arg5,arg6,(double const *)arg7,arg8,arg9,arg10,arg11);
05685   
05686   {
05687     int i;
05688     
05689     if ( arg9 )
05690     {
05691       lua_newtable( L );
05692       for ( i = 0; i < Xlen; i++ )
05693       {
05694         SWIG_write_double_num_array( L, arg9[i], Ylen );
05695         lua_rawseti( L, -2, i + 1 ); // -1 is the inner table, -2 is the outer table
05696       }
05697       SWIG_arg++;
05698     }
05699   }
05700   {
05701     LUA_FREE_ARRAY( arg1 );
05702   }
05703   {
05704     LUA_FREE_ARRAY( arg2 ); 
05705   }
05706   {
05707     LUA_FREE_ARRAY( arg3 );
05708   }
05709   {
05710     LUA_FREE_ARRAY( arg5 );
05711   }
05712   {
05713     int i;
05714     
05715     LUA_FREE_ARRAY( arg7 );
05716     
05717     if ( arg9 )
05718     {
05719       for ( i = 0; i < Xlen; i++ )
05720       LUA_FREE_ARRAY( arg9[i] );
05721       LUA_FREE_ARRAY( arg9 );
05722     }
05723   }
05724   return SWIG_arg;
05725   
05726   if(0) SWIG_fail;
05727   
05728 fail:
05729   {
05730     LUA_FREE_ARRAY( arg1 );
05731   }
05732   {
05733     LUA_FREE_ARRAY( arg2 ); 
05734   }
05735   {
05736     LUA_FREE_ARRAY( arg3 );
05737   }
05738   {
05739     LUA_FREE_ARRAY( arg5 );
05740   }
05741   {
05742     int i;
05743     
05744     LUA_FREE_ARRAY( arg7 );
05745     
05746     if ( arg9 )
05747     {
05748       for ( i = 0; i < Xlen; i++ )
05749       LUA_FREE_ARRAY( arg9[i] );
05750       LUA_FREE_ARRAY( arg9 );
05751     }
05752   }
05753   lua_error(L);
05754   return SWIG_arg;
05755 }
05756 
05757 
05758 static int _wrap_gspa(lua_State* L) {
05759   int SWIG_arg = 0;
05760   PLFLT *arg1 = (PLFLT *) 0 ;
05761   PLFLT *arg2 = (PLFLT *) 0 ;
05762   PLFLT *arg3 = (PLFLT *) 0 ;
05763   PLFLT *arg4 = (PLFLT *) 0 ;
05764   PLFLT temp1 ;
05765   PLFLT temp2 ;
05766   PLFLT temp3 ;
05767   PLFLT temp4 ;
05768   
05769   arg1 = &temp1; 
05770   arg2 = &temp2; 
05771   arg3 = &temp3; 
05772   arg4 = &temp4; 
05773   SWIG_check_num_args("plgspa",0,0)
05774   plgspa(arg1,arg2,arg3,arg4);
05775   
05776   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05777   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05778   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
05779   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
05780   return SWIG_arg;
05781   
05782   if(0) SWIG_fail;
05783   
05784 fail:
05785   lua_error(L);
05786   return SWIG_arg;
05787 }
05788 
05789 
05790 static int _wrap_gstrm(lua_State* L) {
05791   int SWIG_arg = 0;
05792   PLINT *arg1 = (PLINT *) 0 ;
05793   PLINT temp1 ;
05794   
05795   arg1 = &temp1; 
05796   SWIG_check_num_args("plgstrm",0,0)
05797   plgstrm(arg1);
05798   
05799   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05800   return SWIG_arg;
05801   
05802   if(0) SWIG_fail;
05803   
05804 fail:
05805   lua_error(L);
05806   return SWIG_arg;
05807 }
05808 
05809 
05810 static int _wrap_gver(lua_State* L) {
05811   int SWIG_arg = 0;
05812   char *arg1 = (char *) 0 ;
05813   char buff1[1000] ;
05814   
05815   {
05816     arg1 = buff1;
05817   }
05818   SWIG_check_num_args("plgver",0,0)
05819   plgver(arg1);
05820   
05821   {
05822     lua_pushstring( L, arg1 );
05823     SWIG_arg++;
05824   }
05825   return SWIG_arg;
05826   
05827   if(0) SWIG_fail;
05828   
05829 fail:
05830   lua_error(L);
05831   return SWIG_arg;
05832 }
05833 
05834 
05835 static int _wrap_gvpd(lua_State* L) {
05836   int SWIG_arg = 0;
05837   PLFLT *arg1 = (PLFLT *) 0 ;
05838   PLFLT *arg2 = (PLFLT *) 0 ;
05839   PLFLT *arg3 = (PLFLT *) 0 ;
05840   PLFLT *arg4 = (PLFLT *) 0 ;
05841   PLFLT temp1 ;
05842   PLFLT temp2 ;
05843   PLFLT temp3 ;
05844   PLFLT temp4 ;
05845   
05846   arg1 = &temp1; 
05847   arg2 = &temp2; 
05848   arg3 = &temp3; 
05849   arg4 = &temp4; 
05850   SWIG_check_num_args("plgvpd",0,0)
05851   plgvpd(arg1,arg2,arg3,arg4);
05852   
05853   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05854   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05855   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
05856   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
05857   return SWIG_arg;
05858   
05859   if(0) SWIG_fail;
05860   
05861 fail:
05862   lua_error(L);
05863   return SWIG_arg;
05864 }
05865 
05866 
05867 static int _wrap_gvpw(lua_State* L) {
05868   int SWIG_arg = 0;
05869   PLFLT *arg1 = (PLFLT *) 0 ;
05870   PLFLT *arg2 = (PLFLT *) 0 ;
05871   PLFLT *arg3 = (PLFLT *) 0 ;
05872   PLFLT *arg4 = (PLFLT *) 0 ;
05873   PLFLT temp1 ;
05874   PLFLT temp2 ;
05875   PLFLT temp3 ;
05876   PLFLT temp4 ;
05877   
05878   arg1 = &temp1; 
05879   arg2 = &temp2; 
05880   arg3 = &temp3; 
05881   arg4 = &temp4; 
05882   SWIG_check_num_args("plgvpw",0,0)
05883   plgvpw(arg1,arg2,arg3,arg4);
05884   
05885   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05886   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05887   lua_pushnumber(L, (lua_Number) *arg3); SWIG_arg++;
05888   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
05889   return SWIG_arg;
05890   
05891   if(0) SWIG_fail;
05892   
05893 fail:
05894   lua_error(L);
05895   return SWIG_arg;
05896 }
05897 
05898 
05899 static int _wrap_gxax(lua_State* L) {
05900   int SWIG_arg = 0;
05901   PLINT *arg1 = (PLINT *) 0 ;
05902   PLINT *arg2 = (PLINT *) 0 ;
05903   PLINT temp1 ;
05904   PLINT temp2 ;
05905   
05906   arg1 = &temp1; 
05907   arg2 = &temp2; 
05908   SWIG_check_num_args("plgxax",0,0)
05909   plgxax(arg1,arg2);
05910   
05911   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05912   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05913   return SWIG_arg;
05914   
05915   if(0) SWIG_fail;
05916   
05917 fail:
05918   lua_error(L);
05919   return SWIG_arg;
05920 }
05921 
05922 
05923 static int _wrap_gyax(lua_State* L) {
05924   int SWIG_arg = 0;
05925   PLINT *arg1 = (PLINT *) 0 ;
05926   PLINT *arg2 = (PLINT *) 0 ;
05927   PLINT temp1 ;
05928   PLINT temp2 ;
05929   
05930   arg1 = &temp1; 
05931   arg2 = &temp2; 
05932   SWIG_check_num_args("plgyax",0,0)
05933   plgyax(arg1,arg2);
05934   
05935   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05936   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05937   return SWIG_arg;
05938   
05939   if(0) SWIG_fail;
05940   
05941 fail:
05942   lua_error(L);
05943   return SWIG_arg;
05944 }
05945 
05946 
05947 static int _wrap_gzax(lua_State* L) {
05948   int SWIG_arg = 0;
05949   PLINT *arg1 = (PLINT *) 0 ;
05950   PLINT *arg2 = (PLINT *) 0 ;
05951   PLINT temp1 ;
05952   PLINT temp2 ;
05953   
05954   arg1 = &temp1; 
05955   arg2 = &temp2; 
05956   SWIG_check_num_args("plgzax",0,0)
05957   plgzax(arg1,arg2);
05958   
05959   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
05960   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
05961   return SWIG_arg;
05962   
05963   if(0) SWIG_fail;
05964   
05965 fail:
05966   lua_error(L);
05967   return SWIG_arg;
05968 }
05969 
05970 
05971 static int _wrap_hist(lua_State* L) {
05972   int SWIG_arg = 0;
05973   PLINT arg1 ;
05974   PLFLT *arg2 = (PLFLT *) 0 ;
05975   PLFLT arg3 ;
05976   PLFLT arg4 ;
05977   PLINT arg5 ;
05978   PLINT arg6 ;
05979   
05980   SWIG_check_num_args("plhist",5,5)
05981   if(!lua_isnumber(L,2)) SWIG_fail_arg("plhist",2,"PLFLT");
05982   if(!lua_isnumber(L,3)) SWIG_fail_arg("plhist",3,"PLFLT");
05983   if(!lua_isnumber(L,4)) SWIG_fail_arg("plhist",4,"PLINT");
05984   if(!lua_isnumber(L,5)) SWIG_fail_arg("plhist",5,"PLINT");
05985   {
05986     int temp;
05987     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
05988     if ( !arg2 )
05989     SWIG_fail;
05990     arg1 = Alen = temp;
05991   }
05992   arg3 = (PLFLT)lua_tonumber(L, 2);
05993   arg4 = (PLFLT)lua_tonumber(L, 3);
05994   arg5 = (PLINT)lua_tonumber(L, 4);
05995   arg6 = (PLINT)lua_tonumber(L, 5);
05996   plhist(arg1,(double const *)arg2,arg3,arg4,arg5,arg6);
05997   
05998   {
05999     LUA_FREE_ARRAY( arg2 );
06000   }
06001   return SWIG_arg;
06002   
06003   if(0) SWIG_fail;
06004   
06005 fail:
06006   {
06007     LUA_FREE_ARRAY( arg2 );
06008   }
06009   lua_error(L);
06010   return SWIG_arg;
06011 }
06012 
06013 
06014 static int _wrap_hlsrgb(lua_State* L) {
06015   int SWIG_arg = 0;
06016   PLFLT arg1 ;
06017   PLFLT arg2 ;
06018   PLFLT arg3 ;
06019   PLFLT *arg4 = (PLFLT *) 0 ;
06020   PLFLT *arg5 = (PLFLT *) 0 ;
06021   PLFLT *arg6 = (PLFLT *) 0 ;
06022   PLFLT temp4 ;
06023   PLFLT temp5 ;
06024   PLFLT temp6 ;
06025   
06026   arg4 = &temp4; 
06027   arg5 = &temp5; 
06028   arg6 = &temp6; 
06029   SWIG_check_num_args("plhlsrgb",3,3)
06030   if(!lua_isnumber(L,1)) SWIG_fail_arg("plhlsrgb",1,"PLFLT");
06031   if(!lua_isnumber(L,2)) SWIG_fail_arg("plhlsrgb",2,"PLFLT");
06032   if(!lua_isnumber(L,3)) SWIG_fail_arg("plhlsrgb",3,"PLFLT");
06033   arg1 = (PLFLT)lua_tonumber(L, 1);
06034   arg2 = (PLFLT)lua_tonumber(L, 2);
06035   arg3 = (PLFLT)lua_tonumber(L, 3);
06036   plhlsrgb(arg1,arg2,arg3,arg4,arg5,arg6);
06037   
06038   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
06039   lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
06040   lua_pushnumber(L, (lua_Number) *arg6); SWIG_arg++;
06041   return SWIG_arg;
06042   
06043   if(0) SWIG_fail;
06044   
06045 fail:
06046   lua_error(L);
06047   return SWIG_arg;
06048 }
06049 
06050 
06051 static int _wrap_init(lua_State* L) {
06052   int SWIG_arg = 0;
06053   
06054   SWIG_check_num_args("plinit",0,0)
06055   plinit();
06056   
06057   return SWIG_arg;
06058   
06059   if(0) SWIG_fail;
06060   
06061 fail:
06062   lua_error(L);
06063   return SWIG_arg;
06064 }
06065 
06066 
06067 static int _wrap_join(lua_State* L) {
06068   int SWIG_arg = 0;
06069   PLFLT arg1 ;
06070   PLFLT arg2 ;
06071   PLFLT arg3 ;
06072   PLFLT arg4 ;
06073   
06074   SWIG_check_num_args("pljoin",4,4)
06075   if(!lua_isnumber(L,1)) SWIG_fail_arg("pljoin",1,"PLFLT");
06076   if(!lua_isnumber(L,2)) SWIG_fail_arg("pljoin",2,"PLFLT");
06077   if(!lua_isnumber(L,3)) SWIG_fail_arg("pljoin",3,"PLFLT");
06078   if(!lua_isnumber(L,4)) SWIG_fail_arg("pljoin",4,"PLFLT");
06079   arg1 = (PLFLT)lua_tonumber(L, 1);
06080   arg2 = (PLFLT)lua_tonumber(L, 2);
06081   arg3 = (PLFLT)lua_tonumber(L, 3);
06082   arg4 = (PLFLT)lua_tonumber(L, 4);
06083   pljoin(arg1,arg2,arg3,arg4);
06084   
06085   return SWIG_arg;
06086   
06087   if(0) SWIG_fail;
06088   
06089 fail:
06090   lua_error(L);
06091   return SWIG_arg;
06092 }
06093 
06094 
06095 static int _wrap_lab(lua_State* L) {
06096   int SWIG_arg = 0;
06097   char *arg1 = (char *) 0 ;
06098   char *arg2 = (char *) 0 ;
06099   char *arg3 = (char *) 0 ;
06100   
06101   SWIG_check_num_args("pllab",3,3)
06102   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("pllab",1,"char const *");
06103   if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("pllab",2,"char const *");
06104   if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("pllab",3,"char const *");
06105   arg1 = (char *)lua_tostring(L, 1);
06106   arg2 = (char *)lua_tostring(L, 2);
06107   arg3 = (char *)lua_tostring(L, 3);
06108   pllab((char const *)arg1,(char const *)arg2,(char const *)arg3);
06109   
06110   return SWIG_arg;
06111   
06112   if(0) SWIG_fail;
06113   
06114 fail:
06115   lua_error(L);
06116   return SWIG_arg;
06117 }
06118 
06119 
06120 static int _wrap_legend(lua_State* L) {
06121   int SWIG_arg = 0;
06122   PLFLT *arg1 = (PLFLT *) 0 ;
06123   PLFLT *arg2 = (PLFLT *) 0 ;
06124   PLINT arg3 ;
06125   PLINT arg4 ;
06126   PLFLT arg5 ;
06127   PLFLT arg6 ;
06128   PLFLT arg7 ;
06129   PLINT arg8 ;
06130   PLINT arg9 ;
06131   PLINT arg10 ;
06132   PLINT arg11 ;
06133   PLINT arg12 ;
06134   PLINT arg13 ;
06135   PLINT *arg14 = (PLINT *) 0 ;
06136   PLFLT arg15 ;
06137   PLFLT arg16 ;
06138   PLFLT arg17 ;
06139   PLFLT arg18 ;
06140   PLINT *arg19 = (PLINT *) 0 ;
06141   char **arg20 = (char **) 0 ;
06142   PLINT *arg21 = (PLINT *) 0 ;
06143   PLINT *arg22 = (PLINT *) 0 ;
06144   PLFLT *arg23 = (PLFLT *) 0 ;
06145   PLFLT *arg24 = (PLFLT *) 0 ;
06146   PLINT *arg25 = (PLINT *) 0 ;
06147   PLINT *arg26 = (PLINT *) 0 ;
06148   PLFLT *arg27 = (PLFLT *) 0 ;
06149   PLINT *arg28 = (PLINT *) 0 ;
06150   PLFLT *arg29 = (PLFLT *) 0 ;
06151   PLINT *arg30 = (PLINT *) 0 ;
06152   char **arg31 = (char **) 0 ;
06153   PLFLT temp1 ;
06154   PLFLT temp2 ;
06155   int temp19 ;
06156   int temp21 ;
06157   int temp22 ;
06158   int temp23 ;
06159   int temp24 ;
06160   int temp25 ;
06161   int temp26 ;
06162   int temp27 ;
06163   int temp28 ;
06164   int temp29 ;
06165   int temp30 ;
06166   
06167   {
06168     arg21 = NULL; 
06169   }
06170   {
06171     arg22 = NULL; 
06172   }
06173   {
06174     arg23 = NULL; 
06175   }
06176   {
06177     arg24 = NULL; 
06178   }
06179   {
06180     arg25 = NULL; 
06181   }
06182   {
06183     arg26 = NULL; 
06184   }
06185   {
06186     arg27 = NULL; 
06187   }
06188   {
06189     arg28 = NULL; 
06190   }
06191   {
06192     arg29 = NULL; 
06193   }
06194   {
06195     arg30 = NULL; 
06196   }
06197   arg1 = &temp1; 
06198   arg2 = &temp2; 
06199   SWIG_check_num_args("pllegend",17,28)
06200   if(!lua_isnumber(L,1)) SWIG_fail_arg("pllegend",1,"PLINT");
06201   if(!lua_isnumber(L,2)) SWIG_fail_arg("pllegend",2,"PLINT");
06202   if(!lua_isnumber(L,3)) SWIG_fail_arg("pllegend",3,"PLFLT");
06203   if(!lua_isnumber(L,4)) SWIG_fail_arg("pllegend",4,"PLFLT");
06204   if(!lua_isnumber(L,5)) SWIG_fail_arg("pllegend",5,"PLFLT");
06205   if(!lua_isnumber(L,6)) SWIG_fail_arg("pllegend",6,"PLINT");
06206   if(!lua_isnumber(L,7)) SWIG_fail_arg("pllegend",7,"PLINT");
06207   if(!lua_isnumber(L,8)) SWIG_fail_arg("pllegend",8,"PLINT");
06208   if(!lua_isnumber(L,9)) SWIG_fail_arg("pllegend",9,"PLINT");
06209   if(!lua_isnumber(L,10)) SWIG_fail_arg("pllegend",10,"PLINT");
06210   if(!lua_isnumber(L,12)) SWIG_fail_arg("pllegend",12,"PLFLT");
06211   if(!lua_isnumber(L,13)) SWIG_fail_arg("pllegend",13,"PLFLT");
06212   if(!lua_isnumber(L,14)) SWIG_fail_arg("pllegend",14,"PLFLT");
06213   if(!lua_isnumber(L,15)) SWIG_fail_arg("pllegend",15,"PLFLT");
06214   if(!lua_istable(L,17)) SWIG_fail_arg("pllegend",17,"char const **");
06215   if(lua_gettop(L)>=28 && !lua_istable(L,28)) SWIG_fail_arg("pllegend",28,"char const **");
06216   arg3 = (PLINT)lua_tonumber(L, 1);
06217   arg4 = (PLINT)lua_tonumber(L, 2);
06218   arg5 = (PLFLT)lua_tonumber(L, 3);
06219   arg6 = (PLFLT)lua_tonumber(L, 4);
06220   arg7 = (PLFLT)lua_tonumber(L, 5);
06221   arg8 = (PLINT)lua_tonumber(L, 6);
06222   arg9 = (PLINT)lua_tonumber(L, 7);
06223   arg10 = (PLINT)lua_tonumber(L, 8);
06224   arg11 = (PLINT)lua_tonumber(L, 9);
06225   arg12 = (PLINT)lua_tonumber(L, 10);
06226   {
06227     arg14 = (PLINT *) LUA_get_int_num_array_var( L, 11, &arg13 );
06228     if ( !arg14 )
06229     SWIG_fail;
06230     Alen = arg13;
06231   }
06232   arg15 = (PLFLT)lua_tonumber(L, 12);
06233   arg16 = (PLFLT)lua_tonumber(L, 13);
06234   arg17 = (PLFLT)lua_tonumber(L, 14);
06235   arg18 = (PLFLT)lua_tonumber(L, 15);
06236   {
06237     arg19 = (PLINT *) LUA_get_int_num_array_var( L, 16, &temp19 );
06238     if ( !arg19 )
06239     SWIG_fail;
06240     if ( temp19 != Alen )
06241     {
06242       lua_pushfstring( L, "Tables must be of same length." );
06243       SWIG_fail;
06244     }
06245   }
06246   {
06247     int i;
06248     arg20 = NULL;
06249     
06250     if ( SWIG_table_size( L, 17 ) != Alen )
06251     {
06252       lua_pushfstring( L, "Tables must be of same length." );
06253       SWIG_fail;
06254     }
06255     arg20 = malloc( sizeof ( char* ) * Alen );
06256     for ( i = 1; i <= Alen; i++ )
06257     {
06258       lua_rawgeti( L, 17, i );
06259       if ( lua_isstring( L, -1 ) )
06260       {
06261         arg20[i - 1] = (char *) lua_tostring( L, -1 );
06262       }
06263       else
06264       {
06265         lua_pop( L, 1 );
06266         lua_pushfstring( L, "Requires a sequence of strings." );
06267         SWIG_fail;
06268         // arg20 array is freed after 'fail:'
06269       }
06270       lua_pop( L, 1 );
06271     }
06272   }
06273   if(lua_gettop(L)>=18){
06274     {
06275       if ( lua_isnil( L, 18 ) )
06276       {
06277         arg21 = NULL;
06278       }
06279       else
06280       {
06281         arg21 = (PLINT *) LUA_get_int_num_array_var( L, 18, &temp21 );
06282         if ( !arg21 )
06283         SWIG_fail;
06284         if ( temp21 != Alen )
06285         {
06286           lua_pushfstring( L, "Tables must be of same length." );
06287           SWIG_fail;
06288         }
06289       }
06290     }
06291   }
06292   if(lua_gettop(L)>=19){
06293     {
06294       if ( lua_isnil( L, 19 ) )
06295       {
06296         arg22 = NULL;
06297       }
06298       else
06299       {
06300         arg22 = (PLINT *) LUA_get_int_num_array_var( L, 19, &temp22 );
06301         if ( !arg22 )
06302         SWIG_fail;
06303         if ( temp22 != Alen )
06304         {
06305           lua_pushfstring( L, "Tables must be of same length." );
06306           SWIG_fail;
06307         }
06308       }
06309     }
06310   }
06311   if(lua_gettop(L)>=20){
06312     {
06313       if ( lua_isnil( L, 20 ) )
06314       {
06315         arg23 = NULL;
06316       }
06317       else
06318       {
06319         arg23 = (PLFLT *) LUA_get_double_num_array_var( L, 20, &temp23 );
06320         if ( !arg23 )
06321         SWIG_fail;
06322         if ( temp23 != Alen )
06323         {
06324           lua_pushfstring( L, "Tables must be of same length." );
06325           SWIG_fail;
06326         }
06327       }
06328     }
06329   }
06330   if(lua_gettop(L)>=21){
06331     {
06332       if ( lua_isnil( L, 21 ) )
06333       {
06334         arg24 = NULL;
06335       }
06336       else
06337       {
06338         arg24 = (PLFLT *) LUA_get_double_num_array_var( L, 21, &temp24 );
06339         if ( !arg24 )
06340         SWIG_fail;
06341         if ( temp24 != Alen )
06342         {
06343           lua_pushfstring( L, "Tables must be of same length." );
06344           SWIG_fail;
06345         }
06346       }
06347     }
06348   }
06349   if(lua_gettop(L)>=22){
06350     {
06351       if ( lua_isnil( L, 22 ) )
06352       {
06353         arg25 = NULL;
06354       }
06355       else
06356       {
06357         arg25 = (PLINT *) LUA_get_int_num_array_var( L, 22, &temp25 );
06358         if ( !arg25 )
06359         SWIG_fail;
06360         if ( temp25 != Alen )
06361         {
06362           lua_pushfstring( L, "Tables must be of same length." );
06363           SWIG_fail;
06364         }
06365       }
06366     }
06367   }
06368   if(lua_gettop(L)>=23){
06369     {
06370       if ( lua_isnil( L, 23 ) )
06371       {
06372         arg26 = NULL;
06373       }
06374       else
06375       {
06376         arg26 = (PLINT *) LUA_get_int_num_array_var( L, 23, &temp26 );
06377         if ( !arg26 )
06378         SWIG_fail;
06379         if ( temp26 != Alen )
06380         {
06381           lua_pushfstring( L, "Tables must be of same length." );
06382           SWIG_fail;
06383         }
06384       }
06385     }
06386   }
06387   if(lua_gettop(L)>=24){
06388     {
06389       if ( lua_isnil( L, 24 ) )
06390       {
06391         arg27 = NULL;
06392       }
06393       else
06394       {
06395         arg27 = (PLFLT *) LUA_get_double_num_array_var( L, 24, &temp27 );
06396         if ( !arg27 )
06397         SWIG_fail;
06398         if ( temp27 != Alen )
06399         {
06400           lua_pushfstring( L, "Tables must be of same length." );
06401           SWIG_fail;
06402         }
06403       }
06404     }
06405   }
06406   if(lua_gettop(L)>=25){
06407     {
06408       if ( lua_isnil( L, 25 ) )
06409       {
06410         arg28 = NULL;
06411       }
06412       else
06413       {
06414         arg28 = (PLINT *) LUA_get_int_num_array_var( L, 25, &temp28 );
06415         if ( !arg28 )
06416         SWIG_fail;
06417         if ( temp28 != Alen )
06418         {
06419           lua_pushfstring( L, "Tables must be of same length." );
06420           SWIG_fail;
06421         }
06422       }
06423     }
06424   }
06425   if(lua_gettop(L)>=26){
06426     {
06427       if ( lua_isnil( L, 26 ) )
06428       {
06429         arg29 = NULL;
06430       }
06431       else
06432       {
06433         arg29 = (PLFLT *) LUA_get_double_num_array_var( L, 26, &temp29 );
06434         if ( !arg29 )
06435         SWIG_fail;
06436         if ( temp29 != Alen )
06437         {
06438           lua_pushfstring( L, "Tables must be of same length." );
06439           SWIG_fail;
06440         }
06441       }
06442     }
06443   }
06444   if(lua_gettop(L)>=27){
06445     {
06446       if ( lua_isnil( L, 27 ) )
06447       {
06448         arg30 = NULL;
06449       }
06450       else
06451       {
06452         arg30 = (PLINT *) LUA_get_int_num_array_var( L, 27, &temp30 );
06453         if ( !arg30 )
06454         SWIG_fail;
06455         if ( temp30 != Alen )
06456         {
06457           lua_pushfstring( L, "Tables must be of same length." );
06458           SWIG_fail;
06459         }
06460       }
06461     }
06462   }
06463   if(lua_gettop(L)>=28){
06464     {
06465       int i;
06466       arg31 = NULL;
06467       
06468       if ( SWIG_table_size( L, 28 ) != Alen )
06469       {
06470         lua_pushfstring( L, "Tables must be of same length." );
06471         SWIG_fail;
06472       }
06473       arg31 = malloc( sizeof ( char* ) * Alen );
06474       for ( i = 1; i <= Alen; i++ )
06475       {
06476         lua_rawgeti( L, 28, i );
06477         if ( lua_isstring( L, -1 ) )
06478         {
06479           arg31[i - 1] = (char *) lua_tostring( L, -1 );
06480         }
06481         else
06482         {
06483           lua_pop( L, 1 );
06484           lua_pushfstring( L, "Requires a sequence of strings." );
06485           SWIG_fail;
06486           // arg31 array is freed after 'fail:'
06487         }
06488         lua_pop( L, 1 );
06489       }
06490     }
06491   }
06492   pllegend(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,(int const *)arg14,arg15,arg16,arg17,arg18,(int const *)arg19,(char const **)arg20,(int const *)arg21,(int const *)arg22,(double const *)arg23,(double const *)arg24,(int const *)arg25,(int const *)arg26,(double const *)arg27,(int const *)arg28,(double const *)arg29,(int const *)arg30,(char const **)arg31);
06493   
06494   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
06495   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
06496   {
06497     LUA_FREE_ARRAY( arg14 );
06498   }
06499   {
06500     LUA_FREE_ARRAY( arg19 ); 
06501   }
06502   {
06503     if ( arg20 )
06504     {
06505       free( arg20 ); arg20 = NULL;
06506     }
06507   }
06508   {
06509     LUA_FREE_ARRAY( arg21 ); 
06510   }
06511   {
06512     LUA_FREE_ARRAY( arg22 ); 
06513   }
06514   {
06515     LUA_FREE_ARRAY( arg23 ); 
06516   }
06517   {
06518     LUA_FREE_ARRAY( arg24 ); 
06519   }
06520   {
06521     LUA_FREE_ARRAY( arg25 ); 
06522   }
06523   {
06524     LUA_FREE_ARRAY( arg26 ); 
06525   }
06526   {
06527     LUA_FREE_ARRAY( arg27 ); 
06528   }
06529   {
06530     LUA_FREE_ARRAY( arg28 ); 
06531   }
06532   {
06533     LUA_FREE_ARRAY( arg29 ); 
06534   }
06535   {
06536     LUA_FREE_ARRAY( arg30 ); 
06537   }
06538   {
06539     if ( arg31 )
06540     {
06541       free( arg31 ); arg31 = NULL;
06542     }
06543   }
06544   return SWIG_arg;
06545   
06546   if(0) SWIG_fail;
06547   
06548 fail:
06549   {
06550     LUA_FREE_ARRAY( arg14 );
06551   }
06552   {
06553     LUA_FREE_ARRAY( arg19 ); 
06554   }
06555   {
06556     if ( arg20 )
06557     {
06558       free( arg20 ); arg20 = NULL;
06559     }
06560   }
06561   {
06562     LUA_FREE_ARRAY( arg21 ); 
06563   }
06564   {
06565     LUA_FREE_ARRAY( arg22 ); 
06566   }
06567   {
06568     LUA_FREE_ARRAY( arg23 ); 
06569   }
06570   {
06571     LUA_FREE_ARRAY( arg24 ); 
06572   }
06573   {
06574     LUA_FREE_ARRAY( arg25 ); 
06575   }
06576   {
06577     LUA_FREE_ARRAY( arg26 ); 
06578   }
06579   {
06580     LUA_FREE_ARRAY( arg27 ); 
06581   }
06582   {
06583     LUA_FREE_ARRAY( arg28 ); 
06584   }
06585   {
06586     LUA_FREE_ARRAY( arg29 ); 
06587   }
06588   {
06589     LUA_FREE_ARRAY( arg30 ); 
06590   }
06591   {
06592     if ( arg31 )
06593     {
06594       free( arg31 ); arg31 = NULL;
06595     }
06596   }
06597   lua_error(L);
06598   return SWIG_arg;
06599 }
06600 
06601 
06602 static int _wrap_colorbar(lua_State* L) {
06603   int SWIG_arg = 0;
06604   PLFLT *arg1 = (PLFLT *) 0 ;
06605   PLFLT *arg2 = (PLFLT *) 0 ;
06606   PLINT arg3 ;
06607   PLINT arg4 ;
06608   PLFLT arg5 ;
06609   PLFLT arg6 ;
06610   PLFLT arg7 ;
06611   PLFLT arg8 ;
06612   PLINT arg9 ;
06613   PLINT arg10 ;
06614   PLINT arg11 ;
06615   PLFLT arg12 ;
06616   PLFLT arg13 ;
06617   PLINT arg14 ;
06618   PLFLT arg15 ;
06619   PLINT arg16 ;
06620   PLINT *arg17 = (PLINT *) 0 ;
06621   char **arg18 = (char **) 0 ;
06622   PLINT arg19 ;
06623   char **arg20 = (char **) 0 ;
06624   PLFLT *arg21 = (PLFLT *) 0 ;
06625   PLINT *arg22 = (PLINT *) 0 ;
06626   PLINT *arg23 = (PLINT *) 0 ;
06627   PLFLT **arg24 = (PLFLT **) 0 ;
06628   PLFLT temp1 ;
06629   PLFLT temp2 ;
06630   int temp21 ;
06631   int temp22 ;
06632   int temp23 ;
06633   int ii24 ;
06634   
06635   arg1 = &temp1; 
06636   arg2 = &temp2; 
06637   SWIG_check_num_args("plcolorbar",20,20)
06638   if(!lua_isnumber(L,1)) SWIG_fail_arg("plcolorbar",1,"PLINT");
06639   if(!lua_isnumber(L,2)) SWIG_fail_arg("plcolorbar",2,"PLINT");
06640   if(!lua_isnumber(L,3)) SWIG_fail_arg("plcolorbar",3,"PLFLT");
06641   if(!lua_isnumber(L,4)) SWIG_fail_arg("plcolorbar",4,"PLFLT");
06642   if(!lua_isnumber(L,5)) SWIG_fail_arg("plcolorbar",5,"PLFLT");
06643   if(!lua_isnumber(L,6)) SWIG_fail_arg("plcolorbar",6,"PLFLT");
06644   if(!lua_isnumber(L,7)) SWIG_fail_arg("plcolorbar",7,"PLINT");
06645   if(!lua_isnumber(L,8)) SWIG_fail_arg("plcolorbar",8,"PLINT");
06646   if(!lua_isnumber(L,9)) SWIG_fail_arg("plcolorbar",9,"PLINT");
06647   if(!lua_isnumber(L,10)) SWIG_fail_arg("plcolorbar",10,"PLFLT");
06648   if(!lua_isnumber(L,11)) SWIG_fail_arg("plcolorbar",11,"PLFLT");
06649   if(!lua_isnumber(L,12)) SWIG_fail_arg("plcolorbar",12,"PLINT");
06650   if(!lua_isnumber(L,13)) SWIG_fail_arg("plcolorbar",13,"PLFLT");
06651   if(!lua_istable(L,15)) SWIG_fail_arg("plcolorbar",15,"char const **");
06652   arg3 = (PLINT)lua_tonumber(L, 1);
06653   arg4 = (PLINT)lua_tonumber(L, 2);
06654   arg5 = (PLFLT)lua_tonumber(L, 3);
06655   arg6 = (PLFLT)lua_tonumber(L, 4);
06656   arg7 = (PLFLT)lua_tonumber(L, 5);
06657   arg8 = (PLFLT)lua_tonumber(L, 6);
06658   arg9 = (PLINT)lua_tonumber(L, 7);
06659   arg10 = (PLINT)lua_tonumber(L, 8);
06660   arg11 = (PLINT)lua_tonumber(L, 9);
06661   arg12 = (PLFLT)lua_tonumber(L, 10);
06662   arg13 = (PLFLT)lua_tonumber(L, 11);
06663   arg14 = (PLINT)lua_tonumber(L, 12);
06664   arg15 = (PLFLT)lua_tonumber(L, 13);
06665   {
06666     arg17 = (PLINT *) LUA_get_int_num_array_var( L, 14, &arg16 );
06667     if ( !arg17 )
06668     SWIG_fail;
06669     Alen = arg16;
06670   }
06671   {
06672     int i;
06673     arg18 = NULL;
06674     
06675     if ( SWIG_table_size( L, 15 ) != Alen )
06676     {
06677       lua_pushfstring( L, "Tables must be of same length." );
06678       SWIG_fail;
06679     }
06680     arg18 = malloc( sizeof ( char* ) * Alen );
06681     for ( i = 1; i <= Alen; i++ )
06682     {
06683       lua_rawgeti( L, 15, i );
06684       if ( lua_isstring( L, -1 ) )
06685       {
06686         arg18[i - 1] = (char *) lua_tostring( L, -1 );
06687       }
06688       else
06689       {
06690         lua_pop( L, 1 );
06691         lua_pushfstring( L, "Requires a sequence of strings." );
06692         SWIG_fail;
06693         // arg18 array is freed after 'fail:'
06694       }
06695       lua_pop( L, 1 );
06696     }
06697   }
06698   {
06699     int i;
06700     arg19   = SWIG_table_size( L, 16 );
06701     Alen = arg19;
06702     
06703     arg20 = malloc( sizeof ( char* ) * Alen );
06704     for ( i = 1; i <= Alen; i++ )
06705     {
06706       lua_rawgeti( L, 16, i );
06707       if ( lua_isstring( L, -1 ) )
06708       {
06709         arg20[i - 1] = (char *) lua_tostring( L, -1 );
06710       }
06711       else
06712       {
06713         lua_pop( L, 1 );
06714         lua_pushfstring( L, "Requires a sequence of strings." );
06715         SWIG_fail;
06716       }
06717       lua_pop( L, 1 );
06718     }
06719   }
06720   {
06721     arg21 = (PLFLT *) LUA_get_double_num_array_var( L, 17, &temp21 );
06722     if ( !arg21 )
06723     SWIG_fail;
06724     if ( temp21 != Alen )
06725     {
06726       lua_pushfstring( L, "Tables must be of same length." );
06727       SWIG_fail;
06728     }
06729   }
06730   {
06731     arg22 = (PLINT *) LUA_get_int_num_array_var( L, 18, &temp22 );
06732     if ( !arg22 )
06733     SWIG_fail;
06734     if ( temp22 != Alen )
06735     {
06736       lua_pushfstring( L, "Tables must be of same length." );
06737       SWIG_fail;
06738     }
06739   }
06740   {
06741     int i;
06742     
06743     arg23 = (PLINT *) LUA_get_int_num_array_var( L, 19, &temp23 );
06744     if ( !arg23 )
06745     SWIG_fail;
06746     if ( temp23 != Alen )
06747     {
06748       lua_pushfstring( L, "Tables must be of same length." );
06749       SWIG_fail;
06750     }
06751     
06752     Xlen = temp23;
06753     Ylen = -1;
06754     for ( i = 0; i < Xlen; i++ )
06755     if ( arg23[i] > Ylen )
06756     Ylen = arg23[i];
06757   }
06758   {
06759     int jj;
06760     
06761     arg24 = read_double_Matrix( L, 20, &ii24, &jj );
06762     if ( !arg24 )
06763     SWIG_fail;
06764     if ( ( ii24 != Xlen ) || ( jj != Ylen ) )
06765     {
06766       lua_pushfstring( L, "Vectors must match matrix." );
06767       SWIG_fail;
06768     }
06769   }
06770   plcolorbar(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,(int const *)arg17,(char const **)arg18,arg19,(char const **)arg20,(double const *)arg21,(int const *)arg22,(int const *)arg23,(double const **)arg24);
06771   
06772   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
06773   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
06774   {
06775     LUA_FREE_ARRAY( arg17 );
06776   }
06777   {
06778     if ( arg18 )
06779     {
06780       free( arg18 ); arg18 = NULL;
06781     }
06782   }
06783   {
06784     if ( arg20 )
06785     {
06786       free( arg20 ); arg20 = NULL;
06787     }
06788   }
06789   {
06790     LUA_FREE_ARRAY( arg21 ); 
06791   }
06792   {
06793     LUA_FREE_ARRAY( arg22 ); 
06794   }
06795   {
06796     LUA_FREE_ARRAY( arg23 );
06797   }
06798   {
06799     int i;
06800     
06801     if ( arg24 )
06802     {
06803       for ( i = 0; i < ii24; i++ )
06804       LUA_FREE_ARRAY( arg24[i] );
06805       LUA_FREE_ARRAY( arg24 );
06806     }
06807   }
06808   return SWIG_arg;
06809   
06810   if(0) SWIG_fail;
06811   
06812 fail:
06813   {
06814     LUA_FREE_ARRAY( arg17 );
06815   }
06816   {
06817     if ( arg18 )
06818     {
06819       free( arg18 ); arg18 = NULL;
06820     }
06821   }
06822   {
06823     if ( arg20 )
06824     {
06825       free( arg20 ); arg20 = NULL;
06826     }
06827   }
06828   {
06829     LUA_FREE_ARRAY( arg21 ); 
06830   }
06831   {
06832     LUA_FREE_ARRAY( arg22 ); 
06833   }
06834   {
06835     LUA_FREE_ARRAY( arg23 );
06836   }
06837   {
06838     int i;
06839     
06840     if ( arg24 )
06841     {
06842       for ( i = 0; i < ii24; i++ )
06843       LUA_FREE_ARRAY( arg24[i] );
06844       LUA_FREE_ARRAY( arg24 );
06845     }
06846   }
06847   lua_error(L);
06848   return SWIG_arg;
06849 }
06850 
06851 
06852 static int _wrap_lightsource(lua_State* L) {
06853   int SWIG_arg = 0;
06854   PLFLT arg1 ;
06855   PLFLT arg2 ;
06856   PLFLT arg3 ;
06857   
06858   SWIG_check_num_args("pllightsource",3,3)
06859   if(!lua_isnumber(L,1)) SWIG_fail_arg("pllightsource",1,"PLFLT");
06860   if(!lua_isnumber(L,2)) SWIG_fail_arg("pllightsource",2,"PLFLT");
06861   if(!lua_isnumber(L,3)) SWIG_fail_arg("pllightsource",3,"PLFLT");
06862   arg1 = (PLFLT)lua_tonumber(L, 1);
06863   arg2 = (PLFLT)lua_tonumber(L, 2);
06864   arg3 = (PLFLT)lua_tonumber(L, 3);
06865   pllightsource(arg1,arg2,arg3);
06866   
06867   return SWIG_arg;
06868   
06869   if(0) SWIG_fail;
06870   
06871 fail:
06872   lua_error(L);
06873   return SWIG_arg;
06874 }
06875 
06876 
06877 static int _wrap_line(lua_State* L) {
06878   int SWIG_arg = 0;
06879   PLINT arg1 ;
06880   PLFLT *arg2 = (PLFLT *) 0 ;
06881   PLFLT *arg3 = (PLFLT *) 0 ;
06882   int temp3 ;
06883   
06884   SWIG_check_num_args("plline",2,2)
06885   {
06886     int temp;
06887     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
06888     if ( !arg2 )
06889     SWIG_fail;
06890     arg1 = Alen = temp;
06891   }
06892   {
06893     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
06894     if ( !arg3 )
06895     SWIG_fail;
06896     if ( temp3 != Alen )
06897     {
06898       lua_pushfstring( L, "Tables must be of same length." );
06899       SWIG_fail;
06900     }
06901   }
06902   plline(arg1,(double const *)arg2,(double const *)arg3);
06903   
06904   {
06905     LUA_FREE_ARRAY( arg2 );
06906   }
06907   {
06908     LUA_FREE_ARRAY( arg3 ); 
06909   }
06910   return SWIG_arg;
06911   
06912   if(0) SWIG_fail;
06913   
06914 fail:
06915   {
06916     LUA_FREE_ARRAY( arg2 );
06917   }
06918   {
06919     LUA_FREE_ARRAY( arg3 ); 
06920   }
06921   lua_error(L);
06922   return SWIG_arg;
06923 }
06924 
06925 
06926 static int _wrap_line3(lua_State* L) {
06927   int SWIG_arg = 0;
06928   PLINT arg1 ;
06929   PLFLT *arg2 = (PLFLT *) 0 ;
06930   PLFLT *arg3 = (PLFLT *) 0 ;
06931   PLFLT *arg4 = (PLFLT *) 0 ;
06932   int temp3 ;
06933   int temp4 ;
06934   
06935   SWIG_check_num_args("plline3",3,3)
06936   {
06937     int temp;
06938     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
06939     if ( !arg2 )
06940     SWIG_fail;
06941     arg1 = Alen = temp;
06942   }
06943   {
06944     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
06945     if ( !arg3 )
06946     SWIG_fail;
06947     if ( temp3 != Alen )
06948     {
06949       lua_pushfstring( L, "Tables must be of same length." );
06950       SWIG_fail;
06951     }
06952   }
06953   {
06954     arg4 = (PLFLT *) LUA_get_double_num_array_var( L, 3, &temp4 );
06955     if ( !arg4 )
06956     SWIG_fail;
06957     if ( temp4 != Alen )
06958     {
06959       lua_pushfstring( L, "Tables must be of same length." );
06960       SWIG_fail;
06961     }
06962   }
06963   plline3(arg1,(double const *)arg2,(double const *)arg3,(double const *)arg4);
06964   
06965   {
06966     LUA_FREE_ARRAY( arg2 );
06967   }
06968   {
06969     LUA_FREE_ARRAY( arg3 ); 
06970   }
06971   {
06972     LUA_FREE_ARRAY( arg4 ); 
06973   }
06974   return SWIG_arg;
06975   
06976   if(0) SWIG_fail;
06977   
06978 fail:
06979   {
06980     LUA_FREE_ARRAY( arg2 );
06981   }
06982   {
06983     LUA_FREE_ARRAY( arg3 ); 
06984   }
06985   {
06986     LUA_FREE_ARRAY( arg4 ); 
06987   }
06988   lua_error(L);
06989   return SWIG_arg;
06990 }
06991 
06992 
06993 static int _wrap_lsty(lua_State* L) {
06994   int SWIG_arg = 0;
06995   PLINT arg1 ;
06996   
06997   SWIG_check_num_args("pllsty",1,1)
06998   if(!lua_isnumber(L,1)) SWIG_fail_arg("pllsty",1,"PLINT");
06999   arg1 = (PLINT)lua_tonumber(L, 1);
07000   pllsty(arg1);
07001   
07002   return SWIG_arg;
07003   
07004   if(0) SWIG_fail;
07005   
07006 fail:
07007   lua_error(L);
07008   return SWIG_arg;
07009 }
07010 
07011 
07012 static int _wrap_mesh(lua_State* L) {
07013   int SWIG_arg = 0;
07014   PLFLT *arg1 = (PLFLT *) 0 ;
07015   PLFLT *arg2 = (PLFLT *) 0 ;
07016   PLFLT **arg3 = (PLFLT **) 0 ;
07017   PLINT arg4 ;
07018   PLINT arg5 ;
07019   PLINT arg6 ;
07020   int ii3 ;
07021   
07022   SWIG_check_num_args("plmesh",4,4)
07023   if(!lua_isnumber(L,4)) SWIG_fail_arg("plmesh",4,"PLINT");
07024   {
07025     int temp;
07026     arg1 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
07027     if ( !arg1 )
07028     SWIG_fail;
07029     Xlen = temp;
07030   }
07031   {
07032     int temp;
07033     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp );
07034     if ( !arg2 )
07035     SWIG_fail;
07036     Ylen = temp;
07037   }
07038   {
07039     int jj;
07040     
07041     arg3 = read_double_Matrix( L, 3, &ii3, &jj );
07042     if ( !arg3 )
07043     SWIG_fail;
07044     arg4 = ii3;
07045     arg5 = jj;
07046     if ( ( arg4 != Xlen ) || ( arg5 != Ylen ) )
07047     {
07048       lua_pushfstring( L, "Vectors must match matrix." );
07049       SWIG_fail;
07050     }
07051   }
07052   arg6 = (PLINT)lua_tonumber(L, 4);
07053   plmesh((double const *)arg1,(double const *)arg2,(double const **)arg3,arg4,arg5,arg6);
07054   
07055   {
07056     LUA_FREE_ARRAY( arg1 ); 
07057   }
07058   {
07059     LUA_FREE_ARRAY( arg2 );
07060   }
07061   {
07062     int i;
07063     
07064     if ( arg3 )
07065     {
07066       for ( i = 0; i < ii3; i++ )
07067       LUA_FREE_ARRAY( arg3[i] );
07068       LUA_FREE_ARRAY( arg3 );
07069     }
07070   }
07071   return SWIG_arg;
07072   
07073   if(0) SWIG_fail;
07074   
07075 fail:
07076   {
07077     LUA_FREE_ARRAY( arg1 ); 
07078   }
07079   {
07080     LUA_FREE_ARRAY( arg2 );
07081   }
07082   {
07083     int i;
07084     
07085     if ( arg3 )
07086     {
07087       for ( i = 0; i < ii3; i++ )
07088       LUA_FREE_ARRAY( arg3[i] );
07089       LUA_FREE_ARRAY( arg3 );
07090     }
07091   }
07092   lua_error(L);
07093   return SWIG_arg;
07094 }
07095 
07096 
07097 static int _wrap_meshc(lua_State* L) {
07098   int SWIG_arg = 0;
07099   PLFLT *arg1 = (PLFLT *) 0 ;
07100   PLFLT *arg2 = (PLFLT *) 0 ;
07101   PLFLT **arg3 = (PLFLT **) 0 ;
07102   PLINT arg4 ;
07103   PLINT arg5 ;
07104   PLINT arg6 ;
07105   PLFLT *arg7 = (PLFLT *) 0 ;
07106   PLINT arg8 ;
07107   int ii3 ;
07108   
07109   SWIG_check_num_args("plmeshc",5,5)
07110   if(!lua_isnumber(L,4)) SWIG_fail_arg("plmeshc",4,"PLINT");
07111   {
07112     int temp;
07113     arg1 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
07114     if ( !arg1 )
07115     SWIG_fail;
07116     Xlen = temp;
07117   }
07118   {
07119     int temp;
07120     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp );
07121     if ( !arg2 )
07122     SWIG_fail;
07123     Ylen = temp;
07124   }
07125   {
07126     int jj;
07127     
07128     arg3 = read_double_Matrix( L, 3, &ii3, &jj );
07129     if ( !arg3 )
07130     SWIG_fail;
07131     arg4 = ii3;
07132     arg5 = jj;
07133     if ( ( arg4 != Xlen ) || ( arg5 != Ylen ) )
07134     {
07135       lua_pushfstring( L, "Vectors must match matrix." );
07136       SWIG_fail;
07137     }
07138   }
07139   arg6 = (PLINT)lua_tonumber(L, 4);
07140   {
07141     int temp;
07142     arg7 = (PLFLT *) LUA_get_double_num_array_var( L, 5, &temp );
07143     if ( !arg7 )
07144     SWIG_fail;
07145     arg8 = Alen = temp;
07146   }
07147   plmeshc((double const *)arg1,(double const *)arg2,(double const **)arg3,arg4,arg5,arg6,(double const *)arg7,arg8);
07148   
07149   {
07150     LUA_FREE_ARRAY( arg1 ); 
07151   }
07152   {
07153     LUA_FREE_ARRAY( arg2 );
07154   }
07155   {
07156     int i;
07157     
07158     if ( arg3 )
07159     {
07160       for ( i = 0; i < ii3; i++ )
07161       LUA_FREE_ARRAY( arg3[i] );
07162       LUA_FREE_ARRAY( arg3 );
07163     }
07164   }
07165   {
07166     LUA_FREE_ARRAY( arg7 );
07167   }
07168   return SWIG_arg;
07169   
07170   if(0) SWIG_fail;
07171   
07172 fail:
07173   {
07174     LUA_FREE_ARRAY( arg1 ); 
07175   }
07176   {
07177     LUA_FREE_ARRAY( arg2 );
07178   }
07179   {
07180     int i;
07181     
07182     if ( arg3 )
07183     {
07184       for ( i = 0; i < ii3; i++ )
07185       LUA_FREE_ARRAY( arg3[i] );
07186       LUA_FREE_ARRAY( arg3 );
07187     }
07188   }
07189   {
07190     LUA_FREE_ARRAY( arg7 );
07191   }
07192   lua_error(L);
07193   return SWIG_arg;
07194 }
07195 
07196 
07197 static int _wrap_mkstrm(lua_State* L) {
07198   int SWIG_arg = 0;
07199   PLINT *arg1 = (PLINT *) 0 ;
07200   PLINT temp1 ;
07201   
07202   arg1 = &temp1; 
07203   SWIG_check_num_args("plmkstrm",0,0)
07204   plmkstrm(arg1);
07205   
07206   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
07207   return SWIG_arg;
07208   
07209   if(0) SWIG_fail;
07210   
07211 fail:
07212   lua_error(L);
07213   return SWIG_arg;
07214 }
07215 
07216 
07217 static int _wrap_mtex(lua_State* L) {
07218   int SWIG_arg = 0;
07219   char *arg1 = (char *) 0 ;
07220   PLFLT arg2 ;
07221   PLFLT arg3 ;
07222   PLFLT arg4 ;
07223   char *arg5 = (char *) 0 ;
07224   
07225   SWIG_check_num_args("plmtex",5,5)
07226   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plmtex",1,"char const *");
07227   if(!lua_isnumber(L,2)) SWIG_fail_arg("plmtex",2,"PLFLT");
07228   if(!lua_isnumber(L,3)) SWIG_fail_arg("plmtex",3,"PLFLT");
07229   if(!lua_isnumber(L,4)) SWIG_fail_arg("plmtex",4,"PLFLT");
07230   if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("plmtex",5,"char const *");
07231   arg1 = (char *)lua_tostring(L, 1);
07232   arg2 = (PLFLT)lua_tonumber(L, 2);
07233   arg3 = (PLFLT)lua_tonumber(L, 3);
07234   arg4 = (PLFLT)lua_tonumber(L, 4);
07235   arg5 = (char *)lua_tostring(L, 5);
07236   plmtex((char const *)arg1,arg2,arg3,arg4,(char const *)arg5);
07237   
07238   return SWIG_arg;
07239   
07240   if(0) SWIG_fail;
07241   
07242 fail:
07243   lua_error(L);
07244   return SWIG_arg;
07245 }
07246 
07247 
07248 static int _wrap_mtex3(lua_State* L) {
07249   int SWIG_arg = 0;
07250   char *arg1 = (char *) 0 ;
07251   PLFLT arg2 ;
07252   PLFLT arg3 ;
07253   PLFLT arg4 ;
07254   char *arg5 = (char *) 0 ;
07255   
07256   SWIG_check_num_args("plmtex3",5,5)
07257   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plmtex3",1,"char const *");
07258   if(!lua_isnumber(L,2)) SWIG_fail_arg("plmtex3",2,"PLFLT");
07259   if(!lua_isnumber(L,3)) SWIG_fail_arg("plmtex3",3,"PLFLT");
07260   if(!lua_isnumber(L,4)) SWIG_fail_arg("plmtex3",4,"PLFLT");
07261   if(!SWIG_lua_isnilstring(L,5)) SWIG_fail_arg("plmtex3",5,"char const *");
07262   arg1 = (char *)lua_tostring(L, 1);
07263   arg2 = (PLFLT)lua_tonumber(L, 2);
07264   arg3 = (PLFLT)lua_tonumber(L, 3);
07265   arg4 = (PLFLT)lua_tonumber(L, 4);
07266   arg5 = (char *)lua_tostring(L, 5);
07267   plmtex3((char const *)arg1,arg2,arg3,arg4,(char const *)arg5);
07268   
07269   return SWIG_arg;
07270   
07271   if(0) SWIG_fail;
07272   
07273 fail:
07274   lua_error(L);
07275   return SWIG_arg;
07276 }
07277 
07278 
07279 static int _wrap_plot3d(lua_State* L) {
07280   int SWIG_arg = 0;
07281   PLFLT *arg1 = (PLFLT *) 0 ;
07282   PLFLT *arg2 = (PLFLT *) 0 ;
07283   PLFLT **arg3 = (PLFLT **) 0 ;
07284   PLINT arg4 ;
07285   PLINT arg5 ;
07286   PLINT arg6 ;
07287   PLBOOL arg7 ;
07288   int ii3 ;
07289   
07290   SWIG_check_num_args("plot3d",5,5)
07291   if(!lua_isnumber(L,4)) SWIG_fail_arg("plot3d",4,"PLINT");
07292   if(!lua_isnumber(L,5)) SWIG_fail_arg("plot3d",5,"PLBOOL");
07293   {
07294     int temp;
07295     arg1 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
07296     if ( !arg1 )
07297     SWIG_fail;
07298     Xlen = temp;
07299   }
07300   {
07301     int temp;
07302     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp );
07303     if ( !arg2 )
07304     SWIG_fail;
07305     Ylen = temp;
07306   }
07307   {
07308     int jj;
07309     
07310     arg3 = read_double_Matrix( L, 3, &ii3, &jj );
07311     if ( !arg3 )
07312     SWIG_fail;
07313     arg4 = ii3;
07314     arg5 = jj;
07315     if ( ( arg4 != Xlen ) || ( arg5 != Ylen ) )
07316     {
07317       lua_pushfstring( L, "Vectors must match matrix." );
07318       SWIG_fail;
07319     }
07320   }
07321   arg6 = (PLINT)lua_tonumber(L, 4);
07322   arg7 = (PLBOOL)lua_tonumber(L, 5);
07323   plot3d((double const *)arg1,(double const *)arg2,(double const **)arg3,arg4,arg5,arg6,arg7);
07324   
07325   {
07326     LUA_FREE_ARRAY( arg1 ); 
07327   }
07328   {
07329     LUA_FREE_ARRAY( arg2 );
07330   }
07331   {
07332     int i;
07333     
07334     if ( arg3 )
07335     {
07336       for ( i = 0; i < ii3; i++ )
07337       LUA_FREE_ARRAY( arg3[i] );
07338       LUA_FREE_ARRAY( arg3 );
07339     }
07340   }
07341   return SWIG_arg;
07342   
07343   if(0) SWIG_fail;
07344   
07345 fail:
07346   {
07347     LUA_FREE_ARRAY( arg1 ); 
07348   }
07349   {
07350     LUA_FREE_ARRAY( arg2 );
07351   }
07352   {
07353     int i;
07354     
07355     if ( arg3 )
07356     {
07357       for ( i = 0; i < ii3; i++ )
07358       LUA_FREE_ARRAY( arg3[i] );
07359       LUA_FREE_ARRAY( arg3 );
07360     }
07361   }
07362   lua_error(L);
07363   return SWIG_arg;
07364 }
07365 
07366 
07367 static int _wrap_plot3dc(lua_State* L) {
07368   int SWIG_arg = 0;
07369   PLFLT *arg1 = (PLFLT *) 0 ;
07370   PLFLT *arg2 = (PLFLT *) 0 ;
07371   PLFLT **arg3 = (PLFLT **) 0 ;
07372   PLINT arg4 ;
07373   PLINT arg5 ;
07374   PLINT arg6 ;
07375   PLFLT *arg7 = (PLFLT *) 0 ;
07376   PLINT arg8 ;
07377   int ii3 ;
07378   
07379   SWIG_check_num_args("plot3dc",5,5)
07380   if(!lua_isnumber(L,4)) SWIG_fail_arg("plot3dc",4,"PLINT");
07381   {
07382     int temp;
07383     arg1 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
07384     if ( !arg1 )
07385     SWIG_fail;
07386     Xlen = temp;
07387   }
07388   {
07389     int temp;
07390     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp );
07391     if ( !arg2 )
07392     SWIG_fail;
07393     Ylen = temp;
07394   }
07395   {
07396     int jj;
07397     
07398     arg3 = read_double_Matrix( L, 3, &ii3, &jj );
07399     if ( !arg3 )
07400     SWIG_fail;
07401     arg4 = ii3;
07402     arg5 = jj;
07403     if ( ( arg4 != Xlen ) || ( arg5 != Ylen ) )
07404     {
07405       lua_pushfstring( L, "Vectors must match matrix." );
07406       SWIG_fail;
07407     }
07408   }
07409   arg6 = (PLINT)lua_tonumber(L, 4);
07410   {
07411     int temp;
07412     arg7 = (PLFLT *) LUA_get_double_num_array_var( L, 5, &temp );
07413     if ( !arg7 )
07414     SWIG_fail;
07415     arg8 = Alen = temp;
07416   }
07417   plot3dc((double const *)arg1,(double const *)arg2,(double const **)arg3,arg4,arg5,arg6,(double const *)arg7,arg8);
07418   
07419   {
07420     LUA_FREE_ARRAY( arg1 ); 
07421   }
07422   {
07423     LUA_FREE_ARRAY( arg2 );
07424   }
07425   {
07426     int i;
07427     
07428     if ( arg3 )
07429     {
07430       for ( i = 0; i < ii3; i++ )
07431       LUA_FREE_ARRAY( arg3[i] );
07432       LUA_FREE_ARRAY( arg3 );
07433     }
07434   }
07435   {
07436     LUA_FREE_ARRAY( arg7 );
07437   }
07438   return SWIG_arg;
07439   
07440   if(0) SWIG_fail;
07441   
07442 fail:
07443   {
07444     LUA_FREE_ARRAY( arg1 ); 
07445   }
07446   {
07447     LUA_FREE_ARRAY( arg2 );
07448   }
07449   {
07450     int i;
07451     
07452     if ( arg3 )
07453     {
07454       for ( i = 0; i < ii3; i++ )
07455       LUA_FREE_ARRAY( arg3[i] );
07456       LUA_FREE_ARRAY( arg3 );
07457     }
07458   }
07459   {
07460     LUA_FREE_ARRAY( arg7 );
07461   }
07462   lua_error(L);
07463   return SWIG_arg;
07464 }
07465 
07466 
07467 static int _wrap_plot3dcl(lua_State* L) {
07468   int SWIG_arg = 0;
07469   PLFLT *arg1 = (PLFLT *) 0 ;
07470   PLFLT *arg2 = (PLFLT *) 0 ;
07471   PLFLT **arg3 = (PLFLT **) 0 ;
07472   PLINT arg4 ;
07473   PLINT arg5 ;
07474   PLINT arg6 ;
07475   PLFLT *arg7 = (PLFLT *) 0 ;
07476   PLINT arg8 ;
07477   PLINT arg9 ;
07478   PLINT arg10 ;
07479   PLINT *arg11 = (PLINT *) 0 ;
07480   PLINT *arg12 = (PLINT *) 0 ;
07481   int ii3 ;
07482   int temp12 ;
07483   
07484   SWIG_check_num_args("plot3dcl",8,8)
07485   if(!lua_isnumber(L,4)) SWIG_fail_arg("plot3dcl",4,"PLINT");
07486   if(!lua_isnumber(L,6)) SWIG_fail_arg("plot3dcl",6,"PLINT");
07487   {
07488     int temp;
07489     arg1 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
07490     if ( !arg1 )
07491     SWIG_fail;
07492     Xlen = temp;
07493   }
07494   {
07495     int temp;
07496     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp );
07497     if ( !arg2 )
07498     SWIG_fail;
07499     Ylen = temp;
07500   }
07501   {
07502     int jj;
07503     
07504     arg3 = read_double_Matrix( L, 3, &ii3, &jj );
07505     if ( !arg3 )
07506     SWIG_fail;
07507     arg4 = ii3;
07508     arg5 = jj;
07509     if ( ( arg4 != Xlen ) || ( arg5 != Ylen ) )
07510     {
07511       lua_pushfstring( L, "Vectors must match matrix." );
07512       SWIG_fail;
07513     }
07514   }
07515   arg6 = (PLINT)lua_tonumber(L, 4);
07516   {
07517     int temp;
07518     arg7 = (PLFLT *) LUA_get_double_num_array_var( L, 5, &temp );
07519     if ( !arg7 )
07520     SWIG_fail;
07521     arg8 = Alen = temp;
07522   }
07523   arg9 = (PLINT)lua_tonumber(L, 6);
07524   {
07525     arg11 = (PLINT *) LUA_get_int_num_array_var( L, 7, &arg10 );
07526     if ( !arg11 )
07527     SWIG_fail;
07528     Alen = arg10;
07529   }
07530   {
07531     arg12 = (PLINT *) LUA_get_int_num_array_var( L, 8, &temp12 );
07532     if ( !arg12 )
07533     SWIG_fail;
07534     if ( temp12 != Alen )
07535     {
07536       lua_pushfstring( L, "Tables must be of same length." );
07537       SWIG_fail;
07538     }
07539   }
07540   plot3dcl((double const *)arg1,(double const *)arg2,(double const **)arg3,arg4,arg5,arg6,(double const *)arg7,arg8,arg9,arg10,(int const *)arg11,(int const *)arg12);
07541   
07542   {
07543     LUA_FREE_ARRAY( arg1 ); 
07544   }
07545   {
07546     LUA_FREE_ARRAY( arg2 );
07547   }
07548   {
07549     int i;
07550     
07551     if ( arg3 )
07552     {
07553       for ( i = 0; i < ii3; i++ )
07554       LUA_FREE_ARRAY( arg3[i] );
07555       LUA_FREE_ARRAY( arg3 );
07556     }
07557   }
07558   {
07559     LUA_FREE_ARRAY( arg7 );
07560   }
07561   {
07562     LUA_FREE_ARRAY( arg11 );
07563   }
07564   {
07565     LUA_FREE_ARRAY( arg12 ); 
07566   }
07567   return SWIG_arg;
07568   
07569   if(0) SWIG_fail;
07570   
07571 fail:
07572   {
07573     LUA_FREE_ARRAY( arg1 ); 
07574   }
07575   {
07576     LUA_FREE_ARRAY( arg2 );
07577   }
07578   {
07579     int i;
07580     
07581     if ( arg3 )
07582     {
07583       for ( i = 0; i < ii3; i++ )
07584       LUA_FREE_ARRAY( arg3[i] );
07585       LUA_FREE_ARRAY( arg3 );
07586     }
07587   }
07588   {
07589     LUA_FREE_ARRAY( arg7 );
07590   }
07591   {
07592     LUA_FREE_ARRAY( arg11 );
07593   }
07594   {
07595     LUA_FREE_ARRAY( arg12 ); 
07596   }
07597   lua_error(L);
07598   return SWIG_arg;
07599 }
07600 
07601 
07602 static int _wrap_surf3d(lua_State* L) {
07603   int SWIG_arg = 0;
07604   PLFLT *arg1 = (PLFLT *) 0 ;
07605   PLFLT *arg2 = (PLFLT *) 0 ;
07606   PLFLT **arg3 = (PLFLT **) 0 ;
07607   PLINT arg4 ;
07608   PLINT arg5 ;
07609   PLINT arg6 ;
07610   PLFLT *arg7 = (PLFLT *) 0 ;
07611   PLINT arg8 ;
07612   int ii3 ;
07613   
07614   SWIG_check_num_args("plsurf3d",5,5)
07615   if(!lua_isnumber(L,4)) SWIG_fail_arg("plsurf3d",4,"PLINT");
07616   {
07617     int temp;
07618     arg1 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
07619     if ( !arg1 )
07620     SWIG_fail;
07621     Xlen = temp;
07622   }
07623   {
07624     int temp;
07625     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp );
07626     if ( !arg2 )
07627     SWIG_fail;
07628     Ylen = temp;
07629   }
07630   {
07631     int jj;
07632     
07633     arg3 = read_double_Matrix( L, 3, &ii3, &jj );
07634     if ( !arg3 )
07635     SWIG_fail;
07636     arg4 = ii3;
07637     arg5 = jj;
07638     if ( ( arg4 != Xlen ) || ( arg5 != Ylen ) )
07639     {
07640       lua_pushfstring( L, "Vectors must match matrix." );
07641       SWIG_fail;
07642     }
07643   }
07644   arg6 = (PLINT)lua_tonumber(L, 4);
07645   {
07646     int temp;
07647     arg7 = (PLFLT *) LUA_get_double_num_array_var( L, 5, &temp );
07648     if ( !arg7 )
07649     SWIG_fail;
07650     arg8 = Alen = temp;
07651   }
07652   plsurf3d((double const *)arg1,(double const *)arg2,(double const **)arg3,arg4,arg5,arg6,(double const *)arg7,arg8);
07653   
07654   {
07655     LUA_FREE_ARRAY( arg1 ); 
07656   }
07657   {
07658     LUA_FREE_ARRAY( arg2 );
07659   }
07660   {
07661     int i;
07662     
07663     if ( arg3 )
07664     {
07665       for ( i = 0; i < ii3; i++ )
07666       LUA_FREE_ARRAY( arg3[i] );
07667       LUA_FREE_ARRAY( arg3 );
07668     }
07669   }
07670   {
07671     LUA_FREE_ARRAY( arg7 );
07672   }
07673   return SWIG_arg;
07674   
07675   if(0) SWIG_fail;
07676   
07677 fail:
07678   {
07679     LUA_FREE_ARRAY( arg1 ); 
07680   }
07681   {
07682     LUA_FREE_ARRAY( arg2 );
07683   }
07684   {
07685     int i;
07686     
07687     if ( arg3 )
07688     {
07689       for ( i = 0; i < ii3; i++ )
07690       LUA_FREE_ARRAY( arg3[i] );
07691       LUA_FREE_ARRAY( arg3 );
07692     }
07693   }
07694   {
07695     LUA_FREE_ARRAY( arg7 );
07696   }
07697   lua_error(L);
07698   return SWIG_arg;
07699 }
07700 
07701 
07702 static int _wrap_surf3dl(lua_State* L) {
07703   int SWIG_arg = 0;
07704   PLFLT *arg1 = (PLFLT *) 0 ;
07705   PLFLT *arg2 = (PLFLT *) 0 ;
07706   PLFLT **arg3 = (PLFLT **) 0 ;
07707   PLINT arg4 ;
07708   PLINT arg5 ;
07709   PLINT arg6 ;
07710   PLFLT *arg7 = (PLFLT *) 0 ;
07711   PLINT arg8 ;
07712   PLINT arg9 ;
07713   PLINT arg10 ;
07714   PLINT *arg11 = (PLINT *) 0 ;
07715   PLINT *arg12 = (PLINT *) 0 ;
07716   int ii3 ;
07717   int temp12 ;
07718   
07719   SWIG_check_num_args("plsurf3dl",8,8)
07720   if(!lua_isnumber(L,4)) SWIG_fail_arg("plsurf3dl",4,"PLINT");
07721   if(!lua_isnumber(L,6)) SWIG_fail_arg("plsurf3dl",6,"PLINT");
07722   {
07723     int temp;
07724     arg1 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
07725     if ( !arg1 )
07726     SWIG_fail;
07727     Xlen = temp;
07728   }
07729   {
07730     int temp;
07731     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp );
07732     if ( !arg2 )
07733     SWIG_fail;
07734     Ylen = temp;
07735   }
07736   {
07737     int jj;
07738     
07739     arg3 = read_double_Matrix( L, 3, &ii3, &jj );
07740     if ( !arg3 )
07741     SWIG_fail;
07742     arg4 = ii3;
07743     arg5 = jj;
07744     if ( ( arg4 != Xlen ) || ( arg5 != Ylen ) )
07745     {
07746       lua_pushfstring( L, "Vectors must match matrix." );
07747       SWIG_fail;
07748     }
07749   }
07750   arg6 = (PLINT)lua_tonumber(L, 4);
07751   {
07752     int temp;
07753     arg7 = (PLFLT *) LUA_get_double_num_array_var( L, 5, &temp );
07754     if ( !arg7 )
07755     SWIG_fail;
07756     arg8 = Alen = temp;
07757   }
07758   arg9 = (PLINT)lua_tonumber(L, 6);
07759   {
07760     arg11 = (PLINT *) LUA_get_int_num_array_var( L, 7, &arg10 );
07761     if ( !arg11 )
07762     SWIG_fail;
07763     Alen = arg10;
07764   }
07765   {
07766     arg12 = (PLINT *) LUA_get_int_num_array_var( L, 8, &temp12 );
07767     if ( !arg12 )
07768     SWIG_fail;
07769     if ( temp12 != Alen )
07770     {
07771       lua_pushfstring( L, "Tables must be of same length." );
07772       SWIG_fail;
07773     }
07774   }
07775   plsurf3dl((double const *)arg1,(double const *)arg2,(double const **)arg3,arg4,arg5,arg6,(double const *)arg7,arg8,arg9,arg10,(int const *)arg11,(int const *)arg12);
07776   
07777   {
07778     LUA_FREE_ARRAY( arg1 ); 
07779   }
07780   {
07781     LUA_FREE_ARRAY( arg2 );
07782   }
07783   {
07784     int i;
07785     
07786     if ( arg3 )
07787     {
07788       for ( i = 0; i < ii3; i++ )
07789       LUA_FREE_ARRAY( arg3[i] );
07790       LUA_FREE_ARRAY( arg3 );
07791     }
07792   }
07793   {
07794     LUA_FREE_ARRAY( arg7 );
07795   }
07796   {
07797     LUA_FREE_ARRAY( arg11 );
07798   }
07799   {
07800     LUA_FREE_ARRAY( arg12 ); 
07801   }
07802   return SWIG_arg;
07803   
07804   if(0) SWIG_fail;
07805   
07806 fail:
07807   {
07808     LUA_FREE_ARRAY( arg1 ); 
07809   }
07810   {
07811     LUA_FREE_ARRAY( arg2 );
07812   }
07813   {
07814     int i;
07815     
07816     if ( arg3 )
07817     {
07818       for ( i = 0; i < ii3; i++ )
07819       LUA_FREE_ARRAY( arg3[i] );
07820       LUA_FREE_ARRAY( arg3 );
07821     }
07822   }
07823   {
07824     LUA_FREE_ARRAY( arg7 );
07825   }
07826   {
07827     LUA_FREE_ARRAY( arg11 );
07828   }
07829   {
07830     LUA_FREE_ARRAY( arg12 ); 
07831   }
07832   lua_error(L);
07833   return SWIG_arg;
07834 }
07835 
07836 
07837 static int _wrap_parseopts(lua_State* L) {
07838   int SWIG_arg = 0;
07839   int *arg1 = (int *) 0 ;
07840   char **arg2 = (char **) 0 ;
07841   PLINT arg3 ;
07842   PLINT result;
07843   
07844   SWIG_check_num_args("plparseopts",2,2)
07845   if(!lua_istable(L,1)) SWIG_fail_arg("plparseopts",1,"int *");
07846   if(!lua_isnumber(L,2)) SWIG_fail_arg("plparseopts",2,"PLINT");
07847   {
07848     int i, n;
07849     
07850     // from lua 5.1 on there is no element "n" anymore,
07851     //       so we need to find out the number of command line
07852     //       options manually
07853     for ( i = 1;; i++ )
07854     {
07855       lua_rawgeti( L, 1, i );
07856       if ( lua_isnil( L, -1 ) )
07857       {
07858         // ok, this index doesn't exist anymore, we have i-1
07859         //               command line options
07860         lua_pop( L, 1 );
07861         break;
07862       }
07863     }
07864     n  = i;
07865     arg1 = &n;
07866     
07867     arg2 = LUA_ALLOC_ARRAY( char*, ( n + 1 ) );
07868     
07869     for ( i = 0; i < n; i++ )
07870     {
07871       lua_rawgeti( L, 1, i );
07872       if ( lua_isstring( L, -1 ) )
07873       {
07874         arg2[i] = (char *) lua_tostring( L, -1 );
07875       }
07876       else
07877       {
07878         lua_pop( L, 1 );
07879         lua_pushfstring( L, "List items must be strings" );
07880         SWIG_fail;
07881         // arg2 array is freed after 'fail:'
07882       }
07883       lua_pop( L, 1 );
07884     }
07885     arg2[n] = NULL;
07886   }
07887   arg3 = (PLINT)lua_tonumber(L, 2);
07888   result = (PLINT)plparseopts(arg1,(char const **)arg2,arg3);
07889   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
07890   {
07891     LUA_FREE_ARRAY( arg2 );
07892   }
07893   return SWIG_arg;
07894   
07895   if(0) SWIG_fail;
07896   
07897 fail:
07898   {
07899     LUA_FREE_ARRAY( arg2 );
07900   }
07901   lua_error(L);
07902   return SWIG_arg;
07903 }
07904 
07905 
07906 static int _wrap_pat(lua_State* L) {
07907   int SWIG_arg = 0;
07908   PLINT arg1 ;
07909   PLINT *arg2 = (PLINT *) 0 ;
07910   PLINT *arg3 = (PLINT *) 0 ;
07911   int temp3 ;
07912   
07913   SWIG_check_num_args("plpat",2,2)
07914   {
07915     arg2 = (PLINT *) LUA_get_int_num_array_var( L, 1, &arg1 );
07916     if ( !arg2 )
07917     SWIG_fail;
07918     Alen = arg1;
07919   }
07920   {
07921     arg3 = (PLINT *) LUA_get_int_num_array_var( L, 2, &temp3 );
07922     if ( !arg3 )
07923     SWIG_fail;
07924     if ( temp3 != Alen )
07925     {
07926       lua_pushfstring( L, "Tables must be of same length." );
07927       SWIG_fail;
07928     }
07929   }
07930   plpat(arg1,(int const *)arg2,(int const *)arg3);
07931   
07932   {
07933     LUA_FREE_ARRAY( arg2 );
07934   }
07935   {
07936     LUA_FREE_ARRAY( arg3 ); 
07937   }
07938   return SWIG_arg;
07939   
07940   if(0) SWIG_fail;
07941   
07942 fail:
07943   {
07944     LUA_FREE_ARRAY( arg2 );
07945   }
07946   {
07947     LUA_FREE_ARRAY( arg3 ); 
07948   }
07949   lua_error(L);
07950   return SWIG_arg;
07951 }
07952 
07953 
07954 static int _wrap_path(lua_State* L) {
07955   int SWIG_arg = 0;
07956   PLINT arg1 ;
07957   PLFLT arg2 ;
07958   PLFLT arg3 ;
07959   PLFLT arg4 ;
07960   PLFLT arg5 ;
07961   
07962   SWIG_check_num_args("plpath",5,5)
07963   if(!lua_isnumber(L,1)) SWIG_fail_arg("plpath",1,"PLINT");
07964   if(!lua_isnumber(L,2)) SWIG_fail_arg("plpath",2,"PLFLT");
07965   if(!lua_isnumber(L,3)) SWIG_fail_arg("plpath",3,"PLFLT");
07966   if(!lua_isnumber(L,4)) SWIG_fail_arg("plpath",4,"PLFLT");
07967   if(!lua_isnumber(L,5)) SWIG_fail_arg("plpath",5,"PLFLT");
07968   arg1 = (PLINT)lua_tonumber(L, 1);
07969   arg2 = (PLFLT)lua_tonumber(L, 2);
07970   arg3 = (PLFLT)lua_tonumber(L, 3);
07971   arg4 = (PLFLT)lua_tonumber(L, 4);
07972   arg5 = (PLFLT)lua_tonumber(L, 5);
07973   plpath(arg1,arg2,arg3,arg4,arg5);
07974   
07975   return SWIG_arg;
07976   
07977   if(0) SWIG_fail;
07978   
07979 fail:
07980   lua_error(L);
07981   return SWIG_arg;
07982 }
07983 
07984 
07985 static int _wrap_poin(lua_State* L) {
07986   int SWIG_arg = 0;
07987   PLINT arg1 ;
07988   PLFLT *arg2 = (PLFLT *) 0 ;
07989   PLFLT *arg3 = (PLFLT *) 0 ;
07990   PLINT arg4 ;
07991   int temp3 ;
07992   
07993   SWIG_check_num_args("plpoin",3,3)
07994   if(!lua_isnumber(L,3)) SWIG_fail_arg("plpoin",3,"PLINT");
07995   {
07996     int temp;
07997     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
07998     if ( !arg2 )
07999     SWIG_fail;
08000     arg1 = Alen = temp;
08001   }
08002   {
08003     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
08004     if ( !arg3 )
08005     SWIG_fail;
08006     if ( temp3 != Alen )
08007     {
08008       lua_pushfstring( L, "Tables must be of same length." );
08009       SWIG_fail;
08010     }
08011   }
08012   arg4 = (PLINT)lua_tonumber(L, 3);
08013   plpoin(arg1,(double const *)arg2,(double const *)arg3,arg4);
08014   
08015   {
08016     LUA_FREE_ARRAY( arg2 );
08017   }
08018   {
08019     LUA_FREE_ARRAY( arg3 ); 
08020   }
08021   return SWIG_arg;
08022   
08023   if(0) SWIG_fail;
08024   
08025 fail:
08026   {
08027     LUA_FREE_ARRAY( arg2 );
08028   }
08029   {
08030     LUA_FREE_ARRAY( arg3 ); 
08031   }
08032   lua_error(L);
08033   return SWIG_arg;
08034 }
08035 
08036 
08037 static int _wrap_poin3(lua_State* L) {
08038   int SWIG_arg = 0;
08039   PLINT arg1 ;
08040   PLFLT *arg2 = (PLFLT *) 0 ;
08041   PLFLT *arg3 = (PLFLT *) 0 ;
08042   PLFLT *arg4 = (PLFLT *) 0 ;
08043   PLINT arg5 ;
08044   int temp3 ;
08045   int temp4 ;
08046   
08047   SWIG_check_num_args("plpoin3",4,4)
08048   if(!lua_isnumber(L,4)) SWIG_fail_arg("plpoin3",4,"PLINT");
08049   {
08050     int temp;
08051     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
08052     if ( !arg2 )
08053     SWIG_fail;
08054     arg1 = Alen = temp;
08055   }
08056   {
08057     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
08058     if ( !arg3 )
08059     SWIG_fail;
08060     if ( temp3 != Alen )
08061     {
08062       lua_pushfstring( L, "Tables must be of same length." );
08063       SWIG_fail;
08064     }
08065   }
08066   {
08067     arg4 = (PLFLT *) LUA_get_double_num_array_var( L, 3, &temp4 );
08068     if ( !arg4 )
08069     SWIG_fail;
08070     if ( temp4 != Alen )
08071     {
08072       lua_pushfstring( L, "Tables must be of same length." );
08073       SWIG_fail;
08074     }
08075   }
08076   arg5 = (PLINT)lua_tonumber(L, 4);
08077   plpoin3(arg1,(double const *)arg2,(double const *)arg3,(double const *)arg4,arg5);
08078   
08079   {
08080     LUA_FREE_ARRAY( arg2 );
08081   }
08082   {
08083     LUA_FREE_ARRAY( arg3 ); 
08084   }
08085   {
08086     LUA_FREE_ARRAY( arg4 ); 
08087   }
08088   return SWIG_arg;
08089   
08090   if(0) SWIG_fail;
08091   
08092 fail:
08093   {
08094     LUA_FREE_ARRAY( arg2 );
08095   }
08096   {
08097     LUA_FREE_ARRAY( arg3 ); 
08098   }
08099   {
08100     LUA_FREE_ARRAY( arg4 ); 
08101   }
08102   lua_error(L);
08103   return SWIG_arg;
08104 }
08105 
08106 
08107 static int _wrap_poly3(lua_State* L) {
08108   int SWIG_arg = 0;
08109   PLINT arg1 ;
08110   PLFLT *arg2 = (PLFLT *) 0 ;
08111   PLFLT *arg3 = (PLFLT *) 0 ;
08112   PLFLT *arg4 = (PLFLT *) 0 ;
08113   PLBOOL *arg5 = (PLBOOL *) 0 ;
08114   PLBOOL arg6 ;
08115   int temp3 ;
08116   int temp4 ;
08117   int temp5 ;
08118   
08119   SWIG_check_num_args("plpoly3",5,5)
08120   if(!lua_isnumber(L,5)) SWIG_fail_arg("plpoly3",5,"PLBOOL");
08121   {
08122     int temp;
08123     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
08124     if ( !arg2 )
08125     SWIG_fail;
08126     arg1 = Alen = temp;
08127   }
08128   {
08129     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
08130     if ( !arg3 )
08131     SWIG_fail;
08132     if ( temp3 != Alen )
08133     {
08134       lua_pushfstring( L, "Tables must be of same length." );
08135       SWIG_fail;
08136     }
08137   }
08138   {
08139     arg4 = (PLFLT *) LUA_get_double_num_array_var( L, 3, &temp4 );
08140     if ( !arg4 )
08141     SWIG_fail;
08142     if ( temp4 != Alen )
08143     {
08144       lua_pushfstring( L, "Tables must be of same length." );
08145       SWIG_fail;
08146     }
08147   }
08148   {
08149     arg5 = (PLINT *) LUA_get_int_num_array_var( L, 4, &temp5 );
08150     if ( !arg5 )
08151     SWIG_fail;
08152     if ( temp5 < Alen - 1 )
08153     {
08154       lua_pushfstring( L, "Tables must be at least length of others minus 1." );
08155       SWIG_fail;
08156     }
08157   }
08158   arg6 = (PLBOOL)lua_tonumber(L, 5);
08159   plpoly3(arg1,(double const *)arg2,(double const *)arg3,(double const *)arg4,(int const *)arg5,arg6);
08160   
08161   {
08162     LUA_FREE_ARRAY( arg2 );
08163   }
08164   {
08165     LUA_FREE_ARRAY( arg3 ); 
08166   }
08167   {
08168     LUA_FREE_ARRAY( arg4 ); 
08169   }
08170   {
08171     LUA_FREE_ARRAY( arg5 ); 
08172   }
08173   return SWIG_arg;
08174   
08175   if(0) SWIG_fail;
08176   
08177 fail:
08178   {
08179     LUA_FREE_ARRAY( arg2 );
08180   }
08181   {
08182     LUA_FREE_ARRAY( arg3 ); 
08183   }
08184   {
08185     LUA_FREE_ARRAY( arg4 ); 
08186   }
08187   {
08188     LUA_FREE_ARRAY( arg5 ); 
08189   }
08190   lua_error(L);
08191   return SWIG_arg;
08192 }
08193 
08194 
08195 static int _wrap_prec(lua_State* L) {
08196   int SWIG_arg = 0;
08197   PLINT arg1 ;
08198   PLINT arg2 ;
08199   
08200   SWIG_check_num_args("plprec",2,2)
08201   if(!lua_isnumber(L,1)) SWIG_fail_arg("plprec",1,"PLINT");
08202   if(!lua_isnumber(L,2)) SWIG_fail_arg("plprec",2,"PLINT");
08203   arg1 = (PLINT)lua_tonumber(L, 1);
08204   arg2 = (PLINT)lua_tonumber(L, 2);
08205   plprec(arg1,arg2);
08206   
08207   return SWIG_arg;
08208   
08209   if(0) SWIG_fail;
08210   
08211 fail:
08212   lua_error(L);
08213   return SWIG_arg;
08214 }
08215 
08216 
08217 static int _wrap_psty(lua_State* L) {
08218   int SWIG_arg = 0;
08219   PLINT arg1 ;
08220   
08221   SWIG_check_num_args("plpsty",1,1)
08222   if(!lua_isnumber(L,1)) SWIG_fail_arg("plpsty",1,"PLINT");
08223   arg1 = (PLINT)lua_tonumber(L, 1);
08224   plpsty(arg1);
08225   
08226   return SWIG_arg;
08227   
08228   if(0) SWIG_fail;
08229   
08230 fail:
08231   lua_error(L);
08232   return SWIG_arg;
08233 }
08234 
08235 
08236 static int _wrap_ptex(lua_State* L) {
08237   int SWIG_arg = 0;
08238   PLFLT arg1 ;
08239   PLFLT arg2 ;
08240   PLFLT arg3 ;
08241   PLFLT arg4 ;
08242   PLFLT arg5 ;
08243   char *arg6 = (char *) 0 ;
08244   
08245   SWIG_check_num_args("plptex",6,6)
08246   if(!lua_isnumber(L,1)) SWIG_fail_arg("plptex",1,"PLFLT");
08247   if(!lua_isnumber(L,2)) SWIG_fail_arg("plptex",2,"PLFLT");
08248   if(!lua_isnumber(L,3)) SWIG_fail_arg("plptex",3,"PLFLT");
08249   if(!lua_isnumber(L,4)) SWIG_fail_arg("plptex",4,"PLFLT");
08250   if(!lua_isnumber(L,5)) SWIG_fail_arg("plptex",5,"PLFLT");
08251   if(!SWIG_lua_isnilstring(L,6)) SWIG_fail_arg("plptex",6,"char const *");
08252   arg1 = (PLFLT)lua_tonumber(L, 1);
08253   arg2 = (PLFLT)lua_tonumber(L, 2);
08254   arg3 = (PLFLT)lua_tonumber(L, 3);
08255   arg4 = (PLFLT)lua_tonumber(L, 4);
08256   arg5 = (PLFLT)lua_tonumber(L, 5);
08257   arg6 = (char *)lua_tostring(L, 6);
08258   plptex(arg1,arg2,arg3,arg4,arg5,(char const *)arg6);
08259   
08260   return SWIG_arg;
08261   
08262   if(0) SWIG_fail;
08263   
08264 fail:
08265   lua_error(L);
08266   return SWIG_arg;
08267 }
08268 
08269 
08270 static int _wrap_ptex3(lua_State* L) {
08271   int SWIG_arg = 0;
08272   PLFLT arg1 ;
08273   PLFLT arg2 ;
08274   PLFLT arg3 ;
08275   PLFLT arg4 ;
08276   PLFLT arg5 ;
08277   PLFLT arg6 ;
08278   PLFLT arg7 ;
08279   PLFLT arg8 ;
08280   PLFLT arg9 ;
08281   PLFLT arg10 ;
08282   char *arg11 = (char *) 0 ;
08283   
08284   SWIG_check_num_args("plptex3",11,11)
08285   if(!lua_isnumber(L,1)) SWIG_fail_arg("plptex3",1,"PLFLT");
08286   if(!lua_isnumber(L,2)) SWIG_fail_arg("plptex3",2,"PLFLT");
08287   if(!lua_isnumber(L,3)) SWIG_fail_arg("plptex3",3,"PLFLT");
08288   if(!lua_isnumber(L,4)) SWIG_fail_arg("plptex3",4,"PLFLT");
08289   if(!lua_isnumber(L,5)) SWIG_fail_arg("plptex3",5,"PLFLT");
08290   if(!lua_isnumber(L,6)) SWIG_fail_arg("plptex3",6,"PLFLT");
08291   if(!lua_isnumber(L,7)) SWIG_fail_arg("plptex3",7,"PLFLT");
08292   if(!lua_isnumber(L,8)) SWIG_fail_arg("plptex3",8,"PLFLT");
08293   if(!lua_isnumber(L,9)) SWIG_fail_arg("plptex3",9,"PLFLT");
08294   if(!lua_isnumber(L,10)) SWIG_fail_arg("plptex3",10,"PLFLT");
08295   if(!SWIG_lua_isnilstring(L,11)) SWIG_fail_arg("plptex3",11,"char const *");
08296   arg1 = (PLFLT)lua_tonumber(L, 1);
08297   arg2 = (PLFLT)lua_tonumber(L, 2);
08298   arg3 = (PLFLT)lua_tonumber(L, 3);
08299   arg4 = (PLFLT)lua_tonumber(L, 4);
08300   arg5 = (PLFLT)lua_tonumber(L, 5);
08301   arg6 = (PLFLT)lua_tonumber(L, 6);
08302   arg7 = (PLFLT)lua_tonumber(L, 7);
08303   arg8 = (PLFLT)lua_tonumber(L, 8);
08304   arg9 = (PLFLT)lua_tonumber(L, 9);
08305   arg10 = (PLFLT)lua_tonumber(L, 10);
08306   arg11 = (char *)lua_tostring(L, 11);
08307   plptex3(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,(char const *)arg11);
08308   
08309   return SWIG_arg;
08310   
08311   if(0) SWIG_fail;
08312   
08313 fail:
08314   lua_error(L);
08315   return SWIG_arg;
08316 }
08317 
08318 
08319 static int _wrap_randd(lua_State* L) {
08320   int SWIG_arg = 0;
08321   PLFLT result;
08322   
08323   SWIG_check_num_args("plrandd",0,0)
08324   result = (PLFLT)plrandd();
08325   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
08326   return SWIG_arg;
08327   
08328   if(0) SWIG_fail;
08329   
08330 fail:
08331   lua_error(L);
08332   return SWIG_arg;
08333 }
08334 
08335 
08336 static int _wrap_replot(lua_State* L) {
08337   int SWIG_arg = 0;
08338   
08339   SWIG_check_num_args("plreplot",0,0)
08340   plreplot();
08341   
08342   return SWIG_arg;
08343   
08344   if(0) SWIG_fail;
08345   
08346 fail:
08347   lua_error(L);
08348   return SWIG_arg;
08349 }
08350 
08351 
08352 static int _wrap_rgbhls(lua_State* L) {
08353   int SWIG_arg = 0;
08354   PLFLT arg1 ;
08355   PLFLT arg2 ;
08356   PLFLT arg3 ;
08357   PLFLT *arg4 = (PLFLT *) 0 ;
08358   PLFLT *arg5 = (PLFLT *) 0 ;
08359   PLFLT *arg6 = (PLFLT *) 0 ;
08360   PLFLT temp4 ;
08361   PLFLT temp5 ;
08362   PLFLT temp6 ;
08363   
08364   arg4 = &temp4; 
08365   arg5 = &temp5; 
08366   arg6 = &temp6; 
08367   SWIG_check_num_args("plrgbhls",3,3)
08368   if(!lua_isnumber(L,1)) SWIG_fail_arg("plrgbhls",1,"PLFLT");
08369   if(!lua_isnumber(L,2)) SWIG_fail_arg("plrgbhls",2,"PLFLT");
08370   if(!lua_isnumber(L,3)) SWIG_fail_arg("plrgbhls",3,"PLFLT");
08371   arg1 = (PLFLT)lua_tonumber(L, 1);
08372   arg2 = (PLFLT)lua_tonumber(L, 2);
08373   arg3 = (PLFLT)lua_tonumber(L, 3);
08374   plrgbhls(arg1,arg2,arg3,arg4,arg5,arg6);
08375   
08376   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
08377   lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
08378   lua_pushnumber(L, (lua_Number) *arg6); SWIG_arg++;
08379   return SWIG_arg;
08380   
08381   if(0) SWIG_fail;
08382   
08383 fail:
08384   lua_error(L);
08385   return SWIG_arg;
08386 }
08387 
08388 
08389 static int _wrap_schr(lua_State* L) {
08390   int SWIG_arg = 0;
08391   PLFLT arg1 ;
08392   PLFLT arg2 ;
08393   
08394   SWIG_check_num_args("plschr",2,2)
08395   if(!lua_isnumber(L,1)) SWIG_fail_arg("plschr",1,"PLFLT");
08396   if(!lua_isnumber(L,2)) SWIG_fail_arg("plschr",2,"PLFLT");
08397   arg1 = (PLFLT)lua_tonumber(L, 1);
08398   arg2 = (PLFLT)lua_tonumber(L, 2);
08399   plschr(arg1,arg2);
08400   
08401   return SWIG_arg;
08402   
08403   if(0) SWIG_fail;
08404   
08405 fail:
08406   lua_error(L);
08407   return SWIG_arg;
08408 }
08409 
08410 
08411 static int _wrap_scmap0(lua_State* L) {
08412   int SWIG_arg = 0;
08413   PLINT *arg1 = (PLINT *) 0 ;
08414   PLINT *arg2 = (PLINT *) 0 ;
08415   PLINT *arg3 = (PLINT *) 0 ;
08416   PLINT arg4 ;
08417   int temp1 ;
08418   int temp2 ;
08419   int temp3 ;
08420   
08421   SWIG_check_num_args("plscmap0",3,3)
08422   {
08423     arg1 = (PLINT *) LUA_get_int_num_array_var( L, 1, &temp1 );
08424     if ( !arg1 )
08425     SWIG_fail;
08426     Alen = temp1;
08427   }
08428   {
08429     arg2 = (PLINT *) LUA_get_int_num_array_var( L, 2, &temp2 );
08430     if ( !arg2 )
08431     SWIG_fail;
08432     if ( temp2 != Alen )
08433     {
08434       lua_pushfstring( L, "Tables must be of same length." );
08435       SWIG_fail;
08436     }
08437   }
08438   {
08439     arg3 = (PLINT *) LUA_get_int_num_array_var( L, 3, &temp3 );
08440     if ( !arg3 )
08441     SWIG_fail;
08442     if ( temp3 != Alen )
08443     {
08444       lua_pushfstring( L, "Tables must be of same length." );
08445       SWIG_fail;
08446     }
08447     arg4 = temp3;
08448   }
08449   plscmap0((int const *)arg1,(int const *)arg2,(int const *)arg3,arg4);
08450   
08451   {
08452     LUA_FREE_ARRAY( arg1 );
08453   }
08454   {
08455     LUA_FREE_ARRAY( arg2 ); 
08456   }
08457   {
08458     LUA_FREE_ARRAY( arg3 );
08459   }
08460   return SWIG_arg;
08461   
08462   if(0) SWIG_fail;
08463   
08464 fail:
08465   {
08466     LUA_FREE_ARRAY( arg1 );
08467   }
08468   {
08469     LUA_FREE_ARRAY( arg2 ); 
08470   }
08471   {
08472     LUA_FREE_ARRAY( arg3 );
08473   }
08474   lua_error(L);
08475   return SWIG_arg;
08476 }
08477 
08478 
08479 static int _wrap_scmap0a(lua_State* L) {
08480   int SWIG_arg = 0;
08481   PLINT *arg1 = (PLINT *) 0 ;
08482   PLINT *arg2 = (PLINT *) 0 ;
08483   PLINT *arg3 = (PLINT *) 0 ;
08484   PLFLT *arg4 = (PLFLT *) 0 ;
08485   PLINT arg5 ;
08486   int temp1 ;
08487   int temp2 ;
08488   int temp3 ;
08489   
08490   SWIG_check_num_args("plscmap0a",4,4)
08491   {
08492     arg1 = (PLINT *) LUA_get_int_num_array_var( L, 1, &temp1 );
08493     if ( !arg1 )
08494     SWIG_fail;
08495     Alen = temp1;
08496   }
08497   {
08498     arg2 = (PLINT *) LUA_get_int_num_array_var( L, 2, &temp2 );
08499     if ( !arg2 )
08500     SWIG_fail;
08501     if ( temp2 != Alen )
08502     {
08503       lua_pushfstring( L, "Tables must be of same length." );
08504       SWIG_fail;
08505     }
08506   }
08507   {
08508     arg3 = (PLINT *) LUA_get_int_num_array_var( L, 3, &temp3 );
08509     if ( !arg3 )
08510     SWIG_fail;
08511     if ( temp3 != Alen )
08512     {
08513       lua_pushfstring( L, "Tables must be of same length." );
08514       SWIG_fail;
08515     }
08516   }
08517   {
08518     int temp;
08519     arg4 = (PLFLT *) LUA_get_double_num_array_var( L, 4, &temp );
08520     if ( !arg4 )
08521     SWIG_fail;
08522     if ( temp != Alen )
08523     {
08524       lua_pushfstring( L, "Tables must be of same length." );
08525       SWIG_fail;
08526     }
08527     arg5 = temp;
08528   }
08529   plscmap0a((int const *)arg1,(int const *)arg2,(int const *)arg3,(double const *)arg4,arg5);
08530   
08531   {
08532     LUA_FREE_ARRAY( arg1 );
08533   }
08534   {
08535     LUA_FREE_ARRAY( arg2 ); 
08536   }
08537   {
08538     LUA_FREE_ARRAY( arg3 ); 
08539   }
08540   {
08541     LUA_FREE_ARRAY( arg4 );
08542   }
08543   return SWIG_arg;
08544   
08545   if(0) SWIG_fail;
08546   
08547 fail:
08548   {
08549     LUA_FREE_ARRAY( arg1 );
08550   }
08551   {
08552     LUA_FREE_ARRAY( arg2 ); 
08553   }
08554   {
08555     LUA_FREE_ARRAY( arg3 ); 
08556   }
08557   {
08558     LUA_FREE_ARRAY( arg4 );
08559   }
08560   lua_error(L);
08561   return SWIG_arg;
08562 }
08563 
08564 
08565 static int _wrap_scmap0n(lua_State* L) {
08566   int SWIG_arg = 0;
08567   PLINT arg1 ;
08568   
08569   SWIG_check_num_args("plscmap0n",1,1)
08570   if(!lua_isnumber(L,1)) SWIG_fail_arg("plscmap0n",1,"PLINT");
08571   arg1 = (PLINT)lua_tonumber(L, 1);
08572   plscmap0n(arg1);
08573   
08574   return SWIG_arg;
08575   
08576   if(0) SWIG_fail;
08577   
08578 fail:
08579   lua_error(L);
08580   return SWIG_arg;
08581 }
08582 
08583 
08584 static int _wrap_scmap1(lua_State* L) {
08585   int SWIG_arg = 0;
08586   PLINT *arg1 = (PLINT *) 0 ;
08587   PLINT *arg2 = (PLINT *) 0 ;
08588   PLINT *arg3 = (PLINT *) 0 ;
08589   PLINT arg4 ;
08590   int temp1 ;
08591   int temp2 ;
08592   int temp3 ;
08593   
08594   SWIG_check_num_args("plscmap1",3,3)
08595   {
08596     arg1 = (PLINT *) LUA_get_int_num_array_var( L, 1, &temp1 );
08597     if ( !arg1 )
08598     SWIG_fail;
08599     Alen = temp1;
08600   }
08601   {
08602     arg2 = (PLINT *) LUA_get_int_num_array_var( L, 2, &temp2 );
08603     if ( !arg2 )
08604     SWIG_fail;
08605     if ( temp2 != Alen )
08606     {
08607       lua_pushfstring( L, "Tables must be of same length." );
08608       SWIG_fail;
08609     }
08610   }
08611   {
08612     arg3 = (PLINT *) LUA_get_int_num_array_var( L, 3, &temp3 );
08613     if ( !arg3 )
08614     SWIG_fail;
08615     if ( temp3 != Alen )
08616     {
08617       lua_pushfstring( L, "Tables must be of same length." );
08618       SWIG_fail;
08619     }
08620     arg4 = temp3;
08621   }
08622   plscmap1((int const *)arg1,(int const *)arg2,(int const *)arg3,arg4);
08623   
08624   {
08625     LUA_FREE_ARRAY( arg1 );
08626   }
08627   {
08628     LUA_FREE_ARRAY( arg2 ); 
08629   }
08630   {
08631     LUA_FREE_ARRAY( arg3 );
08632   }
08633   return SWIG_arg;
08634   
08635   if(0) SWIG_fail;
08636   
08637 fail:
08638   {
08639     LUA_FREE_ARRAY( arg1 );
08640   }
08641   {
08642     LUA_FREE_ARRAY( arg2 ); 
08643   }
08644   {
08645     LUA_FREE_ARRAY( arg3 );
08646   }
08647   lua_error(L);
08648   return SWIG_arg;
08649 }
08650 
08651 
08652 static int _wrap_scmap1a(lua_State* L) {
08653   int SWIG_arg = 0;
08654   PLINT *arg1 = (PLINT *) 0 ;
08655   PLINT *arg2 = (PLINT *) 0 ;
08656   PLINT *arg3 = (PLINT *) 0 ;
08657   PLFLT *arg4 = (PLFLT *) 0 ;
08658   PLINT arg5 ;
08659   int temp1 ;
08660   int temp2 ;
08661   int temp3 ;
08662   
08663   SWIG_check_num_args("plscmap1a",4,4)
08664   {
08665     arg1 = (PLINT *) LUA_get_int_num_array_var( L, 1, &temp1 );
08666     if ( !arg1 )
08667     SWIG_fail;
08668     Alen = temp1;
08669   }
08670   {
08671     arg2 = (PLINT *) LUA_get_int_num_array_var( L, 2, &temp2 );
08672     if ( !arg2 )
08673     SWIG_fail;
08674     if ( temp2 != Alen )
08675     {
08676       lua_pushfstring( L, "Tables must be of same length." );
08677       SWIG_fail;
08678     }
08679   }
08680   {
08681     arg3 = (PLINT *) LUA_get_int_num_array_var( L, 3, &temp3 );
08682     if ( !arg3 )
08683     SWIG_fail;
08684     if ( temp3 != Alen )
08685     {
08686       lua_pushfstring( L, "Tables must be of same length." );
08687       SWIG_fail;
08688     }
08689   }
08690   {
08691     int temp;
08692     arg4 = (PLFLT *) LUA_get_double_num_array_var( L, 4, &temp );
08693     if ( !arg4 )
08694     SWIG_fail;
08695     if ( temp != Alen )
08696     {
08697       lua_pushfstring( L, "Tables must be of same length." );
08698       SWIG_fail;
08699     }
08700     arg5 = temp;
08701   }
08702   plscmap1a((int const *)arg1,(int const *)arg2,(int const *)arg3,(double const *)arg4,arg5);
08703   
08704   {
08705     LUA_FREE_ARRAY( arg1 );
08706   }
08707   {
08708     LUA_FREE_ARRAY( arg2 ); 
08709   }
08710   {
08711     LUA_FREE_ARRAY( arg3 ); 
08712   }
08713   {
08714     LUA_FREE_ARRAY( arg4 );
08715   }
08716   return SWIG_arg;
08717   
08718   if(0) SWIG_fail;
08719   
08720 fail:
08721   {
08722     LUA_FREE_ARRAY( arg1 );
08723   }
08724   {
08725     LUA_FREE_ARRAY( arg2 ); 
08726   }
08727   {
08728     LUA_FREE_ARRAY( arg3 ); 
08729   }
08730   {
08731     LUA_FREE_ARRAY( arg4 );
08732   }
08733   lua_error(L);
08734   return SWIG_arg;
08735 }
08736 
08737 
08738 static int _wrap_scmap1l(lua_State* L) {
08739   int SWIG_arg = 0;
08740   PLBOOL arg1 ;
08741   PLINT arg2 ;
08742   PLFLT *arg3 = (PLFLT *) 0 ;
08743   PLFLT *arg4 = (PLFLT *) 0 ;
08744   PLFLT *arg5 = (PLFLT *) 0 ;
08745   PLFLT *arg6 = (PLFLT *) 0 ;
08746   PLBOOL *arg7 = (PLBOOL *) 0 ;
08747   int temp4 ;
08748   int temp5 ;
08749   int temp6 ;
08750   int temp7 ;
08751   
08752   {
08753     arg7 = NULL; 
08754   }
08755   SWIG_check_num_args("plscmap1l",5,6)
08756   if(!lua_isnumber(L,1)) SWIG_fail_arg("plscmap1l",1,"PLBOOL");
08757   arg1 = (PLBOOL)lua_tonumber(L, 1);
08758   {
08759     int temp;
08760     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp );
08761     if ( !arg3 )
08762     SWIG_fail;
08763     arg2 = Alen = temp;
08764   }
08765   {
08766     arg4 = (PLFLT *) LUA_get_double_num_array_var( L, 3, &temp4 );
08767     if ( !arg4 )
08768     SWIG_fail;
08769     if ( temp4 != Alen )
08770     {
08771       lua_pushfstring( L, "Tables must be of same length." );
08772       SWIG_fail;
08773     }
08774   }
08775   {
08776     arg5 = (PLFLT *) LUA_get_double_num_array_var( L, 4, &temp5 );
08777     if ( !arg5 )
08778     SWIG_fail;
08779     if ( temp5 != Alen )
08780     {
08781       lua_pushfstring( L, "Tables must be of same length." );
08782       SWIG_fail;
08783     }
08784   }
08785   {
08786     arg6 = (PLFLT *) LUA_get_double_num_array_var( L, 5, &temp6 );
08787     if ( !arg6 )
08788     SWIG_fail;
08789     if ( temp6 != Alen )
08790     {
08791       lua_pushfstring( L, "Tables must be of same length." );
08792       SWIG_fail;
08793     }
08794   }
08795   if(lua_gettop(L)>=6){
08796     {
08797       if ( lua_isnil( L, 6 ) )
08798       {
08799         arg7 = NULL;
08800       }
08801       else
08802       {
08803         arg7 = (PLINT *) LUA_get_int_num_array_var( L, 6, &temp7 );
08804         if ( !arg7 )
08805         SWIG_fail;
08806         if ( temp7 < Alen - 1 )
08807         {
08808           lua_pushfstring( L, "Tables must be at least length of others minus 1." );
08809           SWIG_fail;
08810         }
08811       }
08812     }
08813   }
08814   plscmap1l(arg1,arg2,(double const *)arg3,(double const *)arg4,(double const *)arg5,(double const *)arg6,(int const *)arg7);
08815   
08816   {
08817     LUA_FREE_ARRAY( arg3 );
08818   }
08819   {
08820     LUA_FREE_ARRAY( arg4 ); 
08821   }
08822   {
08823     LUA_FREE_ARRAY( arg5 ); 
08824   }
08825   {
08826     LUA_FREE_ARRAY( arg6 ); 
08827   }
08828   {
08829     LUA_FREE_ARRAY( arg7 ); 
08830   }
08831   return SWIG_arg;
08832   
08833   if(0) SWIG_fail;
08834   
08835 fail:
08836   {
08837     LUA_FREE_ARRAY( arg3 );
08838   }
08839   {
08840     LUA_FREE_ARRAY( arg4 ); 
08841   }
08842   {
08843     LUA_FREE_ARRAY( arg5 ); 
08844   }
08845   {
08846     LUA_FREE_ARRAY( arg6 ); 
08847   }
08848   {
08849     LUA_FREE_ARRAY( arg7 ); 
08850   }
08851   lua_error(L);
08852   return SWIG_arg;
08853 }
08854 
08855 
08856 static int _wrap_scmap1la(lua_State* L) {
08857   int SWIG_arg = 0;
08858   PLBOOL arg1 ;
08859   PLINT arg2 ;
08860   PLFLT *arg3 = (PLFLT *) 0 ;
08861   PLFLT *arg4 = (PLFLT *) 0 ;
08862   PLFLT *arg5 = (PLFLT *) 0 ;
08863   PLFLT *arg6 = (PLFLT *) 0 ;
08864   PLFLT *arg7 = (PLFLT *) 0 ;
08865   PLBOOL *arg8 = (PLBOOL *) 0 ;
08866   int temp4 ;
08867   int temp5 ;
08868   int temp6 ;
08869   int temp7 ;
08870   int temp8 ;
08871   
08872   {
08873     arg8 = NULL; 
08874   }
08875   SWIG_check_num_args("plscmap1la",6,7)
08876   if(!lua_isnumber(L,1)) SWIG_fail_arg("plscmap1la",1,"PLBOOL");
08877   arg1 = (PLBOOL)lua_tonumber(L, 1);
08878   {
08879     int temp;
08880     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp );
08881     if ( !arg3 )
08882     SWIG_fail;
08883     arg2 = Alen = temp;
08884   }
08885   {
08886     arg4 = (PLFLT *) LUA_get_double_num_array_var( L, 3, &temp4 );
08887     if ( !arg4 )
08888     SWIG_fail;
08889     if ( temp4 != Alen )
08890     {
08891       lua_pushfstring( L, "Tables must be of same length." );
08892       SWIG_fail;
08893     }
08894   }
08895   {
08896     arg5 = (PLFLT *) LUA_get_double_num_array_var( L, 4, &temp5 );
08897     if ( !arg5 )
08898     SWIG_fail;
08899     if ( temp5 != Alen )
08900     {
08901       lua_pushfstring( L, "Tables must be of same length." );
08902       SWIG_fail;
08903     }
08904   }
08905   {
08906     arg6 = (PLFLT *) LUA_get_double_num_array_var( L, 5, &temp6 );
08907     if ( !arg6 )
08908     SWIG_fail;
08909     if ( temp6 != Alen )
08910     {
08911       lua_pushfstring( L, "Tables must be of same length." );
08912       SWIG_fail;
08913     }
08914   }
08915   {
08916     arg7 = (PLFLT *) LUA_get_double_num_array_var( L, 6, &temp7 );
08917     if ( !arg7 )
08918     SWIG_fail;
08919     if ( temp7 != Alen )
08920     {
08921       lua_pushfstring( L, "Tables must be of same length." );
08922       SWIG_fail;
08923     }
08924   }
08925   if(lua_gettop(L)>=7){
08926     {
08927       if ( lua_isnil( L, 7 ) )
08928       {
08929         arg8 = NULL;
08930       }
08931       else
08932       {
08933         arg8 = (PLINT *) LUA_get_int_num_array_var( L, 7, &temp8 );
08934         if ( !arg8 )
08935         SWIG_fail;
08936         if ( temp8 < Alen - 1 )
08937         {
08938           lua_pushfstring( L, "Tables must be at least length of others minus 1." );
08939           SWIG_fail;
08940         }
08941       }
08942     }
08943   }
08944   plscmap1la(arg1,arg2,(double const *)arg3,(double const *)arg4,(double const *)arg5,(double const *)arg6,(double const *)arg7,(int const *)arg8);
08945   
08946   {
08947     LUA_FREE_ARRAY( arg3 );
08948   }
08949   {
08950     LUA_FREE_ARRAY( arg4 ); 
08951   }
08952   {
08953     LUA_FREE_ARRAY( arg5 ); 
08954   }
08955   {
08956     LUA_FREE_ARRAY( arg6 ); 
08957   }
08958   {
08959     LUA_FREE_ARRAY( arg7 ); 
08960   }
08961   {
08962     LUA_FREE_ARRAY( arg8 ); 
08963   }
08964   return SWIG_arg;
08965   
08966   if(0) SWIG_fail;
08967   
08968 fail:
08969   {
08970     LUA_FREE_ARRAY( arg3 );
08971   }
08972   {
08973     LUA_FREE_ARRAY( arg4 ); 
08974   }
08975   {
08976     LUA_FREE_ARRAY( arg5 ); 
08977   }
08978   {
08979     LUA_FREE_ARRAY( arg6 ); 
08980   }
08981   {
08982     LUA_FREE_ARRAY( arg7 ); 
08983   }
08984   {
08985     LUA_FREE_ARRAY( arg8 ); 
08986   }
08987   lua_error(L);
08988   return SWIG_arg;
08989 }
08990 
08991 
08992 static int _wrap_scmap1n(lua_State* L) {
08993   int SWIG_arg = 0;
08994   PLINT arg1 ;
08995   
08996   SWIG_check_num_args("plscmap1n",1,1)
08997   if(!lua_isnumber(L,1)) SWIG_fail_arg("plscmap1n",1,"PLINT");
08998   arg1 = (PLINT)lua_tonumber(L, 1);
08999   plscmap1n(arg1);
09000   
09001   return SWIG_arg;
09002   
09003   if(0) SWIG_fail;
09004   
09005 fail:
09006   lua_error(L);
09007   return SWIG_arg;
09008 }
09009 
09010 
09011 static int _wrap_scmap1_range(lua_State* L) {
09012   int SWIG_arg = 0;
09013   PLFLT arg1 ;
09014   PLFLT arg2 ;
09015   
09016   SWIG_check_num_args("plscmap1_range",2,2)
09017   if(!lua_isnumber(L,1)) SWIG_fail_arg("plscmap1_range",1,"PLFLT");
09018   if(!lua_isnumber(L,2)) SWIG_fail_arg("plscmap1_range",2,"PLFLT");
09019   arg1 = (PLFLT)lua_tonumber(L, 1);
09020   arg2 = (PLFLT)lua_tonumber(L, 2);
09021   plscmap1_range(arg1,arg2);
09022   
09023   return SWIG_arg;
09024   
09025   if(0) SWIG_fail;
09026   
09027 fail:
09028   lua_error(L);
09029   return SWIG_arg;
09030 }
09031 
09032 
09033 static int _wrap_gcmap1_range(lua_State* L) {
09034   int SWIG_arg = 0;
09035   PLFLT *arg1 = (PLFLT *) 0 ;
09036   PLFLT *arg2 = (PLFLT *) 0 ;
09037   PLFLT temp1 ;
09038   PLFLT temp2 ;
09039   
09040   arg1 = &temp1; 
09041   arg2 = &temp2; 
09042   SWIG_check_num_args("plgcmap1_range",0,0)
09043   plgcmap1_range(arg1,arg2);
09044   
09045   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
09046   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
09047   return SWIG_arg;
09048   
09049   if(0) SWIG_fail;
09050   
09051 fail:
09052   lua_error(L);
09053   return SWIG_arg;
09054 }
09055 
09056 
09057 static int _wrap_scol0(lua_State* L) {
09058   int SWIG_arg = 0;
09059   PLINT arg1 ;
09060   PLINT arg2 ;
09061   PLINT arg3 ;
09062   PLINT arg4 ;
09063   
09064   SWIG_check_num_args("plscol0",4,4)
09065   if(!lua_isnumber(L,1)) SWIG_fail_arg("plscol0",1,"PLINT");
09066   if(!lua_isnumber(L,2)) SWIG_fail_arg("plscol0",2,"PLINT");
09067   if(!lua_isnumber(L,3)) SWIG_fail_arg("plscol0",3,"PLINT");
09068   if(!lua_isnumber(L,4)) SWIG_fail_arg("plscol0",4,"PLINT");
09069   arg1 = (PLINT)lua_tonumber(L, 1);
09070   arg2 = (PLINT)lua_tonumber(L, 2);
09071   arg3 = (PLINT)lua_tonumber(L, 3);
09072   arg4 = (PLINT)lua_tonumber(L, 4);
09073   plscol0(arg1,arg2,arg3,arg4);
09074   
09075   return SWIG_arg;
09076   
09077   if(0) SWIG_fail;
09078   
09079 fail:
09080   lua_error(L);
09081   return SWIG_arg;
09082 }
09083 
09084 
09085 static int _wrap_scol0a(lua_State* L) {
09086   int SWIG_arg = 0;
09087   PLINT arg1 ;
09088   PLINT arg2 ;
09089   PLINT arg3 ;
09090   PLINT arg4 ;
09091   PLFLT arg5 ;
09092   
09093   SWIG_check_num_args("plscol0a",5,5)
09094   if(!lua_isnumber(L,1)) SWIG_fail_arg("plscol0a",1,"PLINT");
09095   if(!lua_isnumber(L,2)) SWIG_fail_arg("plscol0a",2,"PLINT");
09096   if(!lua_isnumber(L,3)) SWIG_fail_arg("plscol0a",3,"PLINT");
09097   if(!lua_isnumber(L,4)) SWIG_fail_arg("plscol0a",4,"PLINT");
09098   if(!lua_isnumber(L,5)) SWIG_fail_arg("plscol0a",5,"PLFLT");
09099   arg1 = (PLINT)lua_tonumber(L, 1);
09100   arg2 = (PLINT)lua_tonumber(L, 2);
09101   arg3 = (PLINT)lua_tonumber(L, 3);
09102   arg4 = (PLINT)lua_tonumber(L, 4);
09103   arg5 = (PLFLT)lua_tonumber(L, 5);
09104   plscol0a(arg1,arg2,arg3,arg4,arg5);
09105   
09106   return SWIG_arg;
09107   
09108   if(0) SWIG_fail;
09109   
09110 fail:
09111   lua_error(L);
09112   return SWIG_arg;
09113 }
09114 
09115 
09116 static int _wrap_scolbg(lua_State* L) {
09117   int SWIG_arg = 0;
09118   PLINT arg1 ;
09119   PLINT arg2 ;
09120   PLINT arg3 ;
09121   
09122   SWIG_check_num_args("plscolbg",3,3)
09123   if(!lua_isnumber(L,1)) SWIG_fail_arg("plscolbg",1,"PLINT");
09124   if(!lua_isnumber(L,2)) SWIG_fail_arg("plscolbg",2,"PLINT");
09125   if(!lua_isnumber(L,3)) SWIG_fail_arg("plscolbg",3,"PLINT");
09126   arg1 = (PLINT)lua_tonumber(L, 1);
09127   arg2 = (PLINT)lua_tonumber(L, 2);
09128   arg3 = (PLINT)lua_tonumber(L, 3);
09129   plscolbg(arg1,arg2,arg3);
09130   
09131   return SWIG_arg;
09132   
09133   if(0) SWIG_fail;
09134   
09135 fail:
09136   lua_error(L);
09137   return SWIG_arg;
09138 }
09139 
09140 
09141 static int _wrap_scolbga(lua_State* L) {
09142   int SWIG_arg = 0;
09143   PLINT arg1 ;
09144   PLINT arg2 ;
09145   PLINT arg3 ;
09146   PLFLT arg4 ;
09147   
09148   SWIG_check_num_args("plscolbga",4,4)
09149   if(!lua_isnumber(L,1)) SWIG_fail_arg("plscolbga",1,"PLINT");
09150   if(!lua_isnumber(L,2)) SWIG_fail_arg("plscolbga",2,"PLINT");
09151   if(!lua_isnumber(L,3)) SWIG_fail_arg("plscolbga",3,"PLINT");
09152   if(!lua_isnumber(L,4)) SWIG_fail_arg("plscolbga",4,"PLFLT");
09153   arg1 = (PLINT)lua_tonumber(L, 1);
09154   arg2 = (PLINT)lua_tonumber(L, 2);
09155   arg3 = (PLINT)lua_tonumber(L, 3);
09156   arg4 = (PLFLT)lua_tonumber(L, 4);
09157   plscolbga(arg1,arg2,arg3,arg4);
09158   
09159   return SWIG_arg;
09160   
09161   if(0) SWIG_fail;
09162   
09163 fail:
09164   lua_error(L);
09165   return SWIG_arg;
09166 }
09167 
09168 
09169 static int _wrap_scolor(lua_State* L) {
09170   int SWIG_arg = 0;
09171   PLINT arg1 ;
09172   
09173   SWIG_check_num_args("plscolor",1,1)
09174   if(!lua_isnumber(L,1)) SWIG_fail_arg("plscolor",1,"PLINT");
09175   arg1 = (PLINT)lua_tonumber(L, 1);
09176   plscolor(arg1);
09177   
09178   return SWIG_arg;
09179   
09180   if(0) SWIG_fail;
09181   
09182 fail:
09183   lua_error(L);
09184   return SWIG_arg;
09185 }
09186 
09187 
09188 static int _wrap_scompression(lua_State* L) {
09189   int SWIG_arg = 0;
09190   PLINT arg1 ;
09191   
09192   SWIG_check_num_args("plscompression",1,1)
09193   if(!lua_isnumber(L,1)) SWIG_fail_arg("plscompression",1,"PLINT");
09194   arg1 = (PLINT)lua_tonumber(L, 1);
09195   plscompression(arg1);
09196   
09197   return SWIG_arg;
09198   
09199   if(0) SWIG_fail;
09200   
09201 fail:
09202   lua_error(L);
09203   return SWIG_arg;
09204 }
09205 
09206 
09207 static int _wrap_sdev(lua_State* L) {
09208   int SWIG_arg = 0;
09209   char *arg1 = (char *) 0 ;
09210   
09211   SWIG_check_num_args("plsdev",1,1)
09212   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plsdev",1,"char const *");
09213   arg1 = (char *)lua_tostring(L, 1);
09214   plsdev((char const *)arg1);
09215   
09216   return SWIG_arg;
09217   
09218   if(0) SWIG_fail;
09219   
09220 fail:
09221   lua_error(L);
09222   return SWIG_arg;
09223 }
09224 
09225 
09226 static int _wrap_sdidev(lua_State* L) {
09227   int SWIG_arg = 0;
09228   PLFLT arg1 ;
09229   PLFLT arg2 ;
09230   PLFLT arg3 ;
09231   PLFLT arg4 ;
09232   
09233   SWIG_check_num_args("plsdidev",4,4)
09234   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsdidev",1,"PLFLT");
09235   if(!lua_isnumber(L,2)) SWIG_fail_arg("plsdidev",2,"PLFLT");
09236   if(!lua_isnumber(L,3)) SWIG_fail_arg("plsdidev",3,"PLFLT");
09237   if(!lua_isnumber(L,4)) SWIG_fail_arg("plsdidev",4,"PLFLT");
09238   arg1 = (PLFLT)lua_tonumber(L, 1);
09239   arg2 = (PLFLT)lua_tonumber(L, 2);
09240   arg3 = (PLFLT)lua_tonumber(L, 3);
09241   arg4 = (PLFLT)lua_tonumber(L, 4);
09242   plsdidev(arg1,arg2,arg3,arg4);
09243   
09244   return SWIG_arg;
09245   
09246   if(0) SWIG_fail;
09247   
09248 fail:
09249   lua_error(L);
09250   return SWIG_arg;
09251 }
09252 
09253 
09254 static int _wrap_sdimap(lua_State* L) {
09255   int SWIG_arg = 0;
09256   PLINT arg1 ;
09257   PLINT arg2 ;
09258   PLINT arg3 ;
09259   PLINT arg4 ;
09260   PLFLT arg5 ;
09261   PLFLT arg6 ;
09262   
09263   SWIG_check_num_args("plsdimap",6,6)
09264   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsdimap",1,"PLINT");
09265   if(!lua_isnumber(L,2)) SWIG_fail_arg("plsdimap",2,"PLINT");
09266   if(!lua_isnumber(L,3)) SWIG_fail_arg("plsdimap",3,"PLINT");
09267   if(!lua_isnumber(L,4)) SWIG_fail_arg("plsdimap",4,"PLINT");
09268   if(!lua_isnumber(L,5)) SWIG_fail_arg("plsdimap",5,"PLFLT");
09269   if(!lua_isnumber(L,6)) SWIG_fail_arg("plsdimap",6,"PLFLT");
09270   arg1 = (PLINT)lua_tonumber(L, 1);
09271   arg2 = (PLINT)lua_tonumber(L, 2);
09272   arg3 = (PLINT)lua_tonumber(L, 3);
09273   arg4 = (PLINT)lua_tonumber(L, 4);
09274   arg5 = (PLFLT)lua_tonumber(L, 5);
09275   arg6 = (PLFLT)lua_tonumber(L, 6);
09276   plsdimap(arg1,arg2,arg3,arg4,arg5,arg6);
09277   
09278   return SWIG_arg;
09279   
09280   if(0) SWIG_fail;
09281   
09282 fail:
09283   lua_error(L);
09284   return SWIG_arg;
09285 }
09286 
09287 
09288 static int _wrap_sdiori(lua_State* L) {
09289   int SWIG_arg = 0;
09290   PLFLT arg1 ;
09291   
09292   SWIG_check_num_args("plsdiori",1,1)
09293   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsdiori",1,"PLFLT");
09294   arg1 = (PLFLT)lua_tonumber(L, 1);
09295   plsdiori(arg1);
09296   
09297   return SWIG_arg;
09298   
09299   if(0) SWIG_fail;
09300   
09301 fail:
09302   lua_error(L);
09303   return SWIG_arg;
09304 }
09305 
09306 
09307 static int _wrap_sdiplt(lua_State* L) {
09308   int SWIG_arg = 0;
09309   PLFLT arg1 ;
09310   PLFLT arg2 ;
09311   PLFLT arg3 ;
09312   PLFLT arg4 ;
09313   
09314   SWIG_check_num_args("plsdiplt",4,4)
09315   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsdiplt",1,"PLFLT");
09316   if(!lua_isnumber(L,2)) SWIG_fail_arg("plsdiplt",2,"PLFLT");
09317   if(!lua_isnumber(L,3)) SWIG_fail_arg("plsdiplt",3,"PLFLT");
09318   if(!lua_isnumber(L,4)) SWIG_fail_arg("plsdiplt",4,"PLFLT");
09319   arg1 = (PLFLT)lua_tonumber(L, 1);
09320   arg2 = (PLFLT)lua_tonumber(L, 2);
09321   arg3 = (PLFLT)lua_tonumber(L, 3);
09322   arg4 = (PLFLT)lua_tonumber(L, 4);
09323   plsdiplt(arg1,arg2,arg3,arg4);
09324   
09325   return SWIG_arg;
09326   
09327   if(0) SWIG_fail;
09328   
09329 fail:
09330   lua_error(L);
09331   return SWIG_arg;
09332 }
09333 
09334 
09335 static int _wrap_sdiplz(lua_State* L) {
09336   int SWIG_arg = 0;
09337   PLFLT arg1 ;
09338   PLFLT arg2 ;
09339   PLFLT arg3 ;
09340   PLFLT arg4 ;
09341   
09342   SWIG_check_num_args("plsdiplz",4,4)
09343   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsdiplz",1,"PLFLT");
09344   if(!lua_isnumber(L,2)) SWIG_fail_arg("plsdiplz",2,"PLFLT");
09345   if(!lua_isnumber(L,3)) SWIG_fail_arg("plsdiplz",3,"PLFLT");
09346   if(!lua_isnumber(L,4)) SWIG_fail_arg("plsdiplz",4,"PLFLT");
09347   arg1 = (PLFLT)lua_tonumber(L, 1);
09348   arg2 = (PLFLT)lua_tonumber(L, 2);
09349   arg3 = (PLFLT)lua_tonumber(L, 3);
09350   arg4 = (PLFLT)lua_tonumber(L, 4);
09351   plsdiplz(arg1,arg2,arg3,arg4);
09352   
09353   return SWIG_arg;
09354   
09355   if(0) SWIG_fail;
09356   
09357 fail:
09358   lua_error(L);
09359   return SWIG_arg;
09360 }
09361 
09362 
09363 static int _wrap_seed(lua_State* L) {
09364   int SWIG_arg = 0;
09365   unsigned int arg1 ;
09366   
09367   SWIG_check_num_args("plseed",1,1)
09368   if(!lua_isnumber(L,1)) SWIG_fail_arg("plseed",1,"unsigned int");
09369   SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
09370   arg1 = (unsigned int)lua_tonumber(L, 1);
09371   plseed(arg1);
09372   
09373   return SWIG_arg;
09374   
09375   if(0) SWIG_fail;
09376   
09377 fail:
09378   lua_error(L);
09379   return SWIG_arg;
09380 }
09381 
09382 
09383 static int _wrap_sesc(lua_State* L) {
09384   int SWIG_arg = 0;
09385   char arg1 ;
09386   
09387   SWIG_check_num_args("plsesc",1,1)
09388   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plsesc",1,"char");
09389   arg1 = (lua_tostring(L, 1))[0];
09390   plsesc(arg1);
09391   
09392   return SWIG_arg;
09393   
09394   if(0) SWIG_fail;
09395   
09396 fail:
09397   lua_error(L);
09398   return SWIG_arg;
09399 }
09400 
09401 
09402 static int _wrap_setopt(lua_State* L) {
09403   int SWIG_arg = 0;
09404   char *arg1 = (char *) 0 ;
09405   char *arg2 = (char *) 0 ;
09406   PLINT result;
09407   
09408   SWIG_check_num_args("plsetopt",2,2)
09409   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plsetopt",1,"char const *");
09410   if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("plsetopt",2,"char const *");
09411   arg1 = (char *)lua_tostring(L, 1);
09412   arg2 = (char *)lua_tostring(L, 2);
09413   result = (PLINT)plsetopt((char const *)arg1,(char const *)arg2);
09414   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
09415   return SWIG_arg;
09416   
09417   if(0) SWIG_fail;
09418   
09419 fail:
09420   lua_error(L);
09421   return SWIG_arg;
09422 }
09423 
09424 
09425 static int _wrap_sfam(lua_State* L) {
09426   int SWIG_arg = 0;
09427   PLINT arg1 ;
09428   PLINT arg2 ;
09429   PLINT arg3 ;
09430   
09431   SWIG_check_num_args("plsfam",3,3)
09432   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsfam",1,"PLINT");
09433   if(!lua_isnumber(L,2)) SWIG_fail_arg("plsfam",2,"PLINT");
09434   if(!lua_isnumber(L,3)) SWIG_fail_arg("plsfam",3,"PLINT");
09435   arg1 = (PLINT)lua_tonumber(L, 1);
09436   arg2 = (PLINT)lua_tonumber(L, 2);
09437   arg3 = (PLINT)lua_tonumber(L, 3);
09438   plsfam(arg1,arg2,arg3);
09439   
09440   return SWIG_arg;
09441   
09442   if(0) SWIG_fail;
09443   
09444 fail:
09445   lua_error(L);
09446   return SWIG_arg;
09447 }
09448 
09449 
09450 static int _wrap_sfci(lua_State* L) {
09451   int SWIG_arg = 0;
09452   PLUNICODE arg1 ;
09453   
09454   SWIG_check_num_args("plsfci",1,1)
09455   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsfci",1,"PLUNICODE");
09456   SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative")
09457   arg1 = (PLUNICODE)lua_tonumber(L, 1);
09458   plsfci(arg1);
09459   
09460   return SWIG_arg;
09461   
09462   if(0) SWIG_fail;
09463   
09464 fail:
09465   lua_error(L);
09466   return SWIG_arg;
09467 }
09468 
09469 
09470 static int _wrap_sfnam(lua_State* L) {
09471   int SWIG_arg = 0;
09472   char *arg1 = (char *) 0 ;
09473   
09474   SWIG_check_num_args("plsfnam",1,1)
09475   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plsfnam",1,"char const *");
09476   arg1 = (char *)lua_tostring(L, 1);
09477   plsfnam((char const *)arg1);
09478   
09479   return SWIG_arg;
09480   
09481   if(0) SWIG_fail;
09482   
09483 fail:
09484   lua_error(L);
09485   return SWIG_arg;
09486 }
09487 
09488 
09489 static int _wrap_sfont(lua_State* L) {
09490   int SWIG_arg = 0;
09491   PLINT arg1 ;
09492   PLINT arg2 ;
09493   PLINT arg3 ;
09494   
09495   SWIG_check_num_args("plsfont",3,3)
09496   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsfont",1,"PLINT");
09497   if(!lua_isnumber(L,2)) SWIG_fail_arg("plsfont",2,"PLINT");
09498   if(!lua_isnumber(L,3)) SWIG_fail_arg("plsfont",3,"PLINT");
09499   arg1 = (PLINT)lua_tonumber(L, 1);
09500   arg2 = (PLINT)lua_tonumber(L, 2);
09501   arg3 = (PLINT)lua_tonumber(L, 3);
09502   plsfont(arg1,arg2,arg3);
09503   
09504   return SWIG_arg;
09505   
09506   if(0) SWIG_fail;
09507   
09508 fail:
09509   lua_error(L);
09510   return SWIG_arg;
09511 }
09512 
09513 
09514 static int _wrap_shades(lua_State* L) {
09515   int SWIG_arg = 0;
09516   PLFLT **arg1 = (PLFLT **) 0 ;
09517   PLINT arg2 ;
09518   PLINT arg3 ;
09519   defined_func arg4 = (defined_func) 0 ;
09520   PLFLT arg5 ;
09521   PLFLT arg6 ;
09522   PLFLT arg7 ;
09523   PLFLT arg8 ;
09524   PLFLT *arg9 = (PLFLT *) 0 ;
09525   PLINT arg10 ;
09526   PLFLT arg11 ;
09527   PLINT arg12 ;
09528   PLFLT arg13 ;
09529   fill_func arg14 = (fill_func) 0 ;
09530   PLBOOL arg15 ;
09531   pltr_func arg16 = (pltr_func) 0 ;
09532   PLPointer arg17 = (PLPointer) 0 ;
09533   int ii1 ;
09534   PLcGrid cgrid117 ;
09535   PLcGrid2 cgrid217 ;
09536   
09537   {
09538     cgrid117.xg = cgrid117.yg = cgrid117.zg = NULL;
09539     cgrid117.nx = cgrid117.ny = cgrid117.nz = 0;
09540     cgrid217.xg = cgrid217.yg = cgrid217.zg = NULL;
09541     cgrid217.nx = cgrid217.ny = 0;
09542   }
09543   {
09544     arg16 = NULL;
09545   }
09546   {
09547     arg17 = NULL;
09548   }
09549   {
09550     arg4 = NULL;
09551   }
09552   {
09553     arg14 = plfill;
09554   }
09555   SWIG_check_num_args("plshades",10,12)
09556   if(!lua_isnumber(L,2)) SWIG_fail_arg("plshades",2,"PLFLT");
09557   if(!lua_isnumber(L,3)) SWIG_fail_arg("plshades",3,"PLFLT");
09558   if(!lua_isnumber(L,4)) SWIG_fail_arg("plshades",4,"PLFLT");
09559   if(!lua_isnumber(L,5)) SWIG_fail_arg("plshades",5,"PLFLT");
09560   if(!lua_isnumber(L,7)) SWIG_fail_arg("plshades",7,"PLFLT");
09561   if(!lua_isnumber(L,8)) SWIG_fail_arg("plshades",8,"PLINT");
09562   if(!lua_isnumber(L,9)) SWIG_fail_arg("plshades",9,"PLFLT");
09563   if(!lua_isnumber(L,10)) SWIG_fail_arg("plshades",10,"PLBOOL");
09564   {
09565     int jj;
09566     
09567     arg1 = read_double_Matrix( L, 1, &ii1, &jj );
09568     if ( !arg1 )
09569     SWIG_fail;
09570     Xlen = arg2 = ii1;
09571     Ylen = arg3 = jj;
09572   }
09573   arg5 = (PLFLT)lua_tonumber(L, 2);
09574   arg6 = (PLFLT)lua_tonumber(L, 3);
09575   arg7 = (PLFLT)lua_tonumber(L, 4);
09576   arg8 = (PLFLT)lua_tonumber(L, 5);
09577   {
09578     int temp;
09579     arg9 = (PLFLT *) LUA_get_double_num_array_var( L, 6, &temp );
09580     if ( !arg9 )
09581     SWIG_fail;
09582     arg10 = Alen = temp;
09583   }
09584   arg11 = (PLFLT)lua_tonumber(L, 7);
09585   arg12 = (PLINT)lua_tonumber(L, 8);
09586   arg13 = (PLFLT)lua_tonumber(L, 9);
09587   arg15 = (PLBOOL)lua_tonumber(L, 10);
09588   if(lua_gettop(L)>=11){
09589     {
09590       arg16 = NULL;
09591       mypltr_funcstr[0] = '\0';
09592       
09593       if ( lua_isstring( L, 11 ) )
09594       {
09595         const char* funcstr = lua_tostring( L, 11 );
09596         if ( strcmp( "pltr0", funcstr ) == 0 )
09597         {
09598           arg16 = pltr0;
09599         }
09600         else if ( strcmp( "pltr1", funcstr ) == 0 )
09601         {
09602           arg16 = pltr1;
09603         }
09604         else if ( strcmp( "pltr2", funcstr ) == 0 )
09605         {
09606           arg16 = pltr2;
09607         }
09608         else
09609         {
09610           arg16 = mypltr;
09611           strncpy( mypltr_funcstr, funcstr, 255 );
09612           myL = L;
09613         }
09614       }
09615       else
09616       SWIG_fail_arg( "shades", 16, "pltr_func" );
09617     }
09618   }
09619   if(lua_gettop(L)>=12){
09620     {
09621       int nx, ny;
09622       int gridmode = 0;
09623       
09624       lua_pushstring( L, "xg" );
09625       lua_gettable( L, 12 );
09626       if ( !lua_istable( L, -1 ) )
09627       {
09628         lua_pop( L, 1 ); // pop "xg"
09629         lua_pushstring( L, "expected a table xg" );
09630         SWIG_fail;
09631       }
09632       lua_rawgeti( L, -1, 1 );
09633       if ( lua_istable( L, -1 ) )
09634       gridmode = 2; // two dimensional array
09635       else if ( lua_isnumber( L, -1 ) )
09636       gridmode = 1; // one dimensional array
09637       else
09638       {
09639         lua_pop( L, 1 ); // pop "1"
09640         lua_pop( L, 1 ); // pop "xg"
09641         lua_pushstring( L, "expected a one or two dimensional array/table in xg" );
09642         SWIG_fail;
09643       }
09644       lua_pop( L, 1 ); // pop test element
09645       if ( gridmode == 1 )
09646       {
09647         cgrid117.xg = (PLFLT *) LUA_get_double_num_array_var( L, -1, &nx );
09648         if ( !cgrid117.xg )
09649         {
09650           lua_pop( L, 1 ); // pop "xg"
09651           SWIG_fail;
09652         }
09653         if ( nx != Xlen )
09654         {
09655           lua_pushfstring( L, "Table xg must be of length%d.", Xlen );
09656           SWIG_fail;
09657         }
09658         cgrid117.nx = nx;
09659       }
09660       else
09661       {
09662         cgrid217.xg = read_double_Matrix( L, -1, &nx, &ny );
09663         if ( !cgrid217.xg )
09664         {
09665           lua_pop( L, 1 ); // pop "xg"
09666           SWIG_fail;
09667         }
09668         if ( ( nx != Xlen ) || ( ny != Ylen ) )
09669         {
09670           lua_pop( L, 1 ); // pop "xg"
09671           lua_pushfstring( L, "Vectors must match matrix." );
09672           SWIG_fail;
09673         }
09674         cgrid217.nx = nx;
09675         cgrid217.ny = ny;
09676       }
09677       lua_pop( L, 1 ); // pop "xg"
09678       
09679       lua_pushstring( L, "yg" );
09680       lua_gettable( L, 12 );
09681       if ( !lua_istable( L, -1 ) )
09682       {
09683         lua_pop( L, 1 );
09684         lua_pushstring( L, "expected a table yg" );
09685         SWIG_fail;
09686       }
09687       lua_rawgeti( L, -1, 1 );
09688       if ( gridmode == 2 )
09689       {
09690         if ( !lua_istable( L, -1 ) )
09691         {
09692           lua_pop( L, 1 ); // pop "1"
09693           lua_pop( L, 1 ); // pop "yg"
09694           lua_pushstring( L, "expected a two dimensional array/table in yg" );
09695           SWIG_fail;
09696         }
09697       }
09698       else
09699       {
09700         if ( !lua_isnumber( L, -1 ) )
09701         {
09702           lua_pop( L, 1 ); // pop "1"
09703           lua_pop( L, 1 ); // pop "yg"
09704           lua_pushstring( L, "expected a one dimensional array/table in yg" );
09705           SWIG_fail;
09706         }
09707       }
09708       lua_pop( L, 1 ); // pop "1"
09709       if ( gridmode == 1 )
09710       {
09711         cgrid117.yg = (PLFLT *) LUA_get_double_num_array_var( L, -1, &ny );
09712         if ( !cgrid117.yg )
09713         {
09714           lua_pop( L, 1 ); // pop "yg"
09715           SWIG_fail;
09716         }
09717         if ( ny != Ylen )
09718         {
09719           lua_pushfstring( L, "Table yg must be of length%d.", Ylen );
09720           SWIG_fail;
09721         }
09722         cgrid117.ny = ny;
09723       }
09724       else
09725       {
09726         cgrid217.yg = read_double_Matrix( L, -1, &nx, &ny );
09727         if ( !cgrid217.yg )
09728         {
09729           lua_pop( L, 1 ); // pop "xg"
09730           SWIG_fail;
09731         }
09732         if ( ( nx != Xlen ) || ( ny != Ylen ) )
09733         {
09734           lua_pop( L, 1 ); // pop "xg"
09735           lua_pushfstring( L, "Vectors must match matrix." );
09736           SWIG_fail;
09737         }
09738         // cgrid217.nx/ny already set
09739       }
09740       lua_pop( L, 1 ); // pop "yg"
09741       
09742       if ( gridmode == 1 )
09743       arg17 = &cgrid117;
09744       else if ( gridmode == 2 )
09745       arg17 = &cgrid217;
09746     }
09747   }
09748   plshades((double const **)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,(double const *)arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17);
09749   
09750   {
09751     int i;
09752     
09753     if ( arg1 )
09754     {
09755       for ( i = 0; i < ii1; i++ )
09756       LUA_FREE_ARRAY( arg1[i] );
09757       LUA_FREE_ARRAY( arg1 );
09758     }
09759   }
09760   {
09761     LUA_FREE_ARRAY( arg9 );
09762   }
09763   {
09764     mypltr_funcstr[0] = '\0';
09765   }
09766   {
09767     int i;
09768     
09769     LUA_FREE_ARRAY( cgrid117.xg );
09770     LUA_FREE_ARRAY( cgrid117.yg );
09771     
09772     if ( cgrid217.xg )
09773     {
09774       for ( i = 0; i < Xlen; i++ )
09775       LUA_FREE_ARRAY( cgrid217.xg[i] );
09776       LUA_FREE_ARRAY( cgrid217.xg );
09777     }
09778     if ( cgrid217.yg )
09779     {
09780       for ( i = 0; i < Xlen; i++ )
09781       LUA_FREE_ARRAY( cgrid217.yg[i] );
09782       LUA_FREE_ARRAY( cgrid217.yg );
09783     }
09784   }
09785   return SWIG_arg;
09786   
09787   if(0) SWIG_fail;
09788   
09789 fail:
09790   {
09791     int i;
09792     
09793     if ( arg1 )
09794     {
09795       for ( i = 0; i < ii1; i++ )
09796       LUA_FREE_ARRAY( arg1[i] );
09797       LUA_FREE_ARRAY( arg1 );
09798     }
09799   }
09800   {
09801     LUA_FREE_ARRAY( arg9 );
09802   }
09803   {
09804     mypltr_funcstr[0] = '\0';
09805   }
09806   {
09807     int i;
09808     
09809     LUA_FREE_ARRAY( cgrid117.xg );
09810     LUA_FREE_ARRAY( cgrid117.yg );
09811     
09812     if ( cgrid217.xg )
09813     {
09814       for ( i = 0; i < Xlen; i++ )
09815       LUA_FREE_ARRAY( cgrid217.xg[i] );
09816       LUA_FREE_ARRAY( cgrid217.xg );
09817     }
09818     if ( cgrid217.yg )
09819     {
09820       for ( i = 0; i < Xlen; i++ )
09821       LUA_FREE_ARRAY( cgrid217.yg[i] );
09822       LUA_FREE_ARRAY( cgrid217.yg );
09823     }
09824   }
09825   lua_error(L);
09826   return SWIG_arg;
09827 }
09828 
09829 
09830 static int _wrap_shade(lua_State* L) {
09831   int SWIG_arg = 0;
09832   PLFLT **arg1 = (PLFLT **) 0 ;
09833   PLINT arg2 ;
09834   PLINT arg3 ;
09835   defined_func arg4 = (defined_func) 0 ;
09836   PLFLT arg5 ;
09837   PLFLT arg6 ;
09838   PLFLT arg7 ;
09839   PLFLT arg8 ;
09840   PLFLT arg9 ;
09841   PLFLT arg10 ;
09842   PLINT arg11 ;
09843   PLFLT arg12 ;
09844   PLFLT arg13 ;
09845   PLINT arg14 ;
09846   PLFLT arg15 ;
09847   PLINT arg16 ;
09848   PLFLT arg17 ;
09849   fill_func arg18 = (fill_func) 0 ;
09850   PLBOOL arg19 ;
09851   pltr_func arg20 = (pltr_func) 0 ;
09852   PLPointer arg21 = (PLPointer) 0 ;
09853   int ii1 ;
09854   PLcGrid cgrid121 ;
09855   PLcGrid2 cgrid221 ;
09856   
09857   {
09858     cgrid121.xg = cgrid121.yg = cgrid121.zg = NULL;
09859     cgrid121.nx = cgrid121.ny = cgrid121.nz = 0;
09860     cgrid221.xg = cgrid221.yg = cgrid221.zg = NULL;
09861     cgrid221.nx = cgrid221.ny = 0;
09862   }
09863   {
09864     arg20 = NULL;
09865   }
09866   {
09867     arg21 = NULL;
09868   }
09869   {
09870     arg4 = NULL;
09871   }
09872   {
09873     arg18 = plfill;
09874   }
09875   SWIG_check_num_args("plshade",15,17)
09876   if(!lua_isnumber(L,2)) SWIG_fail_arg("plshade",2,"PLFLT");
09877   if(!lua_isnumber(L,3)) SWIG_fail_arg("plshade",3,"PLFLT");
09878   if(!lua_isnumber(L,4)) SWIG_fail_arg("plshade",4,"PLFLT");
09879   if(!lua_isnumber(L,5)) SWIG_fail_arg("plshade",5,"PLFLT");
09880   if(!lua_isnumber(L,6)) SWIG_fail_arg("plshade",6,"PLFLT");
09881   if(!lua_isnumber(L,7)) SWIG_fail_arg("plshade",7,"PLFLT");
09882   if(!lua_isnumber(L,8)) SWIG_fail_arg("plshade",8,"PLINT");
09883   if(!lua_isnumber(L,9)) SWIG_fail_arg("plshade",9,"PLFLT");
09884   if(!lua_isnumber(L,10)) SWIG_fail_arg("plshade",10,"PLFLT");
09885   if(!lua_isnumber(L,11)) SWIG_fail_arg("plshade",11,"PLINT");
09886   if(!lua_isnumber(L,12)) SWIG_fail_arg("plshade",12,"PLFLT");
09887   if(!lua_isnumber(L,13)) SWIG_fail_arg("plshade",13,"PLINT");
09888   if(!lua_isnumber(L,14)) SWIG_fail_arg("plshade",14,"PLFLT");
09889   if(!lua_isnumber(L,15)) SWIG_fail_arg("plshade",15,"PLBOOL");
09890   {
09891     int jj;
09892     
09893     arg1 = read_double_Matrix( L, 1, &ii1, &jj );
09894     if ( !arg1 )
09895     SWIG_fail;
09896     Xlen = arg2 = ii1;
09897     Ylen = arg3 = jj;
09898   }
09899   arg5 = (PLFLT)lua_tonumber(L, 2);
09900   arg6 = (PLFLT)lua_tonumber(L, 3);
09901   arg7 = (PLFLT)lua_tonumber(L, 4);
09902   arg8 = (PLFLT)lua_tonumber(L, 5);
09903   arg9 = (PLFLT)lua_tonumber(L, 6);
09904   arg10 = (PLFLT)lua_tonumber(L, 7);
09905   arg11 = (PLINT)lua_tonumber(L, 8);
09906   arg12 = (PLFLT)lua_tonumber(L, 9);
09907   arg13 = (PLFLT)lua_tonumber(L, 10);
09908   arg14 = (PLINT)lua_tonumber(L, 11);
09909   arg15 = (PLFLT)lua_tonumber(L, 12);
09910   arg16 = (PLINT)lua_tonumber(L, 13);
09911   arg17 = (PLFLT)lua_tonumber(L, 14);
09912   arg19 = (PLBOOL)lua_tonumber(L, 15);
09913   if(lua_gettop(L)>=16){
09914     {
09915       arg20 = NULL;
09916       mypltr_funcstr[0] = '\0';
09917       
09918       if ( lua_isstring( L, 16 ) )
09919       {
09920         const char* funcstr = lua_tostring( L, 16 );
09921         if ( strcmp( "pltr0", funcstr ) == 0 )
09922         {
09923           arg20 = pltr0;
09924         }
09925         else if ( strcmp( "pltr1", funcstr ) == 0 )
09926         {
09927           arg20 = pltr1;
09928         }
09929         else if ( strcmp( "pltr2", funcstr ) == 0 )
09930         {
09931           arg20 = pltr2;
09932         }
09933         else
09934         {
09935           arg20 = mypltr;
09936           strncpy( mypltr_funcstr, funcstr, 255 );
09937           myL = L;
09938         }
09939       }
09940       else
09941       SWIG_fail_arg( "shade", 20, "pltr_func" );
09942     }
09943   }
09944   if(lua_gettop(L)>=17){
09945     {
09946       int nx, ny;
09947       int gridmode = 0;
09948       
09949       lua_pushstring( L, "xg" );
09950       lua_gettable( L, 17 );
09951       if ( !lua_istable( L, -1 ) )
09952       {
09953         lua_pop( L, 1 ); // pop "xg"
09954         lua_pushstring( L, "expected a table xg" );
09955         SWIG_fail;
09956       }
09957       lua_rawgeti( L, -1, 1 );
09958       if ( lua_istable( L, -1 ) )
09959       gridmode = 2; // two dimensional array
09960       else if ( lua_isnumber( L, -1 ) )
09961       gridmode = 1; // one dimensional array
09962       else
09963       {
09964         lua_pop( L, 1 ); // pop "1"
09965         lua_pop( L, 1 ); // pop "xg"
09966         lua_pushstring( L, "expected a one or two dimensional array/table in xg" );
09967         SWIG_fail;
09968       }
09969       lua_pop( L, 1 ); // pop test element
09970       if ( gridmode == 1 )
09971       {
09972         cgrid121.xg = (PLFLT *) LUA_get_double_num_array_var( L, -1, &nx );
09973         if ( !cgrid121.xg )
09974         {
09975           lua_pop( L, 1 ); // pop "xg"
09976           SWIG_fail;
09977         }
09978         if ( nx != Xlen )
09979         {
09980           lua_pushfstring( L, "Table xg must be of length%d.", Xlen );
09981           SWIG_fail;
09982         }
09983         cgrid121.nx = nx;
09984       }
09985       else
09986       {
09987         cgrid221.xg = read_double_Matrix( L, -1, &nx, &ny );
09988         if ( !cgrid221.xg )
09989         {
09990           lua_pop( L, 1 ); // pop "xg"
09991           SWIG_fail;
09992         }
09993         if ( ( nx != Xlen ) || ( ny != Ylen ) )
09994         {
09995           lua_pop( L, 1 ); // pop "xg"
09996           lua_pushfstring( L, "Vectors must match matrix." );
09997           SWIG_fail;
09998         }
09999         cgrid221.nx = nx;
10000         cgrid221.ny = ny;
10001       }
10002       lua_pop( L, 1 ); // pop "xg"
10003       
10004       lua_pushstring( L, "yg" );
10005       lua_gettable( L, 17 );
10006       if ( !lua_istable( L, -1 ) )
10007       {
10008         lua_pop( L, 1 );
10009         lua_pushstring( L, "expected a table yg" );
10010         SWIG_fail;
10011       }
10012       lua_rawgeti( L, -1, 1 );
10013       if ( gridmode == 2 )
10014       {
10015         if ( !lua_istable( L, -1 ) )
10016         {
10017           lua_pop( L, 1 ); // pop "1"
10018           lua_pop( L, 1 ); // pop "yg"
10019           lua_pushstring( L, "expected a two dimensional array/table in yg" );
10020           SWIG_fail;
10021         }
10022       }
10023       else
10024       {
10025         if ( !lua_isnumber( L, -1 ) )
10026         {
10027           lua_pop( L, 1 ); // pop "1"
10028           lua_pop( L, 1 ); // pop "yg"
10029           lua_pushstring( L, "expected a one dimensional array/table in yg" );
10030           SWIG_fail;
10031         }
10032       }
10033       lua_pop( L, 1 ); // pop "1"
10034       if ( gridmode == 1 )
10035       {
10036         cgrid121.yg = (PLFLT *) LUA_get_double_num_array_var( L, -1, &ny );
10037         if ( !cgrid121.yg )
10038         {
10039           lua_pop( L, 1 ); // pop "yg"
10040           SWIG_fail;
10041         }
10042         if ( ny != Ylen )
10043         {
10044           lua_pushfstring( L, "Table yg must be of length%d.", Ylen );
10045           SWIG_fail;
10046         }
10047         cgrid121.ny = ny;
10048       }
10049       else
10050       {
10051         cgrid221.yg = read_double_Matrix( L, -1, &nx, &ny );
10052         if ( !cgrid221.yg )
10053         {
10054           lua_pop( L, 1 ); // pop "xg"
10055           SWIG_fail;
10056         }
10057         if ( ( nx != Xlen ) || ( ny != Ylen ) )
10058         {
10059           lua_pop( L, 1 ); // pop "xg"
10060           lua_pushfstring( L, "Vectors must match matrix." );
10061           SWIG_fail;
10062         }
10063         // cgrid221.nx/ny already set
10064       }
10065       lua_pop( L, 1 ); // pop "yg"
10066       
10067       if ( gridmode == 1 )
10068       arg21 = &cgrid121;
10069       else if ( gridmode == 2 )
10070       arg21 = &cgrid221;
10071     }
10072   }
10073   plshade((double const **)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19,arg20,arg21);
10074   
10075   {
10076     int i;
10077     
10078     if ( arg1 )
10079     {
10080       for ( i = 0; i < ii1; i++ )
10081       LUA_FREE_ARRAY( arg1[i] );
10082       LUA_FREE_ARRAY( arg1 );
10083     }
10084   }
10085   {
10086     mypltr_funcstr[0] = '\0';
10087   }
10088   {
10089     int i;
10090     
10091     LUA_FREE_ARRAY( cgrid121.xg );
10092     LUA_FREE_ARRAY( cgrid121.yg );
10093     
10094     if ( cgrid221.xg )
10095     {
10096       for ( i = 0; i < Xlen; i++ )
10097       LUA_FREE_ARRAY( cgrid221.xg[i] );
10098       LUA_FREE_ARRAY( cgrid221.xg );
10099     }
10100     if ( cgrid221.yg )
10101     {
10102       for ( i = 0; i < Xlen; i++ )
10103       LUA_FREE_ARRAY( cgrid221.yg[i] );
10104       LUA_FREE_ARRAY( cgrid221.yg );
10105     }
10106   }
10107   return SWIG_arg;
10108   
10109   if(0) SWIG_fail;
10110   
10111 fail:
10112   {
10113     int i;
10114     
10115     if ( arg1 )
10116     {
10117       for ( i = 0; i < ii1; i++ )
10118       LUA_FREE_ARRAY( arg1[i] );
10119       LUA_FREE_ARRAY( arg1 );
10120     }
10121   }
10122   {
10123     mypltr_funcstr[0] = '\0';
10124   }
10125   {
10126     int i;
10127     
10128     LUA_FREE_ARRAY( cgrid121.xg );
10129     LUA_FREE_ARRAY( cgrid121.yg );
10130     
10131     if ( cgrid221.xg )
10132     {
10133       for ( i = 0; i < Xlen; i++ )
10134       LUA_FREE_ARRAY( cgrid221.xg[i] );
10135       LUA_FREE_ARRAY( cgrid221.xg );
10136     }
10137     if ( cgrid221.yg )
10138     {
10139       for ( i = 0; i < Xlen; i++ )
10140       LUA_FREE_ARRAY( cgrid221.yg[i] );
10141       LUA_FREE_ARRAY( cgrid221.yg );
10142     }
10143   }
10144   lua_error(L);
10145   return SWIG_arg;
10146 }
10147 
10148 
10149 static int _wrap_slabelfunc(lua_State* L) {
10150   int SWIG_arg = 0;
10151   label_func arg1 = (label_func) 0 ;
10152   PLPointer arg2 = (PLPointer) 0 ;
10153   
10154   {
10155     arg2 = NULL;
10156   }
10157   SWIG_check_num_args("plslabelfunc",1,1)
10158   {
10159     arg1 = NULL;
10160     mylabel_funcstr[0] = '\0';
10161     
10162     if ( lua_isnil( L, 1 ) )
10163     {
10164       arg1 = NULL;
10165     }
10166     else if ( lua_isstring( L, 1 ) )
10167     {
10168       arg1 = mylabel;
10169       strncpy( mylabel_funcstr, lua_tostring( L, 1 ), 255 );
10170       myL = L;
10171     }
10172     else
10173     SWIG_fail_arg( "slabelfunc", 1, "label_func" );
10174   }
10175   plslabelfunc(arg1,arg2);
10176   
10177   {
10178     
10179   }
10180   return SWIG_arg;
10181   
10182   if(0) SWIG_fail;
10183   
10184 fail:
10185   {
10186     
10187   }
10188   lua_error(L);
10189   return SWIG_arg;
10190 }
10191 
10192 
10193 static int _wrap_smaj(lua_State* L) {
10194   int SWIG_arg = 0;
10195   PLFLT arg1 ;
10196   PLFLT arg2 ;
10197   
10198   SWIG_check_num_args("plsmaj",2,2)
10199   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsmaj",1,"PLFLT");
10200   if(!lua_isnumber(L,2)) SWIG_fail_arg("plsmaj",2,"PLFLT");
10201   arg1 = (PLFLT)lua_tonumber(L, 1);
10202   arg2 = (PLFLT)lua_tonumber(L, 2);
10203   plsmaj(arg1,arg2);
10204   
10205   return SWIG_arg;
10206   
10207   if(0) SWIG_fail;
10208   
10209 fail:
10210   lua_error(L);
10211   return SWIG_arg;
10212 }
10213 
10214 
10215 static int _wrap_smin(lua_State* L) {
10216   int SWIG_arg = 0;
10217   PLFLT arg1 ;
10218   PLFLT arg2 ;
10219   
10220   SWIG_check_num_args("plsmin",2,2)
10221   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsmin",1,"PLFLT");
10222   if(!lua_isnumber(L,2)) SWIG_fail_arg("plsmin",2,"PLFLT");
10223   arg1 = (PLFLT)lua_tonumber(L, 1);
10224   arg2 = (PLFLT)lua_tonumber(L, 2);
10225   plsmin(arg1,arg2);
10226   
10227   return SWIG_arg;
10228   
10229   if(0) SWIG_fail;
10230   
10231 fail:
10232   lua_error(L);
10233   return SWIG_arg;
10234 }
10235 
10236 
10237 static int _wrap_sori(lua_State* L) {
10238   int SWIG_arg = 0;
10239   PLINT arg1 ;
10240   
10241   SWIG_check_num_args("plsori",1,1)
10242   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsori",1,"PLINT");
10243   arg1 = (PLINT)lua_tonumber(L, 1);
10244   plsori(arg1);
10245   
10246   return SWIG_arg;
10247   
10248   if(0) SWIG_fail;
10249   
10250 fail:
10251   lua_error(L);
10252   return SWIG_arg;
10253 }
10254 
10255 
10256 static int _wrap_spage(lua_State* L) {
10257   int SWIG_arg = 0;
10258   PLFLT arg1 ;
10259   PLFLT arg2 ;
10260   PLINT arg3 ;
10261   PLINT arg4 ;
10262   PLINT arg5 ;
10263   PLINT arg6 ;
10264   
10265   SWIG_check_num_args("plspage",6,6)
10266   if(!lua_isnumber(L,1)) SWIG_fail_arg("plspage",1,"PLFLT");
10267   if(!lua_isnumber(L,2)) SWIG_fail_arg("plspage",2,"PLFLT");
10268   if(!lua_isnumber(L,3)) SWIG_fail_arg("plspage",3,"PLINT");
10269   if(!lua_isnumber(L,4)) SWIG_fail_arg("plspage",4,"PLINT");
10270   if(!lua_isnumber(L,5)) SWIG_fail_arg("plspage",5,"PLINT");
10271   if(!lua_isnumber(L,6)) SWIG_fail_arg("plspage",6,"PLINT");
10272   arg1 = (PLFLT)lua_tonumber(L, 1);
10273   arg2 = (PLFLT)lua_tonumber(L, 2);
10274   arg3 = (PLINT)lua_tonumber(L, 3);
10275   arg4 = (PLINT)lua_tonumber(L, 4);
10276   arg5 = (PLINT)lua_tonumber(L, 5);
10277   arg6 = (PLINT)lua_tonumber(L, 6);
10278   plspage(arg1,arg2,arg3,arg4,arg5,arg6);
10279   
10280   return SWIG_arg;
10281   
10282   if(0) SWIG_fail;
10283   
10284 fail:
10285   lua_error(L);
10286   return SWIG_arg;
10287 }
10288 
10289 
10290 static int _wrap_spal0(lua_State* L) {
10291   int SWIG_arg = 0;
10292   char *arg1 = (char *) 0 ;
10293   
10294   SWIG_check_num_args("plspal0",1,1)
10295   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plspal0",1,"char const *");
10296   arg1 = (char *)lua_tostring(L, 1);
10297   plspal0((char const *)arg1);
10298   
10299   return SWIG_arg;
10300   
10301   if(0) SWIG_fail;
10302   
10303 fail:
10304   lua_error(L);
10305   return SWIG_arg;
10306 }
10307 
10308 
10309 static int _wrap_spal1(lua_State* L) {
10310   int SWIG_arg = 0;
10311   char *arg1 = (char *) 0 ;
10312   PLBOOL arg2 ;
10313   
10314   SWIG_check_num_args("plspal1",2,2)
10315   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plspal1",1,"char const *");
10316   if(!lua_isnumber(L,2)) SWIG_fail_arg("plspal1",2,"PLBOOL");
10317   arg1 = (char *)lua_tostring(L, 1);
10318   arg2 = (PLBOOL)lua_tonumber(L, 2);
10319   plspal1((char const *)arg1,arg2);
10320   
10321   return SWIG_arg;
10322   
10323   if(0) SWIG_fail;
10324   
10325 fail:
10326   lua_error(L);
10327   return SWIG_arg;
10328 }
10329 
10330 
10331 static int _wrap_spause(lua_State* L) {
10332   int SWIG_arg = 0;
10333   PLBOOL arg1 ;
10334   
10335   SWIG_check_num_args("plspause",1,1)
10336   if(!lua_isnumber(L,1)) SWIG_fail_arg("plspause",1,"PLBOOL");
10337   arg1 = (PLBOOL)lua_tonumber(L, 1);
10338   plspause(arg1);
10339   
10340   return SWIG_arg;
10341   
10342   if(0) SWIG_fail;
10343   
10344 fail:
10345   lua_error(L);
10346   return SWIG_arg;
10347 }
10348 
10349 
10350 static int _wrap_sstrm(lua_State* L) {
10351   int SWIG_arg = 0;
10352   PLINT arg1 ;
10353   
10354   SWIG_check_num_args("plsstrm",1,1)
10355   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsstrm",1,"PLINT");
10356   arg1 = (PLINT)lua_tonumber(L, 1);
10357   plsstrm(arg1);
10358   
10359   return SWIG_arg;
10360   
10361   if(0) SWIG_fail;
10362   
10363 fail:
10364   lua_error(L);
10365   return SWIG_arg;
10366 }
10367 
10368 
10369 static int _wrap_ssub(lua_State* L) {
10370   int SWIG_arg = 0;
10371   PLINT arg1 ;
10372   PLINT arg2 ;
10373   
10374   SWIG_check_num_args("plssub",2,2)
10375   if(!lua_isnumber(L,1)) SWIG_fail_arg("plssub",1,"PLINT");
10376   if(!lua_isnumber(L,2)) SWIG_fail_arg("plssub",2,"PLINT");
10377   arg1 = (PLINT)lua_tonumber(L, 1);
10378   arg2 = (PLINT)lua_tonumber(L, 2);
10379   plssub(arg1,arg2);
10380   
10381   return SWIG_arg;
10382   
10383   if(0) SWIG_fail;
10384   
10385 fail:
10386   lua_error(L);
10387   return SWIG_arg;
10388 }
10389 
10390 
10391 static int _wrap_ssym(lua_State* L) {
10392   int SWIG_arg = 0;
10393   PLFLT arg1 ;
10394   PLFLT arg2 ;
10395   
10396   SWIG_check_num_args("plssym",2,2)
10397   if(!lua_isnumber(L,1)) SWIG_fail_arg("plssym",1,"PLFLT");
10398   if(!lua_isnumber(L,2)) SWIG_fail_arg("plssym",2,"PLFLT");
10399   arg1 = (PLFLT)lua_tonumber(L, 1);
10400   arg2 = (PLFLT)lua_tonumber(L, 2);
10401   plssym(arg1,arg2);
10402   
10403   return SWIG_arg;
10404   
10405   if(0) SWIG_fail;
10406   
10407 fail:
10408   lua_error(L);
10409   return SWIG_arg;
10410 }
10411 
10412 
10413 static int _wrap_star(lua_State* L) {
10414   int SWIG_arg = 0;
10415   PLINT arg1 ;
10416   PLINT arg2 ;
10417   
10418   SWIG_check_num_args("plstar",2,2)
10419   if(!lua_isnumber(L,1)) SWIG_fail_arg("plstar",1,"PLINT");
10420   if(!lua_isnumber(L,2)) SWIG_fail_arg("plstar",2,"PLINT");
10421   arg1 = (PLINT)lua_tonumber(L, 1);
10422   arg2 = (PLINT)lua_tonumber(L, 2);
10423   plstar(arg1,arg2);
10424   
10425   return SWIG_arg;
10426   
10427   if(0) SWIG_fail;
10428   
10429 fail:
10430   lua_error(L);
10431   return SWIG_arg;
10432 }
10433 
10434 
10435 static int _wrap_start(lua_State* L) {
10436   int SWIG_arg = 0;
10437   char *arg1 = (char *) 0 ;
10438   PLINT arg2 ;
10439   PLINT arg3 ;
10440   
10441   SWIG_check_num_args("plstart",3,3)
10442   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plstart",1,"char const *");
10443   if(!lua_isnumber(L,2)) SWIG_fail_arg("plstart",2,"PLINT");
10444   if(!lua_isnumber(L,3)) SWIG_fail_arg("plstart",3,"PLINT");
10445   arg1 = (char *)lua_tostring(L, 1);
10446   arg2 = (PLINT)lua_tonumber(L, 2);
10447   arg3 = (PLINT)lua_tonumber(L, 3);
10448   plstart((char const *)arg1,arg2,arg3);
10449   
10450   return SWIG_arg;
10451   
10452   if(0) SWIG_fail;
10453   
10454 fail:
10455   lua_error(L);
10456   return SWIG_arg;
10457 }
10458 
10459 
10460 static int _wrap_stransform(lua_State* L) {
10461   int SWIG_arg = 0;
10462   ct_func arg1 = (ct_func) 0 ;
10463   PLPointer arg2 = (PLPointer) 0 ;
10464   
10465   {
10466     arg1 = NULL;
10467     myct_funcstr[0] = '\0';
10468   }
10469   {
10470     arg2 = NULL;
10471   }
10472   SWIG_check_num_args("plstransform",0,1)
10473   if(lua_gettop(L)>=1){
10474     {
10475       arg1 = NULL;
10476       myct_funcstr[0] = '\0';
10477       
10478       if ( lua_isstring( L, 1 ) )
10479       {
10480         const char* funcstr = lua_tostring( L, 1 );
10481         arg1 = myct;
10482         strncpy( myct_funcstr, funcstr, 255 );
10483         myL = L;
10484       }
10485       else
10486       SWIG_fail_arg( "stransform", 1, "ct_func" );
10487     }
10488   }
10489   plstransform(arg1,arg2);
10490   
10491   return SWIG_arg;
10492   
10493   if(0) SWIG_fail;
10494   
10495 fail:
10496   lua_error(L);
10497   return SWIG_arg;
10498 }
10499 
10500 
10501 static int _wrap_string(lua_State* L) {
10502   int SWIG_arg = 0;
10503   PLINT arg1 ;
10504   PLFLT *arg2 = (PLFLT *) 0 ;
10505   PLFLT *arg3 = (PLFLT *) 0 ;
10506   char *arg4 = (char *) 0 ;
10507   int temp3 ;
10508   
10509   SWIG_check_num_args("plstring",3,3)
10510   if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("plstring",3,"char const *");
10511   {
10512     int temp;
10513     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
10514     if ( !arg2 )
10515     SWIG_fail;
10516     arg1 = Alen = temp;
10517   }
10518   {
10519     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
10520     if ( !arg3 )
10521     SWIG_fail;
10522     if ( temp3 != Alen )
10523     {
10524       lua_pushfstring( L, "Tables must be of same length." );
10525       SWIG_fail;
10526     }
10527   }
10528   arg4 = (char *)lua_tostring(L, 3);
10529   plstring(arg1,(double const *)arg2,(double const *)arg3,(char const *)arg4);
10530   
10531   {
10532     LUA_FREE_ARRAY( arg2 );
10533   }
10534   {
10535     LUA_FREE_ARRAY( arg3 ); 
10536   }
10537   return SWIG_arg;
10538   
10539   if(0) SWIG_fail;
10540   
10541 fail:
10542   {
10543     LUA_FREE_ARRAY( arg2 );
10544   }
10545   {
10546     LUA_FREE_ARRAY( arg3 ); 
10547   }
10548   lua_error(L);
10549   return SWIG_arg;
10550 }
10551 
10552 
10553 static int _wrap_string3(lua_State* L) {
10554   int SWIG_arg = 0;
10555   PLINT arg1 ;
10556   PLFLT *arg2 = (PLFLT *) 0 ;
10557   PLFLT *arg3 = (PLFLT *) 0 ;
10558   PLFLT *arg4 = (PLFLT *) 0 ;
10559   char *arg5 = (char *) 0 ;
10560   int temp3 ;
10561   int temp4 ;
10562   
10563   SWIG_check_num_args("plstring3",4,4)
10564   if(!SWIG_lua_isnilstring(L,4)) SWIG_fail_arg("plstring3",4,"char const *");
10565   {
10566     int temp;
10567     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
10568     if ( !arg2 )
10569     SWIG_fail;
10570     arg1 = Alen = temp;
10571   }
10572   {
10573     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
10574     if ( !arg3 )
10575     SWIG_fail;
10576     if ( temp3 != Alen )
10577     {
10578       lua_pushfstring( L, "Tables must be of same length." );
10579       SWIG_fail;
10580     }
10581   }
10582   {
10583     arg4 = (PLFLT *) LUA_get_double_num_array_var( L, 3, &temp4 );
10584     if ( !arg4 )
10585     SWIG_fail;
10586     if ( temp4 != Alen )
10587     {
10588       lua_pushfstring( L, "Tables must be of same length." );
10589       SWIG_fail;
10590     }
10591   }
10592   arg5 = (char *)lua_tostring(L, 4);
10593   plstring3(arg1,(double const *)arg2,(double const *)arg3,(double const *)arg4,(char const *)arg5);
10594   
10595   {
10596     LUA_FREE_ARRAY( arg2 );
10597   }
10598   {
10599     LUA_FREE_ARRAY( arg3 ); 
10600   }
10601   {
10602     LUA_FREE_ARRAY( arg4 ); 
10603   }
10604   return SWIG_arg;
10605   
10606   if(0) SWIG_fail;
10607   
10608 fail:
10609   {
10610     LUA_FREE_ARRAY( arg2 );
10611   }
10612   {
10613     LUA_FREE_ARRAY( arg3 ); 
10614   }
10615   {
10616     LUA_FREE_ARRAY( arg4 ); 
10617   }
10618   lua_error(L);
10619   return SWIG_arg;
10620 }
10621 
10622 
10623 static int _wrap_stripa(lua_State* L) {
10624   int SWIG_arg = 0;
10625   PLINT arg1 ;
10626   PLINT arg2 ;
10627   PLFLT arg3 ;
10628   PLFLT arg4 ;
10629   
10630   SWIG_check_num_args("plstripa",4,4)
10631   if(!lua_isnumber(L,1)) SWIG_fail_arg("plstripa",1,"PLINT");
10632   if(!lua_isnumber(L,2)) SWIG_fail_arg("plstripa",2,"PLINT");
10633   if(!lua_isnumber(L,3)) SWIG_fail_arg("plstripa",3,"PLFLT");
10634   if(!lua_isnumber(L,4)) SWIG_fail_arg("plstripa",4,"PLFLT");
10635   arg1 = (PLINT)lua_tonumber(L, 1);
10636   arg2 = (PLINT)lua_tonumber(L, 2);
10637   arg3 = (PLFLT)lua_tonumber(L, 3);
10638   arg4 = (PLFLT)lua_tonumber(L, 4);
10639   plstripa(arg1,arg2,arg3,arg4);
10640   
10641   return SWIG_arg;
10642   
10643   if(0) SWIG_fail;
10644   
10645 fail:
10646   lua_error(L);
10647   return SWIG_arg;
10648 }
10649 
10650 
10651 static int _wrap_stripc(lua_State* L) {
10652   int SWIG_arg = 0;
10653   PLINT *arg1 = (PLINT *) 0 ;
10654   char *arg2 = (char *) 0 ;
10655   char *arg3 = (char *) 0 ;
10656   PLFLT arg4 ;
10657   PLFLT arg5 ;
10658   PLFLT arg6 ;
10659   PLFLT arg7 ;
10660   PLFLT arg8 ;
10661   PLFLT arg9 ;
10662   PLFLT arg10 ;
10663   PLBOOL arg11 ;
10664   PLBOOL arg12 ;
10665   PLINT arg13 ;
10666   PLINT arg14 ;
10667   PLINT *arg15 = (PLINT *) 0 ;
10668   PLINT *arg16 = (PLINT *) 0 ;
10669   char **arg17 ;
10670   char *arg18 = (char *) 0 ;
10671   char *arg19 = (char *) 0 ;
10672   char *arg20 = (char *) 0 ;
10673   PLINT temp1 ;
10674   int temp15 ;
10675   int temp16 ;
10676   
10677   {
10678     arg17 = NULL; 
10679   }
10680   arg1 = &temp1; 
10681   SWIG_check_num_args("plstripc",15,19)
10682   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plstripc",1,"char const *");
10683   if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("plstripc",2,"char const *");
10684   if(!lua_isnumber(L,3)) SWIG_fail_arg("plstripc",3,"PLFLT");
10685   if(!lua_isnumber(L,4)) SWIG_fail_arg("plstripc",4,"PLFLT");
10686   if(!lua_isnumber(L,5)) SWIG_fail_arg("plstripc",5,"PLFLT");
10687   if(!lua_isnumber(L,6)) SWIG_fail_arg("plstripc",6,"PLFLT");
10688   if(!lua_isnumber(L,7)) SWIG_fail_arg("plstripc",7,"PLFLT");
10689   if(!lua_isnumber(L,8)) SWIG_fail_arg("plstripc",8,"PLFLT");
10690   if(!lua_isnumber(L,9)) SWIG_fail_arg("plstripc",9,"PLFLT");
10691   if(!lua_isnumber(L,10)) SWIG_fail_arg("plstripc",10,"PLBOOL");
10692   if(!lua_isnumber(L,11)) SWIG_fail_arg("plstripc",11,"PLBOOL");
10693   if(!lua_isnumber(L,12)) SWIG_fail_arg("plstripc",12,"PLINT");
10694   if(!lua_isnumber(L,13)) SWIG_fail_arg("plstripc",13,"PLINT");
10695   if(lua_gettop(L)>=16 && !lua_istable(L,16)) SWIG_fail_arg("plstripc",16,"char const *[4]");
10696   if(lua_gettop(L)>=17 && !SWIG_lua_isnilstring(L,17)) SWIG_fail_arg("plstripc",17,"char const *");
10697   if(lua_gettop(L)>=18 && !SWIG_lua_isnilstring(L,18)) SWIG_fail_arg("plstripc",18,"char const *");
10698   if(lua_gettop(L)>=19 && !SWIG_lua_isnilstring(L,19)) SWIG_fail_arg("plstripc",19,"char const *");
10699   arg2 = (char *)lua_tostring(L, 1);
10700   arg3 = (char *)lua_tostring(L, 2);
10701   arg4 = (PLFLT)lua_tonumber(L, 3);
10702   arg5 = (PLFLT)lua_tonumber(L, 4);
10703   arg6 = (PLFLT)lua_tonumber(L, 5);
10704   arg7 = (PLFLT)lua_tonumber(L, 6);
10705   arg8 = (PLFLT)lua_tonumber(L, 7);
10706   arg9 = (PLFLT)lua_tonumber(L, 8);
10707   arg10 = (PLFLT)lua_tonumber(L, 9);
10708   arg11 = (PLBOOL)lua_tonumber(L, 10);
10709   arg12 = (PLBOOL)lua_tonumber(L, 11);
10710   arg13 = (PLINT)lua_tonumber(L, 12);
10711   arg14 = (PLINT)lua_tonumber(L, 13);
10712   {
10713     arg15 = (PLINT *) LUA_get_int_num_array_var( L, 14, &temp15 );
10714     if ( !arg15 )
10715     SWIG_fail;
10716     Alen = temp15;
10717   }
10718   {
10719     arg16 = (PLINT *) LUA_get_int_num_array_var( L, 15, &temp16 );
10720     if ( !arg16 )
10721     SWIG_fail;
10722     if ( temp16 != Alen )
10723     {
10724       lua_pushfstring( L, "Tables must be of same length." );
10725       SWIG_fail;
10726     }
10727   }
10728   if(lua_gettop(L)>=16){
10729     {
10730       int i;
10731       arg17 = NULL;
10732       
10733       if ( SWIG_table_size( L, 16 ) != 4 )
10734       {
10735         lua_pushfstring( L, "Requires a sequence of 4 strings." );
10736         SWIG_fail;
10737       }
10738       if ( Alen != 4 )
10739       {
10740         lua_pushfstring( L, "colline and styline args must be length 4." );
10741         SWIG_fail;
10742       }
10743       
10744       arg17 = malloc( sizeof ( char* ) * 4 );
10745       for ( i = 1; i <= 4; i++ )
10746       {
10747         lua_rawgeti( L, 16, i );
10748         if ( lua_isstring( L, -1 ) )
10749         {
10750           arg17[i - 1] = (char *) lua_tostring( L, -1 );
10751         }
10752         else
10753         {
10754           lua_pop( L, 1 );
10755           lua_pushfstring( L, "Requires a sequence of 4 strings." );
10756           SWIG_fail;
10757           // arg17 array is freed after 'fail:'
10758         }
10759         lua_pop( L, 1 );
10760       }
10761     }
10762   }
10763   if(lua_gettop(L)>=17){
10764     arg18 = (char *)lua_tostring(L, 17);
10765   }
10766   if(lua_gettop(L)>=18){
10767     arg19 = (char *)lua_tostring(L, 18);
10768   }
10769   if(lua_gettop(L)>=19){
10770     arg20 = (char *)lua_tostring(L, 19);
10771   }
10772   plstripc(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,(int const *)arg15,(int const *)arg16,(char const *(*))arg17,(char const *)arg18,(char const *)arg19,(char const *)arg20);
10773   
10774   lua_pushnumber(L, (lua_Number) *arg1); SWIG_arg++;
10775   {
10776     LUA_FREE_ARRAY( arg15 );
10777   }
10778   {
10779     LUA_FREE_ARRAY( arg16 ); 
10780   }
10781   {
10782     if ( arg17 )
10783     {
10784       free( arg17 ); arg17 = NULL;
10785     }
10786   }
10787   return SWIG_arg;
10788   
10789   if(0) SWIG_fail;
10790   
10791 fail:
10792   {
10793     LUA_FREE_ARRAY( arg15 );
10794   }
10795   {
10796     LUA_FREE_ARRAY( arg16 ); 
10797   }
10798   {
10799     if ( arg17 )
10800     {
10801       free( arg17 ); arg17 = NULL;
10802     }
10803   }
10804   lua_error(L);
10805   return SWIG_arg;
10806 }
10807 
10808 
10809 static int _wrap_stripd(lua_State* L) {
10810   int SWIG_arg = 0;
10811   PLINT arg1 ;
10812   
10813   SWIG_check_num_args("plstripd",1,1)
10814   if(!lua_isnumber(L,1)) SWIG_fail_arg("plstripd",1,"PLINT");
10815   arg1 = (PLINT)lua_tonumber(L, 1);
10816   plstripd(arg1);
10817   
10818   return SWIG_arg;
10819   
10820   if(0) SWIG_fail;
10821   
10822 fail:
10823   lua_error(L);
10824   return SWIG_arg;
10825 }
10826 
10827 
10828 static int _wrap_styl(lua_State* L) {
10829   int SWIG_arg = 0;
10830   PLINT arg1 ;
10831   PLINT *arg2 = (PLINT *) 0 ;
10832   PLINT *arg3 = (PLINT *) 0 ;
10833   int temp3 ;
10834   
10835   SWIG_check_num_args("plstyl",2,2)
10836   {
10837     arg2 = (PLINT *) LUA_get_int_num_array_var( L, 1, &arg1 );
10838     if ( !arg2 )
10839     SWIG_fail;
10840     Alen = arg1;
10841   }
10842   {
10843     arg3 = (PLINT *) LUA_get_int_num_array_var( L, 2, &temp3 );
10844     if ( !arg3 )
10845     SWIG_fail;
10846     if ( temp3 != Alen )
10847     {
10848       lua_pushfstring( L, "Tables must be of same length." );
10849       SWIG_fail;
10850     }
10851   }
10852   plstyl(arg1,(int const *)arg2,(int const *)arg3);
10853   
10854   {
10855     LUA_FREE_ARRAY( arg2 );
10856   }
10857   {
10858     LUA_FREE_ARRAY( arg3 ); 
10859   }
10860   return SWIG_arg;
10861   
10862   if(0) SWIG_fail;
10863   
10864 fail:
10865   {
10866     LUA_FREE_ARRAY( arg2 );
10867   }
10868   {
10869     LUA_FREE_ARRAY( arg3 ); 
10870   }
10871   lua_error(L);
10872   return SWIG_arg;
10873 }
10874 
10875 
10876 static int _wrap_svect(lua_State* L) {
10877   int SWIG_arg = 0;
10878   PLFLT *arg1 = (PLFLT *) 0 ;
10879   PLFLT *arg2 = (PLFLT *) 0 ;
10880   PLINT arg3 ;
10881   PLBOOL arg4 ;
10882   
10883   {
10884     arg2 = NULL; arg3 = 0;
10885   }
10886   {
10887     arg4 = 0;
10888   }
10889   SWIG_check_num_args("plsvect",1,3)
10890   if(lua_gettop(L)>=3 && !lua_isnumber(L,3)) SWIG_fail_arg("plsvect",3,"PLBOOL");
10891   {
10892     int temp;
10893     if ( lua_isnil( L, 1 ) )
10894     {
10895       arg1   = NULL;
10896       Alen = 0;
10897     }
10898     else
10899     {
10900       arg1 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
10901       if ( !arg1 )
10902       SWIG_fail;
10903       Alen = temp;
10904     }
10905   }
10906   if(lua_gettop(L)>=2){
10907     {
10908       int temp = 0;
10909       if ( lua_isnil( L, 2 ) )
10910       {
10911         arg2 = NULL;
10912       }
10913       else
10914       {
10915         arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp );
10916         if ( !arg2 )
10917         SWIG_fail;
10918         if ( temp != Alen )
10919         {
10920           lua_pushfstring( L, "Tables must be of same length." );
10921           SWIG_fail;
10922         }
10923       }
10924       arg3 = temp;
10925     }
10926   }
10927   if(lua_gettop(L)>=3){
10928     arg4 = (PLBOOL)lua_tonumber(L, 3);
10929   }
10930   plsvect((double const *)arg1,(double const *)arg2,arg3,arg4);
10931   
10932   {
10933     LUA_FREE_ARRAY( arg2 );
10934   }
10935   return SWIG_arg;
10936   
10937   if(0) SWIG_fail;
10938   
10939 fail:
10940   {
10941     LUA_FREE_ARRAY( arg2 );
10942   }
10943   lua_error(L);
10944   return SWIG_arg;
10945 }
10946 
10947 
10948 static int _wrap_svpa(lua_State* L) {
10949   int SWIG_arg = 0;
10950   PLFLT arg1 ;
10951   PLFLT arg2 ;
10952   PLFLT arg3 ;
10953   PLFLT arg4 ;
10954   
10955   SWIG_check_num_args("plsvpa",4,4)
10956   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsvpa",1,"PLFLT");
10957   if(!lua_isnumber(L,2)) SWIG_fail_arg("plsvpa",2,"PLFLT");
10958   if(!lua_isnumber(L,3)) SWIG_fail_arg("plsvpa",3,"PLFLT");
10959   if(!lua_isnumber(L,4)) SWIG_fail_arg("plsvpa",4,"PLFLT");
10960   arg1 = (PLFLT)lua_tonumber(L, 1);
10961   arg2 = (PLFLT)lua_tonumber(L, 2);
10962   arg3 = (PLFLT)lua_tonumber(L, 3);
10963   arg4 = (PLFLT)lua_tonumber(L, 4);
10964   plsvpa(arg1,arg2,arg3,arg4);
10965   
10966   return SWIG_arg;
10967   
10968   if(0) SWIG_fail;
10969   
10970 fail:
10971   lua_error(L);
10972   return SWIG_arg;
10973 }
10974 
10975 
10976 static int _wrap_sxax(lua_State* L) {
10977   int SWIG_arg = 0;
10978   PLINT arg1 ;
10979   PLINT arg2 ;
10980   
10981   SWIG_check_num_args("plsxax",2,2)
10982   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsxax",1,"PLINT");
10983   if(!lua_isnumber(L,2)) SWIG_fail_arg("plsxax",2,"PLINT");
10984   arg1 = (PLINT)lua_tonumber(L, 1);
10985   arg2 = (PLINT)lua_tonumber(L, 2);
10986   plsxax(arg1,arg2);
10987   
10988   return SWIG_arg;
10989   
10990   if(0) SWIG_fail;
10991   
10992 fail:
10993   lua_error(L);
10994   return SWIG_arg;
10995 }
10996 
10997 
10998 static int _wrap_syax(lua_State* L) {
10999   int SWIG_arg = 0;
11000   PLINT arg1 ;
11001   PLINT arg2 ;
11002   
11003   SWIG_check_num_args("plsyax",2,2)
11004   if(!lua_isnumber(L,1)) SWIG_fail_arg("plsyax",1,"PLINT");
11005   if(!lua_isnumber(L,2)) SWIG_fail_arg("plsyax",2,"PLINT");
11006   arg1 = (PLINT)lua_tonumber(L, 1);
11007   arg2 = (PLINT)lua_tonumber(L, 2);
11008   plsyax(arg1,arg2);
11009   
11010   return SWIG_arg;
11011   
11012   if(0) SWIG_fail;
11013   
11014 fail:
11015   lua_error(L);
11016   return SWIG_arg;
11017 }
11018 
11019 
11020 static int _wrap_sym(lua_State* L) {
11021   int SWIG_arg = 0;
11022   PLINT arg1 ;
11023   PLFLT *arg2 = (PLFLT *) 0 ;
11024   PLFLT *arg3 = (PLFLT *) 0 ;
11025   PLINT arg4 ;
11026   int temp3 ;
11027   
11028   SWIG_check_num_args("plsym",3,3)
11029   if(!lua_isnumber(L,3)) SWIG_fail_arg("plsym",3,"PLINT");
11030   {
11031     int temp;
11032     arg2 = (PLFLT *) LUA_get_double_num_array_var( L, 1, &temp );
11033     if ( !arg2 )
11034     SWIG_fail;
11035     arg1 = Alen = temp;
11036   }
11037   {
11038     arg3 = (PLFLT *) LUA_get_double_num_array_var( L, 2, &temp3 );
11039     if ( !arg3 )
11040     SWIG_fail;
11041     if ( temp3 != Alen )
11042     {
11043       lua_pushfstring( L, "Tables must be of same length." );
11044       SWIG_fail;
11045     }
11046   }
11047   arg4 = (PLINT)lua_tonumber(L, 3);
11048   plsym(arg1,(double const *)arg2,(double const *)arg3,arg4);
11049   
11050   {
11051     LUA_FREE_ARRAY( arg2 );
11052   }
11053   {
11054     LUA_FREE_ARRAY( arg3 ); 
11055   }
11056   return SWIG_arg;
11057   
11058   if(0) SWIG_fail;
11059   
11060 fail:
11061   {
11062     LUA_FREE_ARRAY( arg2 );
11063   }
11064   {
11065     LUA_FREE_ARRAY( arg3 ); 
11066   }
11067   lua_error(L);
11068   return SWIG_arg;
11069 }
11070 
11071 
11072 static int _wrap_szax(lua_State* L) {
11073   int SWIG_arg = 0;
11074   PLINT arg1 ;
11075   PLINT arg2 ;
11076   
11077   SWIG_check_num_args("plszax",2,2)
11078   if(!lua_isnumber(L,1)) SWIG_fail_arg("plszax",1,"PLINT");
11079   if(!lua_isnumber(L,2)) SWIG_fail_arg("plszax",2,"PLINT");
11080   arg1 = (PLINT)lua_tonumber(L, 1);
11081   arg2 = (PLINT)lua_tonumber(L, 2);
11082   plszax(arg1,arg2);
11083   
11084   return SWIG_arg;
11085   
11086   if(0) SWIG_fail;
11087   
11088 fail:
11089   lua_error(L);
11090   return SWIG_arg;
11091 }
11092 
11093 
11094 static int _wrap_text(lua_State* L) {
11095   int SWIG_arg = 0;
11096   
11097   SWIG_check_num_args("pltext",0,0)
11098   pltext();
11099   
11100   return SWIG_arg;
11101   
11102   if(0) SWIG_fail;
11103   
11104 fail:
11105   lua_error(L);
11106   return SWIG_arg;
11107 }
11108 
11109 
11110 static int _wrap_timefmt(lua_State* L) {
11111   int SWIG_arg = 0;
11112   char *arg1 = (char *) 0 ;
11113   
11114   SWIG_check_num_args("pltimefmt",1,1)
11115   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("pltimefmt",1,"char const *");
11116   arg1 = (char *)lua_tostring(L, 1);
11117   pltimefmt((char const *)arg1);
11118   
11119   return SWIG_arg;
11120   
11121   if(0) SWIG_fail;
11122   
11123 fail:
11124   lua_error(L);
11125   return SWIG_arg;
11126 }
11127 
11128 
11129 static int _wrap_vasp(lua_State* L) {
11130   int SWIG_arg = 0;
11131   PLFLT arg1 ;
11132   
11133   SWIG_check_num_args("plvasp",1,1)
11134   if(!lua_isnumber(L,1)) SWIG_fail_arg("plvasp",1,"PLFLT");
11135   arg1 = (PLFLT)lua_tonumber(L, 1);
11136   plvasp(arg1);
11137   
11138   return SWIG_arg;
11139   
11140   if(0) SWIG_fail;
11141   
11142 fail:
11143   lua_error(L);
11144   return SWIG_arg;
11145 }
11146 
11147 
11148 static int _wrap_vect(lua_State* L) {
11149   int SWIG_arg = 0;
11150   PLFLT **arg1 = (PLFLT **) 0 ;
11151   PLFLT **arg2 = (PLFLT **) 0 ;
11152   PLINT arg3 ;
11153   PLINT arg4 ;
11154   PLFLT arg5 ;
11155   pltr_func arg6 = (pltr_func) 0 ;
11156   PLPointer arg7 = (PLPointer) 0 ;
11157   int ii1 ;
11158   int ii2 ;
11159   PLcGrid cgrid17 ;
11160   PLcGrid2 cgrid27 ;
11161   
11162   {
11163     cgrid17.xg = cgrid17.yg = cgrid17.zg = NULL;
11164     cgrid17.nx = cgrid17.ny = cgrid17.nz = 0;
11165     cgrid27.xg = cgrid27.yg = cgrid27.zg = NULL;
11166     cgrid27.nx = cgrid27.ny = 0;
11167   }
11168   {
11169     arg6 = NULL;
11170   }
11171   {
11172     arg7 = NULL;
11173   }
11174   SWIG_check_num_args("plvect",3,5)
11175   if(!lua_isnumber(L,3)) SWIG_fail_arg("plvect",3,"PLFLT");
11176   {
11177     int jj;
11178     
11179     arg1 = read_double_Matrix( L, 1, &ii1, &jj );
11180     if ( !arg1 )
11181     SWIG_fail;
11182     Xlen = ii1;
11183     Ylen = jj;
11184   }
11185   {
11186     int jj;
11187     
11188     arg2 = read_double_Matrix( L, 2, &ii2, &jj );
11189     if ( !arg2 )
11190     SWIG_fail;
11191     arg3 = ii2;
11192     arg4 = jj;
11193     if ( ( arg3 != Xlen ) || ( arg4 != Ylen ) )
11194     {
11195       lua_pushfstring( L, "Vectors must match matrix." );
11196       SWIG_fail;
11197     }
11198   }
11199   arg5 = (PLFLT)lua_tonumber(L, 3);
11200   if(lua_gettop(L)>=4){
11201     {
11202       arg6 = NULL;
11203       mypltr_funcstr[0] = '\0';
11204       
11205       if ( lua_isstring( L, 4 ) )
11206       {
11207         const char* funcstr = lua_tostring( L, 4 );
11208         if ( strcmp( "pltr0", funcstr ) == 0 )
11209         {
11210           arg6 = pltr0;
11211         }
11212         else if ( strcmp( "pltr1", funcstr ) == 0 )
11213         {
11214           arg6 = pltr1;
11215         }
11216         else if ( strcmp( "pltr2", funcstr ) == 0 )
11217         {
11218           arg6 = pltr2;
11219         }
11220         else
11221         {
11222           arg6 = mypltr;
11223           strncpy( mypltr_funcstr, funcstr, 255 );
11224           myL = L;
11225         }
11226       }
11227       else
11228       SWIG_fail_arg( "vect", 6, "pltr_func" );
11229     }
11230   }
11231   if(lua_gettop(L)>=5){
11232     {
11233       int nx, ny;
11234       int gridmode = 0;
11235       
11236       lua_pushstring( L, "xg" );
11237       lua_gettable( L, 5 );
11238       if ( !lua_istable( L, -1 ) )
11239       {
11240         lua_pop( L, 1 ); // pop "xg"
11241         lua_pushstring( L, "expected a table xg" );
11242         SWIG_fail;
11243       }
11244       lua_rawgeti( L, -1, 1 );
11245       if ( lua_istable( L, -1 ) )
11246       gridmode = 2; // two dimensional array
11247       else if ( lua_isnumber( L, -1 ) )
11248       gridmode = 1; // one dimensional array
11249       else
11250       {
11251         lua_pop( L, 1 ); // pop "1"
11252         lua_pop( L, 1 ); // pop "xg"
11253         lua_pushstring( L, "expected a one or two dimensional array/table in xg" );
11254         SWIG_fail;
11255       }
11256       lua_pop( L, 1 ); // pop test element
11257       if ( gridmode == 1 )
11258       {
11259         cgrid17.xg = (PLFLT *) LUA_get_double_num_array_var( L, -1, &nx );
11260         if ( !cgrid17.xg )
11261         {
11262           lua_pop( L, 1 ); // pop "xg"
11263           SWIG_fail;
11264         }
11265         if ( nx != Xlen )
11266         {
11267           lua_pushfstring( L, "Table xg must be of length%d.", Xlen );
11268           SWIG_fail;
11269         }
11270         cgrid17.nx = nx;
11271       }
11272       else
11273       {
11274         cgrid27.xg = read_double_Matrix( L, -1, &nx, &ny );
11275         if ( !cgrid27.xg )
11276         {
11277           lua_pop( L, 1 ); // pop "xg"
11278           SWIG_fail;
11279         }
11280         if ( ( nx != Xlen ) || ( ny != Ylen ) )
11281         {
11282           lua_pop( L, 1 ); // pop "xg"
11283           lua_pushfstring( L, "Vectors must match matrix." );
11284           SWIG_fail;
11285         }
11286         cgrid27.nx = nx;
11287         cgrid27.ny = ny;
11288       }
11289       lua_pop( L, 1 ); // pop "xg"
11290       
11291       lua_pushstring( L, "yg" );
11292       lua_gettable( L, 5 );
11293       if ( !lua_istable( L, -1 ) )
11294       {
11295         lua_pop( L, 1 );
11296         lua_pushstring( L, "expected a table yg" );
11297         SWIG_fail;
11298       }
11299       lua_rawgeti( L, -1, 1 );
11300       if ( gridmode == 2 )
11301       {
11302         if ( !lua_istable( L, -1 ) )
11303         {
11304           lua_pop( L, 1 ); // pop "1"
11305           lua_pop( L, 1 ); // pop "yg"
11306           lua_pushstring( L, "expected a two dimensional array/table in yg" );
11307           SWIG_fail;
11308         }
11309       }
11310       else
11311       {
11312         if ( !lua_isnumber( L, -1 ) )
11313         {
11314           lua_pop( L, 1 ); // pop "1"
11315           lua_pop( L, 1 ); // pop "yg"
11316           lua_pushstring( L, "expected a one dimensional array/table in yg" );
11317           SWIG_fail;
11318         }
11319       }
11320       lua_pop( L, 1 ); // pop "1"
11321       if ( gridmode == 1 )
11322       {
11323         cgrid17.yg = (PLFLT *) LUA_get_double_num_array_var( L, -1, &ny );
11324         if ( !cgrid17.yg )
11325         {
11326           lua_pop( L, 1 ); // pop "yg"
11327           SWIG_fail;
11328         }
11329         if ( ny != Ylen )
11330         {
11331           lua_pushfstring( L, "Table yg must be of length%d.", Ylen );
11332           SWIG_fail;
11333         }
11334         cgrid17.ny = ny;
11335       }
11336       else
11337       {
11338         cgrid27.yg = read_double_Matrix( L, -1, &nx, &ny );
11339         if ( !cgrid27.yg )
11340         {
11341           lua_pop( L, 1 ); // pop "xg"
11342           SWIG_fail;
11343         }
11344         if ( ( nx != Xlen ) || ( ny != Ylen ) )
11345         {
11346           lua_pop( L, 1 ); // pop "xg"
11347           lua_pushfstring( L, "Vectors must match matrix." );
11348           SWIG_fail;
11349         }
11350         // cgrid27.nx/ny already set
11351       }
11352       lua_pop( L, 1 ); // pop "yg"
11353       
11354       if ( gridmode == 1 )
11355       arg7 = &cgrid17;
11356       else if ( gridmode == 2 )
11357       arg7 = &cgrid27;
11358     }
11359   }
11360   plvect((double const **)arg1,(double const **)arg2,arg3,arg4,arg5,arg6,arg7);
11361   
11362   {
11363     int i;
11364     
11365     if ( arg1 )
11366     {
11367       for ( i = 0; i < ii1; i++ )
11368       LUA_FREE_ARRAY( arg1[i] );
11369       LUA_FREE_ARRAY( arg1 );
11370     }
11371   }
11372   {
11373     int i;
11374     
11375     if ( arg2 )
11376     {
11377       for ( i = 0; i < ii2; i++ )
11378       LUA_FREE_ARRAY( arg2[i] );
11379       LUA_FREE_ARRAY( arg2 );
11380     }
11381   }
11382   {
11383     mypltr_funcstr[0] = '\0';
11384   }
11385   {
11386     int i;
11387     
11388     LUA_FREE_ARRAY( cgrid17.xg );
11389     LUA_FREE_ARRAY( cgrid17.yg );
11390     
11391     if ( cgrid27.xg )
11392     {
11393       for ( i = 0; i < Xlen; i++ )
11394       LUA_FREE_ARRAY( cgrid27.xg[i] );
11395       LUA_FREE_ARRAY( cgrid27.xg );
11396     }
11397     if ( cgrid27.yg )
11398     {
11399       for ( i = 0; i < Xlen; i++ )
11400       LUA_FREE_ARRAY( cgrid27.yg[i] );
11401       LUA_FREE_ARRAY( cgrid27.yg );
11402     }
11403   }
11404   return SWIG_arg;
11405   
11406   if(0) SWIG_fail;
11407   
11408 fail:
11409   {
11410     int i;
11411     
11412     if ( arg1 )
11413     {
11414       for ( i = 0; i < ii1; i++ )
11415       LUA_FREE_ARRAY( arg1[i] );
11416       LUA_FREE_ARRAY( arg1 );
11417     }
11418   }
11419   {
11420     int i;
11421     
11422     if ( arg2 )
11423     {
11424       for ( i = 0; i < ii2; i++ )
11425       LUA_FREE_ARRAY( arg2[i] );
11426       LUA_FREE_ARRAY( arg2 );
11427     }
11428   }
11429   {
11430     mypltr_funcstr[0] = '\0';
11431   }
11432   {
11433     int i;
11434     
11435     LUA_FREE_ARRAY( cgrid17.xg );
11436     LUA_FREE_ARRAY( cgrid17.yg );
11437     
11438     if ( cgrid27.xg )
11439     {
11440       for ( i = 0; i < Xlen; i++ )
11441       LUA_FREE_ARRAY( cgrid27.xg[i] );
11442       LUA_FREE_ARRAY( cgrid27.xg );
11443     }
11444     if ( cgrid27.yg )
11445     {
11446       for ( i = 0; i < Xlen; i++ )
11447       LUA_FREE_ARRAY( cgrid27.yg[i] );
11448       LUA_FREE_ARRAY( cgrid27.yg );
11449     }
11450   }
11451   lua_error(L);
11452   return SWIG_arg;
11453 }
11454 
11455 
11456 static int _wrap_vpas(lua_State* L) {
11457   int SWIG_arg = 0;
11458   PLFLT arg1 ;
11459   PLFLT arg2 ;
11460   PLFLT arg3 ;
11461   PLFLT arg4 ;
11462   PLFLT arg5 ;
11463   
11464   SWIG_check_num_args("plvpas",5,5)
11465   if(!lua_isnumber(L,1)) SWIG_fail_arg("plvpas",1,"PLFLT");
11466   if(!lua_isnumber(L,2)) SWIG_fail_arg("plvpas",2,"PLFLT");
11467   if(!lua_isnumber(L,3)) SWIG_fail_arg("plvpas",3,"PLFLT");
11468   if(!lua_isnumber(L,4)) SWIG_fail_arg("plvpas",4,"PLFLT");
11469   if(!lua_isnumber(L,5)) SWIG_fail_arg("plvpas",5,"PLFLT");
11470   arg1 = (PLFLT)lua_tonumber(L, 1);
11471   arg2 = (PLFLT)lua_tonumber(L, 2);
11472   arg3 = (PLFLT)lua_tonumber(L, 3);
11473   arg4 = (PLFLT)lua_tonumber(L, 4);
11474   arg5 = (PLFLT)lua_tonumber(L, 5);
11475   plvpas(arg1,arg2,arg3,arg4,arg5);
11476   
11477   return SWIG_arg;
11478   
11479   if(0) SWIG_fail;
11480   
11481 fail:
11482   lua_error(L);
11483   return SWIG_arg;
11484 }
11485 
11486 
11487 static int _wrap_vpor(lua_State* L) {
11488   int SWIG_arg = 0;
11489   PLFLT arg1 ;
11490   PLFLT arg2 ;
11491   PLFLT arg3 ;
11492   PLFLT arg4 ;
11493   
11494   SWIG_check_num_args("plvpor",4,4)
11495   if(!lua_isnumber(L,1)) SWIG_fail_arg("plvpor",1,"PLFLT");
11496   if(!lua_isnumber(L,2)) SWIG_fail_arg("plvpor",2,"PLFLT");
11497   if(!lua_isnumber(L,3)) SWIG_fail_arg("plvpor",3,"PLFLT");
11498   if(!lua_isnumber(L,4)) SWIG_fail_arg("plvpor",4,"PLFLT");
11499   arg1 = (PLFLT)lua_tonumber(L, 1);
11500   arg2 = (PLFLT)lua_tonumber(L, 2);
11501   arg3 = (PLFLT)lua_tonumber(L, 3);
11502   arg4 = (PLFLT)lua_tonumber(L, 4);
11503   plvpor(arg1,arg2,arg3,arg4);
11504   
11505   return SWIG_arg;
11506   
11507   if(0) SWIG_fail;
11508   
11509 fail:
11510   lua_error(L);
11511   return SWIG_arg;
11512 }
11513 
11514 
11515 static int _wrap_vsta(lua_State* L) {
11516   int SWIG_arg = 0;
11517   
11518   SWIG_check_num_args("plvsta",0,0)
11519   plvsta();
11520   
11521   return SWIG_arg;
11522   
11523   if(0) SWIG_fail;
11524   
11525 fail:
11526   lua_error(L);
11527   return SWIG_arg;
11528 }
11529 
11530 
11531 static int _wrap_w3d(lua_State* L) {
11532   int SWIG_arg = 0;
11533   PLFLT arg1 ;
11534   PLFLT arg2 ;
11535   PLFLT arg3 ;
11536   PLFLT arg4 ;
11537   PLFLT arg5 ;
11538   PLFLT arg6 ;
11539   PLFLT arg7 ;
11540   PLFLT arg8 ;
11541   PLFLT arg9 ;
11542   PLFLT arg10 ;
11543   PLFLT arg11 ;
11544   
11545   SWIG_check_num_args("plw3d",11,11)
11546   if(!lua_isnumber(L,1)) SWIG_fail_arg("plw3d",1,"PLFLT");
11547   if(!lua_isnumber(L,2)) SWIG_fail_arg("plw3d",2,"PLFLT");
11548   if(!lua_isnumber(L,3)) SWIG_fail_arg("plw3d",3,"PLFLT");
11549   if(!lua_isnumber(L,4)) SWIG_fail_arg("plw3d",4,"PLFLT");
11550   if(!lua_isnumber(L,5)) SWIG_fail_arg("plw3d",5,"PLFLT");
11551   if(!lua_isnumber(L,6)) SWIG_fail_arg("plw3d",6,"PLFLT");
11552   if(!lua_isnumber(L,7)) SWIG_fail_arg("plw3d",7,"PLFLT");
11553   if(!lua_isnumber(L,8)) SWIG_fail_arg("plw3d",8,"PLFLT");
11554   if(!lua_isnumber(L,9)) SWIG_fail_arg("plw3d",9,"PLFLT");
11555   if(!lua_isnumber(L,10)) SWIG_fail_arg("plw3d",10,"PLFLT");
11556   if(!lua_isnumber(L,11)) SWIG_fail_arg("plw3d",11,"PLFLT");
11557   arg1 = (PLFLT)lua_tonumber(L, 1);
11558   arg2 = (PLFLT)lua_tonumber(L, 2);
11559   arg3 = (PLFLT)lua_tonumber(L, 3);
11560   arg4 = (PLFLT)lua_tonumber(L, 4);
11561   arg5 = (PLFLT)lua_tonumber(L, 5);
11562   arg6 = (PLFLT)lua_tonumber(L, 6);
11563   arg7 = (PLFLT)lua_tonumber(L, 7);
11564   arg8 = (PLFLT)lua_tonumber(L, 8);
11565   arg9 = (PLFLT)lua_tonumber(L, 9);
11566   arg10 = (PLFLT)lua_tonumber(L, 10);
11567   arg11 = (PLFLT)lua_tonumber(L, 11);
11568   plw3d(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11);
11569   
11570   return SWIG_arg;
11571   
11572   if(0) SWIG_fail;
11573   
11574 fail:
11575   lua_error(L);
11576   return SWIG_arg;
11577 }
11578 
11579 
11580 static int _wrap_width(lua_State* L) {
11581   int SWIG_arg = 0;
11582   PLFLT arg1 ;
11583   
11584   SWIG_check_num_args("plwidth",1,1)
11585   if(!lua_isnumber(L,1)) SWIG_fail_arg("plwidth",1,"PLFLT");
11586   arg1 = (PLFLT)lua_tonumber(L, 1);
11587   plwidth(arg1);
11588   
11589   return SWIG_arg;
11590   
11591   if(0) SWIG_fail;
11592   
11593 fail:
11594   lua_error(L);
11595   return SWIG_arg;
11596 }
11597 
11598 
11599 static int _wrap_wind(lua_State* L) {
11600   int SWIG_arg = 0;
11601   PLFLT arg1 ;
11602   PLFLT arg2 ;
11603   PLFLT arg3 ;
11604   PLFLT arg4 ;
11605   
11606   SWIG_check_num_args("plwind",4,4)
11607   if(!lua_isnumber(L,1)) SWIG_fail_arg("plwind",1,"PLFLT");
11608   if(!lua_isnumber(L,2)) SWIG_fail_arg("plwind",2,"PLFLT");
11609   if(!lua_isnumber(L,3)) SWIG_fail_arg("plwind",3,"PLFLT");
11610   if(!lua_isnumber(L,4)) SWIG_fail_arg("plwind",4,"PLFLT");
11611   arg1 = (PLFLT)lua_tonumber(L, 1);
11612   arg2 = (PLFLT)lua_tonumber(L, 2);
11613   arg3 = (PLFLT)lua_tonumber(L, 3);
11614   arg4 = (PLFLT)lua_tonumber(L, 4);
11615   plwind(arg1,arg2,arg3,arg4);
11616   
11617   return SWIG_arg;
11618   
11619   if(0) SWIG_fail;
11620   
11621 fail:
11622   lua_error(L);
11623   return SWIG_arg;
11624 }
11625 
11626 
11627 static int _wrap_xormod(lua_State* L) {
11628   int SWIG_arg = 0;
11629   PLBOOL arg1 ;
11630   PLBOOL *arg2 = (PLBOOL *) 0 ;
11631   PLBOOL temp2 ;
11632   
11633   arg2 = &temp2; 
11634   SWIG_check_num_args("plxormod",1,1)
11635   if(!lua_isnumber(L,1)) SWIG_fail_arg("plxormod",1,"PLBOOL");
11636   arg1 = (PLBOOL)lua_tonumber(L, 1);
11637   plxormod(arg1,arg2);
11638   
11639   lua_pushnumber(L, (lua_Number) *arg2); SWIG_arg++;
11640   return SWIG_arg;
11641   
11642   if(0) SWIG_fail;
11643   
11644 fail:
11645   lua_error(L);
11646   return SWIG_arg;
11647 }
11648 
11649 
11650 static int _wrap_map(lua_State* L) {
11651   int SWIG_arg = 0;
11652   mapform_func arg1 = (mapform_func) 0 ;
11653   char *arg2 = (char *) 0 ;
11654   PLFLT arg3 ;
11655   PLFLT arg4 ;
11656   PLFLT arg5 ;
11657   PLFLT arg6 ;
11658   
11659   SWIG_check_num_args("plmap",6,6)
11660   if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("plmap",2,"char const *");
11661   if(!lua_isnumber(L,3)) SWIG_fail_arg("plmap",3,"PLFLT");
11662   if(!lua_isnumber(L,4)) SWIG_fail_arg("plmap",4,"PLFLT");
11663   if(!lua_isnumber(L,5)) SWIG_fail_arg("plmap",5,"PLFLT");
11664   if(!lua_isnumber(L,6)) SWIG_fail_arg("plmap",6,"PLFLT");
11665   {
11666     arg1 = NULL;
11667     mapform_funcstr[0] = '\0';
11668     
11669     if ( lua_isnil( L, 1 ) )
11670     {
11671       arg1 = NULL;
11672     }
11673     else if ( lua_isstring( L, 1 ) )
11674     {
11675       arg1 = mapform;
11676       strncpy( mapform_funcstr, lua_tostring( L, 1 ), 255 );
11677       myL = L;
11678     }
11679     else
11680     SWIG_fail_arg( "map", 1, "mapform_func" );
11681   }
11682   arg2 = (char *)lua_tostring(L, 2);
11683   arg3 = (PLFLT)lua_tonumber(L, 3);
11684   arg4 = (PLFLT)lua_tonumber(L, 4);
11685   arg5 = (PLFLT)lua_tonumber(L, 5);
11686   arg6 = (PLFLT)lua_tonumber(L, 6);
11687   plmap(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
11688   
11689   {
11690     mapform_funcstr[0] = '\0';
11691   }
11692   return SWIG_arg;
11693   
11694   if(0) SWIG_fail;
11695   
11696 fail:
11697   {
11698     mapform_funcstr[0] = '\0';
11699   }
11700   lua_error(L);
11701   return SWIG_arg;
11702 }
11703 
11704 
11705 static int _wrap_meridians(lua_State* L) {
11706   int SWIG_arg = 0;
11707   mapform_func arg1 = (mapform_func) 0 ;
11708   PLFLT arg2 ;
11709   PLFLT arg3 ;
11710   PLFLT arg4 ;
11711   PLFLT arg5 ;
11712   PLFLT arg6 ;
11713   PLFLT arg7 ;
11714   
11715   SWIG_check_num_args("plmeridians",7,7)
11716   if(!lua_isnumber(L,2)) SWIG_fail_arg("plmeridians",2,"PLFLT");
11717   if(!lua_isnumber(L,3)) SWIG_fail_arg("plmeridians",3,"PLFLT");
11718   if(!lua_isnumber(L,4)) SWIG_fail_arg("plmeridians",4,"PLFLT");
11719   if(!lua_isnumber(L,5)) SWIG_fail_arg("plmeridians",5,"PLFLT");
11720   if(!lua_isnumber(L,6)) SWIG_fail_arg("plmeridians",6,"PLFLT");
11721   if(!lua_isnumber(L,7)) SWIG_fail_arg("plmeridians",7,"PLFLT");
11722   {
11723     arg1 = NULL;
11724     mapform_funcstr[0] = '\0';
11725     
11726     if ( lua_isnil( L, 1 ) )
11727     {
11728       arg1 = NULL;
11729     }
11730     else if ( lua_isstring( L, 1 ) )
11731     {
11732       arg1 = mapform;
11733       strncpy( mapform_funcstr, lua_tostring( L, 1 ), 255 );
11734       myL = L;
11735     }
11736     else
11737     SWIG_fail_arg( "meridians", 1, "mapform_func" );
11738   }
11739   arg2 = (PLFLT)lua_tonumber(L, 2);
11740   arg3 = (PLFLT)lua_tonumber(L, 3);
11741   arg4 = (PLFLT)lua_tonumber(L, 4);
11742   arg5 = (PLFLT)lua_tonumber(L, 5);
11743   arg6 = (PLFLT)lua_tonumber(L, 6);
11744   arg7 = (PLFLT)lua_tonumber(L, 7);
11745   plmeridians(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
11746   
11747   {
11748     mapform_funcstr[0] = '\0';
11749   }
11750   return SWIG_arg;
11751   
11752   if(0) SWIG_fail;
11753   
11754 fail:
11755   {
11756     mapform_funcstr[0] = '\0';
11757   }
11758   lua_error(L);
11759   return SWIG_arg;
11760 }
11761 
11762 
11763 static int _wrap_image(lua_State* L) {
11764   int SWIG_arg = 0;
11765   PLFLT **arg1 = (PLFLT **) 0 ;
11766   PLINT arg2 ;
11767   PLINT arg3 ;
11768   PLFLT arg4 ;
11769   PLFLT arg5 ;
11770   PLFLT arg6 ;
11771   PLFLT arg7 ;
11772   PLFLT arg8 ;
11773   PLFLT arg9 ;
11774   PLFLT arg10 ;
11775   PLFLT arg11 ;
11776   PLFLT arg12 ;
11777   PLFLT arg13 ;
11778   int ii1 ;
11779   
11780   SWIG_check_num_args("plimage",11,11)
11781   if(!lua_isnumber(L,2)) SWIG_fail_arg("plimage",2,"PLFLT");
11782   if(!lua_isnumber(L,3)) SWIG_fail_arg("plimage",3,"PLFLT");
11783   if(!lua_isnumber(L,4)) SWIG_fail_arg("plimage",4,"PLFLT");
11784   if(!lua_isnumber(L,5)) SWIG_fail_arg("plimage",5,"PLFLT");
11785   if(!lua_isnumber(L,6)) SWIG_fail_arg("plimage",6,"PLFLT");
11786   if(!lua_isnumber(L,7)) SWIG_fail_arg("plimage",7,"PLFLT");
11787   if(!lua_isnumber(L,8)) SWIG_fail_arg("plimage",8,"PLFLT");
11788   if(!lua_isnumber(L,9)) SWIG_fail_arg("plimage",9,"PLFLT");
11789   if(!lua_isnumber(L,10)) SWIG_fail_arg("plimage",10,"PLFLT");
11790   if(!lua_isnumber(L,11)) SWIG_fail_arg("plimage",11,"PLFLT");
11791   {
11792     int jj;
11793     
11794     arg1 = read_double_Matrix( L, 1, &ii1, &jj );
11795     if ( !arg1 )
11796     SWIG_fail;
11797     Xlen = arg2 = ii1;
11798     Ylen = arg3 = jj;
11799   }
11800   arg4 = (PLFLT)lua_tonumber(L, 2);
11801   arg5 = (PLFLT)lua_tonumber(L, 3);
11802   arg6 = (PLFLT)lua_tonumber(L, 4);
11803   arg7 = (PLFLT)lua_tonumber(L, 5);
11804   arg8 = (PLFLT)lua_tonumber(L, 6);
11805   arg9 = (PLFLT)lua_tonumber(L, 7);
11806   arg10 = (PLFLT)lua_tonumber(L, 8);
11807   arg11 = (PLFLT)lua_tonumber(L, 9);
11808   arg12 = (PLFLT)lua_tonumber(L, 10);
11809   arg13 = (PLFLT)lua_tonumber(L, 11);
11810   plimage((double const **)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13);
11811   
11812   {
11813     int i;
11814     
11815     if ( arg1 )
11816     {
11817       for ( i = 0; i < ii1; i++ )
11818       LUA_FREE_ARRAY( arg1[i] );
11819       LUA_FREE_ARRAY( arg1 );
11820     }
11821   }
11822   return SWIG_arg;
11823   
11824   if(0) SWIG_fail;
11825   
11826 fail:
11827   {
11828     int i;
11829     
11830     if ( arg1 )
11831     {
11832       for ( i = 0; i < ii1; i++ )
11833       LUA_FREE_ARRAY( arg1[i] );
11834       LUA_FREE_ARRAY( arg1 );
11835     }
11836   }
11837   lua_error(L);
11838   return SWIG_arg;
11839 }
11840 
11841 
11842 static int _wrap_imagefr(lua_State* L) {
11843   int SWIG_arg = 0;
11844   PLFLT **arg1 = (PLFLT **) 0 ;
11845   PLINT arg2 ;
11846   PLINT arg3 ;
11847   PLFLT arg4 ;
11848   PLFLT arg5 ;
11849   PLFLT arg6 ;
11850   PLFLT arg7 ;
11851   PLFLT arg8 ;
11852   PLFLT arg9 ;
11853   PLFLT arg10 ;
11854   PLFLT arg11 ;
11855   pltr_func arg12 = (pltr_func) 0 ;
11856   PLPointer arg13 = (PLPointer) 0 ;
11857   int ii1 ;
11858   PLcGrid cgrid113 ;
11859   PLcGrid2 cgrid213 ;
11860   
11861   {
11862     cgrid113.xg = cgrid113.yg = cgrid113.zg = NULL;
11863     cgrid113.nx = cgrid113.ny = cgrid113.nz = 0;
11864     cgrid213.xg = cgrid213.yg = cgrid213.zg = NULL;
11865     cgrid213.nx = cgrid213.ny = 0;
11866   }
11867   {
11868     arg12 = NULL;
11869   }
11870   {
11871     arg13 = NULL;
11872   }
11873   SWIG_check_num_args("plimagefr",9,11)
11874   if(!lua_isnumber(L,2)) SWIG_fail_arg("plimagefr",2,"PLFLT");
11875   if(!lua_isnumber(L,3)) SWIG_fail_arg("plimagefr",3,"PLFLT");
11876   if(!lua_isnumber(L,4)) SWIG_fail_arg("plimagefr",4,"PLFLT");
11877   if(!lua_isnumber(L,5)) SWIG_fail_arg("plimagefr",5,"PLFLT");
11878   if(!lua_isnumber(L,6)) SWIG_fail_arg("plimagefr",6,"PLFLT");
11879   if(!lua_isnumber(L,7)) SWIG_fail_arg("plimagefr",7,"PLFLT");
11880   if(!lua_isnumber(L,8)) SWIG_fail_arg("plimagefr",8,"PLFLT");
11881   if(!lua_isnumber(L,9)) SWIG_fail_arg("plimagefr",9,"PLFLT");
11882   {
11883     int jj;
11884     
11885     arg1 = read_double_Matrix( L, 1, &ii1, &jj );
11886     if ( !arg1 )
11887     SWIG_fail;
11888     Xlen = arg2 = ii1;
11889     Ylen = arg3 = jj;
11890   }
11891   arg4 = (PLFLT)lua_tonumber(L, 2);
11892   arg5 = (PLFLT)lua_tonumber(L, 3);
11893   arg6 = (PLFLT)lua_tonumber(L, 4);
11894   arg7 = (PLFLT)lua_tonumber(L, 5);
11895   arg8 = (PLFLT)lua_tonumber(L, 6);
11896   arg9 = (PLFLT)lua_tonumber(L, 7);
11897   arg10 = (PLFLT)lua_tonumber(L, 8);
11898   arg11 = (PLFLT)lua_tonumber(L, 9);
11899   if(lua_gettop(L)>=10){
11900     {
11901       arg12 = NULL;
11902       mypltr_funcstr[0] = '\0';
11903       
11904       if ( lua_isstring( L, 10 ) )
11905       {
11906         const char* funcstr = lua_tostring( L, 10 );
11907         if ( strcmp( "pltr0", funcstr ) == 0 )
11908         {
11909           arg12 = pltr0;
11910         }
11911         else if ( strcmp( "pltr1", funcstr ) == 0 )
11912         {
11913           arg12 = pltr1;
11914         }
11915         else if ( strcmp( "pltr2", funcstr ) == 0 )
11916         {
11917           arg12 = pltr2;
11918         }
11919         else
11920         {
11921           arg12 = mypltr;
11922           strncpy( mypltr_funcstr, funcstr, 255 );
11923           myL = L;
11924         }
11925       }
11926       else
11927       SWIG_fail_arg( "imagefr", 12, "pltr_func" );
11928     }
11929   }
11930   if(lua_gettop(L)>=11){
11931     {
11932       int nx, ny;
11933       int gridmode = 0;
11934       
11935       lua_pushstring( L, "xg" );
11936       lua_gettable( L, 11 );
11937       if ( !lua_istable( L, -1 ) )
11938       {
11939         lua_pop( L, 1 ); // pop "xg"
11940         lua_pushstring( L, "expected a table xg" );
11941         SWIG_fail;
11942       }
11943       lua_rawgeti( L, -1, 1 );
11944       if ( lua_istable( L, -1 ) )
11945       gridmode = 2; // two dimensional array
11946       else if ( lua_isnumber( L, -1 ) )
11947       gridmode = 1; // one dimensional array
11948       else
11949       {
11950         lua_pop( L, 1 ); // pop "1"
11951         lua_pop( L, 1 ); // pop "xg"
11952         lua_pushstring( L, "expected a one or two dimensional array/table in xg" );
11953         SWIG_fail;
11954       }
11955       lua_pop( L, 1 ); // pop test element
11956       if ( gridmode == 1 )
11957       {
11958         cgrid113.xg = (PLFLT *) LUA_get_double_num_array_var( L, -1, &nx );
11959         if ( !cgrid113.xg )
11960         {
11961           lua_pop( L, 1 ); // pop "xg"
11962           SWIG_fail;
11963         }
11964         if ( nx != Xlen )
11965         {
11966           lua_pushfstring( L, "Table xg must be of length%d.", Xlen );
11967           SWIG_fail;
11968         }
11969         cgrid113.nx = nx;
11970       }
11971       else
11972       {
11973         cgrid213.xg = read_double_Matrix( L, -1, &nx, &ny );
11974         if ( !cgrid213.xg )
11975         {
11976           lua_pop( L, 1 ); // pop "xg"
11977           SWIG_fail;
11978         }
11979         if ( ( nx != Xlen ) || ( ny != Ylen ) )
11980         {
11981           lua_pop( L, 1 ); // pop "xg"
11982           lua_pushfstring( L, "Vectors must match matrix." );
11983           SWIG_fail;
11984         }
11985         cgrid213.nx = nx;
11986         cgrid213.ny = ny;
11987       }
11988       lua_pop( L, 1 ); // pop "xg"
11989       
11990       lua_pushstring( L, "yg" );
11991       lua_gettable( L, 11 );
11992       if ( !lua_istable( L, -1 ) )
11993       {
11994         lua_pop( L, 1 );
11995         lua_pushstring( L, "expected a table yg" );
11996         SWIG_fail;
11997       }
11998       lua_rawgeti( L, -1, 1 );
11999       if ( gridmode == 2 )
12000       {
12001         if ( !lua_istable( L, -1 ) )
12002         {
12003           lua_pop( L, 1 ); // pop "1"
12004           lua_pop( L, 1 ); // pop "yg"
12005           lua_pushstring( L, "expected a two dimensional array/table in yg" );
12006           SWIG_fail;
12007         }
12008       }
12009       else
12010       {
12011         if ( !lua_isnumber( L, -1 ) )
12012         {
12013           lua_pop( L, 1 ); // pop "1"
12014           lua_pop( L, 1 ); // pop "yg"
12015           lua_pushstring( L, "expected a one dimensional array/table in yg" );
12016           SWIG_fail;
12017         }
12018       }
12019       lua_pop( L, 1 ); // pop "1"
12020       if ( gridmode == 1 )
12021       {
12022         cgrid113.yg = (PLFLT *) LUA_get_double_num_array_var( L, -1, &ny );
12023         if ( !cgrid113.yg )
12024         {
12025           lua_pop( L, 1 ); // pop "yg"
12026           SWIG_fail;
12027         }
12028         if ( ny != Ylen )
12029         {
12030           lua_pushfstring( L, "Table yg must be of length%d.", Ylen );
12031           SWIG_fail;
12032         }
12033         cgrid113.ny = ny;
12034       }
12035       else
12036       {
12037         cgrid213.yg = read_double_Matrix( L, -1, &nx, &ny );
12038         if ( !cgrid213.yg )
12039         {
12040           lua_pop( L, 1 ); // pop "xg"
12041           SWIG_fail;
12042         }
12043         if ( ( nx != Xlen ) || ( ny != Ylen ) )
12044         {
12045           lua_pop( L, 1 ); // pop "xg"
12046           lua_pushfstring( L, "Vectors must match matrix." );
12047           SWIG_fail;
12048         }
12049         // cgrid213.nx/ny already set
12050       }
12051       lua_pop( L, 1 ); // pop "yg"
12052       
12053       if ( gridmode == 1 )
12054       arg13 = &cgrid113;
12055       else if ( gridmode == 2 )
12056       arg13 = &cgrid213;
12057     }
12058   }
12059   plimagefr((double const **)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13);
12060   
12061   {
12062     int i;
12063     
12064     if ( arg1 )
12065     {
12066       for ( i = 0; i < ii1; i++ )
12067       LUA_FREE_ARRAY( arg1[i] );
12068       LUA_FREE_ARRAY( arg1 );
12069     }
12070   }
12071   {
12072     mypltr_funcstr[0] = '\0';
12073   }
12074   {
12075     int i;
12076     
12077     LUA_FREE_ARRAY( cgrid113.xg );
12078     LUA_FREE_ARRAY( cgrid113.yg );
12079     
12080     if ( cgrid213.xg )
12081     {
12082       for ( i = 0; i < Xlen; i++ )
12083       LUA_FREE_ARRAY( cgrid213.xg[i] );
12084       LUA_FREE_ARRAY( cgrid213.xg );
12085     }
12086     if ( cgrid213.yg )
12087     {
12088       for ( i = 0; i < Xlen; i++ )
12089       LUA_FREE_ARRAY( cgrid213.yg[i] );
12090       LUA_FREE_ARRAY( cgrid213.yg );
12091     }
12092   }
12093   return SWIG_arg;
12094   
12095   if(0) SWIG_fail;
12096   
12097 fail:
12098   {
12099     int i;
12100     
12101     if ( arg1 )
12102     {
12103       for ( i = 0; i < ii1; i++ )
12104       LUA_FREE_ARRAY( arg1[i] );
12105       LUA_FREE_ARRAY( arg1 );
12106     }
12107   }
12108   {
12109     mypltr_funcstr[0] = '\0';
12110   }
12111   {
12112     int i;
12113     
12114     LUA_FREE_ARRAY( cgrid113.xg );
12115     LUA_FREE_ARRAY( cgrid113.yg );
12116     
12117     if ( cgrid213.xg )
12118     {
12119       for ( i = 0; i < Xlen; i++ )
12120       LUA_FREE_ARRAY( cgrid213.xg[i] );
12121       LUA_FREE_ARRAY( cgrid213.xg );
12122     }
12123     if ( cgrid213.yg )
12124     {
12125       for ( i = 0; i < Xlen; i++ )
12126       LUA_FREE_ARRAY( cgrid213.yg[i] );
12127       LUA_FREE_ARRAY( cgrid213.yg );
12128     }
12129   }
12130   lua_error(L);
12131   return SWIG_arg;
12132 }
12133 
12134 
12135 static int _wrap_plClearOpts(lua_State* L) {
12136   int SWIG_arg = 0;
12137   
12138   SWIG_check_num_args("plClearOpts",0,0)
12139   plClearOpts();
12140   
12141   return SWIG_arg;
12142   
12143   if(0) SWIG_fail;
12144   
12145 fail:
12146   lua_error(L);
12147   return SWIG_arg;
12148 }
12149 
12150 
12151 static int _wrap_plResetOpts(lua_State* L) {
12152   int SWIG_arg = 0;
12153   
12154   SWIG_check_num_args("plResetOpts",0,0)
12155   plResetOpts();
12156   
12157   return SWIG_arg;
12158   
12159   if(0) SWIG_fail;
12160   
12161 fail:
12162   lua_error(L);
12163   return SWIG_arg;
12164 }
12165 
12166 
12167 static int _wrap_plSetUsage(lua_State* L) {
12168   int SWIG_arg = 0;
12169   char *arg1 = (char *) 0 ;
12170   char *arg2 = (char *) 0 ;
12171   
12172   SWIG_check_num_args("plSetUsage",2,2)
12173   if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("plSetUsage",1,"char const *");
12174   if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("plSetUsage",2,"char const *");
12175   arg1 = (char *)lua_tostring(L, 1);
12176   arg2 = (char *)lua_tostring(L, 2);
12177   plSetUsage((char const *)arg1,(char const *)arg2);
12178   
12179   return SWIG_arg;
12180   
12181   if(0) SWIG_fail;
12182   
12183 fail:
12184   lua_error(L);
12185   return SWIG_arg;
12186 }
12187 
12188 
12189 static int _wrap_plOptUsage(lua_State* L) {
12190   int SWIG_arg = 0;
12191   
12192   SWIG_check_num_args("plOptUsage",0,0)
12193   plOptUsage();
12194   
12195   return SWIG_arg;
12196   
12197   if(0) SWIG_fail;
12198   
12199 fail:
12200   lua_error(L);
12201   return SWIG_arg;
12202 }
12203 
12204 
12205 static int _wrap_MinMax2dGrid(lua_State* L) {
12206   int SWIG_arg = 0;
12207   PLFLT **arg1 = (PLFLT **) 0 ;
12208   PLINT arg2 ;
12209   PLINT arg3 ;
12210   PLFLT *arg4 = (PLFLT *) 0 ;
12211   PLFLT *arg5 = (PLFLT *) 0 ;
12212   int ii1 ;
12213   PLFLT temp4 ;
12214   PLFLT temp5 ;
12215   
12216   arg4 = &temp4; 
12217   arg5 = &temp5; 
12218   SWIG_check_num_args("plMinMax2dGrid",1,1)
12219   {
12220     int jj;
12221     
12222     arg1 = read_double_Matrix( L, 1, &ii1, &jj );
12223     if ( !arg1 )
12224     SWIG_fail;
12225     Xlen = arg2 = ii1;
12226     Ylen = arg3 = jj;
12227   }
12228   plMinMax2dGrid((double const **)arg1,arg2,arg3,arg4,arg5);
12229   
12230   lua_pushnumber(L, (lua_Number) *arg4); SWIG_arg++;
12231   lua_pushnumber(L, (lua_Number) *arg5); SWIG_arg++;
12232   {
12233     int i;
12234     
12235     if ( arg1 )
12236     {
12237       for ( i = 0; i < ii1; i++ )
12238       LUA_FREE_ARRAY( arg1[i] );
12239       LUA_FREE_ARRAY( arg1 );
12240     }
12241   }
12242   return SWIG_arg;
12243   
12244   if(0) SWIG_fail;
12245   
12246 fail:
12247   {
12248     int i;
12249     
12250     if ( arg1 )
12251     {
12252       for ( i = 0; i < ii1; i++ )
12253       LUA_FREE_ARRAY( arg1[i] );
12254       LUA_FREE_ARRAY( arg1 );
12255     }
12256   }
12257   lua_error(L);
12258   return SWIG_arg;
12259 }
12260 
12261 
12262 static int _wrap_plGetCursor(lua_State* L) {
12263   int SWIG_arg = 0;
12264   PLGraphicsIn *arg1 = (PLGraphicsIn *) 0 ;
12265   PLINT result;
12266   
12267   SWIG_check_num_args("plGetCursor",1,1)
12268   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("plGetCursor",1,"PLGraphicsIn *");
12269   
12270   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_PLGraphicsIn,0))){
12271     SWIG_fail_ptr("plGetCursor",1,SWIGTYPE_p_PLGraphicsIn);
12272   }
12273   
12274   result = (PLINT)plGetCursor(arg1);
12275   lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
12276   return SWIG_arg;
12277   
12278   if(0) SWIG_fail;
12279   
12280 fail:
12281   lua_error(L);
12282   return SWIG_arg;
12283 }
12284 
12285 
12286 static int _wrap_warn(lua_State* L) {
12287   int SWIG_arg = 0;
12288   char *arg1 = (char *) 0 ;
12289   
12290   SWIG_check_num_args("plwarn",1,1)
12291   if(!lua_isstring(L,1)) SWIG_fail_arg("plwarn",1,"char const *");
12292   {
12293     arg1 = (char *) lua_tostring( L, 1 );
12294   }
12295   plwarn((char const *)arg1);
12296   
12297   return SWIG_arg;
12298   
12299   if(0) SWIG_fail;
12300   
12301 fail:
12302   lua_error(L);
12303   return SWIG_arg;
12304 }
12305 
12306 
12307 static int _wrap_abort(lua_State* L) {
12308   int SWIG_arg = 0;
12309   char *arg1 = (char *) 0 ;
12310   
12311   SWIG_check_num_args("plabort",1,1)
12312   if(!lua_isstring(L,1)) SWIG_fail_arg("plabort",1,"char const *");
12313   {
12314     arg1 = (char *) lua_tostring( L, 1 );
12315   }
12316   plabort((char const *)arg1);
12317   
12318   return SWIG_arg;
12319   
12320   if(0) SWIG_fail;
12321   
12322 fail:
12323   lua_error(L);
12324   return SWIG_arg;
12325 }
12326 
12327 
12328 static swig_lua_attribute swig_SwigModule_attributes[] = {
12329     {0,0,0}
12330 };
12331 static swig_lua_const_info swig_SwigModule_constants[]= {
12332     {SWIG_LUA_CONSTTAB_INT("PLESC_SET_RGB", 1)},
12333     {SWIG_LUA_CONSTTAB_INT("PLESC_ALLOC_NCOL", 2)},
12334     {SWIG_LUA_CONSTTAB_INT("PLESC_SET_LPB", 3)},
12335     {SWIG_LUA_CONSTTAB_INT("PLESC_EXPOSE", 4)},
12336     {SWIG_LUA_CONSTTAB_INT("PLESC_RESIZE", 5)},
12337     {SWIG_LUA_CONSTTAB_INT("PLESC_REDRAW", 6)},
12338     {SWIG_LUA_CONSTTAB_INT("PLESC_TEXT", 7)},
12339     {SWIG_LUA_CONSTTAB_INT("PLESC_GRAPH", 8)},
12340     {SWIG_LUA_CONSTTAB_INT("PLESC_FILL", 9)},
12341     {SWIG_LUA_CONSTTAB_INT("PLESC_DI", 10)},
12342     {SWIG_LUA_CONSTTAB_INT("PLESC_FLUSH", 11)},
12343     {SWIG_LUA_CONSTTAB_INT("PLESC_EH", 12)},
12344     {SWIG_LUA_CONSTTAB_INT("PLESC_GETC", 13)},
12345     {SWIG_LUA_CONSTTAB_INT("PLESC_SWIN", 14)},
12346     {SWIG_LUA_CONSTTAB_INT("PLESC_DOUBLEBUFFERING", 15)},
12347     {SWIG_LUA_CONSTTAB_INT("PLESC_XORMOD", 16)},
12348     {SWIG_LUA_CONSTTAB_INT("PLESC_SET_COMPRESSION", 17)},
12349     {SWIG_LUA_CONSTTAB_INT("PLESC_CLEAR", 18)},
12350     {SWIG_LUA_CONSTTAB_INT("PLESC_DASH", 19)},
12351     {SWIG_LUA_CONSTTAB_INT("PLESC_HAS_TEXT", 20)},
12352     {SWIG_LUA_CONSTTAB_INT("PLESC_IMAGE", 21)},
12353     {SWIG_LUA_CONSTTAB_INT("PLESC_IMAGEOPS", 22)},
12354     {SWIG_LUA_CONSTTAB_INT("PLESC_PL2DEVCOL", 23)},
12355     {SWIG_LUA_CONSTTAB_INT("PLESC_DEV2PLCOL", 24)},
12356     {SWIG_LUA_CONSTTAB_INT("PLESC_SETBGFG", 25)},
12357     {SWIG_LUA_CONSTTAB_INT("PLESC_DEVINIT", 26)},
12358     {SWIG_LUA_CONSTTAB_INT("PLESC_GETBACKEND", 27)},
12359     {SWIG_LUA_CONSTTAB_INT("PLESC_BEGIN_TEXT", 28)},
12360     {SWIG_LUA_CONSTTAB_INT("PLESC_TEXT_CHAR", 29)},
12361     {SWIG_LUA_CONSTTAB_INT("PLESC_CONTROL_CHAR", 30)},
12362     {SWIG_LUA_CONSTTAB_INT("PLESC_END_TEXT", 31)},
12363     {SWIG_LUA_CONSTTAB_INT("PLESC_START_RASTERIZE", 32)},
12364     {SWIG_LUA_CONSTTAB_INT("PLESC_END_RASTERIZE", 33)},
12365     {SWIG_LUA_CONSTTAB_INT("PLESC_ARC", 34)},
12366     {SWIG_LUA_CONSTTAB_INT("PLESC_GRADIENT", 35)},
12367     {SWIG_LUA_CONSTTAB_INT("PLESC_MODESET", 36)},
12368     {SWIG_LUA_CONSTTAB_INT("PLESC_MODEGET", 37)},
12369     {SWIG_LUA_CONSTTAB_INT("PLTEXT_FONTCHANGE", 0)},
12370     {SWIG_LUA_CONSTTAB_INT("PLTEXT_SUPERSCRIPT", 1)},
12371     {SWIG_LUA_CONSTTAB_INT("PLTEXT_SUBSCRIPT", 2)},
12372     {SWIG_LUA_CONSTTAB_INT("PLTEXT_BACKCHAR", 3)},
12373     {SWIG_LUA_CONSTTAB_INT("PLTEXT_OVERLINE", 4)},
12374     {SWIG_LUA_CONSTTAB_INT("PLTEXT_UNDERLINE", 5)},
12375     {SWIG_LUA_CONSTTAB_INT("ZEROW2B", 1)},
12376     {SWIG_LUA_CONSTTAB_INT("ZEROW2D", 2)},
12377     {SWIG_LUA_CONSTTAB_INT("ONEW2B", 3)},
12378     {SWIG_LUA_CONSTTAB_INT("ONEW2D", 4)},
12379     {SWIG_LUA_CONSTTAB_INT("PLSWIN_DEVICE", 1)},
12380     {SWIG_LUA_CONSTTAB_INT("PLSWIN_WORLD", 2)},
12381     {SWIG_LUA_CONSTTAB_INT("PL_X_AXIS", 1)},
12382     {SWIG_LUA_CONSTTAB_INT("PL_Y_AXIS", 2)},
12383     {SWIG_LUA_CONSTTAB_INT("PL_Z_AXIS", 3)},
12384     {SWIG_LUA_CONSTTAB_INT("PL_OPT_ENABLED", 0x0001)},
12385     {SWIG_LUA_CONSTTAB_INT("PL_OPT_ARG", 0x0002)},
12386     {SWIG_LUA_CONSTTAB_INT("PL_OPT_NODELETE", 0x0004)},
12387     {SWIG_LUA_CONSTTAB_INT("PL_OPT_INVISIBLE", 0x0008)},
12388     {SWIG_LUA_CONSTTAB_INT("PL_OPT_DISABLED", 0x0010)},
12389     {SWIG_LUA_CONSTTAB_INT("PL_OPT_FUNC", 0x0100)},
12390     {SWIG_LUA_CONSTTAB_INT("PL_OPT_BOOL", 0x0200)},
12391     {SWIG_LUA_CONSTTAB_INT("PL_OPT_INT", 0x0400)},
12392     {SWIG_LUA_CONSTTAB_INT("PL_OPT_FLOAT", 0x0800)},
12393     {SWIG_LUA_CONSTTAB_INT("PL_OPT_STRING", 0x1000)},
12394     {SWIG_LUA_CONSTTAB_INT("PL_PARSE_PARTIAL", 0x0000)},
12395     {SWIG_LUA_CONSTTAB_INT("PL_PARSE_FULL", 0x0001)},
12396     {SWIG_LUA_CONSTTAB_INT("PL_PARSE_QUIET", 0x0002)},
12397     {SWIG_LUA_CONSTTAB_INT("PL_PARSE_NODELETE", 0x0004)},
12398     {SWIG_LUA_CONSTTAB_INT("PL_PARSE_SHOWALL", 0x0008)},
12399     {SWIG_LUA_CONSTTAB_INT("PL_PARSE_OVERRIDE", 0x0010)},
12400     {SWIG_LUA_CONSTTAB_INT("PL_PARSE_NOPROGRAM", 0x0020)},
12401     {SWIG_LUA_CONSTTAB_INT("PL_PARSE_NODASH", 0x0040)},
12402     {SWIG_LUA_CONSTTAB_INT("PL_PARSE_SKIP", 0x0080)},
12403     {SWIG_LUA_CONSTTAB_INT("PL_FCI_MARK", 0x80000000)},
12404     {SWIG_LUA_CONSTTAB_INT("PL_FCI_IMPOSSIBLE", 0x00000000)},
12405     {SWIG_LUA_CONSTTAB_INT("PL_FCI_HEXDIGIT_MASK", 0xf)},
12406     {SWIG_LUA_CONSTTAB_INT("PL_FCI_HEXPOWER_MASK", 0x7)},
12407     {SWIG_LUA_CONSTTAB_INT("PL_FCI_HEXPOWER_IMPOSSIBLE", 0xf)},
12408     {SWIG_LUA_CONSTTAB_INT("PL_FCI_FAMILY", 0x0)},
12409     {SWIG_LUA_CONSTTAB_INT("PL_FCI_STYLE", 0x1)},
12410     {SWIG_LUA_CONSTTAB_INT("PL_FCI_WEIGHT", 0x2)},
12411     {SWIG_LUA_CONSTTAB_INT("PL_FCI_SANS", 0x0)},
12412     {SWIG_LUA_CONSTTAB_INT("PL_FCI_SERIF", 0x1)},
12413     {SWIG_LUA_CONSTTAB_INT("PL_FCI_MONO", 0x2)},
12414     {SWIG_LUA_CONSTTAB_INT("PL_FCI_SCRIPT", 0x3)},
12415     {SWIG_LUA_CONSTTAB_INT("PL_FCI_SYMBOL", 0x4)},
12416     {SWIG_LUA_CONSTTAB_INT("PL_FCI_UPRIGHT", 0x0)},
12417     {SWIG_LUA_CONSTTAB_INT("PL_FCI_ITALIC", 0x1)},
12418     {SWIG_LUA_CONSTTAB_INT("PL_FCI_OBLIQUE", 0x2)},
12419     {SWIG_LUA_CONSTTAB_INT("PL_FCI_MEDIUM", 0x0)},
12420     {SWIG_LUA_CONSTTAB_INT("PL_FCI_BOLD", 0x1)},
12421     {SWIG_LUA_CONSTTAB_INT("PL_MAXKEY", 16)},
12422     {SWIG_LUA_CONSTTAB_INT("PL_MAXWINDOWS", 64)},
12423     {SWIG_LUA_CONSTTAB_INT("PL_NOTSET", (-42))},
12424     {SWIG_LUA_CONSTTAB_INT("PLESC_DOUBLEBUFFERING_ENABLE", 1)},
12425     {SWIG_LUA_CONSTTAB_INT("PLESC_DOUBLEBUFFERING_DISABLE", 2)},
12426     {SWIG_LUA_CONSTTAB_INT("PLESC_DOUBLEBUFFERING_QUERY", 3)},
12427     {SWIG_LUA_CONSTTAB_INT("PL_BIN_DEFAULT", 0x0)},
12428     {SWIG_LUA_CONSTTAB_INT("PL_BIN_CENTRED", 0x1)},
12429     {SWIG_LUA_CONSTTAB_INT("PL_BIN_NOEXPAND", 0x2)},
12430     {SWIG_LUA_CONSTTAB_INT("PL_BIN_NOEMPTY", 0x4)},
12431     {SWIG_LUA_CONSTTAB_INT("GRID_CSA", 1)},
12432     {SWIG_LUA_CONSTTAB_INT("GRID_DTLI", 2)},
12433     {SWIG_LUA_CONSTTAB_INT("GRID_NNI", 3)},
12434     {SWIG_LUA_CONSTTAB_INT("GRID_NNIDW", 4)},
12435     {SWIG_LUA_CONSTTAB_INT("GRID_NNLI", 5)},
12436     {SWIG_LUA_CONSTTAB_INT("GRID_NNAIDW", 6)},
12437     {SWIG_LUA_CONSTTAB_INT("PL_HIST_DEFAULT", 0x00)},
12438     {SWIG_LUA_CONSTTAB_INT("PL_HIST_NOSCALING", 0x01)},
12439     {SWIG_LUA_CONSTTAB_INT("PL_HIST_IGNORE_OUTLIERS", 0x02)},
12440     {SWIG_LUA_CONSTTAB_INT("PL_HIST_NOEXPAND", 0x08)},
12441     {SWIG_LUA_CONSTTAB_INT("PL_HIST_NOEMPTY", 0x10)},
12442     {SWIG_LUA_CONSTTAB_INT("PL_POSITION_LEFT", 0x1)},
12443     {SWIG_LUA_CONSTTAB_INT("PL_POSITION_RIGHT", 0x2)},
12444     {SWIG_LUA_CONSTTAB_INT("PL_POSITION_TOP", 0x4)},
12445     {SWIG_LUA_CONSTTAB_INT("PL_POSITION_BOTTOM", 0x8)},
12446     {SWIG_LUA_CONSTTAB_INT("PL_POSITION_INSIDE", 0x10)},
12447     {SWIG_LUA_CONSTTAB_INT("PL_POSITION_OUTSIDE", 0x20)},
12448     {SWIG_LUA_CONSTTAB_INT("PL_POSITION_VIEWPORT", 0x40)},
12449     {SWIG_LUA_CONSTTAB_INT("PL_POSITION_SUBPAGE", 0x80)},
12450     {SWIG_LUA_CONSTTAB_INT("PL_LEGEND_NONE", 0x1)},
12451     {SWIG_LUA_CONSTTAB_INT("PL_LEGEND_COLOR_BOX", 0x2)},
12452     {SWIG_LUA_CONSTTAB_INT("PL_LEGEND_LINE", 0x4)},
12453     {SWIG_LUA_CONSTTAB_INT("PL_LEGEND_SYMBOL", 0x8)},
12454     {SWIG_LUA_CONSTTAB_INT("PL_LEGEND_TEXT_LEFT", 0x10)},
12455     {SWIG_LUA_CONSTTAB_INT("PL_LEGEND_BACKGROUND", 0x20)},
12456     {SWIG_LUA_CONSTTAB_INT("PL_LEGEND_BOUNDING_BOX", 0x40)},
12457     {SWIG_LUA_CONSTTAB_INT("PL_LEGEND_ROW_MAJOR", 0x80)},
12458     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_LABEL_LEFT", 0x1)},
12459     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_LABEL_RIGHT", 0x2)},
12460     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_LABEL_TOP", 0x4)},
12461     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_LABEL_BOTTOM", 0x8)},
12462     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_IMAGE", 0x10)},
12463     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_SHADE", 0x20)},
12464     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_GRADIENT", 0x40)},
12465     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_CAP_NONE", 0x80)},
12466     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_CAP_LOW", 0x100)},
12467     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_CAP_HIGH", 0x200)},
12468     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_SHADE_LABEL", 0x400)},
12469     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_ORIENT_RIGHT", 0x800)},
12470     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_ORIENT_TOP", 0x1000)},
12471     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_ORIENT_LEFT", 0x2000)},
12472     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_ORIENT_BOTTOM", 0x4000)},
12473     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_BACKGROUND", 0x8000)},
12474     {SWIG_LUA_CONSTTAB_INT("PL_COLORBAR_BOUNDING_BOX", 0x10000)},
12475     {SWIG_LUA_CONSTTAB_INT("PL_DRAWMODE_UNKNOWN", 0x0)},
12476     {SWIG_LUA_CONSTTAB_INT("PL_DRAWMODE_DEFAULT", 0x1)},
12477     {SWIG_LUA_CONSTTAB_INT("PL_DRAWMODE_REPLACE", 0x2)},
12478     {SWIG_LUA_CONSTTAB_INT("PL_DRAWMODE_XOR", 0x4)},
12479     {SWIG_LUA_CONSTTAB_INT("DRAW_LINEX", 0x001)},
12480     {SWIG_LUA_CONSTTAB_INT("DRAW_LINEY", 0x002)},
12481     {SWIG_LUA_CONSTTAB_INT("DRAW_LINEXY", 0x003)},
12482     {SWIG_LUA_CONSTTAB_INT("MAG_COLOR", 0x004)},
12483     {SWIG_LUA_CONSTTAB_INT("BASE_CONT", 0x008)},
12484     {SWIG_LUA_CONSTTAB_INT("TOP_CONT", 0x010)},
12485     {SWIG_LUA_CONSTTAB_INT("SURF_CONT", 0x020)},
12486     {SWIG_LUA_CONSTTAB_INT("DRAW_SIDES", 0x040)},
12487     {SWIG_LUA_CONSTTAB_INT("FACETED", 0x080)},
12488     {SWIG_LUA_CONSTTAB_INT("MESH", 0x100)},
12489     {0,0,0,0,0,0}
12490 };
12491 static swig_lua_method swig_SwigModule_methods[]= {
12492     { "setcontlabelformat", _wrap_setcontlabelformat},
12493     { "setcontlabelparam", _wrap_setcontlabelparam},
12494     { "adv", _wrap_adv},
12495     { "arc", _wrap_arc},
12496     { "axes", _wrap_axes},
12497     { "bin", _wrap_bin},
12498     { "btime", _wrap_btime},
12499     { "bop", _wrap_bop},
12500     { "box", _wrap_box},
12501     { "box3", _wrap_box3},
12502     { "calc_world", _wrap_calc_world},
12503     { "clear", _wrap_clear},
12504     { "col0", _wrap_col0},
12505     { "col1", _wrap_col1},
12506     { "configtime", _wrap_configtime},
12507     { "cont", _wrap_cont},
12508     { "ctime", _wrap_ctime},
12509     { "cpstrm", _wrap_cpstrm},
12510     { "plend", _wrap_plend},
12511     { "plend1", _wrap_plend1},
12512     { "env", _wrap_env},
12513     { "env0", _wrap_env0},
12514     { "eop", _wrap_eop},
12515     { "errx", _wrap_errx},
12516     { "erry", _wrap_erry},
12517     { "famadv", _wrap_famadv},
12518     { "fill", _wrap_fill},
12519     { "fill3", _wrap_fill3},
12520     { "gradient", _wrap_gradient},
12521     { "flush", _wrap_flush},
12522     { "font", _wrap_font},
12523     { "fontld", _wrap_fontld},
12524     { "gchr", _wrap_gchr},
12525     { "gcol0", _wrap_gcol0},
12526     { "gcol0a", _wrap_gcol0a},
12527     { "gcolbg", _wrap_gcolbg},
12528     { "gcolbga", _wrap_gcolbga},
12529     { "gcompression", _wrap_gcompression},
12530     { "gdev", _wrap_gdev},
12531     { "gdidev", _wrap_gdidev},
12532     { "gdiori", _wrap_gdiori},
12533     { "gdiplt", _wrap_gdiplt},
12534     { "gfam", _wrap_gfam},
12535     { "gfci", _wrap_gfci},
12536     { "gfnam", _wrap_gfnam},
12537     { "gfont", _wrap_gfont},
12538     { "glevel", _wrap_glevel},
12539     { "gpage", _wrap_gpage},
12540     { "gra", _wrap_gra},
12541     { "griddata", _wrap_griddata},
12542     { "gspa", _wrap_gspa},
12543     { "gstrm", _wrap_gstrm},
12544     { "gver", _wrap_gver},
12545     { "gvpd", _wrap_gvpd},
12546     { "gvpw", _wrap_gvpw},
12547     { "gxax", _wrap_gxax},
12548     { "gyax", _wrap_gyax},
12549     { "gzax", _wrap_gzax},
12550     { "hist", _wrap_hist},
12551     { "hlsrgb", _wrap_hlsrgb},
12552     { "init", _wrap_init},
12553     { "join", _wrap_join},
12554     { "lab", _wrap_lab},
12555     { "legend", _wrap_legend},
12556     { "colorbar", _wrap_colorbar},
12557     { "lightsource", _wrap_lightsource},
12558     { "line", _wrap_line},
12559     { "line3", _wrap_line3},
12560     { "lsty", _wrap_lsty},
12561     { "mesh", _wrap_mesh},
12562     { "meshc", _wrap_meshc},
12563     { "mkstrm", _wrap_mkstrm},
12564     { "mtex", _wrap_mtex},
12565     { "mtex3", _wrap_mtex3},
12566     { "plot3d", _wrap_plot3d},
12567     { "plot3dc", _wrap_plot3dc},
12568     { "plot3dcl", _wrap_plot3dcl},
12569     { "surf3d", _wrap_surf3d},
12570     { "surf3dl", _wrap_surf3dl},
12571     { "parseopts", _wrap_parseopts},
12572     { "pat", _wrap_pat},
12573     { "path", _wrap_path},
12574     { "poin", _wrap_poin},
12575     { "poin3", _wrap_poin3},
12576     { "poly3", _wrap_poly3},
12577     { "prec", _wrap_prec},
12578     { "psty", _wrap_psty},
12579     { "ptex", _wrap_ptex},
12580     { "ptex3", _wrap_ptex3},
12581     { "randd", _wrap_randd},
12582     { "replot", _wrap_replot},
12583     { "rgbhls", _wrap_rgbhls},
12584     { "schr", _wrap_schr},
12585     { "scmap0", _wrap_scmap0},
12586     { "scmap0a", _wrap_scmap0a},
12587     { "scmap0n", _wrap_scmap0n},
12588     { "scmap1", _wrap_scmap1},
12589     { "scmap1a", _wrap_scmap1a},
12590     { "scmap1l", _wrap_scmap1l},
12591     { "scmap1la", _wrap_scmap1la},
12592     { "scmap1n", _wrap_scmap1n},
12593     { "scmap1_range", _wrap_scmap1_range},
12594     { "gcmap1_range", _wrap_gcmap1_range},
12595     { "scol0", _wrap_scol0},
12596     { "scol0a", _wrap_scol0a},
12597     { "scolbg", _wrap_scolbg},
12598     { "scolbga", _wrap_scolbga},
12599     { "scolor", _wrap_scolor},
12600     { "scompression", _wrap_scompression},
12601     { "sdev", _wrap_sdev},
12602     { "sdidev", _wrap_sdidev},
12603     { "sdimap", _wrap_sdimap},
12604     { "sdiori", _wrap_sdiori},
12605     { "sdiplt", _wrap_sdiplt},
12606     { "sdiplz", _wrap_sdiplz},
12607     { "seed", _wrap_seed},
12608     { "sesc", _wrap_sesc},
12609     { "setopt", _wrap_setopt},
12610     { "sfam", _wrap_sfam},
12611     { "sfci", _wrap_sfci},
12612     { "sfnam", _wrap_sfnam},
12613     { "sfont", _wrap_sfont},
12614     { "shades", _wrap_shades},
12615     { "shade", _wrap_shade},
12616     { "slabelfunc", _wrap_slabelfunc},
12617     { "smaj", _wrap_smaj},
12618     { "smin", _wrap_smin},
12619     { "sori", _wrap_sori},
12620     { "spage", _wrap_spage},
12621     { "spal0", _wrap_spal0},
12622     { "spal1", _wrap_spal1},
12623     { "spause", _wrap_spause},
12624     { "sstrm", _wrap_sstrm},
12625     { "ssub", _wrap_ssub},
12626     { "ssym", _wrap_ssym},
12627     { "star", _wrap_star},
12628     { "start", _wrap_start},
12629     { "stransform", _wrap_stransform},
12630     { "string", _wrap_string},
12631     { "string3", _wrap_string3},
12632     { "stripa", _wrap_stripa},
12633     { "stripc", _wrap_stripc},
12634     { "stripd", _wrap_stripd},
12635     { "styl", _wrap_styl},
12636     { "svect", _wrap_svect},
12637     { "svpa", _wrap_svpa},
12638     { "sxax", _wrap_sxax},
12639     { "syax", _wrap_syax},
12640     { "sym", _wrap_sym},
12641     { "szax", _wrap_szax},
12642     { "text", _wrap_text},
12643     { "timefmt", _wrap_timefmt},
12644     { "vasp", _wrap_vasp},
12645     { "vect", _wrap_vect},
12646     { "vpas", _wrap_vpas},
12647     { "vpor", _wrap_vpor},
12648     { "vsta", _wrap_vsta},
12649     { "w3d", _wrap_w3d},
12650     { "width", _wrap_width},
12651     { "wind", _wrap_wind},
12652     { "xormod", _wrap_xormod},
12653     { "map", _wrap_map},
12654     { "meridians", _wrap_meridians},
12655     { "image", _wrap_image},
12656     { "imagefr", _wrap_imagefr},
12657     { "plClearOpts", _wrap_plClearOpts},
12658     { "plResetOpts", _wrap_plResetOpts},
12659     { "plSetUsage", _wrap_plSetUsage},
12660     { "plOptUsage", _wrap_plOptUsage},
12661     { "MinMax2dGrid", _wrap_MinMax2dGrid},
12662     { "plGetCursor", _wrap_plGetCursor},
12663     { "warn", _wrap_warn},
12664     { "abort", _wrap_abort},
12665     {0,0}
12666 };
12667 static swig_lua_class* swig_SwigModule_classes[]= {
12668 &_wrap_class_PLGraphicsIn,
12669     0
12670 };
12671 static swig_lua_namespace* swig_SwigModule_namespaces[] = {
12672     0
12673 };
12674 
12675 static swig_lua_namespace swig_SwigModule = {
12676     "plplotluac",
12677     swig_SwigModule_methods,
12678     swig_SwigModule_attributes,
12679     swig_SwigModule_constants,
12680     swig_SwigModule_classes,
12681     swig_SwigModule_namespaces
12682 };
12683 #ifdef __cplusplus
12684 }
12685 #endif
12686 
12687 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
12688 
12689 static swig_type_info _swigt__p_PLGraphicsIn = {"_p_PLGraphicsIn", "PLGraphicsIn *", 0, 0, (void*)&_wrap_class_PLGraphicsIn, 0};
12690 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
12691 static swig_type_info _swigt__p_double = {"_p_double", "double *|PLFLT *", 0, 0, (void*)0, 0};
12692 static swig_type_info _swigt__p_f_double_double__int = {"_p_f_double_double__int", "defined_func|int (*)(double,double)", 0, 0, (void*)0, 0};
12693 static swig_type_info _swigt__p_f_double_double_p_double_p_double_p_void__void = {"_p_f_double_double_p_double_p_double_p_void__void", "ct_func|pltr_func|void (*)(double,double,double *,double *,void *)", 0, 0, (void*)0, 0};
12694 static swig_type_info _swigt__p_f_int_double_p_char_int_p_void__void = {"_p_f_int_double_p_char_int_p_void__void", "void (*)(int,double,char *,int,void *)|label_func", 0, 0, (void*)0, 0};
12695 static swig_type_info _swigt__p_f_int_p_double_p_double__void = {"_p_f_int_p_double_p_double__void", "mapform_func|void (*)(int,double *,double *)", 0, 0, (void*)0, 0};
12696 static swig_type_info _swigt__p_f_int_p_q_const__double_p_q_const__double__void = {"_p_f_int_p_q_const__double_p_q_const__double__void", "void (*)(int,double const *,double const *)|fill_func", 0, 0, (void*)0, 0};
12697 static swig_type_info _swigt__p_int = {"_p_int", "PLBOOL *|int *|PLINT *", 0, 0, (void*)0, 0};
12698 static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
12699 static swig_type_info _swigt__p_p_double = {"_p_p_double", "PLFLT **|double **", 0, 0, (void*)0, 0};
12700 static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *|PLUNICODE *", 0, 0, (void*)0, 0};
12701 
12702 static swig_type_info *swig_type_initial[] = {
12703   &_swigt__p_PLGraphicsIn,
12704   &_swigt__p_char,
12705   &_swigt__p_double,
12706   &_swigt__p_f_double_double__int,
12707   &_swigt__p_f_double_double_p_double_p_double_p_void__void,
12708   &_swigt__p_f_int_double_p_char_int_p_void__void,
12709   &_swigt__p_f_int_p_double_p_double__void,
12710   &_swigt__p_f_int_p_q_const__double_p_q_const__double__void,
12711   &_swigt__p_int,
12712   &_swigt__p_p_char,
12713   &_swigt__p_p_double,
12714   &_swigt__p_unsigned_int,
12715 };
12716 
12717 static swig_cast_info _swigc__p_PLGraphicsIn[] = {  {&_swigt__p_PLGraphicsIn, 0, 0, 0},{0, 0, 0, 0}};
12718 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
12719 static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
12720 static swig_cast_info _swigc__p_f_double_double__int[] = {  {&_swigt__p_f_double_double__int, 0, 0, 0},{0, 0, 0, 0}};
12721 static swig_cast_info _swigc__p_f_double_double_p_double_p_double_p_void__void[] = {  {&_swigt__p_f_double_double_p_double_p_double_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
12722 static swig_cast_info _swigc__p_f_int_double_p_char_int_p_void__void[] = {  {&_swigt__p_f_int_double_p_char_int_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
12723 static swig_cast_info _swigc__p_f_int_p_double_p_double__void[] = {  {&_swigt__p_f_int_p_double_p_double__void, 0, 0, 0},{0, 0, 0, 0}};
12724 static swig_cast_info _swigc__p_f_int_p_q_const__double_p_q_const__double__void[] = {  {&_swigt__p_f_int_p_q_const__double_p_q_const__double__void, 0, 0, 0},{0, 0, 0, 0}};
12725 static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
12726 static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
12727 static swig_cast_info _swigc__p_p_double[] = {  {&_swigt__p_p_double, 0, 0, 0},{0, 0, 0, 0}};
12728 static swig_cast_info _swigc__p_unsigned_int[] = {  {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
12729 
12730 static swig_cast_info *swig_cast_initial[] = {
12731   _swigc__p_PLGraphicsIn,
12732   _swigc__p_char,
12733   _swigc__p_double,
12734   _swigc__p_f_double_double__int,
12735   _swigc__p_f_double_double_p_double_p_double_p_void__void,
12736   _swigc__p_f_int_double_p_char_int_p_void__void,
12737   _swigc__p_f_int_p_double_p_double__void,
12738   _swigc__p_f_int_p_q_const__double_p_q_const__double__void,
12739   _swigc__p_int,
12740   _swigc__p_p_char,
12741   _swigc__p_p_double,
12742   _swigc__p_unsigned_int,
12743 };
12744 
12745 
12746 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
12747 
12748 /* -----------------------------------------------------------------------------
12749  * Type initialization:
12750  * This problem is tough by the requirement that no dynamic
12751  * memory is used. Also, since swig_type_info structures store pointers to
12752  * swig_cast_info structures and swig_cast_info structures store pointers back
12753  * to swig_type_info structures, we need some lookup code at initialization.
12754  * The idea is that swig generates all the structures that are needed.
12755  * The runtime then collects these partially filled structures.
12756  * The SWIG_InitializeModule function takes these initial arrays out of
12757  * swig_module, and does all the lookup, filling in the swig_module.types
12758  * array with the correct data and linking the correct swig_cast_info
12759  * structures together.
12760  *
12761  * The generated swig_type_info structures are assigned statically to an initial
12762  * array. We just loop through that array, and handle each type individually.
12763  * First we lookup if this type has been already loaded, and if so, use the
12764  * loaded structure instead of the generated one. Then we have to fill in the
12765  * cast linked list. The cast data is initially stored in something like a
12766  * two-dimensional array. Each row corresponds to a type (there are the same
12767  * number of rows as there are in the swig_type_initial array). Each entry in
12768  * a column is one of the swig_cast_info structures for that type.
12769  * The cast_initial array is actually an array of arrays, because each row has
12770  * a variable number of columns. So to actually build the cast linked list,
12771  * we find the array of casts associated with the type, and loop through it
12772  * adding the casts to the list. The one last trick we need to do is making
12773  * sure the type pointer in the swig_cast_info struct is correct.
12774  *
12775  * First off, we lookup the cast->type name to see if it is already loaded.
12776  * There are three cases to handle:
12777  *  1) If the cast->type has already been loaded AND the type we are adding
12778  *     casting info to has not been loaded (it is in this module), THEN we
12779  *     replace the cast->type pointer with the type pointer that has already
12780  *     been loaded.
12781  *  2) If BOTH types (the one we are adding casting info to, and the
12782  *     cast->type) are loaded, THEN the cast info has already been loaded by
12783  *     the previous module so we just ignore it.
12784  *  3) Finally, if cast->type has not already been loaded, then we add that
12785  *     swig_cast_info to the linked list (because the cast->type) pointer will
12786  *     be correct.
12787  * ----------------------------------------------------------------------------- */
12788 
12789 #ifdef __cplusplus
12790 extern "C" {
12791 #if 0
12792 } /* c-mode */
12793 #endif
12794 #endif
12795 
12796 #if 0
12797 #define SWIGRUNTIME_DEBUG
12798 #endif
12799 
12800 
12801 SWIGRUNTIME void
12802 SWIG_InitializeModule(void *clientdata) {
12803   size_t i;
12804   swig_module_info *module_head, *iter;
12805   int found, init;
12806 
12807   /* check to see if the circular list has been setup, if not, set it up */
12808   if (swig_module.next==0) {
12809     /* Initialize the swig_module */
12810     swig_module.type_initial = swig_type_initial;
12811     swig_module.cast_initial = swig_cast_initial;
12812     swig_module.next = &swig_module;
12813     init = 1;
12814   } else {
12815     init = 0;
12816   }
12817 
12818   /* Try and load any already created modules */
12819   module_head = SWIG_GetModule(clientdata);
12820   if (!module_head) {
12821     /* This is the first module loaded for this interpreter */
12822     /* so set the swig module into the interpreter */
12823     SWIG_SetModule(clientdata, &swig_module);
12824     module_head = &swig_module;
12825   } else {
12826     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
12827     found=0;
12828     iter=module_head;
12829     do {
12830       if (iter==&swig_module) {
12831         found=1;
12832         break;
12833       }
12834       iter=iter->next;
12835     } while (iter!= module_head);
12836 
12837     /* if the is found in the list, then all is done and we may leave */
12838     if (found) return;
12839     /* otherwise we must add out module into the list */
12840     swig_module.next = module_head->next;
12841     module_head->next = &swig_module;
12842   }
12843 
12844   /* When multiple interpreters are used, a module could have already been initialized in
12845      a different interpreter, but not yet have a pointer in this interpreter.
12846      In this case, we do not want to continue adding types... everything should be
12847      set up already */
12848   if (init == 0) return;
12849 
12850   /* Now work on filling in swig_module.types */
12851 #ifdef SWIGRUNTIME_DEBUG
12852   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
12853 #endif
12854   for (i = 0; i < swig_module.size; ++i) {
12855     swig_type_info *type = 0;
12856     swig_type_info *ret;
12857     swig_cast_info *cast;
12858 
12859 #ifdef SWIGRUNTIME_DEBUG
12860     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
12861 #endif
12862 
12863     /* if there is another module already loaded */
12864     if (swig_module.next != &swig_module) {
12865       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
12866     }
12867     if (type) {
12868       /* Overwrite clientdata field */
12869 #ifdef SWIGRUNTIME_DEBUG
12870       printf("SWIG_InitializeModule: found type %s\n", type->name);
12871 #endif
12872       if (swig_module.type_initial[i]->clientdata) {
12873         type->clientdata = swig_module.type_initial[i]->clientdata;
12874 #ifdef SWIGRUNTIME_DEBUG
12875       printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
12876 #endif
12877       }
12878     } else {
12879       type = swig_module.type_initial[i];
12880     }
12881 
12882     /* Insert casting types */
12883     cast = swig_module.cast_initial[i];
12884     while (cast->type) {
12885 
12886       /* Don't need to add information already in the list */
12887       ret = 0;
12888 #ifdef SWIGRUNTIME_DEBUG
12889       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
12890 #endif
12891       if (swig_module.next != &swig_module) {
12892         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
12893 #ifdef SWIGRUNTIME_DEBUG
12894         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
12895 #endif
12896       }
12897       if (ret) {
12898         if (type == swig_module.type_initial[i]) {
12899 #ifdef SWIGRUNTIME_DEBUG
12900           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
12901 #endif
12902           cast->type = ret;
12903           ret = 0;
12904         } else {
12905           /* Check for casting already in the list */
12906           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
12907 #ifdef SWIGRUNTIME_DEBUG
12908           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
12909 #endif
12910           if (!ocast) ret = 0;
12911         }
12912       }
12913 
12914       if (!ret) {
12915 #ifdef SWIGRUNTIME_DEBUG
12916         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
12917 #endif
12918         if (type->cast) {
12919           type->cast->prev = cast;
12920           cast->next = type->cast;
12921         }
12922         type->cast = cast;
12923       }
12924       cast++;
12925     }
12926     /* Set entry in modules->types array equal to the type */
12927     swig_module.types[i] = type;
12928   }
12929   swig_module.types[i] = 0;
12930 
12931 #ifdef SWIGRUNTIME_DEBUG
12932   printf("**** SWIG_InitializeModule: Cast List ******\n");
12933   for (i = 0; i < swig_module.size; ++i) {
12934     int j = 0;
12935     swig_cast_info *cast = swig_module.cast_initial[i];
12936     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
12937     while (cast->type) {
12938       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
12939       cast++;
12940       ++j;
12941     }
12942   printf("---- Total casts: %d\n",j);
12943   }
12944   printf("**** SWIG_InitializeModule: Cast List ******\n");
12945 #endif
12946 }
12947 
12948 /* This function will propagate the clientdata field of type to
12949 * any new swig_type_info structures that have been added into the list
12950 * of equivalent types.  It is like calling
12951 * SWIG_TypeClientData(type, clientdata) a second time.
12952 */
12953 SWIGRUNTIME void
12954 SWIG_PropagateClientData(void) {
12955   size_t i;
12956   swig_cast_info *equiv;
12957   static int init_run = 0;
12958 
12959   if (init_run) return;
12960   init_run = 1;
12961 
12962   for (i = 0; i < swig_module.size; i++) {
12963     if (swig_module.types[i]->clientdata) {
12964       equiv = swig_module.types[i]->cast;
12965       while (equiv) {
12966         if (!equiv->converter) {
12967           if (equiv->type && !equiv->type->clientdata)
12968             SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
12969         }
12970         equiv = equiv->next;
12971       }
12972     }
12973   }
12974 }
12975 
12976 #ifdef __cplusplus
12977 #if 0
12978 { /* c-mode */
12979 #endif
12980 }
12981 #endif
12982 
12983 
12984 
12985 /* Forward declaration of where the user's %init{} gets inserted */
12986 void SWIG_init_user(lua_State* L );
12987     
12988 #ifdef __cplusplus
12989 extern "C" {
12990 #endif
12991 /* this is the initialization function
12992   added at the very end of the code
12993   the function is always called SWIG_init, but an earlier #define will rename it
12994 */
12995 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
12996 LUALIB_API int SWIG_init(lua_State* L)
12997 #else
12998 SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */
12999 #endif
13000 {
13001 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
13002   int i;
13003   int globalRegister = 0;
13004   /* start with global table */
13005   lua_pushglobaltable (L);
13006   /* SWIG's internal initialisation */
13007   SWIG_InitializeModule((void*)L);
13008   SWIG_PropagateClientData();
13009 #endif
13010 
13011 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) || defined(SWIG_LUA_ELUA_EMULATE)
13012   /* add a global fn */
13013   SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
13014   SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_class_equal);
13015 #endif
13016 
13017 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
13018   /* set up base class pointers (the hierarchy) */
13019   for (i = 0; swig_types[i]; i++){
13020     if (swig_types[i]->clientdata){
13021       SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
13022     }
13023   }
13024 #ifdef SWIG_LUA_MODULE_GLOBAL
13025   globalRegister = 1;
13026 #endif
13027 
13028 
13029 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
13030   SWIG_Lua_namespace_register(L,&swig_SwigModule, globalRegister);
13031 #endif
13032 
13033 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
13034   for (i = 0; swig_types[i]; i++){
13035     if (swig_types[i]->clientdata){
13036       SWIG_Lua_elua_class_register_instance(L,(swig_lua_class*)(swig_types[i]->clientdata));
13037     }
13038   }
13039 #endif
13040 
13041 #if defined(SWIG_LUA_ELUA_EMULATE)
13042   lua_newtable(L);
13043   SWIG_Lua_elua_emulate_register(L,swig_SwigModule.ns_methods);
13044   SWIG_Lua_elua_emulate_register_clear(L);
13045   if(globalRegister) {
13046     lua_pushstring(L,swig_SwigModule.name);
13047     lua_pushvalue(L,-2);
13048     lua_rawset(L,-4);
13049   }
13050 #endif
13051 
13052 #endif
13053 
13054 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
13055   /* invoke user-specific initialization */
13056   SWIG_init_user(L);
13057   /* end module */
13058   /* Note: We do not clean up the stack here (Lua will do this for us). At this
13059      point, we have the globals table and out module table on the stack. Returning
13060      one value makes the module table the result of the require command. */
13061   return 1;
13062 #else
13063   return 0;
13064 #endif
13065 }
13066 
13067 #ifdef __cplusplus
13068 }
13069 #endif
13070 
13071 
13072 const char* SWIG_LUACODE=
13073   "\n"
13074   "    pl = plplotluac";
13075 
13076 void SWIG_init_user(lua_State* L)
13077 {
13078   /* exec Lua code if applicable */
13079   SWIG_Lua_dostring(L,SWIG_LUACODE);
13080 }
13081 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines