summaryrefslogtreecommitdiff
path: root/manual.tex
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-03-20 15:44:02 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-03-20 15:44:02 -0300
commit9704ff4cb14f34077062447d15196d32ace23e95 (patch)
treec0297a49e3f4516eb776c48c4d242edd0874b623 /manual.tex
parente3c0ce9a6977c750eca72dcf173bcffaf01a11d7 (diff)
downloadlua-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.tex17
1 files changed, 8 insertions, 9 deletions
diff --git a/manual.tex b/manual.tex
index 4828448a..b99ec2ee 100644
--- a/manual.tex
+++ b/manual.tex
@@ -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}
811All macros return 1 if the object is compatible with the given type, 811All macros return 1 if the object is compatible with the given type,
812and 0 otherwise. 812and 0 otherwise.
813\verb'lua_isnumber' accepts numbers and numerical strings, 813The 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}),
815and \verb'lua_isfunction' accepts Lua and C functions. 815and \verb'lua_isfunction' accepts Lua and C functions.
816 816
@@ -1587,7 +1587,10 @@ this function fails and returns 0.
1587The Lua interpreter offers two hooks for debug purposes: 1587The Lua interpreter offers two hooks for debug purposes:
1588\begin{verbatim} 1588\begin{verbatim}
1589typedef void (*lua_CHFunction) (lua_Function func, char *file, int line); 1589typedef void (*lua_CHFunction) (lua_Function func, char *file, int line);
1590extern lua_CHFunction lua_callhook;
1591
1590typedef void (*lua_LHFunction) (int line); 1592typedef void (*lua_LHFunction) (int line);
1593extern lua_LHFunction lua_linehook;
1591\end{verbatim} 1594\end{verbatim}
1592The first one is called whenever the interpreter enters or leaves a 1595The first one is called whenever the interpreter enters or leaves a
1593function. 1596function.
@@ -1606,12 +1609,8 @@ Its only parameter is the line number
1606This second hook is only called if the active function 1609This second hook is only called if the active function
1607has been pre-compiled with debug information (\see{pragma}). 1610has been pre-compiled with debug information (\see{pragma}).
1608 1611
1609To set these hooks, there are the functions: 1612A hook is disabled when its value is NULL (0),
1610\begin{verbatim} 1613which is the initial value of both hooks.
1611lua_LHFunction lua_setlinehook (lua_LHFunction hook);
1612lua_CHFunction lua_setcallhook (lua_CHFunction hook);
1613\end{verbatim}
1614Both return the previous hook.
1615 1614
1616 1615
1617\section{Some Examples} 1616\section{Some Examples}