diff options
Diffstat (limited to '')
| -rw-r--r-- | manual.tex | 23 |
1 files changed, 15 insertions, 8 deletions
| @@ -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} |
| 1576 | int lua_dofile (char *filename); | 1576 | int lua_dofile (char *filename); |
| 1577 | int lua_dostring (char *string); | 1577 | int lua_dostring (char *string); |
| 1578 | int lua_dobuffer (char *buff, int size); | 1578 | int lua_dobuffer (char *buff, int size, char *name); |
| 1579 | \end{verbatim} | 1579 | \end{verbatim} |
| 1580 | All these functions return an error code: | 1580 | All these functions return an error code: |
| 1581 | 0, in case of success; non zero, in case of errors. | 1581 | 0, 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 | |||
| 1583 | it could not open the file. | 1583 | it could not open the file. |
| 1584 | The function \verb|lua_dofile|, if called with argument \verb|NULL|, | 1584 | The function \verb|lua_dofile|, if called with argument \verb|NULL|, |
| 1585 | executes the \verb|stdin| stream. | 1585 | executes the \verb|stdin| stream. |
| 1586 | Function \verb|lua_dofile| is also able to execute pre-compiled chunks. | 1586 | Functions \verb|lua_dofile| and \verb|lua_dobuffer| |
| 1587 | It automatically detects whether the file is text or binary, | 1587 | are both able to execute pre-compiled chunks. |
| 1588 | and loads it accordingly (see program \IndexVerb{luac}). | 1588 | They automatically detect whether the chunk is text or binary, |
| 1589 | Function \verb|lua_dostring| executes only source code, | 1589 | and load it accordingly (see program \IndexVerb{luac}). |
| 1590 | and function \verb|lua_dobuffer| executes only pre-compiled chunks. | 1590 | Function \verb|lua_dostring| executes only source code. |
| 1591 | |||
| 1592 | The third parameter to \verb|lua_dobuffer| (\verb|name|) | ||
| 1593 | is the ``name of the chunk'', | ||
| 1594 | used in error messages and debug information. | ||
| 1595 | In files this name is the file name, | ||
| 1596 | and \verb|lua_dostring| uses a small prefix | ||
| 1597 | of the string as the chunk name. | ||
| 1591 | 1598 | ||
| 1592 | These functions return, in structure lua2C, | 1599 | These functions return, in structure lua2C, |
| 1593 | any values eventually returned by the chunks. | 1600 | any values eventually returned by the chunks. |
