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

📄 canltwo_wrap.c

📁 can4linux-3.5.3.gz can4 linux
💻 C
📖 第 1 页 / 共 5 页
字号:
  int arg1 ;  int arg2 ;  char *arg3 = (char *) 0 ;  int result;  int val1 ;  int ecode1 = 0 ;  int val2 ;  int ecode2 = 0 ;  int res3 ;  char *buf3 = 0 ;  int alloc3 = 0 ;    if (SWIG_GetArgs(interp, objc, objv,"ooo:can_send fd len message ",(void *)0,(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;  ecode1 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[1], &val1);  if (!SWIG_IsOK(ecode1)) {    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "can_send" "', argument " "1"" of type '" "int""'");  }   arg1 = (int)(val1);  ecode2 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);  if (!SWIG_IsOK(ecode2)) {    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "can_send" "', argument " "2"" of type '" "int""'");  }   arg2 = (int)(val2);  res3 = SWIG_AsCharPtrAndSize(objv[3], &buf3, NULL, &alloc3);  if (!SWIG_IsOK(res3)) {    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "can_send" "', argument " "3"" of type '" "char *""'");  }  arg3 = buf3;  result = (int)can_send(arg1,arg2,arg3);  Tcl_SetObjResult(interp,SWIG_From_int((int)(result)));  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);  return TCL_OK;fail:  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);  return TCL_ERROR;}SWIGINTERN int_wrap_can_read(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {  int arg1 ;  char *result = 0 ;  int val1 ;  int ecode1 = 0 ;    if (SWIG_GetArgs(interp, objc, objv,"o:can_read fd ",(void *)0) == TCL_ERROR) SWIG_fail;  ecode1 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[1], &val1);  if (!SWIG_IsOK(ecode1)) {    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "can_read" "', argument " "1"" of type '" "int""'");  }   arg1 = (int)(val1);  result = (char *)can_read(arg1);  Tcl_SetObjResult(interp,SWIG_FromCharPtr(result));  return TCL_OK;fail:  return TCL_ERROR;}SWIGINTERN int_wrap_can_read1(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {  int arg1 ;  int arg2 = (int) 5000000 ;  char *result = 0 ;  int val1 ;  int ecode1 = 0 ;  int val2 ;  int ecode2 = 0 ;    if (SWIG_GetArgs(interp, objc, objv,"o|o:can_read1 fd ?timeout? ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;  ecode1 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[1], &val1);  if (!SWIG_IsOK(ecode1)) {    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "can_read1" "', argument " "1"" of type '" "int""'");  }   arg1 = (int)(val1);  if (objc > 2) {    ecode2 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);    if (!SWIG_IsOK(ecode2)) {      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "can_read1" "', argument " "2"" of type '" "int""'");    }     arg2 = (int)(val2);  }  result = (char *)can_read1(arg1,arg2);  Tcl_SetObjResult(interp,SWIG_FromCharPtr(result));  return TCL_OK;fail:  return TCL_ERROR;}SWIGINTERN int_wrap_can_read2(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {  int arg1 ;  int arg2 = (int) 5000000 ;  char *result = 0 ;  int val1 ;  int ecode1 = 0 ;  int val2 ;  int ecode2 = 0 ;    if (SWIG_GetArgs(interp, objc, objv,"o|o:can_read2 fd ?timeout? ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;  ecode1 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[1], &val1);  if (!SWIG_IsOK(ecode1)) {    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "can_read2" "', argument " "1"" of type '" "int""'");  }   arg1 = (int)(val1);  if (objc > 2) {    ecode2 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[2], &val2);    if (!SWIG_IsOK(ecode2)) {      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "can_read2" "', argument " "2"" of type '" "int""'");    }     arg2 = (int)(val2);  }  result = (char *)can_read2(arg1,arg2);  Tcl_SetObjResult(interp,SWIG_FromCharPtr(result));  return TCL_OK;fail:  return TCL_ERROR;}static swig_command_info swig_commands[] = {    { SWIG_prefix "can_open", (swig_wrapper_func) _wrap_can_open, NULL},    { SWIG_prefix "can_close", (swig_wrapper_func) _wrap_can_close, NULL},    { SWIG_prefix "can_send", (swig_wrapper_func) _wrap_can_send, NULL},    { SWIG_prefix "can_read", (swig_wrapper_func) _wrap_can_read, NULL},    { SWIG_prefix "can_read1", (swig_wrapper_func) _wrap_can_read1, NULL},    { SWIG_prefix "can_read2", (swig_wrapper_func) _wrap_can_read2, NULL},    {0, 0, 0}};static swig_var_info swig_variables[] = {    {0,0,0,0}};static swig_const_info swig_constants[] = {    {0,0,0,0,0,0}};/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};static swig_type_info *swig_type_initial[] = {  &_swigt__p_char,};static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};static swig_cast_info *swig_cast_initial[] = {  _swigc__p_char,};/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */#ifdef __cplusplus}#endif/* ----------------------------------------------------------------------------- * Type initialization: * This problem is tough by the requirement that no dynamic  * memory is used. Also, since swig_type_info structures store pointers to  * swig_cast_info structures and swig_cast_info structures store pointers back * to swig_type_info structures, we need some lookup code at initialization.  * The idea is that swig generates all the structures that are needed.  * The runtime then collects these partially filled structures.  * The SWIG_InitializeModule function takes these initial arrays out of  * swig_module, and does all the lookup, filling in the swig_module.types * array with the correct data and linking the correct swig_cast_info * structures together. * * The generated swig_type_info structures are assigned staticly to an initial  * array. We just loop though that array, and handle each type individually. * First we lookup if this type has been already loaded, and if so, use the * loaded structure instead of the generated one. Then we have to fill in the * cast linked list. The cast data is initially stored in something like a * two-dimensional array. Each row corresponds to a type (there are the same * number of rows as there are in the swig_type_initial array). Each entry in * a column is one of the swig_cast_info structures for that type. * The cast_initial array is actually an array of arrays, because each row has * a variable number of columns. So to actually build the cast linked list, * we find the array of casts associated with the type, and loop through it  * adding the casts to the list. The one last trick we need to do is making * sure the type pointer in the swig_cast_info struct is correct. * * First off, we lookup the cast->type name to see if it is already loaded.  * There are three cases to handle: *  1) If the cast->type has already been loaded AND the type we are adding *     casting info to has not been loaded (it is in this module), THEN we *     replace the cast->type pointer with the type pointer that has already *     been loaded. *  2) If BOTH types (the one we are adding casting info to, and the  *     cast->type) are loaded, THEN the cast info has already been loaded by *     the previous module so we just ignore it. *  3) Finally, if cast->type has not already been loaded, then we add that *     swig_cast_info to the linked list (because the cast->type) pointer will *     be correct. * ----------------------------------------------------------------------------- */#ifdef __cplusplusextern "C" {#if 0} /* c-mode */#endif#endif#if 0#define SWIGRUNTIME_DEBUG#endifSWIGRUNTIME voidSWIG_InitializeModule(void *clientdata) {  size_t i;  swig_module_info *module_head;  static int init_run = 0;    clientdata = clientdata;    if (init_run) return;  init_run = 1;    /* Initialize the swig_module */  swig_module.type_initial = swig_type_initial;  swig_module.cast_initial = swig_cast_initial;    /* Try and load any already created modules */  module_head = SWIG_GetModule(clientdata);  if (module_head) {    swig_module.next = module_head->next;    module_head->next = &swig_module;  } else {    /* This is the first module loaded */    swig_module.next = &swig_module;    SWIG_SetModule(clientdata, &swig_module);  }    /* Now work on filling in swig_module.types */#ifdef SWIGRUNTIME_DEBUG  printf("SWIG_InitializeModule: size %d\n", swig_module.size);#endif  for (i = 0; i < swig_module.size; ++i) {    swig_type_info *type = 0;    swig_type_info *ret;    swig_cast_info *cast;    #ifdef SWIGRUNTIME_DEBUG    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);#endif        /* if there is another module already loaded */    if (swig_module.next != &swig_module) {      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);    }    if (type) {      /* Overwrite clientdata field */#ifdef SWIGRUNTIME_DEBUG      printf("SWIG_InitializeModule: found type %s\n", type->name);#endif      if (swig_module.type_initial[i]->clientdata) {        type->clientdata = swig_module.type_initial[i]->clientdata;#ifdef SWIGRUNTIME_DEBUG        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);#endif      }    } else {      type = swig_module.type_initial[i];    }        /* Insert casting types */    cast = swig_module.cast_initial[i];    while (cast->type) {      /* Don't need to add information already in the list */      ret = 0;#ifdef SWIGRUNTIME_DEBUG      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);#endif      if (swig_module.next != &swig_module) {        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);#ifdef SWIGRUNTIME_DEBUG        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);#endif      }      if (ret) {        if (type == swig_module.type_initial[i]) {#ifdef SWIGRUNTIME_DEBUG          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);#endif          cast->type = ret;          ret = 0;        } else {          /* Check for casting already in the list */          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);#ifdef SWIGRUNTIME_DEBUG          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);#endif          if (!ocast) ret = 0;        }      }            if (!ret) {#ifdef SWIGRUNTIME_DEBUG        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);#endif        if (type->cast) {          type->cast->prev = cast;          cast->next = type->cast;        }        type->cast = cast;      }      cast++;    }    /* Set entry in modules->types array equal to the type */    swig_module.types[i] = type;  }  swig_module.types[i] = 0;  #ifdef SWIGRUNTIME_DEBUG  printf("**** SWIG_InitializeModule: Cast List ******\n");  for (i = 0; i < swig_module.size; ++i) {    int j = 0;    swig_cast_info *cast = swig_module.cast_initial[i];    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);    while (cast->type) {      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);      cast++;      ++j;    }    printf("---- Total casts: %d\n",j);  }  printf("**** SWIG_InitializeModule: Cast List ******\n");#endif}/* This function will propagate the clientdata field of type to* any new swig_type_info structures that have been added into the list* of equivalent types.  It is like calling* SWIG_TypeClientData(type, clientdata) a second time.*/SWIGRUNTIME voidSWIG_PropagateClientData(void) {  size_t i;  swig_cast_info *equiv;  static int init_run = 0;    if (init_run) return;  init_run = 1;    for (i = 0; i < swig_module.size; i++) {    if (swig_module.types[i]->clientdata) {      equiv = swig_module.types[i]->cast;      while (equiv) {        if (!equiv->converter) {          if (equiv->type && !equiv->type->clientdata)          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);        }        equiv = equiv->next;      }    }  }}#ifdef __cplusplus#if 0{  /* c-mode */#endif}#endif#ifdef __cplusplusextern "C" {#endif    /* -----------------------------------------------------------------------------   * constants/methods manipulation   * ----------------------------------------------------------------------------- */    /* Install Constants */    SWIGINTERN void  SWIG_Tcl_InstallConstants(Tcl_Interp *interp, swig_const_info constants[]) {    int i;    Tcl_Obj *obj;        if (!swigconstTableinit) {      Tcl_InitHashTable(&swigconstTable, TCL_STRING_KEYS);      swigconstTableinit = 1;    }    for (i = 0; constants[i].type; i++) {      switch(constants[i].type) {      case SWIG_TCL_POINTER:        obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);        break;      case SWIG_TCL_BINARY:        obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));        break;      default:        obj = 0;        break;      }      if (obj) {        SWIG_Tcl_SetConstantObj(interp, constants[i].name, obj);      }    }  }  #ifdef __cplusplus}#endif/* -----------------------------------------------------------------------------* *  Partial Init method * -----------------------------------------------------------------------------*/SWIGEXPORT int SWIG_init(Tcl_Interp *interp) {  int i;  if (interp == 0) return TCL_ERROR;#ifdef USE_TCL_STUBS  if (Tcl_InitStubs(interp, (char*)"8.1", 0) == NULL) {    return TCL_ERROR;  }#endif    Tcl_PkgProvide(interp, (char*)SWIG_name, (char*)SWIG_version);  #ifdef SWIG_namespace  Tcl_Eval(interp, "namespace eval " SWIG_namespace " { }");#endif    SWIG_InitializeModule((void *) interp);  SWIG_PropagateClientData();    for (i = 0;

⌨️ 快捷键说明

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