📄 cmdline.c
字号:
char *buf1 = 0 ; int alloc1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; int res4 ; char *buf4 = 0 ; int alloc4 = 0 ; int argvi = 0; dXSARGS; if ((items < 4) || (items > 4)) { SWIG_croak("Usage: new_dumpspec_t(host,disk,datestamp,level);"); } res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_dumpspec_t" "', argument " "1"" of type '" "char *""'"); } arg1 = (char *)(buf1); res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_dumpspec_t" "', argument " "2"" of type '" "char *""'"); } arg2 = (char *)(buf2); res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_dumpspec_t" "', argument " "3"" of type '" "char *""'"); } arg3 = (char *)(buf3); res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_dumpspec_t" "', argument " "4"" of type '" "char *""'"); } arg4 = (char *)(buf4); result = (dumpspec_t *)new_dumpspec_t(arg1,arg2,arg3,arg4); ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpspec_t, SWIG_OWNER | SWIG_SHADOW); argvi++ ; if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); XSRETURN(argvi); fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); SWIG_croak_null(); }}XS(_wrap_delete_dumpspec_t) { { dumpspec_t *arg1 = (dumpspec_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; if ((items < 1) || (items > 1)) { SWIG_croak("Usage: delete_dumpspec_t(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpspec_t, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_dumpspec_t" "', argument " "1"" of type '" "dumpspec_t *""'"); } arg1 = (dumpspec_t *)(argp1); delete_dumpspec_t(arg1); XSRETURN(argvi); fail: SWIG_croak_null(); }}XS(_wrap_dumpspec_t_format) { { dumpspec_t *arg1 = (dumpspec_t *) 0 ; char *result = 0 ; void *argp1 = 0 ; int res1 = 0 ; int argvi = 0; dXSARGS; if ((items < 1) || (items > 1)) { SWIG_croak("Usage: dumpspec_t_format(self);"); } res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dumpspec_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dumpspec_t_format" "', argument " "1"" of type '" "dumpspec_t *""'"); } arg1 = (dumpspec_t *)(argp1); result = (char *)dumpspec_t_format(arg1); ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; free((char*)result); XSRETURN(argvi); fail: SWIG_croak_null(); }}XS(_wrap_format_dumpspec_components) { { char *arg1 = (char *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; char *arg4 = (char *) 0 ; char *result = 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; int res4 ; char *buf4 = 0 ; int alloc4 = 0 ; int argvi = 0; dXSARGS; if ((items < 4) || (items > 4)) { SWIG_croak("Usage: format_dumpspec_components(host,disk,datestamp,level);"); } res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "format_dumpspec_components" "', argument " "1"" of type '" "char *""'"); } arg1 = (char *)(buf1); res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "format_dumpspec_components" "', argument " "2"" of type '" "char *""'"); } arg2 = (char *)(buf2); res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "format_dumpspec_components" "', argument " "3"" of type '" "char *""'"); } arg3 = (char *)(buf3); res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "format_dumpspec_components" "', argument " "4"" of type '" "char *""'"); } arg4 = (char *)(buf4); result = (char *)cmdline_format_dumpspec_components(arg1,arg2,arg3,arg4); ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); XSRETURN(argvi); fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); SWIG_croak_null(); }}XS(_wrap_parse_dumpspecs) { { int arg1 ; char **arg2 = (char **) 0 ; int arg3 ; amglue_dumpspec_list *result = 0 ; int argvi = 0; dXSARGS; if ((items < 2) || (items > 2)) { SWIG_croak("Usage: parse_dumpspecs(argc,argv,flags);"); } { AV *av; int i; if (!SvROK(ST(0)) || SvTYPE(SvRV(ST(0))) != SVt_PVAV) { SWIG_exception(SWIG_TypeError, "Expected an arrayref"); } av = (AV *)SvRV(ST(0)); arg1 = av_len(av)+1; /* av_len(av) is like $#av */ arg2 = malloc(sizeof(char *) * arg1); for (i = 0; i < arg1; i++) { SV **elt = av_fetch(av, i, 0); if (!elt || !SvPOK(*elt)) { SWIG_exception(SWIG_TypeError, "Non-string in arrayref"); } arg2[i] = SvPV_nolen(*elt); /* TODO: handle unicode here */ } } { if (sizeof(signed int) == 1) { arg3 = amglue_SvI8(ST(1)); } else if (sizeof(signed int) == 2) { arg3 = amglue_SvI16(ST(1)); } else if (sizeof(signed int) == 4) { arg3 = amglue_SvI32(ST(1)); } else if (sizeof(signed int) == 8) { arg3 = amglue_SvI64(ST(1)); } else { g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ } } result = (amglue_dumpspec_list *)cmdline_parse_dumpspecs(arg1,arg2,arg3); { if (result) { GSList *iter; EXTEND(SP, g_slist_length(result)); /* make room for return values */ iter = result; while (iter) { /* Let SWIG take ownership of the object; we'll free the GSList momentarily */ ST(argvi) = SWIG_NewPointerObj(iter->data, SWIGTYPE_p_dumpspec_t, SWIG_OWNER | SWIG_SHADOW); argvi++; iter = iter->next; } /* Now free the GSList, but *not* its contents (which are now "owned" by SWIG) */ g_slist_free(result); } } { free(arg2); } XSRETURN(argvi); fail: { free(arg2); } SWIG_croak_null(); }}/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */static swig_type_info _swigt__p_GSList = {"_p_GSList", "GSList *|amglue_dumpspec_list *", 0, 0, (void*)0, 0};static swig_type_info _swigt__p_char = {"_p_char", "char *|gchar *", 0, 0, (void*)0, 0};static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};static swig_type_info _swigt__p_dumpspec_t = {"_p_dumpspec_t", "struct dumpspec_t *|dumpspec_t *", 0, 0, (void*)"Amanda::Cmdline::dumpspec_t", 0};static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};static swig_type_info _swigt__p_int = {"_p_int", "int *|cmdline_parse_dumpspecs_flags *", 0, 0, (void*)0, 0};static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|guchar *", 0, 0, (void*)0, 0};static swig_type_info *swig_type_initial[] = { &_swigt__p_GSList, &_swigt__p_char, &_swigt__p_double, &_swigt__p_dumpspec_t, &_swigt__p_float, &_swigt__p_int, &_swigt__p_p_char, &_swigt__p_unsigned_char,};static swig_cast_info _swigc__p_GSList[] = { {&_swigt__p_GSList, 0, 0, 0},{0, 0, 0, 0}};static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};static swig_cast_info _swigc__p_dumpspec_t[] = { {&_swigt__p_dumpspec_t, 0, 0, 0},{0, 0, 0, 0}};static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};static swig_cast_info *swig_cast_initial[] = { _swigc__p_GSList, _swigc__p_char, _swigc__p_double, _swigc__p_dumpspec_t, _swigc__p_float, _swigc__p_int, _swigc__p_p_char, _swigc__p_unsigned_char,};/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */static swig_constant_info swig_constants[] = {{0,0,0,0,0,0}};#ifdef __cplusplus}#endifstatic swig_variable_info swig_variables[] = {{0,0,0,0}};static swig_command_info swig_commands[] = {{"Amanda::Cmdlinec::dumpspec_t_host_get", _wrap_dumpspec_t_host_get},{"Amanda::Cmdlinec::dumpspec_t_disk_get", _wrap_dumpspec_t_disk_get},{"Amanda::Cmdlinec::dumpspec_t_datestamp_get", _wrap_dumpspec_t_datestamp_get},{"Amanda::Cmdlinec::dumpspec_t_level_get", _wrap_dumpspec_t_level_get},{"Amanda::Cmdlinec::new_dumpspec_t", _wrap_new_dumpspec_t},{"Amanda::Cmdlinec::delete_dumpspec_t", _wrap_delete_dumpspec_t},{"Amanda::Cmdlinec::dumpspec_t_format", _wrap_dumpspec_t_format},{"Amanda::Cmdlinec::format_dumpspec_components", _wrap_format_dumpspec_components},{"Amanda::Cmdlinec::parse_dumpspecs", _wrap_parse_dumpspecs},{0,0}};/* ----------------------------------------------------------------------------- * 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 through 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, *iter; int found; clientdata = clientdata; /* check to see if the circular list has been setup, if not, set it up */ if (swig_module.next==0) { /* Initialize the swig_module */ swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; swig_module.next = &swig_module; } /* Try and load any already created modules */ module_head = SWIG_GetModule(clientdata); if (!module_head) { /* This is the first module loaded for this interpreter */ /* so set the swig module into the interpreter */ SWIG_SetModule(clientdata, &swig_module); module_head = &swig_module; } else { /* the interpreter has loaded a SWIG module, but has it loaded this one? */ found=0; iter=module_head; do { if (iter==&swig_module) { found=1; break; } iter=iter->next; } while (iter!= module_head); /* if the is found in the list, then all is done and we may leave */ if (found) return; /* otherwise we must add out module into the list */ swig_module.next = module_head->next; module_head->next = &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_initi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -