lua-users home
lua-l archive

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


This might be of interest to others -- I just did a quick inspection
of the libc requirements for 5.0 beta.  If you're planning on using
lua on something with a tiny or homemade libc, here's what you need:

liblua + lauxlib:
	setjmp, longjmp, exit, realloc, free, memcpy,
	isalnum, isdigit, isspace, isalpha, iscntrl,
	strchr, strcat, strncat, strncpy, strcoll, strcmp
	(if you don't provide lua_number2str & lua_str2number):
	sprintf, strod
	(if you don't have your own luaL_loadfile):
	stdin, errno, fopen, fclose, getc, ungetc, fread, feof, ferror
	(if you don't adjust callalert):
	stderr, fprintf

lbaselib:
	strtoul, getenv
	(if you don't replace luaB_print):
	stdout, fputc, fputs 
	(already needed for liblua):
	sprintf, strchr

lstrlib:
	tolower, toupper, islower, ispunct, isupper, isxdigit
	memchr, strpbrk
	(already needed for liblua):
	isalpha, iscntrl, isdigit, isspace, isalnum, 
	strchr, strncpy, sprintf

ltablib:
	(needs no libc support)

I don't have my notes from when I did something similar for lua 4,
but I *think* lua 5 requires even fewer libc functions to get the
base runtime up and going.  For an embedded language, not only does
it lua continue to be tiny and easy to hook up, but it requires almost
no library support to make it go.  

Brian

-- 
 Brian Swetland ..: | "This patch fixes the Problem of Evil and 
 swetland@frotz.net |  the dangling-else ambiguity." -- acb