Commit Graph

263 Commits

Author SHA1 Message Date
Roberto Ierusalimschy e39e758a73 closing a "popen" file returns the process exit status 2009-02-20 10:50:27 -03:00
Roberto Ierusalimschy f86f4116c8 micro-optimization: avoid one API call in 'read_chars' 2008-02-12 15:05:36 -02:00
Roberto Ierusalimschy 7f69f0efb0 remove of useless test in 'read_chars' (if n == 0 then the resulting
string cannot be empty).
2008-02-12 14:51:03 -02:00
Roberto Ierusalimschy dae850e0ee details 2007-12-08 09:54:32 -02:00
Roberto Ierusalimschy 79cb336d74 does not allow standard files to be closed 2007-04-19 17:22:32 -03:00
Roberto Ierusalimschy d22526ec30 'lua_strlen' is for compatibility only 2006-09-18 11:03:18 -03:00
Roberto Ierusalimschy ee41bc03ab details 2006-06-22 13:12:59 -03:00
Roberto Ierusalimschy 55e323190e files should not be operated after fclose, even when fclose fails 2006-05-08 17:14:16 -03:00
Roberto Ierusalimschy 64205e91a3 empty string may cause out-of-bound access 2006-01-28 10:59:13 -02:00
Roberto Ierusalimschy baffc37f5c detail 2006-01-18 09:49:12 -02:00
Roberto Ierusalimschy bfdcbbcd76 small optimizations (lua_newtable -> lua_createtable) 2005-12-29 14:23:32 -02:00
Roberto Ierusalimschy ed7039024d avoid some warnings 2005-10-19 11:05:11 -02:00
Roberto Ierusalimschy ebf646efb5 detail 2005-10-14 13:24:11 -03:00
Roberto Ierusalimschy 3390f9a35a detail 2005-08-26 14:36:32 -03:00
Roberto Ierusalimschy 2f2b4a42a9 luaL_checkudata raises an error if value is not correct
(like other luaL_check functions)
2005-08-17 16:05:04 -03:00
Roberto Ierusalimschy 5e8a9e324c luaL_openlib -> luaL_register, luaL_putchar -> luaL_addchar 2005-08-15 11:12:32 -03:00
Roberto Ierusalimschy 80ac5e83fd details (alphabetical order for list of functions) 2005-07-12 11:32:08 -03:00
Roberto Ierusalimschy 3ad03b331d optional size for 'setvbuf' 2005-06-06 15:42:21 -03:00
Roberto Ierusalimschy 86add535d8 'popen' is back 2005-06-06 10:30:52 -03:00
Roberto Ierusalimschy e8a7ecb982 luaL_findstring -> luaL_checkoption 2005-05-25 10:21:26 -03:00
Roberto Ierusalimschy c2bb9abcec better quotes for strings in error messages 2005-05-16 18:19:00 -03:00
Roberto Ierusalimschy 086d6b09ce avoid name colision with `close' function 2005-03-18 15:01:14 -03:00
Roberto Ierusalimschy 7d45a5f48f C functions and userdata also have environments 2005-02-18 10:40:02 -02:00
Roberto Ierusalimschy 2d8b099274 better checking for read errors (with `ferror´) 2004-08-13 16:52:13 -03:00
Roberto Ierusalimschy f87057690b `io.lines' also can give the file name in its error message 2004-08-09 11:35:59 -03:00
Roberto Ierusalimschy 76d8b8db06 `lua_pushfstring' now supports `%p' option too 2004-07-09 13:01:38 -03:00
Roberto Ierusalimschy ce455481ab separation between io lib and os lib 2004-07-09 12:47:48 -03:00
Roberto Ierusalimschy 0733c83b8c other modules may need FILEHANDLE definition 2004-05-28 15:35:05 -03:00
Roberto Ierusalimschy e9844a4f1d `popen' is not ANSI and therefore was removed from the basic library 2004-05-28 15:32:51 -03:00
Roberto Ierusalimschy 37cd986532 in `time', uses default if `isdst' is absent 2004-05-10 17:26:37 -03:00
Roberto Ierusalimschy b4cd38ba6c new scheme for configuration through `luaconf.h' 2004-04-30 17:13:38 -03:00
Roberto Ierusalimschy 10de467c79 new function `lua_createtable' 2003-10-10 10:29:28 -03:00
Roberto Ierusalimschy 533737f26e new functions `lua_getfield' and `lua_setfield' 2003-10-10 09:57:55 -03:00
Roberto Ierusalimschy f04fe526cd new functions `lua_tointeger' and lua_pushinteger' 2003-10-07 17:13:41 -03:00
Roberto Ierusalimschy 64066359dd bug: IBM AS400 (OS400) has sizeof(void *)==16, and a `%p' may generate
up to 60 characters in a `printf'. That causes a buffer overflow in
`tostring'..
2003-08-25 16:49:47 -03:00
Roberto Ierusalimschy 66ed154c89 details 2003-07-09 09:08:43 -03:00
Roberto Ierusalimschy 0ec4c473df bug: file:close cannot be called without a file. 2003-07-07 10:32:52 -03:00
Roberto Ierusalimschy f93051155c ok to use `#elif' and `#if defined()' 2003-05-14 18:01:53 -03:00
Roberto Ierusalimschy 524ae9fc3d new function `setvbuf' 2003-05-14 16:03:43 -03:00
Roberto Ierusalimschy 82dfacbcf7 detail 2003-04-30 17:24:38 -03:00
Roberto Ierusalimschy 26097b6c4b uses integers as keys to standard i/o files 2003-04-30 17:15:55 -03:00
Roberto Ierusalimschy 1a553f9199 better error messages 2003-03-19 18:16:12 -03:00
Roberto Ierusalimschy 40cfb0691e new auxiliary functions for `type' manipulation 2003-03-18 09:25:32 -03:00
Roberto Ierusalimschy 7ea180af6e detail 2003-03-14 16:08:11 -03:00
Roberto Ierusalimschy 05d567d52e `io.input'/`io.output' always return current file 2003-03-14 16:00:16 -03:00
Roberto Ierusalimschy 034de1fe73 new names for functions that open C libraries 2003-03-11 09:24:34 -03:00
Roberto Ierusalimschy 572bddc0b0 LUA_USETMPNAME -> USE_TMPNAME 2003-03-06 16:36:44 -03:00
Roberto Ierusalimschy 60d11ec316 by default, gcc does not get tmpname 2003-02-27 09:39:05 -03:00
Roberto Ierusalimschy 7285fa393b use C names for C types 2003-02-11 13:31:50 -02:00
Roberto Ierusalimschy 5085f09ce5 small optimizations 2003-02-11 13:24:52 -02:00
Roberto Ierusalimschy 9a5bab82ff use the more modern _POSIX_C_SOURCE instead of older _POSIX_SOURCE 2003-01-17 13:27:28 -02:00
Roberto Ierusalimschy 32fd039bb5 `openlib' functions return new module 2002-12-20 08:26:33 -02:00
Roberto Ierusalimschy 27c6b4d422 each .c file defines its own name 2002-12-04 15:38:31 -02:00
Roberto Ierusalimschy 90d7892007 new function `io.type' 2002-12-04 13:27:17 -02:00
Roberto Ierusalimschy 041cb96992 small bug: `write' must return three values in case of errors 2002-12-04 13:17:36 -02:00
Roberto Ierusalimschy d9340154ac `__tostring' for files + small bug (could do invalid read inside
a userdata when it was not a file)
2002-11-25 13:05:39 -02:00
Roberto Ierusalimschy 96ba5d0bc2 include file name in error messages 2002-11-18 14:53:19 -02:00
Roberto Ierusalimschy 097edd3884 better names for auxiliar functions 2002-11-14 13:41:38 -02:00
Roberto Ierusalimschy 6505503b49 do not pretend that file is closed when close fails 2002-10-21 17:41:24 -03:00
Roberto Ierusalimschy ec748fcb0a correct handling of opened files in presence of memory allocation
errors
2002-10-16 17:41:35 -03:00
Roberto Ierusalimschy 669129a6d8 io.lines() iterate over the standard input file 2002-10-11 17:40:32 -03:00
Roberto Ierusalimschy e8f35fc4ff unification of __index & __gettable (and __newindex & __settable) 2002-09-19 17:12:47 -03:00
Roberto Ierusalimschy f6bc7884be new generators for reading a file line by line 2002-09-17 17:35:54 -03:00
Roberto Ierusalimschy 81a8845e4f detail 2002-08-21 11:57:48 -03:00
Roberto Ierusalimschy 576bded513 details 2002-08-16 17:02:13 -03:00
Roberto Ierusalimschy 2e38c6ae5a `luadebug.h' content now is included in `lua.h' 2002-08-06 15:01:50 -03:00
Roberto Ierusalimschy 79c8edb6c4 new names for light userdata operations 2002-07-17 13:25:13 -03:00
Roberto Ierusalimschy ce6b930464 `isdst' should be a boolean (and not 0/1!!) 2002-07-12 15:54:53 -03:00
Roberto Ierusalimschy 88607acc2c details 2002-06-26 13:37:23 -03:00
Roberto Ierusalimschy d8678edddc luaL_verror -> luaL_error 2002-06-18 12:16:18 -03:00
Roberto Ierusalimschy 000d081fd0 warnings from other compilers 2002-06-06 15:17:33 -03:00
Roberto Ierusalimschy e3cddc950c C is not C++... 2002-06-06 09:43:08 -03:00
Roberto Ierusalimschy 5a8f383e60 io.close() closes standard output file; `close' now is method 2002-06-05 14:42:03 -03:00
Roberto Ierusalimschy 5b8ee9fa8d new names for standard libraries 2002-06-05 14:24:04 -03:00
Roberto Ierusalimschy a102221a0b better error messages 2002-06-05 13:59:37 -03:00
Roberto Ierusalimschy 71144e3ff0 errors `return' int, to avoid warnings
+ home-made `sprintf' (first version)
2002-05-06 16:05:10 -03:00
Roberto Ierusalimschy 85dcb411a8 all textual errors go through `luaL_verror' 2002-05-02 14:12:27 -03:00
Roberto Ierusalimschy 1ce6cb6032 no more option `*u' in read (too complex) 2002-04-12 16:56:25 -03:00
Roberto Ierusalimschy 237969724f support for `light' userdata + simpler support for `boxed' udata 2002-04-05 15:54:31 -03:00
Roberto Ierusalimschy c3b90061ea new design for iolib (object style) 2002-04-04 17:24:56 -03:00
Roberto Ierusalimschy d1f220217b when possible, library functions accept nil as none 2002-03-27 12:30:41 -03:00
Roberto Ierusalimschy 88c9bf99de standard libraries in packages 2002-03-20 09:54:08 -03:00
Roberto Ierusalimschy 252e01e398 `setlocale' may be used to query the current locale 2002-02-08 20:39:56 -02:00
Roberto Ierusalimschy 86a4de256e no more lua_[gs]etstr 2002-02-07 15:25:36 -02:00
Roberto Ierusalimschy d6fd33e76f `eventtable' renamed to `metatable' 2002-01-30 15:26:44 -02:00
Roberto Ierusalimschy 09e15692f3 rename of lua_isnull to lua_isnone 2001-12-20 19:27:12 -02:00
Roberto Ierusalimschy 9cd36059ad new API functions lua_getstr/lua_setstr 2001-12-10 20:09:51 -02:00
Roberto Ierusalimschy 592a309177 tag system replaced by event tables 2001-12-05 18:15:18 -02:00
Roberto Ierusalimschy 72659a0605 no more explicit support for wide-chars; too much troble... 2001-11-28 18:13:13 -02:00
Roberto Ierusalimschy 070204300c more consistent names for auxlib functions 2001-10-26 15:33:30 -02:00
Roberto Ierusalimschy b840a7518d details 2001-10-02 13:43:29 -03:00
Roberto Ierusalimschy e1d072571e better syntax for type casts 2001-08-31 16:46:07 -03:00
Roberto Ierusalimschy 45b173cbf8 warnings/details 2001-07-21 21:59:36 -03:00
Roberto Ierusalimschy 6c8e652aa6 use macros for 'getc' 2001-07-16 17:24:48 -03:00
Roberto Ierusalimschy ae1cf64348 better names for type-related functions 2001-07-12 15:11:58 -03:00
Roberto Ierusalimschy a264fd089e small bug in read_chars (fread x eof) 2001-07-12 11:59:14 -03:00
Roberto Ierusalimschy 61a036eaa5 new macro to control format for `read"*n"' 2001-06-28 11:45:44 -03:00
Roberto Ierusalimschy 9559c111a3 new `read' option `*u' (read-until) + simpler implementation for `read' 2001-06-22 10:49:42 -03:00
Roberto Ierusalimschy 4905fdd135 C++ warning 2001-06-08 13:48:32 -03:00
Roberto Ierusalimschy 65c289b046 details 2001-06-07 10:46:29 -03:00