new scheme for buffers, centralized in auxlib.

This commit is contained in:
Roberto Ierusalimschy 1997-12-17 18:48:58 -02:00
parent 82d09fbf0d
commit 502343b402
15 changed files with 181 additions and 172 deletions

View File

@ -1,5 +1,5 @@
/*
** $Id: lauxlib.c,v 1.4 1997/11/21 19:00:46 roberto Exp roberto $
** $Id: lauxlib.c,v 1.5 1997/12/09 13:35:19 roberto Exp roberto $
** Auxiliar functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@ -10,6 +10,8 @@
#include <string.h>
#include "lauxlib.h"
#include "lmem.h"
#include "lstate.h"
#include "lua.h"
#include "luadebug.h"
@ -99,3 +101,70 @@ void luaL_verror (char *fmt, ...)
}
/*-------------------------------------------------------
** Auxiliar buffer
-------------------------------------------------------*/
#define BUFF_STEP 32
#define openspace(size) if (L->Mbuffnext+(size) > L->Mbuffsize) Openspace(size)
static void Openspace (int size)
{
LState *l = L; /* to optimize */
int base = l->Mbuffbase-l->Mbuffer;
l->Mbuffsize *= 2;
if (l->Mbuffnext+size > l->Mbuffsize) /* still not big enough? */
l->Mbuffsize = l->Mbuffnext+size;
l->Mbuffer = luaM_realloc(l->Mbuffer, l->Mbuffsize);
l->Mbuffbase = l->Mbuffer+base;
}
char *luaL_openspace (int size)
{
openspace(size);
return L->Mbuffer+L->Mbuffnext;
}
void luaL_addchar (int c)
{
openspace(BUFF_STEP);
L->Mbuffer[L->Mbuffnext++] = c;
}
void luaL_resetbuffer (void)
{
L->Mbuffnext = L->Mbuffbase-L->Mbuffer;
}
void luaL_addsize (int n)
{
L->Mbuffnext += n;
}
int luaL_newbuffer (int size)
{
int old = L->Mbuffbase-L->Mbuffer;
openspace(size);
L->Mbuffbase = L->Mbuffer+L->Mbuffnext;
return old;
}
void luaL_oldbuffer (int old)
{
L->Mbuffnext = L->Mbuffbase-L->Mbuffer;
L->Mbuffbase = L->Mbuffer+old;
}
char *luaL_buffer (void)
{
return L->Mbuffbase;
}

View File

@ -1,5 +1,5 @@
/*
** $Id: lauxlib.h,v 1.3 1997/11/21 19:00:46 roberto Exp roberto $
** $Id: lauxlib.h,v 1.4 1997/12/09 13:35:19 roberto Exp roberto $
** Auxiliar functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@ -27,6 +27,13 @@ lua_Object luaL_functionarg (int arg);
lua_Object luaL_tablearg (int arg);
lua_Object luaL_nonnullarg (int numArg);
void luaL_verror (char *fmt, ...);
char *luaL_openspace (int size);
void luaL_resetbuffer (void);
void luaL_addchar (int c);
void luaL_addsize (int n);
int luaL_newbuffer (int size);
void luaL_oldbuffer (int old);
char *luaL_buffer (void);
#endif

View File

@ -1,5 +1,5 @@
/*
** $Id: lbuiltin.c,v 1.16 1997/12/11 17:21:11 roberto Exp roberto $
** $Id: lbuiltin.c,v 1.17 1997/12/15 16:17:20 roberto Exp roberto $
** Built-in functions
** See Copyright Notice in lua.h
*/
@ -131,7 +131,7 @@ static void internaldofile (void)
static char *to_string (lua_Object obj)
{
char *buff = luaM_buffer(30);
char *buff = luaL_openspace(30);
TObject *o = luaA_Address(obj);
switch (ttype(o)) {
case LUA_T_NUMBER: case LUA_T_STRING:

3
lgc.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lgc.c,v 1.12 1997/12/11 14:48:46 roberto Exp roberto $
** $Id: lgc.c,v 1.13 1997/12/15 16:17:20 roberto Exp roberto $
** Garbage Collector
** See Copyright Notice in lua.h
*/
@ -272,7 +272,6 @@ long lua_collectgarbage (long limit)
luaS_free(freestr);
luaF_freeproto(freefunc);
luaF_freeclosure(freeclos);
luaM_clearbuffer();
recovered = recovered-L->nblocks;
L->GCthreshold = (limit == 0) ? 2*L->nblocks : L->nblocks+limit;
return recovered;

View File

@ -1,5 +1,5 @@
/*
** $Id: liolib.c,v 1.8 1997/11/28 12:40:37 roberto Exp roberto $
** $Id: liolib.c,v 1.9 1997/12/09 13:50:08 roberto Exp roberto $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@ -190,7 +190,7 @@ static void io_read (void)
char *p = luaL_opt_string(arg, "[^\n]*{\n}");
int inskip = 0; /* to control {skips} */
int c = NEED_OTHER;
luaI_emptybuff();
luaL_resetbuffer();
while (*p) {
if (*p == '{') {
inskip++;
@ -208,7 +208,7 @@ static void io_read (void)
if (c == NEED_OTHER) c = getc(f);
m = luaI_singlematch((c == EOF) ? 0 : (char)c, p, &ep);
if (m) {
if (inskip == 0) luaI_addchar(c);
if (inskip == 0) luaL_addchar(c);
c = NEED_OTHER;
}
switch (*ep) {
@ -227,7 +227,8 @@ static void io_read (void)
} break_while:
if (c >= 0) /* not EOF nor NEED_OTHER? */
ungetc(c, f);
buff = luaI_addchar(0);
luaL_addchar(0);
buff = luaL_buffer();
if (*buff != 0 || *p == 0) /* read something or did not fail? */
lua_pushstring(buff);
}

64
llex.c
View File

@ -1,5 +1,5 @@
/*
** $Id: llex.c,v 1.9 1997/12/02 12:43:54 roberto Exp roberto $
** $Id: llex.c,v 1.10 1997/12/09 13:35:19 roberto Exp roberto $
** Lexical Analizer
** See Copyright Notice in lua.h
*/
@ -8,6 +8,7 @@
#include <ctype.h>
#include <string.h>
#include "lauxlib.h"
#include "llex.h"
#include "lmem.h"
#include "lobject.h"
@ -66,8 +67,7 @@ void luaX_setinput (ZIO *z)
LS->ifstate[0].elsepart = 1; /* to avoid a free $else */
LS->lex_z = z;
firstline(LS);
LS->textbuff.buffsize = 20;
LS->textbuff.text = luaM_buffer(LS->textbuff.buffsize);
luaL_resetbuffer();
}
@ -201,31 +201,24 @@ static void inclinenumber (LexState *LS)
static void save (LexState *LS, int c)
{
if (LS->textbuff.tokensize >= LS->textbuff.buffsize)
LS->textbuff.text = luaM_buffer(LS->textbuff.buffsize *= 2);
LS->textbuff.text[LS->textbuff.tokensize++] = c;
}
#define save(c) luaL_addchar(c)
#define save_and_next(LS) (save(LS->current), next(LS))
char *luaX_lasttoken (void)
{
save(L->lexstate, 0);
return L->lexstate->textbuff.text;
save(0);
return luaL_buffer();
}
#define save_and_next(LS) (save(LS, LS->current), next(LS))
static int read_long_string (LexState *LS, YYSTYPE *l)
{
int cont = 0;
while (1) {
switch (LS->current) {
case EOZ:
save(LS, 0);
save(0);
return WRONGTOKEN;
case '[':
save_and_next(LS);
@ -243,7 +236,7 @@ static int read_long_string (LexState *LS, YYSTYPE *l)
}
continue;
case '\n':
save(LS, '\n');
save('\n');
inclinenumber(LS);
continue;
default:
@ -251,9 +244,9 @@ static int read_long_string (LexState *LS, YYSTYPE *l)
}
} endloop:
save_and_next(LS); /* pass the second ']' */
LS->textbuff.text[LS->textbuff.tokensize-2] = 0; /* erases ']]' */
l->pTStr = luaS_new(LS->textbuff.text+2);
LS->textbuff.text[LS->textbuff.tokensize-2] = ']'; /* restores ']]' */
L->Mbuffer[L->Mbuffnext-2] = 0; /* erases ']]' */
l->pTStr = luaS_new(L->Mbuffbase+2);
L->Mbuffer[L->Mbuffnext-2] = ']'; /* restores ']]' */
return STRING;
}
@ -267,7 +260,7 @@ int luaY_lex (YYSTYPE *l)
{
LexState *LS = L->lexstate;
double a;
LS->textbuff.tokensize = 0;
luaL_resetbuffer();
if (lua_debug)
luaY_codedebugline(LS->linelasttoken);
LS->linelasttoken = LS->linenumber;
@ -286,7 +279,7 @@ int luaY_lex (YYSTYPE *l)
save_and_next(LS);
if (LS->current != '-') return '-';
do { next(LS); } while (LS->current != '\n' && LS->current != EOZ);
LS->textbuff.tokensize = 0;
luaL_resetbuffer();
continue;
case '[':
@ -325,15 +318,15 @@ int luaY_lex (YYSTYPE *l)
switch (LS->current) {
case EOZ:
case '\n':
save(LS, 0);
save(0);
return WRONGTOKEN;
case '\\':
next(LS); /* do not save the '\' */
switch (LS->current) {
case 'n': save(LS, '\n'); next(LS); break;
case 't': save(LS, '\t'); next(LS); break;
case 'r': save(LS, '\r'); next(LS); break;
case '\n': save(LS, '\n'); inclinenumber(LS); break;
case 'n': save('\n'); next(LS); break;
case 't': save('\t'); next(LS); break;
case 'r': save('\r'); next(LS); break;
case '\n': save('\n'); inclinenumber(LS); break;
default : save_and_next(LS); break;
}
break;
@ -342,9 +335,9 @@ int luaY_lex (YYSTYPE *l)
}
}
next(LS); /* skip delimiter */
save(LS, 0);
l->pTStr = luaS_new(LS->textbuff.text+1);
LS->textbuff.text[LS->textbuff.tokensize-1] = del; /* restore delimiter */
save(0);
l->pTStr = luaS_new(L->Mbuffbase+1);
L->Mbuffer[L->Mbuffnext-1] = del; /* restore delimiter */
return STRING;
}
@ -375,7 +368,7 @@ int luaY_lex (YYSTYPE *l)
if (LS->current == '.') {
save_and_next(LS);
if (LS->current == '.') {
save(LS, 0);
save(0);
luaY_error(
"ambiguous syntax (decimal point x string concatenation)");
}
@ -396,7 +389,7 @@ int luaY_lex (YYSTYPE *l)
neg=(LS->current=='-');
if (LS->current == '+' || LS->current == '-') save_and_next(LS);
if (!isdigit(LS->current)) {
save(LS, 0); return WRONGTOKEN; }
save(0); return WRONGTOKEN; }
do {
e=10.0*e+(LS->current-'0');
save_and_next(LS);
@ -412,23 +405,24 @@ int luaY_lex (YYSTYPE *l)
}
case EOZ:
save(LS, 0);
save(0);
if (LS->iflevel > 0)
luaY_syntaxerror("input ends inside a $if", "");
return 0;
default:
if (LS->current != '_' && !isalpha(LS->current)) {
int c = LS->current;
save_and_next(LS);
return LS->textbuff.text[0];
return c;
}
else { /* identifier or reserved word */
TaggedString *ts;
do {
save_and_next(LS);
} while (isalnum(LS->current) || LS->current == '_');
save(LS, 0);
ts = luaS_new(LS->textbuff.text);
save(0);
ts = luaS_new(L->Mbuffbase);
if (ts->head.marked > 255)
return ts->head.marked; /* reserved word */
l->pTStr = ts;

9
llex.h
View File

@ -1,5 +1,5 @@
/*
** $Id: llex.h,v 1.4 1997/11/26 18:53:45 roberto Exp roberto $
** $Id: llex.h,v 1.5 1997/12/02 12:43:44 roberto Exp roberto $
** Lexical Analizer
** See Copyright Notice in lua.h
*/
@ -21,18 +21,11 @@ struct ifState {
int skip; /* true if part must be skiped */
};
struct textBuff {
char *text; /* always points to luaM_buffer */
int tokensize;
int buffsize;
};
typedef struct LexState {
int current; /* look ahead character */
struct zio *lex_z; /* input stream */
int linenumber; /* input line counter */
struct textBuff textbuff; /* buffer for tokens */
int linelasttoken; /* line where last token was read */
int lastline; /* last line wherein a SETLINE was generated */
struct ifState ifstate[MAX_IFS];

19
lmem.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lmem.c,v 1.2 1997/11/19 17:29:23 roberto Exp roberto $
** $Id: lmem.c,v 1.3 1997/12/01 20:30:44 roberto Exp roberto $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
@ -27,23 +27,6 @@ int luaM_growaux (void **block, unsigned long nelems, int size,
void *luaM_buffer (unsigned long size)
{
if (size > L->Mbuffsize) {
L->Mbuffsize = size;
L->Mbuffer = luaM_realloc(L->Mbuffer, L->Mbuffsize);
}
return L->Mbuffer;
}
void luaM_clearbuffer (void)
{
L->Mbuffsize /= 2;
L->Mbuffer = luaM_realloc(L->Mbuffer, L->Mbuffsize);
}
#ifndef DEBUG
/*

4
lmem.h
View File

@ -1,5 +1,5 @@
/*
** $Id: lmem.h,v 1.3 1997/11/26 20:44:52 roberto Exp roberto $
** $Id: lmem.h,v 1.4 1997/12/01 20:30:44 roberto Exp roberto $
** Interface to Memory Manager
** See Copyright Notice in lua.h
*/
@ -20,8 +20,6 @@
#define tableEM "table overflow"
#define memEM "not enough memory"
void *luaM_buffer (unsigned long size);
void luaM_clearbuffer (void);
void *luaM_realloc (void *oldblock, unsigned long size);
int luaM_growaux (void **block, unsigned long nelems, int size,
char *errormsg, unsigned long limit);

View File

@ -1,5 +1,5 @@
/*
** $Id: lstate.c,v 1.3 1997/12/01 20:31:25 roberto Exp roberto $
** $Id: lstate.c,v 1.4 1997/12/11 14:48:46 roberto Exp roberto $
** Global State
** See Copyright Notice in lua.h
*/
@ -40,6 +40,8 @@ void lua_open (void)
L->refArray = NULL;
L->refSize = 0;
L->Mbuffsize = 0;
L->Mbuffnext = 0;
L->Mbuffbase = NULL;
L->Mbuffer = NULL;
L->GCthreshold = GARBAGE_BLOCK;
L->nblocks = 0;

View File

@ -1,5 +1,5 @@
/*
** $Id: lstate.h,v 1.4 1997/11/27 15:59:25 roberto Exp roberto $
** $Id: lstate.h,v 1.5 1997/11/28 16:56:05 roberto Exp roberto $
** Global State
** See Copyright Notice in lua.h
*/
@ -65,8 +65,10 @@ typedef struct LState {
int refSize; /* size of refArray */
unsigned long GCthreshold;
unsigned long nblocks; /* number of 'blocks' currently allocated */
char *Mbuffer; /* global buffer, used by luaM_buffer */
unsigned long Mbuffsize; /* size of Mbuffer */
char *Mbuffer; /* global buffer */
char *Mbuffbase; /* current first position of Mbuffer */
int Mbuffsize; /* size of Mbuffer */
int Mbuffnext; /* next position to fill in Mbuffer */
} LState;

125
lstrlib.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lstrlib.c,v 1.3 1997/12/09 13:35:19 roberto Exp roberto $
** $Id: lstrlib.c,v 1.4 1997/12/15 17:58:49 roberto Exp roberto $
** Standard library for strings and pattern-matching
** See Copyright Notice in lua.h
*/
@ -15,56 +15,12 @@
#include "lualib.h"
struct lbuff {
char *b;
size_t max;
size_t size;
};
static struct lbuff lbuffer = {NULL, 0, 0};
static char *strbuffer (unsigned long size)
{
if (size > lbuffer.max) {
/* ANSI "realloc" doesn't need this test, but some machines (Sun!)
don't follow ANSI */
lbuffer.b = (lbuffer.b) ? realloc(lbuffer.b, lbuffer.max=size) :
malloc(lbuffer.max=size);
if (lbuffer.b == NULL)
lua_error("memory overflow");
}
return lbuffer.b;
}
static char *openspace (unsigned long size)
{
char *buff = strbuffer(lbuffer.size+size);
return buff+lbuffer.size;
}
char *luaI_addchar (int c)
{
if (lbuffer.size >= lbuffer.max)
strbuffer(lbuffer.max == 0 ? 100 : lbuffer.max*2);
lbuffer.b[lbuffer.size++] = c;
return lbuffer.b;
}
void luaI_emptybuff (void)
{
lbuffer.size = 0; /* prepare for next string */
}
static void addnchar (char *s, int n)
{
char *b = openspace(n);
char *b = luaL_openspace(n);
strncpy(b, s, n);
lbuffer.size += n;
luaL_addsize(n);
}
@ -80,6 +36,13 @@ static void str_len (void)
}
static void closeandpush (void)
{
luaL_addchar(0);
lua_pushstring(luaL_buffer());
}
static void str_sub (void)
{
char *s = luaL_check_string(1);
@ -89,9 +52,9 @@ static void str_sub (void)
if (start < 0) start = l+start+1;
if (end < 0) end = l+end+1;
if (1 <= start && start <= end && end <= l) {
luaI_emptybuff();
luaL_resetbuffer();
addnchar(s+start-1, end-start+1);
lua_pushstring(luaI_addchar(0));
closeandpush();
}
else lua_pushstring("");
}
@ -100,30 +63,30 @@ static void str_sub (void)
static void str_lower (void)
{
char *s;
luaI_emptybuff();
luaL_resetbuffer();
for (s = luaL_check_string(1); *s; s++)
luaI_addchar(tolower((unsigned char)*s));
lua_pushstring(luaI_addchar(0));
luaL_addchar(tolower((unsigned char)*s));
closeandpush();
}
static void str_upper (void)
{
char *s;
luaI_emptybuff();
luaL_resetbuffer();
for (s = luaL_check_string(1); *s; s++)
luaI_addchar(toupper((unsigned char)*s));
lua_pushstring(luaI_addchar(0));
luaL_addchar(toupper((unsigned char)*s));
closeandpush();
}
static void str_rep (void)
{
char *s = luaL_check_string(1);
int n = (int)luaL_check_number(2);
luaI_emptybuff();
luaL_resetbuffer();
while (n-- > 0)
addstr(s);
lua_pushstring(luaI_addchar(0));
closeandpush();
}
@ -163,7 +126,7 @@ static void push_captures (struct Capture *cap)
int i;
for (i=0; i<cap->level; i++) {
int l = cap->capture[i].len;
char *buff = openspace(l+1);
char *buff = luaL_openspace(l+1);
if (l == -1) lua_error("unfinished capture");
strncpy(buff, cap->capture[i].init, l);
buff[l] = 0;
@ -395,7 +358,7 @@ static void add_s (lua_Object newp, struct Capture *cap)
char *news = lua_getstring(newp);
while (*news) {
if (*news != ESC || !isdigit((unsigned char)*++news))
luaI_addchar(*news++);
luaL_addchar(*news++);
else {
int l = check_cap(*news++, cap);
addnchar(cap->capture[l].init, cap->capture[l].len);
@ -404,24 +367,24 @@ static void add_s (lua_Object newp, struct Capture *cap)
}
else if (lua_isfunction(newp)) {
lua_Object res;
struct lbuff oldbuff;
int status;
int oldbuff;
lua_beginblock();
push_captures(cap);
/* function may use lbuffer, so save it and create a luaM_new one */
oldbuff = lbuffer;
lbuffer.b = NULL; lbuffer.max = lbuffer.size = 0;
/* function may use buffer, so save it and create a new one */
oldbuff = luaL_newbuffer(0);
status = lua_callfunction(newp);
/* restore old buffer */
free(lbuffer.b);
lbuffer = oldbuff;
if (status != 0)
luaL_oldbuffer(oldbuff);
if (status != 0) {
lua_endblock();
lua_error(NULL);
}
res = lua_getresult(1);
addstr(lua_isstring(res) ? lua_getstring(res) : "");
lua_endblock();
}
else luaL_arg_check(0, 3, NULL);
else luaL_arg_check(0, 3, "string or function expected");
}
@ -433,7 +396,7 @@ static void str_gsub (void)
int max_s = (int)luaL_opt_number(4, strlen(src)+1);
int anchor = (*p == '^') ? (p++, 1) : 0;
int n = 0;
luaI_emptybuff();
luaL_resetbuffer();
while (n < max_s) {
struct Capture cap;
char *e;
@ -446,25 +409,25 @@ static void str_gsub (void)
if (e && e>src) /* non empty match? */
src = e; /* skip it */
else if (*src)
luaI_addchar(*src++);
luaL_addchar(*src++);
else break;
if (anchor) break;
}
addstr(src);
lua_pushstring(luaI_addchar(0));
closeandpush();
lua_pushnumber(n); /* number of substitutions */
}
static void luaI_addquoted (char *s)
{
luaI_addchar('"');
luaL_addchar('"');
for (; *s; s++) {
if (strchr("\"\\\n", *s))
luaI_addchar('\\');
luaI_addchar(*s);
luaL_addchar('\\');
luaL_addchar(*s);
}
luaI_addchar('"');
luaL_addchar('"');
}
#define MAX_FORMAT 200
@ -473,12 +436,12 @@ static void str_format (void)
{
int arg = 1;
char *strfrmt = luaL_check_string(arg);
luaI_emptybuff(); /* initialize */
luaL_resetbuffer();
while (*strfrmt) {
if (*strfrmt != '%')
luaI_addchar(*strfrmt++);
luaL_addchar(*strfrmt++);
else if (*++strfrmt == '%')
luaI_addchar(*strfrmt++); /* %% */
luaL_addchar(*strfrmt++); /* %% */
else { /* format item */
char form[MAX_FORMAT]; /* store the format ('%...') */
struct Capture cap;
@ -496,14 +459,14 @@ static void str_format (void)
arg++;
strncpy(form+1, initf, strfrmt-initf+1); /* +1 to include convertion */
form[strfrmt-initf+2] = 0;
buff = openspace(1000); /* to store the formatted value */
buff = luaL_openspace(1000); /* to store the formatted value */
switch (*strfrmt++) {
case 'q':
luaI_addquoted(luaL_check_string(arg));
continue;
case 's': {
char *s = luaL_check_string(arg);
buff = openspace(strlen(s));
buff = luaL_openspace(strlen(s));
sprintf(buff, form, s);
break;
}
@ -517,10 +480,10 @@ static void str_format (void)
default: /* also treat cases 'pnLlh' */
lua_error("invalid option in `format'");
}
lbuffer.size += strlen(buff);
luaL_addsize(strlen(buff));
}
}
lua_pushstring(luaI_addchar(0)); /* push the result */
closeandpush(); /* push the result */
}

View File

@ -1,5 +1,5 @@
/*
** $Id: lualib.h,v 1.1 1997/09/16 19:25:59 roberto Exp roberto $
** $Id: lualib.h,v 1.2 1997/11/26 18:53:45 roberto Exp roberto $
** Lua standard libraries
** See Copyright Notice in lua.h
*/
@ -28,9 +28,6 @@ void lua_mathlibopen (void);
/* auxiliar functions (private) */
char *luaI_addchar (int c);
void luaI_emptybuff (void);
int luaI_singlematch (int c, char *p, char **ep);
#endif

6
lvm.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lvm.c,v 1.16 1997/12/09 13:35:19 roberto Exp roberto $
** $Id: lvm.c,v 1.17 1997/12/15 16:17:20 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@ -27,7 +27,7 @@
#define next_word(pc) (pc+=2, get_word(pc-2))
/* Extra stack to run a function: LUA_T_LINE(1), TM calls(2), ... */
/* Extra stack size to run a function: LUA_T_LINE(1), TM calls(2), ... */
#define EXTRA_STACK 5
@ -35,7 +35,7 @@
static TaggedString *strconc (char *l, char *r)
{
size_t nl = strlen(l);
char *buffer = luaM_buffer(nl+strlen(r)+1);
char *buffer = luaL_openspace(nl+strlen(r)+1);
strcpy(buffer, l);
strcpy(buffer+nl, r);
return luaS_new(buffer);

View File

@ -1,5 +1,5 @@
#
## $Id: makefile,v 1.5 1997/11/07 15:09:49 roberto Exp roberto $
## $Id: makefile,v 1.6 1997/11/19 17:29:23 roberto Exp roberto $
## Makefile
## See Copyright Notice in lua.h
#
@ -94,7 +94,8 @@ clear :
lapi.o: lapi.c lapi.h lua.h lobject.h lauxlib.h ldo.h lstate.h lfunc.h \
lgc.h lmem.h lstring.h ltable.h ltm.h luadebug.h lvm.h
lauxlib.o: lauxlib.c lauxlib.h lua.h luadebug.h
lauxlib.o: lauxlib.c lauxlib.h lua.h lmem.h lstate.h lobject.h \
luadebug.h
lbuiltin.o: lbuiltin.c lapi.h lua.h lobject.h lauxlib.h lbuiltin.h \
ldo.h lstate.h lfunc.h lmem.h lstring.h ltable.h ltm.h
ldo.o: ldo.c ldo.h lobject.h lua.h lstate.h lfunc.h lgc.h lmem.h \
@ -103,13 +104,13 @@ lfunc.o: lfunc.c lfunc.h lobject.h lua.h lmem.h lstate.h
lgc.o: lgc.c ldo.h lobject.h lua.h lstate.h lfunc.h lgc.h lmem.h \
lstring.h ltable.h ltm.h
liolib.o: liolib.c lauxlib.h lua.h luadebug.h lualib.h
llex.o: llex.c llex.h lobject.h lua.h lzio.h lmem.h lparser.h lstate.h \
lstring.h lstx.h luadebug.h
llex.o: llex.c lauxlib.h lua.h llex.h lobject.h lzio.h lmem.h \
lparser.h lstate.h lstring.h lstx.h luadebug.h
lmathlib.o: lmathlib.c lauxlib.h lua.h lualib.h
lmem.o: lmem.c lmem.h lstate.h lobject.h lua.h
lobject.o: lobject.c lobject.h lua.h
lstate.o: lstate.c lbuiltin.h ldo.h lobject.h lua.h lstate.h llex.h \
lzio.h lmem.h lstring.h ltable.h ltm.h
lstate.o: lstate.c lbuiltin.h ldo.h lobject.h lua.h lstate.h lfunc.h \
lgc.h llex.h lzio.h lmem.h lstring.h ltable.h ltm.h
lstring.o: lstring.c lmem.h lobject.h lua.h lstate.h lstring.h
lstrlib.o: lstrlib.c lauxlib.h lua.h lualib.h
lstx.o: lstx.c lauxlib.h lua.h ldo.h lobject.h lstate.h lfunc.h llex.h \