From tmueller at neoscientists.org Tue May 1 15:11:59 2007 From: tmueller at neoscientists.org (Timm S. =?ISO-8859-15?Q?M=FCller?=) Date: Tue, 1 May 2007 15:11:59 +0200 Subject: [teklib-general] New repository, version control system and website Message-ID: <20070501151159.0f6a312d.tmueller@neoscientists.org> Hey list, TEKlib is undergoing some structural changes, and we (Franciska and I) plan on integrating it in the business model of our own, small development firm, which is currently somewhere between its design and inception. Our firm will be mainly concerned with project work in the embedded systems sector with an emphasis on open source development tools and libraries - TEKlib is not central to our venture, but it fits nicely, and we intend to loosely connect ourselves to this project and reference it from our website. See the refurbished TEKlib website here: http://www.teklib.org/ . I will post a link to our company website soon. The current major release of TEKlib remains as it is and stays in its current CVS repository. As of now, it is called 'TEKlib 1'. A new development branch, 'TEKlib 3', is now available in a Mercurial-based code repository, which is currently under construction and only sparsely populated. See the website for details. In principle, the focus of the TEKlib project remains the same, but I'd like to prune parts that are no longer actively maintained. My personal focus is architecture and interoperability between Unix, Windows and embedded systems. I can't afford to maintain an Amiga port any longer. As usual, your suggestions are welcome, and you are invited to further improve on this project. I will soon come up with more details about the new development model in the 'TEKlib 3' repository - for instance, commit messages are likely going to be posted on a mailing list. Oh, and btw., Mercurial is a real joy, I can heartily suggest to give it a try if you plan on setting up a development project. ;-) - Timm From cisc at broadpark.no Tue May 1 18:26:35 2007 From: cisc at broadpark.no (=?ISO-8859-1?q?Sigbj=F8rn_Skj=E6ret?=) Date: Tue, 01 May 2007 17:26:35 +0100 Subject: [teklib-general] New repository, version control system and website In-Reply-To: <20070501151159.0f6a312d.tmueller@neoscientists.org> Message-ID: <0JHD00M66C8H6FN1@osl1sminn1.broadpark.no> > The current major release of TEKlib remains as it is and stays in its > current CVS repository. As of now, it is called 'TEKlib 1'. A new > development branch, 'TEKlib 3', is now available in a Mercurial-based > code repository, which is currently under construction and only > sparsely populated. See the website for details. Nice, I was beginning to think it was left for dead. :P > In principle, the focus of the TEKlib project remains the same, but I'd > like to prune parts that are no longer actively maintained. My personal > focus is architecture and interoperability between Unix, Windows and > embedded systems. I can't afford to maintain an Amiga port any longer. I suppose that means the MorphOS port has been pruned as well (although it's still listed on the front page) .. as much as I'd like for TEKlib still being able to run on MorphOS I fear I won't have much time to work on it this year (we'll see after the summer). :( > Oh, and btw., Mercurial is a real joy, I can heartily suggest to > give it a try if you plan on setting up a development project. ;-) Sigh, yet another "CVS killer" to relate to... ;) - CISC From tmueller at neoscientists.org Tue May 1 23:42:46 2007 From: tmueller at neoscientists.org (Timm S. =?ISO-8859-15?Q?M=FCller?=) Date: Tue, 1 May 2007 23:42:46 +0200 Subject: [teklib-general] New repository, version control system and website In-Reply-To: <0JHD00M66C8H6FN1@osl1sminn1.broadpark.no> References: <20070501151159.0f6a312d.tmueller@neoscientists.org> <0JHD00M66C8H6FN1@osl1sminn1.broadpark.no> Message-ID: <20070501234246.864432f4.tmueller@neoscientists.org> On Tue, 01 May 2007 17:26:35 +0100 Sigbj?rn Skj?ret wrote: > > The current major release of TEKlib remains as it is and stays in its > > current CVS repository. As of now, it is called 'TEKlib 1'. A new > > development branch, 'TEKlib 3', is now available in a Mercurial-based > > code repository, which is currently under construction and only > > sparsely populated. See the website for details. > > Nice, I was beginning to think it was left for dead. :P No wonder, I have spent relatively few time in open source projects during the last year. I was experimenting on a new build system, which basically consisted of a 'make' tool and wrapper scripts (with 'ReadArgs'-style arguments) to abstract from actual build tools, but complexity and work got somewhat out of hand. (It was a glimpse of real "write once, build everywhere" make tool in its own filesystem namespace and without intermediate makefiles, but it was far from complete. This effort ended up in the 'TEKlib 2' branch, if someone's interested.) I've also spent a great deal of work in an overhaul of TEKlib's inner data structures, but during all that time a decision for a new version control system was outstanding, and thus nothing happened in the CVS. Unfortunately, TEKlib is still far from a self-sustaining project; I'm getting very few requests from people who are actually interested, and for reasons beyond me these people often don't dare to ask on a public mailing list. For example, I got some exciting code samples using TEKlib from an MorphOS/AmigaOS/AROS developer, but I was very much buried in loan work during that time, and I couldn't support it as much as I wanted. There may be still coming something out of this later, I don't know. > > In principle, the focus of the TEKlib project remains the same, but I'd > > like to prune parts that are no longer actively maintained. My personal > > focus is architecture and interoperability between Unix, Windows and > > embedded systems. I can't afford to maintain an Amiga port any longer. > > I suppose that means the MorphOS port has been pruned as well (although it's > still listed on the front page) .. as much as I'd like for TEKlib still being > able to run on MorphOS I fear I won't have much time to work on it this year > (we'll see after the summer). :( It hasn't, I just didn't copy the sources back into the new repository, for I'm not working on the Amiga platform anymore and can't ensure that this port is fully functional. For example, in the next version we will finally need a native 64bit datatype, and I can't be arsed to emulate 64bit for a compiler as old as SAS/C anymore. MorphOS, on the other hand, seems the natural choice to preserve TEKlib's Amiga heritage and all the work that went into the Amiga backends. I've just put my Amiga aside, MorphOS is clearly one of the more vivid ports of TEKlib, and I'd appreciate your ongoing support very much. > > Oh, and btw., Mercurial is a real joy, I can heartily suggest to > > give it a try if you plan on setting up a development project. ;-) > > Sigh, yet another "CVS killer" to relate to... ;) I don't think that it lined up for killing CVS. I rather think it's a subversion killer, or let's say, another killer of star-shaped topologies in collaborative development. :-) If I remember correctly, this is one of the projects that started to flourish in the aftermath of the Bitkeeper controversy in the Linux world. - Timm From tmueller at neoscientists.org Sun May 6 17:05:26 2007 From: tmueller at neoscientists.org (Timm S. Mueller) Date: Sun, 6 May 2007 17:05:26 +0200 (CEST) Subject: [teklib-general] changeset in /hg/teklib/current: Symbols no longer collide with ... Message-ID: changeset 6781dd732438 in /hg/teklib/current details: http://teklib.org:8001/hg/teklib/current?cmd=changeset;node=6781dd732438 description: Symbols no longer collide with implementation of Lua iolib diffs (truncated from 1033 to 300 lines): diff -r 7cd5d196674d -r 6781dd732438 src/lua/lua_teklib.c --- a/src/lua/lua_teklib.c Sun May 06 14:43:20 2007 +0200 +++ b/src/lua/lua_teklib.c Sun May 06 14:56:53 2007 +0200 @@ -58,10 +58,10 @@ TAPTR TimeRequest; /*****************************************************************************/ -static const char *const fnames[] = {"input", "output"}; +static const char *const luatek_fnames[] = {"input", "output"}; static TSTRPTR -geterrs(lua_State *L, TSTRPTR buf, TINT len) +luatek_geterrs(lua_State *L, TSTRPTR buf, TINT len) { TINT errnum = TIOGetIOErr(lua_IOBase); if (errnum) @@ -73,7 +73,7 @@ geterrs(lua_State *L, TSTRPTR buf, TINT } static TINT -pushresult(lua_State *L, TBOOL res, const char *filename) +luatek_pushresult(lua_State *L, TBOOL res, const char *filename) { if (res) { @@ -83,7 +83,7 @@ pushresult(lua_State *L, TBOOL res, cons else { TCHR errbuf[80]; - geterrs(L, errbuf, sizeof(errbuf)); + luatek_geterrs(L, errbuf, sizeof(errbuf)); lua_pushnil(L); if (filename) lua_pushfstring(L, "%s: %s", filename, errbuf); @@ -95,10 +95,10 @@ pushresult(lua_State *L, TBOOL res, cons } static void -fileerror (lua_State *L, int arg, const char *filename) +luatek_fileerror (lua_State *L, int arg, const char *filename) { TCHR errbuf[80]; - geterrs(L, errbuf, sizeof(errbuf)); + luatek_geterrs(L, errbuf, sizeof(errbuf)); lua_pushfstring(L, "%s: %s", filename, errbuf); luaL_argerror(L, arg, lua_tostring(L, -1)); } @@ -106,7 +106,7 @@ fileerror (lua_State *L, int arg, const #define topobject(L, class) ((TAPTR *) luaL_checkudata(L, 1, class)) static LUACFUNC TINT -tek_type (lua_State *L) +luatek_type (lua_State *L) { void *ud; luaL_checkany(L, 1); @@ -122,7 +122,7 @@ tek_type (lua_State *L) } static TAPTR -toobject(lua_State *L, const char *class) +luatek_toobject(lua_State *L, const char *class) { TAPTR *f = topobject(L, class); if (*f == TNULL) @@ -137,7 +137,7 @@ toobject(lua_State *L, const char *class */ static TAPTR * -newobject(lua_State *L, const char *class) +luatek_newobject(lua_State *L, const char *class) { TAPTR *pf = (TAPTR *) lua_newuserdata(L, sizeof(TAPTR)); *pf = TNULL; /* handle is currently `closed' */ @@ -147,17 +147,17 @@ newobject(lua_State *L, const char *clas } static LUACFUNC TINT -tek_fclose (lua_State *L) +luatek_fclose (lua_State *L) { TAPTR *p = topobject(L, LUA_TEKFILEHANDLE); int ok = TIOCloseFile(lua_IOBase, *p); if (ok) *p = TNULL; - return pushresult(L, ok, NULL); + return luatek_pushresult(L, ok, NULL); } static TINT -aux_close (lua_State *L) +luatek_aux_close (lua_State *L) { lua_getfenv(L, 1); lua_getfield(L, -1, "__close"); @@ -165,26 +165,26 @@ aux_close (lua_State *L) } static LUACFUNC TINT -tek_close (lua_State *L) +luatek_close (lua_State *L) { if (lua_isnone(L, 1)) lua_rawgeti(L, LUA_ENVIRONINDEX, TIO_OUTPUT); - toobject(L, LUA_TEKFILEHANDLE); /* make sure argument is a file */ - return aux_close(L); -} - -static LUACFUNC TINT -tek_gc (lua_State *L) + luatek_toobject(L, LUA_TEKFILEHANDLE); /* make sure argument is a file */ + return luatek_aux_close(L); +} + +static LUACFUNC TINT +luatek_gc (lua_State *L) { TAPTR f = *topobject(L, LUA_TEKFILEHANDLE); /* ignore closed files and standard files */ if (f != TNULL && f != lua_StdIn && f != lua_StdOut && f != lua_StdErr) - aux_close(L); + luatek_aux_close(L); return 0; } static LUACFUNC TINT -tek_tostring (lua_State *L) +luatek_tostring (lua_State *L) { TAPTR f = *topobject(L, LUA_TEKFILEHANDLE); if (f == TNULL) @@ -195,11 +195,11 @@ tek_tostring (lua_State *L) } static LUACFUNC TINT -tek_open (lua_State *L) +luatek_open (lua_State *L) { const char *filename = luaL_checkstring(L, 1); const char *mode = luaL_optstring(L, 2, "r"); - TAPTR *pf = newobject(L, LUA_TEKFILEHANDLE); + TAPTR *pf = luatek_newobject(L, LUA_TEKFILEHANDLE); TBOOL append = TFALSE; TUINT tekmode; switch (*mode++) @@ -233,37 +233,37 @@ tek_open (lua_State *L) } return 1; } - return pushresult(L, 0, filename); + return luatek_pushresult(L, 0, filename); } static TAPTR -getiofile (lua_State *L, int findex) +luatek_getiofile (lua_State *L, int findex) { TAPTR f; lua_rawgeti(L, LUA_ENVIRONINDEX, findex); f = *(TAPTR *)lua_touserdata(L, -1); if (f == NULL) - luaL_error(L, "standard %s file is closed", fnames[findex - 1]); + luaL_error(L, "standard %s file is closed", luatek_fnames[findex - 1]); return f; } static TINT -g_iofile (lua_State *L, int f, TUINT mode) +luatek_g_iofile (lua_State *L, int f, TUINT mode) { if (!lua_isnoneornil(L, 1)) { const char *filename = lua_tostring(L, 1); if (filename) { - TAPTR *pf = newobject(L, LUA_TEKFILEHANDLE); + TAPTR *pf = luatek_newobject(L, LUA_TEKFILEHANDLE); *pf = TIOOpenFile(lua_IOBase, (TSTRPTR) filename, mode, TNULL); if (*pf == NULL) - fileerror(L, 1, filename); + luatek_fileerror(L, 1, filename); } else { /* check that it's a valid file handle */ - toobject(L, LUA_TEKFILEHANDLE); + luatek_toobject(L, LUA_TEKFILEHANDLE); lua_pushvalue(L, 1); } lua_rawseti(L, LUA_ENVIRONINDEX, f); @@ -274,46 +274,46 @@ g_iofile (lua_State *L, int f, TUINT mod } static LUACFUNC TINT -tek_input (lua_State *L) -{ - return g_iofile(L, TIO_INPUT, TFMODE_READONLY); -} - -static LUACFUNC TINT -tek_output (lua_State *L) -{ - return g_iofile(L, TIO_OUTPUT, TFMODE_NEWFILE); -} - -static LUACFUNC int tek_readline (lua_State *L); - -static void aux_lines (lua_State *L, int idx, int toclose) { +luatek_input (lua_State *L) +{ + return luatek_g_iofile(L, TIO_INPUT, TFMODE_READONLY); +} + +static LUACFUNC TINT +luatek_output (lua_State *L) +{ + return luatek_g_iofile(L, TIO_OUTPUT, TFMODE_NEWFILE); +} + +static LUACFUNC int luatek_readline (lua_State *L); + +static void luatek_aux_lines (lua_State *L, int idx, int toclose) { lua_pushvalue(L, idx); lua_pushboolean(L, toclose); /* close/not close file when finished */ - lua_pushcclosure(L, tek_readline, 2); -} - -static LUACFUNC TINT -f_lines (lua_State *L) { - toobject(L, LUA_TEKFILEHANDLE); /* check that it's a valid file handle */ - aux_lines(L, 1, 0); + lua_pushcclosure(L, luatek_readline, 2); +} + +static LUACFUNC TINT +luatek_f_lines (lua_State *L) { + luatek_toobject(L, LUA_TEKFILEHANDLE); /* check that it's a valid file handle */ + luatek_aux_lines(L, 1, 0); return 1; } static LUACFUNC TINT -tek_lines (lua_State *L) { +luatek_lines (lua_State *L) { if (lua_isnoneornil(L, 1)) { /* no arguments? */ /* will iterate over default input */ lua_rawgeti(L, LUA_ENVIRONINDEX, TIO_INPUT); - return f_lines(L); + return luatek_f_lines(L); } else { const char *filename = luaL_checkstring(L, 1); - TAPTR *pf = newobject(L, LUA_TEKFILEHANDLE); + TAPTR *pf = luatek_newobject(L, LUA_TEKFILEHANDLE); *pf = TIOOpenFile(lua_IOBase, (TSTRPTR) filename, TFMODE_READONLY, TNULL); if (*pf == NULL) - fileerror(L, 1, filename); - aux_lines(L, lua_gettop(L), 1); + luatek_fileerror(L, 1, filename); + luatek_aux_lines(L, lua_gettop(L), 1); return 1; } } @@ -325,7 +325,7 @@ tek_lines (lua_State *L) { */ static lua_Number -power10(TINT e) +luatek_power10(TINT e) { lua_Number res = 1; if (e > 0) @@ -342,7 +342,7 @@ power10(TINT e) } static TBOOL -scannum(lua_State *L, TAPTR file, lua_Number *d) +luatek_scannum(lua_State *L, TAPTR file, lua_Number *d) { lua_Number result = 0; TINT state = 0; @@ -465,8 +465,8 @@ scannum(lua_State *L, TAPTR file, lua_Nu } } - result = a + b / power10(nd); - result *= power10(esig * e + e2); + result = a + b / luatek_power10(nd); + result *= luatek_power10(esig * e + e2); result *= sig; *d = result; return TTRUE; @@ -476,10 +476,10 @@ scannum(lua_State *L, TAPTR file, lua_Nu } static TINT -read_number(lua_State *L, TAPTR f) +luatek_read_number(lua_State *L, TAPTR f) { lua_Number d; From tmueller at neoscientists.org Sun May 6 17:05:25 2007 From: tmueller at neoscientists.org (Timm S. Mueller) Date: Sun, 6 May 2007 17:05:25 +0200 (CEST) Subject: [teklib-general] changeset in /hg/teklib/current: Removed remnants of garbage col... Message-ID: changeset 7cd5d196674d in /hg/teklib/current details: http://teklib.org:8001/hg/teklib/current?cmd=changeset;node=7cd5d196674d description: Removed remnants of garbage collector tests diffs (42 lines): diff -r f18880ff10dd -r 7cd5d196674d tek/ui.lua --- a/tek/ui.lua Sun Apr 29 15:40:51 2007 +0200 +++ b/tek/ui.lua Sun May 06 14:43:20 2007 +0200 @@ -111,7 +111,6 @@ local _table_insert = table.insert local _table_insert = table.insert local _table_remove = table.remove local _assert = assert -local _collectgarbage = collectgarbage module "tek.ui" @@ -1153,9 +1152,6 @@ end end function app:layout() --- _collectgarbage("collect") --- local x = _collectgarbage("count") - local w, h = self:getattrs() local m1, m2 = self:getminmax() self.v:setattrs { MinWidth = m1, MinHeight = m2 } @@ -1165,8 +1161,6 @@ function app:layout() for _, r in _ipairs(self.freeregion:get()) do r.redraw = true end - --- _print(_collectgarbage("count") - x) end function app:checkxy(e, xy, method) @@ -1270,10 +1264,7 @@ function app:wait() self:open() end --- _collectgarbage("collect") --- _print(_collectgarbage("count")) - - if self.relayout == true then + if self.relayout == true then self:layout() end From tmueller at neoscientists.org Sun May 6 17:05:26 2007 From: tmueller at neoscientists.org (Timm S. Mueller) Date: Sun, 6 May 2007 17:05:26 +0200 (CEST) Subject: [teklib-general] changeset in /hg/teklib/current: Removed overly specific compile... Message-ID: changeset fb96f0401666 in /hg/teklib/current details: http://teklib.org:8001/hg/teklib/current?cmd=changeset;node=fb96f0401666 description: Removed overly specific compiler flags diffs (14 lines): diff -r 6781dd732438 -r fb96f0401666 build/config/posix_linux.tmk --- a/build/config/posix_linux.tmk Sun May 06 14:56:53 2007 +0200 +++ b/build/config/posix_linux.tmk Sun May 06 15:20:15 2007 +0200 @@ -35,8 +35,8 @@ HOST = linux PARENT = ../ - DEF = -DTEKLIB -DTSYS_POSIX -fvisibility=hidden $(EXTRADEFS) - WARN = -ansi -pedantic -Wall -Wextra -Wno-unused-parameter + DEF = -DTEKLIB -DTSYS_POSIX $(EXTRADEFS) + WARN = -ansi -pedantic -Wall -Wno-unused-parameter MKDIR = mkdir -p RM = rm From tmueller at neoscientists.org Sun May 6 17:09:04 2007 From: tmueller at neoscientists.org (Timm S. Mueller) Date: Sun, 6 May 2007 17:09:04 +0200 (CEST) Subject: [teklib-general] changeset in /hg/teklib/current: Added TMODINTERN function quali... Message-ID: changeset 435029366490 in /hg/teklib/current details: http://teklib.org:8001/hg/teklib/current?cmd=changeset;node=435029366490 description: Added TMODINTERN function qualifier diffs (281 lines): diff -r fb96f0401666 -r 435029366490 src/exec/exec_mod.h --- a/src/exec/exec_mod.h Sun May 06 15:20:15 2007 +0200 +++ b/src/exec/exec_mod.h Sun May 06 17:00:13 2007 +0200 @@ -4,7 +4,7 @@ /* ** $Id: exec_mod.h,v 1.4 2006/09/10 14:47:57 tmueller Exp $ -** teklib/mods/exec/exec_mod.h - Exec module internal definitions +** Exec module internal definitions ** ** Written by Timm S. Mueller ** See copyright notice in teklib/COPYRIGHT @@ -23,7 +23,7 @@ /*****************************************************************************/ #ifndef LOCAL -#define LOCAL +#define LOCAL TMODINTERN #endif #ifndef EXPORT diff -r fb96f0401666 -r 435029366490 src/io/io_mod.h --- a/src/io/io_mod.h Sun May 06 15:20:15 2007 +0200 +++ b/src/io/io_mod.h Sun May 06 17:00:13 2007 +0200 @@ -5,6 +5,9 @@ /* ** $Id: io_mod.h,v 1.2 2006/09/10 14:51:00 tmueller Exp $ ** IO module internal definitions +** +** Written by Timm S. Mueller +** See copyright notice in teklib/COPYRIGHT */ #include @@ -14,9 +17,21 @@ #include #include +/*****************************************************************************/ + #define IO_VERSION 0 #define IO_REVISION 3 #define IO_NUMVECTORS 50 + +/*****************************************************************************/ + +#ifndef LOCAL +#define LOCAL TMODINTERN +#endif + +#ifndef EXPORT +#define EXPORT TMODAPI +#endif /*****************************************************************************/ @@ -24,19 +39,15 @@ typedef struct { struct TModule module; /* module header */ - TAPTR modlock; /* module base lock */ - TUINT refcount; /* module reference counter */ - TAPTR mmu; /* module's memory manager */ + TAPTR modlock; /* module base lock */ + TUINT refcount; /* module reference counter */ + TAPTR mmu; /* module's memory manager */ - struct TList devicelist; /* list of handlers and assigns */ - struct TList cdlocklist; /* currentdir locks that we maintain */ + struct TList devicelist; /* list of handlers and assigns */ + struct TList cdlocklist; /* currentdir locks that we maintain */ struct TList stdfhlist; /* list of standard filehandles */ } TMOD_IO; - -/* -** iobuffer -*/ typedef struct { @@ -47,13 +58,11 @@ typedef struct } TIOBUF; -/* -** names -*/ - -#define IOHNDNAME "iohnd_" /* module name prefix */ +/* module name prefix: */ +#define IOHNDNAME "iohnd_" #define IOHNDNAME_LEN 6 -#define IOHNDNAME_DEFAULT "default" /* name of the default handler */ +/* name of the default handler: */ +#define IOHNDNAME_DEFAULT "default" #define IOHNDNAME_DEFLEN 7 /*****************************************************************************/ @@ -71,29 +80,28 @@ struct TDeviceNode struct TDeviceNode { struct TNode node; - TSTRPTR name; /* device entry name (without colon) */ - TSTRPTR altname; /* assigned path/name (with colon) */ - struct TIOPacket *lock; /* device root (handlers) or directory (assigns) */ - TAPTR device; /* link to a exec device */ - TUINT flags; /* see below */ + /* device entry name (without colon): */ + TSTRPTR name; + /* assigned path/name (with colon): */ + TSTRPTR altname; + /* device root (handlers) or directory (assigns): */ + struct TIOPacket *lock; + /* link to a exec device: */ + TAPTR device; + /* see below: */ + TUINT flags; }; #define TDEVF_MOUNT 0x0001 -#define TDEVF_ASSIGN 0x0002 /* e.g. "sys" -> altname = ":opt/tek" */ -#define TDEVF_DEFER 0x0004 /* late-binding; should work for both assigns and handlers */ +/* e.g. "sys" -> altname = ":opt/tek": */ +#define TDEVF_ASSIGN 0x0002 +/* late-binding; should work for both assigns and handlers: */ +#define TDEVF_DEFER 0x0004 /*****************************************************************************/ /* ** module API */ - -#ifndef EXPORT -#define EXPORT TMODAPI -#endif - -#ifndef LOCAL -#define LOCAL -#endif /* utils */ @@ -155,91 +163,4 @@ EXPORT TINT io_FPutS(TMOD_IO *io, struct EXPORT TINT io_FPutS(TMOD_IO *io, struct TIOPacket *iomsg, TSTRPTR s); EXPORT TSTRPTR io_FGetS(TMOD_IO *io, struct TIOPacket *iomsg, TSTRPTR buf, TINT len); -/*****************************************************************************/ -/* -** Revision History -** $Log: io_mod.h,v $ -** Revision 1.2 2006/09/10 14:51:00 tmueller -** eliminated TLIST, TNODE typedefs -** -** Revision 1.1.1.1 2006/08/20 22:15:10 tmueller -** intermediate import -** -** Revision 1.8 2006/08/19 11:05:01 tmueller -** cosmetic -** -** Revision 1.7 2006/04/21 18:43:14 tmueller -** added tags argument to SetDate() -** -** Revision 1.6 2005/11/14 21:29:30 tmueller -** internal type change -** -** Revision 1.5 2005/09/08 03:31:19 tmueller -** strchr/strrchr char argument changed to TINT -** -** Revision 1.4 2005/09/08 00:01:37 tmueller -** mod API extended; cleanup; util dependency removed -** -** Revision 1.3 2004/07/03 03:29:54 tmueller -** added io_setdate() -** -** Revision 1.2 2003/12/12 15:03:57 tmueller -** Updated minor version number -** -** Revision 1.1.1.1 2003/12/11 07:18:42 tmueller -** Krypton import -** -** Revision 1.6 2003/07/11 19:36:14 tmueller -** added io_fgets, io_fputs, io_fungetc -** -** Revision 1.5 2003/07/07 20:18:31 tmueller -** Added io_fungetc() -** -** Revision 1.4 2003/05/11 14:11:34 tmueller -** Updated I/O master and default implementations to extended definitions -** -** Revision 1.3 2003/03/22 05:22:38 tmueller -** io_seek() now handles 64bit offsets. The function prototype changed. The -** return value is now unsigned. See the documentation of io_seek() for the -** implications of the API change. TIOERR_SEEK_ERROR has been removed, -** TIOERR_OUT_OF_RANGE was added. -** -** Revision 1.2 2003/03/12 16:36:46 dtrompetter -** *** empty log message *** -** -** Revision 1.1.1.1 2003/03/08 18:28:40 tmueller -** Import to new chrooted pserver repository. -** -** Revision 1.8 2003/03/07 21:14:32 bifat -** io_makename() added for conversion from HOST to TEK naming conventions. -** Load of name handling problems have been fixed. -** -** Revision 1.7 2003/03/04 02:34:58 bifat -** The return value of io_examine() and io_exnext() changed. -** -** Revision 1.6 2003/03/03 02:22:30 bifat -** io_makedir() now returns a shared lock on the created directory -** -** Revision 1.5 2003/03/02 15:47:03 bifat -** Some packet types extended with additional tag arguments. io_addpart() API -** changed. io_lock(), io_open(), io_makedir() and io_fault() got additional -** taglist arguments. Added TIOERR_LINE_TOO_LONG error code. -** -** Revision 1.4 2003/02/09 13:53:20 tmueller -** added io_outputfh and io_errorfh, added automatic closedown of stdio -** filehandles -** -** Revision 1.3 2003/02/09 13:28:32 tmueller -** added io_outputfh(), added stdin/stdout/stderr fields to exec tasks, -** cleaned up child task inheritance of current directory, added task tags -** TTask_OutputFH etc. for passing stdio filehandles to newly created tasks. -** -** Revision 1.2 2003/01/21 22:28:02 tmueller -** added io_waitchar, io_isinteractive, more packets -** -** Revision 1.1 2003/01/20 21:29:56 tmueller -** added -** -*/ - #endif diff -r fb96f0401666 -r 435029366490 src/util/util_mod.h --- a/src/util/util_mod.h Sun May 06 15:20:15 2007 +0200 +++ b/src/util/util_mod.h Sun May 06 17:00:13 2007 +0200 @@ -20,17 +20,21 @@ /*****************************************************************************/ +#define UTIL_VERSION 6 +#define UTIL_REVISION 0 +#define UTIL_NUMVECTORS 45 + +/*****************************************************************************/ + +#ifndef LOCAL +#define LOCAL TMODINTERN +#endif + #ifndef EXPORT #define EXPORT TMODAPI #endif -#ifndef LOCAL -#define LOCAL -#endif - -#define UTIL_VERSION 6 -#define UTIL_REVISION 0 -#define UTIL_NUMVECTORS 45 +/*****************************************************************************/ typedef struct { diff -r fb96f0401666 -r 435029366490 tek/config.h --- a/tek/config.h Sun May 06 15:20:15 2007 +0200 +++ b/tek/config.h Sun May 06 17:00:13 2007 +0200 @@ -54,6 +54,10 @@ #define TMODENTRY #endif +#ifndef TMODINTERN +#define TMODINTERN +#endif + /*****************************************************************************/ /* ** Callback, hook and task entries From tmueller at neoscientists.org Sun May 6 17:09:05 2007 From: tmueller at neoscientists.org (Timm S. Mueller) Date: Sun, 6 May 2007 17:09:05 +0200 (CEST) Subject: [teklib-general] changeset in /hg/teklib/current: Builds from single source in po... Message-ID: changeset e60698766f31 in /hg/teklib/current details: http://teklib.org:8001/hg/teklib/current?cmd=changeset;node=e60698766f31 description: Builds from single source in posix_linux_gcc_release diffs (255 lines): diff -r 435029366490 -r e60698766f31 src/exec/build/tmkmakefile --- a/src/exec/build/tmkmakefile Sun May 06 17:00:13 2007 +0200 +++ b/src/exec/build/tmkmakefile Sun May 06 17:00:39 2007 +0200 @@ -12,13 +12,23 @@ exec [/embed] - [embed body="modlink"] - exec - $(OBJDIR)/exec_mod.mo \ - $(OBJDIR)/exec_memory.mo \ - $(OBJDIR)/exec_api.mo \ - $(OBJDIR)/exec_doexec.mo - [/embed] + [switch] + [case config="posix_linux_gcc_release"] + [embed body="modlink"] + exec + $(OBJDIR)/exec_all.mo + [/embed] + [/case] + [default] + [embed body="modlink"] + exec + $(OBJDIR)/exec_mod.mo \ + $(OBJDIR)/exec_memory.mo \ + $(OBJDIR)/exec_api.mo \ + $(OBJDIR)/exec_doexec.mo + [/embed] + [/default] + [/switch] [embed body="moddep"] $(OBJDIR)/exec_mod.mo @@ -38,6 +48,11 @@ [embed body="moddep"] $(OBJDIR)/exec_doexec.mo exec_doexec.c + exec_mod.h + [/embed] + [embed body="moddep"] + $(OBJDIR)/exec_all.mo + exec_all.c exec_mod.h [/embed] diff -r 435029366490 -r e60698766f31 src/io/build/tmkmakefile --- a/src/io/build/tmkmakefile Sun May 06 17:00:13 2007 +0200 +++ b/src/io/build/tmkmakefile Sun May 06 17:00:39 2007 +0200 @@ -14,13 +14,24 @@ iohnd_stdio [/embed] - [embed body="modlink"] - io - $(OBJDIR)/io_mod.mo \ - $(OBJDIR)/io_names.mo \ - $(OBJDIR)/io_filelock.mo \ - $(OBJDIR)/io_standard.mo - [/embed] + [switch] + [case config="posix_linux_gcc_release"] + [embed body="modlink"] + io + $(OBJDIR)/io_all.mo + [/embed] + [/case] + [default] + [embed body="modlink"] + io + $(OBJDIR)/io_mod.mo \ + $(OBJDIR)/io_names.mo \ + $(OBJDIR)/io_filelock.mo \ + $(OBJDIR)/io_standard.mo + [/embed] + [/default] + [/switch] + [embed body="modlink"] iohnd_default $(OBJDIR)/iohnd_default.mo @@ -55,6 +66,12 @@ [embed body="moddep"] $(OBJDIR)/iohnd_stdio.mo $(PLATFORM)/iohnd_stdio.c + [/embed] + + [embed body="moddep"] + $(OBJDIR)/io_all.mo + io_all.c + io_mod.h [/embed] [/body] diff -r 435029366490 -r e60698766f31 src/lua/build/tmkmakefile --- a/src/lua/build/tmkmakefile Sun May 06 17:00:13 2007 +0200 +++ b/src/lua/build/tmkmakefile Sun May 06 17:00:39 2007 +0200 @@ -29,26 +29,38 @@ LUASRCDIR = luasrc + [if config="posix_linux"] + EXTRADEFS = -DTEKLIB_LUA_STDLIBS + [/if] + [embed body="mods"] lua5 lua5_mod_tek [/embed] - MODOBJS= $(OBJDIR)/lua_mod.mo \\ - $(OBJDIR)/lapi.mo $(OBJDIR)/lcode.mo $(OBJDIR)/ldebug.mo \\ - $(OBJDIR)/ldo.mo $(OBJDIR)/ldump.mo $(OBJDIR)/lfunc.mo $(OBJDIR)/lgc.mo \\ - $(OBJDIR)/llex.mo $(OBJDIR)/lmem.mo $(OBJDIR)/lobject.mo $(OBJDIR)/lopcodes.mo \\ - $(OBJDIR)/lparser.mo $(OBJDIR)/lstate.mo $(OBJDIR)/lstring.mo $(OBJDIR)/ltable.mo \\ - $(OBJDIR)/ltm.mo $(OBJDIR)/lundump.mo $(OBJDIR)/lvm.mo $(OBJDIR)/lzio.mo \\ - $(OBJDIR)/lib_mathlib.mo $(OBJDIR)/lib_strlib.mo $(OBJDIR)/lib_baselib.mo \\ - $(OBJDIR)/lib_tablib.mo $(OBJDIR)/lib_auxlib.mo $(OBJDIR)/lib_loadlib.mo \\ - $(OBJDIR)/lib_oslib.mo $(OBJDIR)/lib_iolib.mo $(OBJDIR)/lib_dblib.mo \\ - $(OBJDIR)/lib_teklib.mo - - [embed body="modlink"] - lua5 - $(MODOBJS) - [/embed] + [switch] + [case config="posix_linux_gcc_release"] + [embed body="modlink"] + lua5 + $(OBJDIR)/lua_all.mo + [/embed] + [/case] + [default] + [embed body="modlink"] + lua5 + $(OBJDIR)/lua_mod.mo \ + $(OBJDIR)/lapi.mo $(OBJDIR)/lcode.mo $(OBJDIR)/ldebug.mo \ + $(OBJDIR)/ldo.mo $(OBJDIR)/ldump.mo $(OBJDIR)/lfunc.mo $(OBJDIR)/lgc.mo \ + $(OBJDIR)/llex.mo $(OBJDIR)/lmem.mo $(OBJDIR)/lobject.mo $(OBJDIR)/lopcodes.mo \ + $(OBJDIR)/lparser.mo $(OBJDIR)/lstate.mo $(OBJDIR)/lstring.mo $(OBJDIR)/ltable.mo \ + $(OBJDIR)/ltm.mo $(OBJDIR)/lundump.mo $(OBJDIR)/lvm.mo $(OBJDIR)/lzio.mo \ + $(OBJDIR)/lib_mathlib.mo $(OBJDIR)/lib_strlib.mo $(OBJDIR)/lib_baselib.mo \ + $(OBJDIR)/lib_tablib.mo $(OBJDIR)/lib_auxlib.mo $(OBJDIR)/lib_loadlib.mo \ + $(OBJDIR)/lib_oslib.mo $(OBJDIR)/lib_iolib.mo $(OBJDIR)/lib_dblib.mo \ + $(OBJDIR)/lib_teklib.mo + [/embed] + [/default] + [/switch] [embed body="modlink"] lua5_mod_tek diff -r 435029366490 -r e60698766f31 src/lua/lua_all.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/lua/lua_all.c Sun May 06 17:00:39 2007 +0200 @@ -0,0 +1,54 @@ + +/* +** $Id: exec_all.c,v 1.2 2006/09/10 14:39:46 tmueller Exp $ +** Stub to build module from single source +** +** Written by Timm S. Mueller +** See copyright notice in teklib/COPYRIGHT +*/ + +#ifndef EXPORT +#define EXPORT static TMODAPI +#endif + +#ifndef LOCAL +#define LOCAL static +#endif + +#define luaall_c +#define LUA_CORE + +#include "lua_mod.c" +#include "lua_teklib.c" +#include "luasrc/lapi.c" +#include "luasrc/lcode.c" +#include "luasrc/ldebug.c" +#include "luasrc/ldo.c" +#include "luasrc/ldump.c" +#include "luasrc/lfunc.c" +#include "luasrc/lgc.c" +#include "luasrc/llex.c" +#include "luasrc/lmem.c" +#include "luasrc/lobject.c" +#include "luasrc/lopcodes.c" +#include "luasrc/lparser.c" +#include "luasrc/lstate.c" +#include "luasrc/lstring.c" +#include "luasrc/ltable.c" +#include "luasrc/ltm.c" +#include "luasrc/lundump.c" +#include "luasrc/lvm.c" +#include "luasrc/lzio.c" + +#include "luasrc/lmathlib.c" +#include "luasrc/lstrlib.c" +#include "luasrc/lbaselib.c" +#include "luasrc/ltablib.c" +#include "luasrc/lauxlib.c" +#include "luasrc/loadlib.c" +#include "luasrc/ldblib.c" + +#if defined(TEKLIB_LUA_STDLIBS) && !defined(TSYS_PS2) && !defined(TSYS_AMIGA) && !defined(TSYS_MORPHOS) +#include "luasrc/loslib.c" +#include "luasrc/liolib.c" +#endif diff -r 435029366490 -r e60698766f31 src/util/build/tmkmakefile --- a/src/util/build/tmkmakefile Sun May 06 17:00:13 2007 +0200 +++ b/src/util/build/tmkmakefile Sun May 06 17:00:39 2007 +0200 @@ -12,13 +12,23 @@ util [/embed] - [embed body="modlink"] - util - $(OBJDIR)/util_mod.mo \ - $(OBJDIR)/util_args.mo \ - $(OBJDIR)/util_string.mo \ - $(OBJDIR)/util_searchsort.mo - [/embed] + [switch] + [case config="posix_linux_gcc_release"] + [embed body="modlink"] + util + $(OBJDIR)/util_all.mo + [/embed] + [/case] + [default] + [embed body="modlink"] + util + $(OBJDIR)/util_mod.mo \ + $(OBJDIR)/util_args.mo \ + $(OBJDIR)/util_string.mo \ + $(OBJDIR)/util_searchsort.mo + [/embed] + [/default] + [/switch] [embed body="moddep"] $(OBJDIR)/util_mod.mo @@ -38,6 +48,11 @@ [embed body="moddep"] $(OBJDIR)/util_searchsort.mo util_searchsort.c + util_mod.h + [/embed] + [embed body="moddep"] + $(OBJDIR)/util_all.mo + util_all.c util_mod.h [/embed] From tmueller at neoscientists.org Sun May 6 17:09:05 2007 From: tmueller at neoscientists.org (Timm S. Mueller) Date: Sun, 6 May 2007 17:09:05 +0200 (CEST) Subject: [teklib-general] changeset in /hg/teklib/current: No longer linked against -llua ... Message-ID: changeset f2e95dd7bf5a in /hg/teklib/current details: http://teklib.org:8001/hg/teklib/current?cmd=changeset;node=f2e95dd7bf5a description: No longer linked against -llua and -llualib diffs (15 lines): diff -r bd4482b8d896 -r f2e95dd7bf5a src/lua/modules/tek/Makefile --- a/src/lua/modules/tek/Makefile Sun May 06 17:01:13 2007 +0200 +++ b/src/lua/modules/tek/Makefile Sun May 06 17:01:50 2007 +0200 @@ -4,9 +4,9 @@ INCL = -I../../include/ -I ../../../../ INCL = -I../../include/ -I ../../../../ -I../../ DEF = -DTEKLUA -DTEKLIB -LIBS = -L/usr/local/lib -llua -L../../../../lib/$(PLATFORM) \ +LIBS = -L/usr/local/lib -L../../../../lib/$(PLATFORM) \ -lhal -lexec -ltime -lutil -lio -liohnd_default -lvisual \ - -lluautil -ltekc -ltekdebug -L/usr/X11R6/lib -lX11 -lXext \ + -ltekc -ltekdebug -L/usr/X11R6/lib -lX11 -lXext \ -pthread .c.o: From tmueller at neoscientists.org Sun May 6 17:09:05 2007 From: tmueller at neoscientists.org (Timm S. Mueller) Date: Sun, 6 May 2007 17:09:05 +0200 (CEST) Subject: [teklib-general] changeset in /hg/teklib/current: Added TEKLIB_LUA_STDLIBS Message-ID: changeset 001a02fecad2 in /hg/teklib/current details: http://teklib.org:8001/hg/teklib/current?cmd=changeset;node=001a02fecad2 description: Added TEKLIB_LUA_STDLIBS diffs (12 lines): diff -r f2e95dd7bf5a -r 001a02fecad2 src/lua/lua_mod.c --- a/src/lua/lua_mod.c Sun May 06 17:01:50 2007 +0200 +++ b/src/lua/lua_mod.c Sun May 06 17:02:44 2007 +0200 @@ -329,7 +329,7 @@ static const luaL_Reg lualibs[] = {"", luaopen_base}, {LUA_LOADLIBNAME, luaopen_package}, {LUA_TABLIBNAME, luaopen_table}, -#if !defined(TEKLIB_BUILDSTRAP) && !defined(TSYS_PS2) && !defined(TSYS_AMIGA) && !defined(TSYS_MORPHOS) +#if defined(TEKLIB_LUA_STDLIBS) && !defined(TSYS_PS2) && !defined(TSYS_AMIGA) && !defined(TSYS_MORPHOS) {LUA_IOLIBNAME, luaopen_io}, {LUA_OSLIBNAME, luaopen_os}, #endif From tmueller at neoscientists.org Sun May 6 17:09:05 2007 From: tmueller at neoscientists.org (Timm S. Mueller) Date: Sun, 6 May 2007 17:09:05 +0200 (CEST) Subject: [teklib-general] changeset in /hg/teklib/current: Updated to Lua 5.1.2 Message-ID: changeset 0fe6b539bcd6 in /hg/teklib/current details: http://teklib.org:8001/hg/teklib/current?cmd=changeset;node=0fe6b539bcd6 description: Updated to Lua 5.1.2 diffs (truncated from 524 to 300 lines): diff -r 001a02fecad2 -r 0fe6b539bcd6 src/lua/include/lauxlib.h --- a/src/lua/include/lauxlib.h Sun May 06 17:02:44 2007 +0200 +++ b/src/lua/include/lauxlib.h Sun May 06 17:03:02 2007 +0200 @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.h,v 1.1 2006/08/25 02:39:34 tmueller Exp $ +** $Id: lauxlib.h,v 1.88 2006/04/12 20:31:15 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ diff -r 001a02fecad2 -r 0fe6b539bcd6 src/lua/include/lua.h --- a/src/lua/include/lua.h Sun May 06 17:02:44 2007 +0200 +++ b/src/lua/include/lua.h Sun May 06 17:03:02 2007 +0200 @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.2 2006/08/30 20:25:38 tmueller Exp $ +** $Id: lua.h,v 1.218a 2006/06/02 15:34:00 roberto Exp $ ** Lua - An Extensible Extension Language ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) ** See Copyright Notice at the end of this file @@ -17,9 +17,9 @@ #define LUA_VERSION "Lua 5.1" -#define LUA_RELEASE "Lua 5.1.1" +#define LUA_RELEASE "Lua 5.1.2" #define LUA_VERSION_NUM 501 -#define LUA_COPYRIGHT "Copyright (C) 1994-2006 Lua.org, PUC-Rio" +#define LUA_COPYRIGHT "Copyright (C) 1994-2007 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" @@ -29,7 +29,6 @@ /* mark for precompiled code (`Lua') */ #define LUA_SIGNATURE "\033Lua" - /* option for multiple returns in `lua_pcall' and `lua_call' */ #define LUA_MULTRET (-1) @@ -366,7 +365,7 @@ struct lua_Debug { /****************************************************************************** -* Copyright (C) 1994-2006 Lua.org, PUC-Rio. All rights reserved. +* Copyright (C) 1994-2007 Lua.org, PUC-Rio. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the diff -r 001a02fecad2 -r 0fe6b539bcd6 src/lua/include/luaconf.h --- a/src/lua/include/luaconf.h Sun May 06 17:02:44 2007 +0200 +++ b/src/lua/include/luaconf.h Sun May 06 17:03:02 2007 +0200 @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.3 2006/09/10 14:45:20 tmueller Exp $ +** $Id: luaconf.h,v 1.82a 2006/04/10 18:27:23 roberto Exp $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -95,6 +95,7 @@ LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua" #define LUA_CPATH_DEFAULT \ ".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll" + #else #define LUA_ROOT "/usr/local/" #define LUA_LDIR LUA_ROOT "share/lua/5.1/" @@ -366,7 +367,7 @@ /* @@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib' @* behavior. -** CHANGE it to undefined as soon as you replace to 'luaL_registry' +** CHANGE it to undefined as soon as you replace to 'luaL_register' ** your uses of 'luaL_openlib' */ #define LUA_COMPAT_OPENLIB @@ -541,6 +542,7 @@ #define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) #define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */ #define lua_str2number(s,p) strtod((s), (p)) + /* @@ The luai_num* macros define the primitive operations over numbers. diff -r 001a02fecad2 -r 0fe6b539bcd6 src/lua/include/lualib.h --- a/src/lua/include/lualib.h Sun May 06 17:02:44 2007 +0200 +++ b/src/lua/include/lualib.h Sun May 06 17:03:02 2007 +0200 @@ -1,5 +1,5 @@ /* -** $Id: lualib.h,v 1.1 2006/08/25 02:39:34 tmueller Exp $ +** $Id: lualib.h,v 1.36 2005/12/27 17:12:00 roberto Exp $ ** Lua standard libraries ** See Copyright Notice in lua.h */ diff -r 001a02fecad2 -r 0fe6b539bcd6 src/lua/luasrc/lapi.c --- a/src/lua/luasrc/lapi.c Sun May 06 17:02:44 2007 +0200 +++ b/src/lua/luasrc/lapi.c Sun May 06 17:03:02 2007 +0200 @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 1.1 2006/08/25 02:39:34 tmueller Exp $ +** $Id: lapi.c,v 2.55 2006/06/07 12:37:17 roberto Exp $ ** Lua API ** See Copyright Notice in lua.h */ @@ -1077,3 +1077,4 @@ LUA_API const char *lua_setupvalue (lua_ lua_unlock(L); return name; } + diff -r 001a02fecad2 -r 0fe6b539bcd6 src/lua/luasrc/lapi.h --- a/src/lua/luasrc/lapi.h Sun May 06 17:02:44 2007 +0200 +++ b/src/lua/luasrc/lapi.h Sun May 06 17:03:02 2007 +0200 @@ -1,5 +1,5 @@ /* -** $Id: lapi.h,v 1.1 2006/08/25 02:39:34 tmueller Exp $ +** $Id: lapi.h,v 2.2 2005/04/25 19:24:10 roberto Exp $ ** Auxiliary functions from Lua API ** See Copyright Notice in lua.h */ diff -r 001a02fecad2 -r 0fe6b539bcd6 src/lua/luasrc/lauxlib.c --- a/src/lua/luasrc/lauxlib.c Sun May 06 17:02:44 2007 +0200 +++ b/src/lua/luasrc/lauxlib.c Sun May 06 17:03:02 2007 +0200 @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.2 2006/08/30 20:25:38 tmueller Exp $ +** $Id: lauxlib.c,v 1.159 2006/03/21 19:31:09 roberto Exp $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -521,7 +521,7 @@ LUALIB_API void luaL_unref (lua_State *L typedef struct LoadF { int extraline; - TAPTR f; + FILE *f; char buff[LUAL_BUFFERSIZE]; } LoadF; diff -r 001a02fecad2 -r 0fe6b539bcd6 src/lua/luasrc/lbaselib.c --- a/src/lua/luasrc/lbaselib.c Sun May 06 17:02:44 2007 +0200 +++ b/src/lua/luasrc/lbaselib.c Sun May 06 17:03:02 2007 +0200 @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.3 2006/09/10 14:44:21 tmueller Exp $ +** $Id: lbaselib.c,v 1.191a 2006/06/02 15:34:00 roberto Exp $ ** Basic library ** See Copyright Notice in lua.h */ @@ -115,11 +115,11 @@ static LUACFUNC int luaB_setmetatable (l } -static void getfunc (lua_State *L) { +static void getfunc (lua_State *L, int opt) { if (lua_isfunction(L, 1)) lua_pushvalue(L, 1); else { lua_Debug ar; - int level = luaL_optint(L, 1, 1); + int level = opt ? luaL_optint(L, 1, 1) : luaL_checkint(L, 1); luaL_argcheck(L, level >= 0, 1, "level must be non-negative"); if (lua_getstack(L, level, &ar) == 0) luaL_argerror(L, 1, "invalid level"); @@ -131,8 +131,8 @@ static void getfunc (lua_State *L) { } -static LUACFUNC int luaB_getfenv (lua_State *L) { - getfunc(L); +static int luaB_getfenv (lua_State *L) { + getfunc(L, 1); if (lua_iscfunction(L, -1)) /* is a C function? */ lua_pushvalue(L, LUA_GLOBALSINDEX); /* return the thread's global env. */ else @@ -143,7 +143,7 @@ static LUACFUNC int luaB_getfenv (lua_St static LUACFUNC int luaB_setfenv (lua_State *L) { luaL_checktype(L, 2, LUA_TTABLE); - getfunc(L); + getfunc(L, 0); lua_pushvalue(L, 2); if (lua_isnumber(L, 1) && lua_tonumber(L, 1) == 0) { /* change environment of current thread */ diff -r 001a02fecad2 -r 0fe6b539bcd6 src/lua/luasrc/lcode.c --- a/src/lua/luasrc/lcode.c Sun May 06 17:02:44 2007 +0200 +++ b/src/lua/luasrc/lcode.c Sun May 06 17:03:02 2007 +0200 @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 1.1 2006/08/25 02:39:34 tmueller Exp $ +** $Id: lcode.c,v 2.25a 2006/03/21 19:28:49 roberto Exp $ ** Code generator for Lua ** See Copyright Notice in lua.h */ @@ -35,15 +35,20 @@ void luaK_nil (FuncState *fs, int from, void luaK_nil (FuncState *fs, int from, int n) { Instruction *previous; if (fs->pc > fs->lasttarget) { /* no jumps to current position? */ - if (fs->pc == 0) /* function start? */ - return; /* positions are already clean */ - if (GET_OPCODE(*(previous = &fs->f->code[fs->pc-1])) == OP_LOADNIL) { - int pfrom = GETARG_A(*previous); - int pto = GETARG_B(*previous); - if (pfrom <= from && from <= pto+1) { /* can connect both? */ - if (from+n-1 > pto) - SETARG_B(*previous, from+n-1); - return; + if (fs->pc == 0) { /* function start? */ + if (from >= fs->nactvar) + return; /* positions are already clean */ + } + else { + previous = &fs->f->code[fs->pc-1]; + if (GET_OPCODE(*previous) == OP_LOADNIL) { + int pfrom = GETARG_A(*previous); + int pto = GETARG_B(*previous); + if (pfrom <= from && from <= pto+1) { /* can connect both? */ + if (from+n-1 > pto) + SETARG_B(*previous, from+n-1); + return; + } } } } @@ -657,10 +662,16 @@ static void codearith (FuncState *fs, Op if (constfolding(op, e1, e2)) return; else { + int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0; int o1 = luaK_exp2RK(fs, e1); - int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0; - freeexp(fs, e2); - freeexp(fs, e1); + if (o1 > o2) { + freeexp(fs, e1); + freeexp(fs, e2); + } + else { + freeexp(fs, e2); + freeexp(fs, e1); + } e1->u.s.info = luaK_codeABC(fs, op, 0, o1, o2); e1->k = VRELOCABLE; } @@ -718,8 +729,13 @@ void luaK_infix (FuncState *fs, BinOpr o luaK_exp2nextreg(fs, v); /* operand must be on the `stack' */ break; } + case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV: + case OPR_MOD: case OPR_POW: { + if (!isnumeral(v)) luaK_exp2RK(fs, v); + break; + } default: { - if (!isnumeral(v)) luaK_exp2RK(fs, v); + luaK_exp2RK(fs, v); break; } } diff -r 001a02fecad2 -r 0fe6b539bcd6 src/lua/luasrc/ldebug.c --- a/src/lua/luasrc/ldebug.c Sun May 06 17:02:44 2007 +0200 +++ b/src/lua/luasrc/ldebug.c Sun May 06 17:03:02 2007 +0200 @@ -1,5 +1,5 @@ /* -** $Id: ldebug.c,v 1.1 2006/08/25 02:39:34 tmueller Exp $ +** $Id: ldebug.c,v 2.29a 2005/12/22 16:19:56 roberto Exp $ ** Debug Interface ** See Copyright Notice in lua.h */ @@ -432,14 +432,16 @@ static Instruction symbexec (const Proto break; } case OP_CLOSURE: { - int nup; + int nup, j; check(b < pt->sizep); nup = pt->p[b]->nups; check(pc + nup < pt->sizecode); - for (; nup>0; nup--) { - OpCode op1 = GET_OPCODE(pt->code[pc+nup]); + for (j = 1; j <= nup; j++) { + OpCode op1 = GET_OPCODE(pt->code[pc + j]); check(op1 == OP_GETUPVAL || op1 == OP_MOVE); } + if (reg != NO_REG) /* tracing? */ + pc += nup; /* do not 'execute' these pseudo-instructions */ break; } case OP_VARARG: { diff -r 001a02fecad2 -r 0fe6b539bcd6 src/lua/luasrc/lfunc.c --- a/src/lua/luasrc/lfunc.c Sun May 06 17:02:44 2007 +0200 +++ b/src/lua/luasrc/lfunc.c Sun May 06 17:03:02 2007 +0200 @@ -1,5 +1,5 @@ /* -** $Id: lfunc.c,v 1.1 2006/08/25 02:39:34 tmueller Exp $ +** $Id: lfunc.c,v 2.12a 2005/12/22 16:19:56 roberto Exp $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ @@ -55,7 +55,7 @@ UpVal *luaF_findupval (lua_State *L, Stk GCObject **pp = &L->openupval; UpVal *p; From tmueller at neoscientists.org Sun May 6 17:09:05 2007 From: tmueller at neoscientists.org (Timm S. Mueller) Date: Sun, 6 May 2007 17:09:05 +0200 (CEST) Subject: [teklib-general] changeset in /hg/teklib/current: Defined TMODINTERN to be of hid... Message-ID: changeset bd4482b8d896 in /hg/teklib/current details: http://teklib.org:8001/hg/teklib/current?cmd=changeset;node=bd4482b8d896 description: Defined TMODINTERN to be of hidden visibility diffs (31 lines): diff -r e60698766f31 -r bd4482b8d896 tek/config/posix.h --- a/tek/config/posix.h Sun May 06 17:00:39 2007 +0200 +++ b/tek/config/posix.h Sun May 06 17:01:13 2007 +0200 @@ -16,6 +16,7 @@ */ #include +#include #include typedef char TCHR; @@ -69,7 +70,7 @@ typedef union { */ #define TDEBUG_PLATFORM_PUTS(s) fputs(s, stderr) -#define TDEBUG_PLATFORM_FATAL() (*(int *) 0 = 0) +#define TDEBUG_PLATFORM_FATAL() (abort(), 0) /*****************************************************************************/ /* @@ -108,6 +109,10 @@ typedef union { ** Calling conventions and visibility */ +#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ + defined(__ELF__) #define TMODENTRY __attribute__ ((visibility("default"))) +#define TMODINTERN __attribute__ ((visibility("hidden"))) +#endif #endif