⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gpstk_wrap_mod.cxx

📁 gpstk1.5的有关内容 对于刚刚接触gps有一定的帮助 很有用的啊
💻 CXX
📖 第 1 页 / 共 5 页
字号:
static intSWIG_Tcl_GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], const char *fmt, ...) {  int        argno = 0, opt = 0;  long       tempi;  double     tempd;  const char *c;  va_list    ap;  void      *vptr;  Tcl_Obj   *obj = 0;  swig_type_info *ty;  va_start(ap,fmt);  for (c = fmt; (*c && (*c != ':') && (*c != ';')); c++,argno++) {    if (*c == '|') {      opt = 1;      c++;    }    if (argno >= (objc-1)) {      if (!opt) {        Tcl_SetResult(interp, (char *) "Wrong # args. ", TCL_STATIC);        goto argerror;      } else {        va_end(ap);        return TCL_OK;      }    }    vptr = va_arg(ap,void *);    if (vptr) {      if (isupper(*c)) {        obj = SWIG_GetConstant(Tcl_GetStringFromObj(objv[argno+1],0));        if (!obj) obj = objv[argno+1];      } else {        obj = objv[argno+1];      }      switch(*c) {      case 'i': case 'I':      case 'l': case 'L':      case 'h': case 'H':      case 'b': case 'B':        if (Tcl_GetLongFromObj(interp,obj,&tempi) != TCL_OK) goto argerror;        if ((*c == 'i') || (*c == 'I')) *((int *)vptr) = (int)tempi;        else if ((*c == 'l') || (*c == 'L')) *((long *)vptr) = (long)tempi;        else if ((*c == 'h') || (*c == 'H')) *((short*)vptr) = (short)tempi;        else if ((*c == 'b') || (*c == 'B')) *((unsigned char *)vptr) = (unsigned char)tempi;        break;      case 'f': case 'F':      case 'd': case 'D':        if (Tcl_GetDoubleFromObj(interp,obj,&tempd) != TCL_OK) goto argerror;        if ((*c == 'f') || (*c == 'F')) *((float *) vptr) = (float)tempd;        else if ((*c == 'd') || (*c == 'D')) *((double*) vptr) = tempd;        break;      case 's': case 'S':        if (*(c+1) == '#') {          int *vlptr = (int *) va_arg(ap, void *);          *((char **) vptr) = Tcl_GetStringFromObj(obj, vlptr);          c++;        } else {          *((char **)vptr) = Tcl_GetStringFromObj(obj,NULL);        }        break;      case 'c': case 'C':        *((char *)vptr) = *(Tcl_GetStringFromObj(obj,NULL));        break;      case 'p': case 'P':        ty = (swig_type_info *) va_arg(ap, void *);        if (SWIG_Tcl_ConvertPtr(interp, obj, (void **) vptr, ty, SWIG_POINTER_EXCEPTION) == TCL_ERROR) goto argerror;        break;      case 'o': case 'O':        *((Tcl_Obj **)vptr) = objv[argno+1];        break;      default:        break;      }    }  }  if ((*c != ';') && ((objc-1) > argno)) {    Tcl_SetResult(interp, (char *) "Wrong # args.", TCL_STATIC);    goto argerror;  }  va_end(ap);  return TCL_OK; argerror:  {    char temp[32];    sprintf(temp,"%d", argno+1);    c = strchr(fmt,':');    if (!c) c = strchr(fmt,';');    if (!c) c = (char *)"";    Tcl_AppendResult(interp,c," argument ", temp, NULL);    va_end(ap);    return TCL_ERROR;  }}static voidSWIG_Tcl_ObjectDelete(ClientData clientData) {  swig_instance *si = (swig_instance *) clientData;  if ((si) && (si->destroy) && (SWIG_Disown(si->thisvalue))) {    if (si->classptr->destructor) {      (si->classptr->destructor)(si->thisvalue);    }  }  Tcl_DecrRefCount(si->thisptr);  free(si);}/* Function to invoke object methods given an instance */static intSWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST _objv[]) {  char *method,   *attrname;  swig_instance   *inst = (swig_instance *) clientData;  swig_method     *meth;  swig_attribute  *attr;  Tcl_Obj         *oldarg;  Tcl_Obj         **objv;  int              rcode;  swig_class      *cls;  swig_class      *cls_stack[64];  int              cls_stack_bi[64];  int              cls_stack_top = 0;  int              numconf = 2;  int              bi;  objv = (Tcl_Obj **) _objv;  if (objc < 2) {    Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC);    return TCL_ERROR;  }  method = Tcl_GetStringFromObj(objv[1],NULL);  if (strcmp(method,"-acquire") == 0) {    inst->destroy = 1;    SWIG_Acquire(inst->thisvalue);    return TCL_OK;  }  if (strcmp(method,"-disown") == 0) {    if (inst->destroy) {      SWIG_Disown(inst->thisvalue);    }    inst->destroy = 0;    return TCL_OK;  }  if (strcmp(method,"-delete") == 0) {    Tcl_DeleteCommandFromToken(interp,inst->cmdtok);    return TCL_OK;  }  cls_stack[cls_stack_top] = inst->classptr;  cls_stack_bi[cls_stack_top] = -1;  cls = inst->classptr;  while (1) {    bi = cls_stack_bi[cls_stack_top];    cls = cls_stack[cls_stack_top];    if (bi != -1) {      if (!cls->bases[bi] && cls->base_names[bi]) {        /* lookup and cache the base class */	swig_type_info *info = SWIG_TypeQuery(cls->base_names[bi]);	if (info) cls->bases[bi] = (swig_class *) info->clientdata;      }      cls = cls->bases[bi];      if (cls) {        cls_stack_bi[cls_stack_top]++;        cls_stack_top++;        cls_stack[cls_stack_top] = cls;        cls_stack_bi[cls_stack_top] = -1;        continue;      }    }    if (!cls) {      cls_stack_top--;      if (cls_stack_top < 0) break;      else continue;    }    cls_stack_bi[cls_stack_top]++;    meth = cls->methods;    /* Check for methods */    while (meth && meth->name) {      if (strcmp(meth->name,method) == 0) {        oldarg = objv[1];        objv[1] = inst->thisptr;        Tcl_IncrRefCount(inst->thisptr);        rcode = (*meth->method)(clientData,interp,objc,objv);        objv[1] = oldarg;        Tcl_DecrRefCount(inst->thisptr);        return rcode;      }      meth++;    }    /* Check class methods for a match */    if (strcmp(method,"cget") == 0) {      if (objc < 3) {        Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC);        return TCL_ERROR;      }      attrname = Tcl_GetStringFromObj(objv[2],NULL);      attr = cls->attributes;      while (attr && attr->name) {        if ((strcmp(attr->name, attrname) == 0) && (attr->getmethod)) {          oldarg = objv[1];          objv[1] = inst->thisptr;          Tcl_IncrRefCount(inst->thisptr);          rcode = (*attr->getmethod)(clientData,interp,2, objv);          objv[1] = oldarg;          Tcl_DecrRefCount(inst->thisptr);          return rcode;        }        attr++;      }      if (strcmp(attrname, "-this") == 0) {        Tcl_SetObjResult(interp, Tcl_DuplicateObj(inst->thisptr));        return TCL_OK;      }      if (strcmp(attrname, "-thisown") == 0) {        if (SWIG_Thisown(inst->thisvalue)) {          Tcl_SetResult(interp,(char*)"1",TCL_STATIC);        } else {          Tcl_SetResult(interp,(char*)"0",TCL_STATIC);        }        return TCL_OK;      }    } else if (strcmp(method, "configure") == 0) {      int i;      if (objc < 4) {        Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC);        return TCL_ERROR;      }      i = 2;      while (i < objc) {        attrname = Tcl_GetStringFromObj(objv[i],NULL);        attr = cls->attributes;        while (attr && attr->name) {          if ((strcmp(attr->name, attrname) == 0) && (attr->setmethod)) {            oldarg = objv[i];            objv[i] = inst->thisptr;            Tcl_IncrRefCount(inst->thisptr);            rcode = (*attr->setmethod)(clientData,interp,3, &objv[i-1]);            objv[i] = oldarg;            Tcl_DecrRefCount(inst->thisptr);            if (rcode != TCL_OK) return rcode;            numconf += 2;          }          attr++;        }        i+=2;      }    }  }  if (strcmp(method,"configure") == 0) {    if (numconf >= objc) {      return TCL_OK;    } else {      Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC);      return TCL_ERROR;    }  }  if (strcmp(method,"cget") == 0) {      Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC);      return TCL_ERROR;  }  Tcl_SetResult(interp, (char *) "Invalid method. Must be one of: configure cget -acquire -disown -delete", TCL_STATIC);  cls = inst->classptr;  bi = 0;  while (cls) {    meth = cls->methods;    while (meth && meth->name) {      char *cr = (char *) Tcl_GetStringResult(interp);      if (!strstr(strchr(cr,':'), meth->name))        Tcl_AppendElement(interp, (char *) meth->name);      meth++;    }    cls = inst->classptr->bases[bi++];  }  return TCL_ERROR;}/* Function to create objects */static intSWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {    Tcl_Obj          *newObj = 0;    void             *thisvalue = 0;    swig_instance   *newinst = 0;    swig_class      *classptr = (swig_class *) clientData;    swig_wrapper     cons = 0;    char             *name = 0;    int               firstarg = 0;    int               thisarg = 0;    int               destroy = 1;    if (!classptr) {      Tcl_SetResult(interp, (char *) "swig: internal runtime error. No class object defined.", TCL_STATIC);      return TCL_ERROR;    }    cons = classptr->constructor;    if (objc > 1) {      char *s = Tcl_GetStringFromObj(objv[1],NULL);      if (strcmp(s,"-this") == 0) {        thisarg = 2;        cons = 0;      } else if (strcmp(s,"-args") == 0) {        firstarg = 1;      } else if (objc == 2) {        firstarg = 1;        name = s;      } else if (objc >= 3) {        char *s1;        name = s;        s1 = Tcl_GetStringFromObj(objv[2],NULL);        if (strcmp(s1,"-this") == 0) {          thisarg = 3;          cons = 0;        } else {          firstarg = 1;        }      }    }    if (cons) {      int result;      result = (*cons)(0, interp, objc-firstarg, &objv[firstarg]);      if (result != TCL_OK) {        return result;      }      newObj = Tcl_DuplicateObj(Tcl_GetObjResult(interp));      if (!name) name = Tcl_GetStringFromObj(newObj,NULL);    } else if (thisarg > 0) {      if (thisarg < objc) {        destroy = 0;        newObj = Tcl_DuplicateObj(objv[thisarg]);        if (!name) name = Tcl_GetStringFromObj(newObj,NULL);      } else {        Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC);        return TCL_ERROR;      }    } else {      Tcl_SetResult(interp, (char *) "No constructor available.", TCL_STATIC);      return TCL_ERROR;    }    if (SWIG_Tcl_ConvertPtr(interp,newObj, (void **) &thisvalue, *(classptr->type), SWIG_POINTER_EXCEPTION) == TCL_ERROR) {      Tcl_DecrRefCount(newObj);      return TCL_ERROR;    }    newinst = (swig_instance *) malloc(sizeof(swig_instance));    newinst->thisptr = newObj;    Tcl_IncrRefCount(newObj);    newinst->thisvalue = thisvalue;    newinst->classptr = classptr;    newinst->destroy = destroy;    if (destroy) {      SWIG_Acquire(thisvalue);    }    newinst->cmdtok = Tcl_CreateObjCommand(interp,name, (swig_wrapper) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete);    return TCL_OK;}/* This function takes the current result and turns it into an object command */static Tcl_Obj *SWIG_Tcl_NewInstanceObj(Tcl_Interp *interp, void *thisvalue, swig_type_info *type, int flags) {  Tcl_Obj *robj = SWIG_NewPointerObj(thisvalue, type,0);  /* Check to see if this pointer belongs to a class or not */  if ((type->clientdata) && (interp)) {    Tcl_CmdInfo    ci;    char          *name;    name = Tcl_GetStringFromObj(robj,NULL);    if (!Tcl_GetCommandInfo(interp,name, &ci) || (flags)) {      swig_instance *newinst = (swig_instance *) malloc(sizeof(swig_instance));      newinst->thisptr = Tcl_DuplicateObj(robj);      Tcl_IncrRefCount(newinst->thisptr);      newinst->thisvalue = thisvalue;      newinst->classptr = (swig_class *) type->clientdata;      newinst->destroy = flags;      newinst->cmdtok = Tcl_CreateObjCommand(interp, Tcl_GetStringFromObj(robj,NULL), (swig_wrapper_func) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete);      if (flags) {        SWIG_Acquire(thisvalue);      }    }  }  return robj;}/* Structure for command table */typedef struct {  const char *name;  int       (*wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);  ClientData  clientdata;} swig_command_info;/* Structure for variable linking table */typedef struct {  const char *name;  void *addr;  char * (*get)(ClientData, Tcl_Interp *, char *, char *, int);  char * (*set)(ClientData, Tcl_Interp *, char *, char *, int);} swig_var_info;/* Contract support */#define SWIG_contract_assert(expr, msg)  if (!(expr)) { Tcl_SetResult(interp, (char *) msg, TCL_STATIC ); goto fail; } else#ifdef __cplusplus}#endif/* -------- TYPES TABLE (BEGIN) -------- */#define  SWIGTYPE_p_gpstk__AccessError swig_types[0] #define  SWIGTYPE_p_size_t swig_types[1] #define  SWIGTYPE_std__size_t swig_types[2] #define  SWIGTYPE_size_t swig_types[3] #define  SWIGTYPE_p_gpstk__InvalidParameter swig_types[4] #define  SWIGTYPE_p_DayTime swig_types[5] #define  SWIGTYPE_p_gpstk__OutOfMemory swig_types[6] #define  SWIGTYPE_p_gpstk__ExceptionLocation swig_types[7] #define  SWIGTYPE_p_gpstk__GPSZcount swig_types[8] #define  SWIGTYPE_p_long_double swig_types[9] #define  SWIGTYPE_p_GPSZcount swig_types[10] #define  SWIGTYPE_p_double swig_types[11] #define  SWIGTYPE_p_time_t swig_types[12] 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -