Changeset 81757
- Timestamp:
- 08/04/11 11:00:25 (4 years ago)
- Location:
- branches/gsoc11-rev-upgrade/base/src/machista1.0
- Files:
-
- 4 edited
-
libmachista.c (modified) (1 diff)
-
libmachista.h (modified) (1 diff)
-
machista.i (modified) (1 diff)
-
machista_wrap.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/gsoc11-rev-upgrade/base/src/machista1.0/libmachista.c
r80736 r81757 84 84 } 85 85 86 const char *macho_get_arch_name (cpu_type_t cputype) { 87 const NXArchInfo *archInfo = NXGetArchInfoFromCpuType(cputype, CPU_SUBTYPE_MULTIPLE); 88 if (!archInfo) { 89 return NULL; 90 } 91 return archInfo->name; 92 } 93 86 94 /* Some byteswap wrappers */ 87 95 static uint32_t macho_swap32 (uint32_t input) { -
branches/gsoc11-rev-upgrade/base/src/machista1.0/libmachista.h
r80510 r81757 112 112 113 113 /** 114 * Returns a readable version of any cpu_type_t constant. Returns a valid pointer to the first 115 * character in a 0-terminated string or NULL on error. The pointer must not be free()'d after use. 116 */ 117 const char *macho_get_arch_name(cpu_type_t cputype); 118 119 /** 114 120 * Parses the Mach-O file indicated by filepath and writes a pointer to a macho_t describing the 115 121 * Mach-O file into the location idicated by res. Returns MACHO_SUCCESS on success or any of the -
branches/gsoc11-rev-upgrade/base/src/machista1.0/machista.i
r80760 r81757 152 152 char *macho_format_dylib_version(uint32_t); 153 153 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. I 158 * 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
r81254 r81757 2293 2293 2294 2294 2295 SWIGINTERN int 2296 _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 Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)result)); 2310 { 2311 free(result); 2312 } 2313 return TCL_OK; 2314 fail: 2315 return TCL_ERROR; 2316 } 2317 2318 2295 2319 2296 2320 static swig_command_info swig_commands[] = { … … 2317 2341 { SWIG_prefix "strerror", (swig_wrapper_func) _wrap_strerror, NULL}, 2318 2342 { 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}, 2319 2344 {0, 0, 0} 2320 2345 };
Note: See TracChangeset
for help on using the changeset viewer.

