Update of /cvsroot/luabind/luabind/luabind/doc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30150/doc
Modified Files:
Tag: luabind_rc_0_7
docs.html docs.rst
Log Message:
updated docs about pcall_callback
Index: docs.html
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/doc/docs.html,v
retrieving revision 1.54.2.2
retrieving revision 1.54.2.3
diff -u -d -r1.54.2.2 -r1.54.2.3
--- docs.html 9 Jan 2006 16:46:54 -0000 1.54.2.2
+++ docs.html 10 Jan 2006 00:31:39 -0000 1.54.2.3
@@ -7,7 +7,7 @@
<title>luabind</title>
<meta name="author" content="Daniel Wallin, Arvid Norberg" />
<meta name="copyright" content="Copyright Daniel Wallin, Arvid Norberg 2003." />
-<meta name="date" content="2006-01-01" />
+<meta name="date" content="2006-01-09" />
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
@@ -22,9 +22,9 @@
<tr><th class="docinfo-name">Copyright:</th>
<td>Copyright Daniel Wallin, Arvid Norberg 2003.</td></tr>
<tr><th class="docinfo-name">Date:</th>
-<td>2006-01-01</td></tr>
+<td>2006-01-09</td></tr>
<tr><th class="docinfo-name">Revision:</th>
-<td>1.26.2.1</td></tr>
+<td>1.26.2.2</td></tr>
<tr class="field"><th class="docinfo-name">License:</th><td class="field-body"><p class="first">Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
@@ -2638,11 +2638,21 @@
It is possible to set the error handler function that Luabind will use
globally:</p>
<pre class="literal-block">
-typedef void(*pcall_callback_fun)(lua_State*);
+typedef int(*pcall_callback_fun)(lua_State*);
void set_pcall_callback(pcall_callback_fun fn);
</pre>
<p>This is primarily useful for adding more information to the error message
-returned by a failed protected call.</p>
+returned by a failed protected call. For more information on how to use the
+pcall_callback function, see <tt class="docutils literal"><span class="pre">errfunc</span></tt> under the
+<a class="reference" href="http://www.lua.org/manual/5.0/manual.html#3.15">pcall section of the lua manual</a>.</p>
+<p>The message returned by the <tt class="docutils literal"><span class="pre">pcall_callback</span></tt> is accessable as the top lua
+value on the stack. For example, if you would like to access it as a luabind
+object, you could do like this:</p>
+<pre class="literal-block">
+catch(error& e)
+object error_msg(from_stack(e.state(), -1));
+std::cout << error_msg << std::endl;
+</pre>
<div class="section" id="build-options">
<h2><a name="build-options">14.1 Build options</a></h2>
<p>There are a number of configuration options available when building luabind.
Index: docs.rst
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/doc/docs.rst,v
retrieving revision 1.26.2.2
retrieving revision 1.26.2.3
diff -u -d -r1.26.2.2 -r1.26.2.3
--- docs.rst 9 Jan 2006 16:46:54 -0000 1.26.2.2
+++ docs.rst 10 Jan 2006 00:31:40 -0000 1.26.2.3
@@ -2127,13 +2127,25 @@
It is possible to set the error handler function that Luabind will use
globally::
- typedef void(*pcall_callback_fun)(lua_State*);
+ typedef int(*pcall_callback_fun)(lua_State*);
void set_pcall_callback(pcall_callback_fun fn);
This is primarily useful for adding more information to the error message
-returned by a failed protected call.
+returned by a failed protected call. For more information on how to use the
+pcall_callback function, see ``errfunc`` under the
+`pcall section of the lua manual`_.
+
+The message returned by the ``pcall_callback`` is accessable as the top lua
+value on the stack. For example, if you would like to access it as a luabind
+object, you could do like this::
+
+ catch(error& e)
+ object error_msg(from_stack(e.state(), -1));
+ std::cout << error_msg << std::endl;
.. _Lua documentation: http://www.lua.org/manual/5.0/manual.html
+.. _`pcall section of the lua manual`: http://www.lua.org/manual/5.0/manual.html#3.15
+
Build options
-------------
|