lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Might I suggest some simple enhancements - 

1) a centralized .h with all string messages.

(like : "indexed expression not a table") These seem
to be hidden 'everywhere'.

and this one, which is a little more specific to my work
but might just be useful to other folks out
there doing multiplatform projects:

2) wrap your standard includes in custom .h includes:

instead of 

#include <stdlib.h>

have

#include <lua_stdlib.h>

and in lua_stdlib.h you would have the default
include #include <stdlib.h>.

With this, i have complete control over the linked 
libs in my project. 

I can then override the default stdlib.h include
and use my own custom versions of these libraries,
which are smaller, cheaper, and faster than the default.


Regards,
Jim








-----Original Message-----
From: Jim Mathies [mailto:Jim@mathies.com]
Sent: Wednesday, May 31, 2000 2:43 PM
To: Multiple recipients of list
Subject: RE: Unicode and CE? 



How can this be with system string calls like strlen and strncpy
and strcpy in the lua source?  If the strlen or stcpy are the
ascii type, this will not work on strings with null bytes.

Regards,
Jim


-----Original Message-----
From: Roberto Ierusalimschy [mailto:roberto@inf.puc-rio.br]
Sent: Wednesday, May 31, 2000 6:52 AM
To: Multiple recipients of list
Subject: Re: Unicode and CE? 


> this is assuming the lua strlib also works with binary
> strings?  can anyone confirm this?

All strings in Lua are "binary", meaning that they can be any sequence
of binary values (including zeros). The only places that do not
accept strings with embedding zeros are patterns (although the subject
string and eventual results may contain zeros; in the pattern itself you
can use a "%z" to match a zero), and the function "format".

-- Roberto