Skip to content
Snippets Groups Projects
Commit 723570da authored by Simon Marlow's avatar Simon Marlow Committed by ian@well-typed.com
Browse files

fix code in library initialisation example (#7471)

parent f630eb51
No related branches found
No related tags found
No related merge requests found
......@@ -446,21 +446,25 @@ typedef enum {
implemented in C or C++. For example:</para>
<programlisting>
HsBool mylib_init(void){
int argc = ...
char *argv[] = ...
#include &lt;stdlib.h&gt;
#include "HsFFI.h"
HsBool mylib_init(void){
int argc = 2;
char *argv[] = { "+RTS", "-A32m", NULL };
char **pargv = argv;
// Initialize Haskell runtime
hs_init(&amp;argc, &amp;argv);
// Initialize Haskell runtime
hs_init(&amp;argc, &amp;pargv);
// do any other initialization here and
// return false if there was a problem
return HS_BOOL_TRUE;
}
// do any other initialization here and
// return false if there was a problem
return HS_BOOL_TRUE;
}
void mylib_end(void){
hs_exit();
}
void mylib_end(void){
hs_exit();
}
</programlisting>
<para>The initialisation routine, <literal>mylib_init</literal>, calls
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment