Changeset 428
- Timestamp:
- 11/02/08 18:59:46 (2 months ago)
- Location:
- interpreter/trunk
- Files:
-
- 4 added
- 10 modified
-
ChangeLog (modified) (1 diff)
-
modules/Makefile.am (modified) (2 diffs)
-
modules/System/directory.c (added)
-
modules/System/exceptions.kt (modified) (1 diff)
-
modules/System/file.c (modified) (2 diffs)
-
modules/__internal/_cinvoke_function.c (modified) (1 diff)
-
modules/__internal/_cinvoke_library.c (modified) (1 diff)
-
modules/__internal/_exception.c (modified) (2 diffs)
-
modules/all_modules.kt (modified) (1 diff)
-
modules/interface/language/c.kt (modified) (1 diff)
-
tests/Makefile.am (modified) (1 diff)
-
tests/objs/dir (added)
-
tests/objs/dir/tmp_dir.kt (added)
-
tests/objs/dir/tmp_dir.kt.out (added)
Legend:
- Unmodified
- Added
- Removed
-
interpreter/trunk/ChangeLog
r426 r428 1 11/2/2008: 2 * System.directory module added (ticket #63) 3 * Added support for using libc functions in interface.language.c. 4 * Added tell() function to System.file. 5 * Added System.exceptions.SystemCallFailure exception, which pulls 6 perror() to pull exception string. 7 1 8 10/26/2008: 2 9 * Performance improvements. -
interpreter/trunk/modules/Makefile.am
r423 r428 8 8 System/vm/compiler.c System/vm/loader.c System/vm.c \ 9 9 System/math/range.c System/vm/thread.c System/network/socket.c \ 10 __internal.c __internal/_regex.c \10 System/directory.c __internal.c __internal/_regex.c \ 11 11 __internal/_regex_match.c __internal/_exception.c \ 12 12 __internal/_cinvoke_context.c __internal/_cinvoke_library.c \ … … 14 14 __internal/_cinvoke_callback.c 15 15 16 nobase_dist_pkglib_SCRIPTS = System.kt System/network/wrapper.kt System/collections.kt \ 17 System/doc.kt System/doc/outputters.kt System/regex.kt System/vm/debugger.kt \ 18 System/exceptions.kt System/network.kt interface.kt interface/http.kt interface/http/cgi.kt \ 19 interface/language.kt interface/language/c.kt interface/text.kt interface/text/readline.kt \ 20 interface/text/base64.kt interface/text/binary.kt all_modules.kt 16 nobase_dist_pkglib_SCRIPTS = System.kt System/network/wrapper.kt \ 17 System/collections.kt System/doc.kt System/doc/outputters.kt System/regex.kt \ 18 System/vm/debugger.kt System/exceptions.kt System/network.kt interface.kt \ 19 interface/http.kt interface/http/cgi.kt interface/language.kt interface/language/c.kt \ 20 interface/text.kt interface/text/readline.kt interface/text/base64.kt \ 21 interface/text/binary.kt all_modules.kt 21 22 22 23 AM_CFLAGS = -I../objs -fPIC -W -Wall -DCINVOKE_BUILD -
interpreter/trunk/modules/System/exceptions.kt
r382 r428 233 233 ]; 234 234 235 class SystemCallFailure 236 /[Failure while calling system call.]/ 237 [ 238 construct() 239 /[Class constructor.]/ 240 [ 241 base|__construct__(this|get_perror()); 242 ] 243 ]; -
interpreter/trunk/modules/System/file.c
r417 r428 133 133 fclose(this->builtin_data.filevalue); 134 134 this->builtin_data.filevalue = NULL; 135 } 136 137 /***************************************************************************** 138 * Emit current position in file. 139 ****************************************************************************/ 140 KITE_CLASS_METHOD(File_tell) { 141 KITE_NO_ARGS; 142 143 CHECK_FILE_OPEN; 144 kite_vm_return(thd, kite_new_integer(thd, ftell(this->builtin_data.filevalue))); 135 145 } 136 146 … … 196 206 "Move current position in file.", 1, 197 207 "pos", "Position in file to move to.")); 208 kite_add_method(thread, newclass, "tell", 209 kite_new_method_with_docs(thread, FUNC_COMPILED, File_tell, 210 "Return current position in file.", 0)); 198 211 kite_add_method(thread, newclass, "close", 199 212 kite_new_method_with_docs(thread, FUNC_COMPILED, File_close, -
interpreter/trunk/modules/__internal/_cinvoke_function.c
r403 r428 54 54 ret = KITE_GET_STRING_VALUE(retString); 55 55 params = KITE_GET_STRING_VALUE(paramString); 56 56 57 57 func = cinv_function_create(ctx, CINV_CC_CDECL, ret, params); 58 58 typeList = kite_new_list(thd); -
interpreter/trunk/modules/__internal/_cinvoke_library.c
r402 r428 51 51 52 52 ctx = (CInvContext*)ctxObj->builtin_data.filevalue; 53 lib = KITE_GET_STRING_VALUE(libString); 53 if (libString->type == OBJ_NULL) 54 lib = NULL; 55 else lib = KITE_GET_STRING_VALUE(libString); 54 56 55 57 this->builtin_data.listvalue.car = -
interpreter/trunk/modules/__internal/_exception.c
r378 r428 44 44 KITE_NO_ARGS; 45 45 kite_vm_return(thd, kite_object_name(thd, this)); 46 } 47 /***************************************************************************** 48 * Perror of errno 49 ****************************************************************************/ 50 KITE_CLASS_METHOD(Exception_perror) { 51 KITE_NO_ARGS; 52 53 char str[256]; 54 perror(str); 55 56 kite_vm_return(thd, kite_new_string(thd, str)); 46 57 } 47 58 … … 103 114 kite_new_method_with_docs(thread, FUNC_COMPILED, Exception_str, 104 115 "Returns string representation of exception.", 0)); 116 kite_add_method(thread, newclass, "get_perror", 117 kite_new_method_with_docs(thread, FUNC_COMPILED, Exception_perror, 118 "Internal use only.", 0)); 105 119 kite_add_method(thread, newclass, "throw", 106 120 kite_new_method_with_docs(thread, FUNC_COMPILED, Exception_throw, -
interpreter/trunk/modules/all_modules.kt
r423 r428 31 31 import "System.collections"; 32 32 import "System.date"; 33 import "System.directory"; 33 34 import "System.doc"; 34 35 import "System.exceptions"; -
interpreter/trunk/modules/interface/language/c.kt
r389 r428 384 384 property fx; 385 385 property i; 386 386 387 387 fx = make interface.language.c.function_prototype(); 388 388 fx.ret_type = interface.language.c.param_types.type_characters[ret_type]; -
interpreter/trunk/tests/Makefile.am
r422 r428 246 246 ./objs/binary/binary_test.kt \ 247 247 ./objs/binary/binary_test.kt.out \ 248 ./objs/dir/tmp_dir.kt \ 249 ./objs/dir/tmp_dir.kt.out \ 248 250 ./exception/exception_backtrace.kt.out \ 249 251 ./exception/nested_exceptions.kt \
