aboutsummaryrefslogtreecommitdiff
path: root/manual.tex
diff options
context:
space:
mode:
Diffstat (limited to 'manual.tex')
-rw-r--r--manual.tex23
1 files changed, 15 insertions, 8 deletions
diff --git a/manual.tex b/manual.tex
index 6725b893..5bc36b80 100644
--- a/manual.tex
+++ b/manual.tex
@@ -1,4 +1,4 @@
1% $Id: manual.tex,v 1.12 1998/06/02 20:37:04 roberto Exp roberto $ 1% $Id: manual.tex,v 1.13 1998/06/06 21:05:52 roberto Exp roberto $
2 2
3\documentclass[11pt]{article} 3\documentclass[11pt]{article}
4\usepackage{fullpage,bnf} 4\usepackage{fullpage,bnf}
@@ -39,7 +39,7 @@ Waldemar Celes
39\tecgraf\ --- Computer Science Department --- PUC-Rio 39\tecgraf\ --- Computer Science Department --- PUC-Rio
40} 40}
41 41
42%\date{\small \verb$Date: 1998/06/02 20:37:04 $} 42%\date{\small \verb$Date: 1998/06/06 21:05:52 $}
43 43
44\maketitle 44\maketitle
45 45
@@ -1575,7 +1575,7 @@ using the following functions:
1575\begin{verbatim} 1575\begin{verbatim}
1576int lua_dofile (char *filename); 1576int lua_dofile (char *filename);
1577int lua_dostring (char *string); 1577int lua_dostring (char *string);
1578int lua_dobuffer (char *buff, int size); 1578int lua_dobuffer (char *buff, int size, char *name);
1579\end{verbatim} 1579\end{verbatim}
1580All these functions return an error code: 1580All these functions return an error code:
15810, in case of success; non zero, in case of errors. 15810, in case of success; non zero, in case of errors.
@@ -1583,11 +1583,18 @@ More specifically, \verb|lua_dofile| returns 2 if for any reason
1583it could not open the file. 1583it could not open the file.
1584The function \verb|lua_dofile|, if called with argument \verb|NULL|, 1584The function \verb|lua_dofile|, if called with argument \verb|NULL|,
1585executes the \verb|stdin| stream. 1585executes the \verb|stdin| stream.
1586Function \verb|lua_dofile| is also able to execute pre-compiled chunks. 1586Functions \verb|lua_dofile| and \verb|lua_dobuffer|
1587It automatically detects whether the file is text or binary, 1587are both able to execute pre-compiled chunks.
1588and loads it accordingly (see program \IndexVerb{luac}). 1588They automatically detect whether the chunk is text or binary,
1589Function \verb|lua_dostring| executes only source code, 1589and load it accordingly (see program \IndexVerb{luac}).
1590and function \verb|lua_dobuffer| executes only pre-compiled chunks. 1590Function \verb|lua_dostring| executes only source code.
1591
1592The third parameter to \verb|lua_dobuffer| (\verb|name|)
1593is the ``name of the chunk'',
1594used in error messages and debug information.
1595In files this name is the file name,
1596and \verb|lua_dostring| uses a small prefix
1597of the string as the chunk name.
1591 1598
1592These functions return, in structure lua2C, 1599These functions return, in structure lua2C,
1593any values eventually returned by the chunks. 1600any values eventually returned by the chunks.