Commit Graph

291 Commits

Author SHA1 Message Date
Roberto Ierusalimschy 3d838f635c Added "emergency collection" to 'io.tmpfile' and 'os.tmpname'
These operations also can give errors for lack of resources, so they
also will try "emergency collections" in case of resource errors.
Because there are now two libraries with that kind of handling,
'resourcetryagain' was moved to the auxiliary library to be shared
by the libraries.
2018-07-27 15:50:53 -03:00
Roberto Ierusalimschy e885dee5ab File operations try an "emergency collection" when failing
If a file operation fails do to lack of resources (too many open
files or not enough memory), it does a full garbage collection and
tries the operation again. Lack of resources are "too many open
files" (process wise and system wise) and "not enough memory".
The code is full of '#if's because error codes are not part
of the standard ISO C.
2018-07-25 11:44:46 -03:00
Roberto Ierusalimschy 00008b8ed0 back to one format per argument 2018-03-02 15:25:00 -03:00
Roberto Ierusalimschy c67603fafb using new 'lua_newuserdatauv' instead of 'lua_newuserdata' 2018-02-21 10:48:44 -03:00
Roberto Ierusalimschy c47111bd4e 'io.read' accepts multiple formats in a single string argument 2017-11-16 14:28:36 -02:00
Roberto Ierusalimschy e4e5aa85a2 detail ('signal' -> 'sign' in comments) 2017-11-16 11:19:06 -02:00
Roberto Ierusalimschy d266d40dea error when calling close method without arguments (e.g.,
|io.stdin.close()|)
2017-02-09 12:50:05 -02:00
Roberto Ierusalimschy 9903dd52a3 Using LUAI_UAC* types more consistently on vararg calls 2016-12-20 16:37:00 -02:00
Roberto Ierusalimschy 3b91b07fd9 detail (macro 'l_checkmode' reimplemented as function) 2016-09-01 13:14:56 -03:00
Roberto Ierusalimschy f3b52a6061 'io.read("n")' accepts both a dot and the locale point as its
radix character + 'MAXRN' -> 'L_MAXLENNUM' + small detail in
'test2'
2016-05-02 11:03:19 -03:00
Roberto Ierusalimschy 71344b5cac easy the way to accept other modifiers for 'mode' in 'io.open' 2015-11-23 09:36:11 -02:00
Roberto Ierusalimschy 050e8536bb bug: 'io.lines' does not check maximum number of options 2015-07-15 11:40:28 -03:00
Roberto Ierusalimschy 5b6ac971f9 detail (comment) 2015-07-07 14:03:34 -03:00
Roberto Ierusalimschy 43cff79bf7 detail 2015-06-21 10:50:29 -03:00
Roberto Ierusalimschy 48d0674c2e more consistent use of locale radix character across Lua 2015-04-03 15:41:57 -03:00
Roberto Ierusalimschy d7d44b038d detail (use 'lua_pushliteral' to push an empty string) 2015-03-06 16:09:08 -03:00
Roberto Ierusalimschy 234fb7f695 clearer(?) code (also avoids a warning about 'c' being used
without initialization)
2015-01-02 10:50:28 -02:00
Roberto Ierusalimschy 1735c05ac7 avoid memory errors while a file is locked (when reading a line) 2014-11-21 10:17:33 -02:00
Roberto Ierusalimschy e75c0148c3 comments (references to "ANSI C" changed to "ISO C", which is the
international name
2014-11-02 17:33:33 -02:00
Roberto Ierusalimschy 28fdbcf393 added include for 'lprefix.h', for stuff that must be added before
any other header file
2014-11-02 17:19:04 -02:00
Roberto Ierusalimschy 1a69a3ecea LUA_WIN -> LUA_USE_WINDOWS 2014-10-31 13:54:06 -02:00
Roberto Ierusalimschy bdf566a8a3 `name' in comments changed to 'name' 2014-10-25 09:50:46 -02:00
Roberto Ierusalimschy 88ff582fd8 detail (using 'sizeof' instead of 'strlen' for length of a constant
string)
2014-10-22 14:55:57 -02:00
Roberto Ierusalimschy 6b12b82532 added 'l_' prefix for names that can be redefined externally 2014-10-22 09:44:20 -02:00
Roberto Ierusalimschy 0d31efb365 'lua_stringtonum' -> 'lua_stringtonumber' 2014-10-17 16:17:55 -03:00
Roberto Ierusalimschy f97c64d7bf macros 'LUA_QL'/'LUA_QL' deprecated 2014-10-17 13:28:21 -03:00
Roberto Ierusalimschy 89602bf747 'lua_strtonum' -> 'lua_stringtonum' 2014-10-15 11:27:40 -03:00
Roberto Ierusalimschy 2f4d429071 details (comments) 2014-10-03 09:54:57 -03:00
Roberto Ierusalimschy 27f7bd2e83 detail 2014-10-01 13:05:06 -03:00
Roberto Ierusalimschy 56699cd603 small change to avoid bug in some versions of the clang compiler 2014-09-26 11:09:21 -03:00
Roberto Ierusalimschy 3ccbae84d2 added some casts between integral types (to avoid warnings) 2014-07-29 13:01:00 -03:00
Roberto Ierusalimschy b9dcf9974d detail (typos in comments) 2014-06-30 16:48:08 -03:00
Roberto Ierusalimschy e9d86eddf3 if numeral overflows the reading buffer, signal it as invalid input
(resulting in nil)
2014-06-02 00:00:51 -03:00
Roberto Ierusalimschy e966e53791 no more use of 'scanf' for reading numbers 2014-05-21 12:24:21 -03:00
Roberto Ierusalimschy 1ddb251d86 using a more conventional handling of stack space in 'io_readline' 2014-05-15 12:21:06 -03:00
Roberto Ierusalimschy 5a5a834975 new API function 'lua_rotate' 2014-05-13 16:40:28 -03:00
Roberto Ierusalimschy 626124d2d8 old POSIX systems need '<sys/types.h>' for 'off_t' 2014-05-11 11:46:19 -03:00
Roberto Ierusalimschy 2f02d264e9 initial '*' in 'io.read' formats is deprecated 2014-04-15 13:46:45 -03:00
Roberto Ierusalimschy 16f8e44924 with 64-bit integers, file offsets do not need to be floats 2014-03-19 15:57:42 -03:00
Roberto Ierusalimschy a39489194e changing prefix of configurable macros from "lua_" to "l_" 2014-03-13 17:07:18 -03:00
Roberto Ierusalimschy c5bb3643ab simpler code to read a line from a file (using 'getc' or, if present,
'getc_unlocked')
2014-03-06 14:12:02 -03:00
Roberto Ierusalimschy c6c41e85b2 more uniformity for defining system-dependent features 2014-02-26 12:27:56 -03:00
Roberto Ierusalimschy 5715de344f 'read_all' does not need to grow buffer, as 'luaL_prepbuffsize'
already does that
2014-02-21 11:39:50 -03:00
Roberto Ierusalimschy 67c5de9283 comment 2014-01-27 11:28:45 -02:00
Roberto Ierusalimschy 48adb6984c 'io.write' writes integers directly (and correctly) 2013-06-07 16:01:35 -03:00
Roberto Ierusalimschy 27f09415e3 new read format "*i" for reading integers 2013-05-14 12:57:43 -03:00
Roberto Ierusalimschy 49c1607157 _FILE_OFFSET_BITS usually also needs _LARGEFILE_SOURCE + easier to
use default definition for 'l_fseek' in ansi systems
2013-04-11 15:34:06 -03:00
Roberto Ierusalimschy c8e96d6e91 logic for checking mode for 'fopen' moved to macro 'lua_checkmode' 2013-03-21 10:57:27 -03:00
Roberto Ierusalimschy 3f6f78ea0b detail (error message) 2013-03-20 16:40:07 -03:00
Roberto Ierusalimschy 76492b4bb2 macro 'lua_checkmode' + typos in comments 2013-03-16 18:10:18 -03:00