Changeset 81761
- Timestamp:
- 08/04/11 11:08:54 (4 years ago)
- Location:
- branches/gsoc11-rev-upgrade/base/src/machista1.0
- Files:
-
- 2 edited
-
machista.i (modified) (2 diffs)
-
machista_wrap.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/gsoc11-rev-upgrade/base/src/machista1.0/machista.i
r81757 r81761 141 141 142 142 /** 143 * map macho_get_arch_name() 144 * The memory for the returned char * comes from NXGetArchInfoFromCpuType(), 145 * which is documentet in arch(3), without ever mentioning any memory issues. I 146 * assume it's static memory, that should not be free()'d. 147 */ 148 %rename(get_arch_name) macho_get_arch_name; 149 const char *macho_get_arch_name(cpu_type_t); 150 151 /** 143 152 * map macho_format_dylib_version() 144 153 * Since this function internally allocates the result and returns an allocated … … 152 161 char *macho_format_dylib_version(uint32_t); 153 162 154 /**155 * map macho_get_arch_name()156 * The memory for the returned char * comes from NXGetArchInfoFromCpuType(),157 * which is documentet in arch(3), without ever mentioning any memory issues. I158 * assume it's static memory, that should not be free()'d.159 */160 %rename(get_arch_name) macho_get_arch_name;161 const char *macho_get_arch_name(cpu_type_t);162 -
branches/gsoc11-rev-upgrade/base/src/machista1.0/machista_wrap.c
r81757 r81761 2270 2270 2271 2271 SWIGINTERN int 2272 _wrap_get_arch_name(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 2273 cpu_type_t arg1 ; 2274 int val1 ; 2275 int ecode1 = 0 ; 2276 char *result = 0 ; 2277 2278 if (SWIG_GetArgs(interp, objc, objv,"o:machista::get_arch_name cpu_type_t ",(void *)0) == TCL_ERROR) SWIG_fail; 2279 ecode1 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[1], &val1); 2280 if (!SWIG_IsOK(ecode1)) { 2281 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_arch_name" "', argument " "1"" of type '" "cpu_type_t""'"); 2282 } 2283 arg1 = (cpu_type_t)(val1); 2284 result = (char *)macho_get_arch_name(arg1); 2285 Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)result)); 2286 return TCL_OK; 2287 fail: 2288 return TCL_ERROR; 2289 } 2290 2291 2292 SWIGINTERN int 2272 2293 _wrap_format_dylib_version(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { 2273 2294 uint32_t arg1 ; … … 2283 2304 arg1 = (uint32_t)(val1); 2284 2305 result = (char *)macho_format_dylib_version(arg1); 2285 Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)result));2286 {2287 free(result);2288 }2289 return TCL_OK;2290 fail:2291 return TCL_ERROR;2292 }2293 2294 2295 SWIGINTERN int2296 _wrap_get_arch_name(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {2297 cpu_type_t arg1 ;2298 int val1 ;2299 int ecode1 = 0 ;2300 char *result = 0 ;2301 2302 if (SWIG_GetArgs(interp, objc, objv,"o:machista::get_arch_name cpu_type_t ",(void *)0) == TCL_ERROR) SWIG_fail;2303 ecode1 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[1], &val1);2304 if (!SWIG_IsOK(ecode1)) {2305 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_arch_name" "', argument " "1"" of type '" "cpu_type_t""'");2306 }2307 arg1 = (cpu_type_t)(val1);2308 result = (char *)macho_get_arch_name(arg1);2309 2306 Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)result)); 2310 2307 { … … 2340 2337 { SWIG_prefix "parse_file", (swig_wrapper_func) _wrap_parse_file, NULL}, 2341 2338 { SWIG_prefix "strerror", (swig_wrapper_func) _wrap_strerror, NULL}, 2339 { SWIG_prefix "get_arch_name", (swig_wrapper_func) _wrap_get_arch_name, NULL}, 2342 2340 { SWIG_prefix "format_dylib_version", (swig_wrapper_func) _wrap_format_dylib_version, NULL}, 2343 { SWIG_prefix "get_arch_name", (swig_wrapper_func) _wrap_get_arch_name, NULL},2344 2341 {0, 0, 0} 2345 2342 };
Note: See TracChangeset
for help on using the changeset viewer.

