diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-03-20 15:44:02 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-03-20 15:44:02 -0300 |
commit | 9704ff4cb14f34077062447d15196d32ace23e95 (patch) | |
tree | c0297a49e3f4516eb776c48c4d242edd0874b623 /manual.tex | |
parent | e3c0ce9a6977c750eca72dcf173bcffaf01a11d7 (diff) | |
download | lua-9704ff4cb14f34077062447d15196d32ace23e95.tar.gz lua-9704ff4cb14f34077062447d15196d32ace23e95.tar.bz2 lua-9704ff4cb14f34077062447d15196d32ace23e95.zip |
hook variables are global, no more "lua_set...hook" functions.
Diffstat (limited to 'manual.tex')
-rw-r--r-- | manual.tex | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -1,4 +1,4 @@ | |||
1 | % $Id: manual.tex,v 1.12 1996/03/14 17:45:01 roberto Exp roberto $ | 1 | % $Id: manual.tex,v 1.13 1996/03/19 22:39:07 roberto Exp roberto $ |
2 | 2 | ||
3 | \documentstyle[A4,11pt,bnf]{article} | 3 | \documentstyle[A4,11pt,bnf]{article} |
4 | 4 | ||
@@ -34,7 +34,7 @@ Waldemar Celes Filho | |||
34 | \tecgraf\ --- Departamento de Inform\'atica --- PUC-Rio | 34 | \tecgraf\ --- Departamento de Inform\'atica --- PUC-Rio |
35 | } | 35 | } |
36 | 36 | ||
37 | \date{\small \verb$Date: 1996/03/14 17:45:01 $} | 37 | \date{\small \verb$Date: 1996/03/19 22:39:07 $} |
38 | 38 | ||
39 | \maketitle | 39 | \maketitle |
40 | 40 | ||
@@ -810,7 +810,7 @@ int lua_isuserdata (lua_Object object); | |||
810 | \end{verbatim} | 810 | \end{verbatim} |
811 | All macros return 1 if the object is compatible with the given type, | 811 | All macros return 1 if the object is compatible with the given type, |
812 | and 0 otherwise. | 812 | and 0 otherwise. |
813 | \verb'lua_isnumber' accepts numbers and numerical strings, | 813 | The function \verb'lua_isnumber' accepts numbers and numerical strings, |
814 | \verb'lua_isstring' accepts strings and numbers (\see{coercion}), | 814 | \verb'lua_isstring' accepts strings and numbers (\see{coercion}), |
815 | and \verb'lua_isfunction' accepts Lua and C functions. | 815 | and \verb'lua_isfunction' accepts Lua and C functions. |
816 | 816 | ||
@@ -1587,7 +1587,10 @@ this function fails and returns 0. | |||
1587 | The Lua interpreter offers two hooks for debug purposes: | 1587 | The Lua interpreter offers two hooks for debug purposes: |
1588 | \begin{verbatim} | 1588 | \begin{verbatim} |
1589 | typedef void (*lua_CHFunction) (lua_Function func, char *file, int line); | 1589 | typedef void (*lua_CHFunction) (lua_Function func, char *file, int line); |
1590 | extern lua_CHFunction lua_callhook; | ||
1591 | |||
1590 | typedef void (*lua_LHFunction) (int line); | 1592 | typedef void (*lua_LHFunction) (int line); |
1593 | extern lua_LHFunction lua_linehook; | ||
1591 | \end{verbatim} | 1594 | \end{verbatim} |
1592 | The first one is called whenever the interpreter enters or leaves a | 1595 | The first one is called whenever the interpreter enters or leaves a |
1593 | function. | 1596 | function. |
@@ -1606,12 +1609,8 @@ Its only parameter is the line number | |||
1606 | This second hook is only called if the active function | 1609 | This second hook is only called if the active function |
1607 | has been pre-compiled with debug information (\see{pragma}). | 1610 | has been pre-compiled with debug information (\see{pragma}). |
1608 | 1611 | ||
1609 | To set these hooks, there are the functions: | 1612 | A hook is disabled when its value is NULL (0), |
1610 | \begin{verbatim} | 1613 | which is the initial value of both hooks. |
1611 | lua_LHFunction lua_setlinehook (lua_LHFunction hook); | ||
1612 | lua_CHFunction lua_setcallhook (lua_CHFunction hook); | ||
1613 | \end{verbatim} | ||
1614 | Both return the previous hook. | ||
1615 | 1614 | ||
1616 | 1615 | ||
1617 | \section{Some Examples} | 1616 | \section{Some Examples} |