<div dir="ltr"><div>So for each module (or Scheme library) I have in my project I have to do a separate ___setup? I guess if I compile all my libraries into a single standalone executable the ___setup step is no longer required.<br><br></div>--Vijay<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 13, 2015 at 9:10 PM, Marc Feeley <span dir="ltr"><<a href="mailto:dr.marc.feeley@gmail.com" target="_blank">dr.marc.feeley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The structure “setup_params” contains parameters for the runtime system (e.g. the system version number, the size of the heap, the default character encoding for I/O, the debugging level).  And it also contains the program’s “linker”, a function which represents the set of Scheme modules that are part of the program.<br>
<br>
A call to ___setup_params_reset will give default values to all the parameters in setup_params.  Then the parameters in setup_params that don’t have a default value are set explicitly with assignments (here the “version” and the “linker”).<br>
<br>
The call to ___setup is what starts the execution of the Scheme code.  It uses the parameters in setup_params to allocate the heap, the stack, the symbol table, etc.  Then it executes sequentially each module of the program.  When ___setup returns, the Scheme code is finished executing.  Note that it is still possible after that to call Scheme functions defined with c-define.  Finally a call to ___cleanup reclaims the heap and other resources that were allocated by ___setup.<br>
<br>
Marc<br>
<div><div class="h5"><br>
<br>
> On Nov 13, 2015, at 9:48 AM, Vijay Mathew <<a href="mailto:vijay.the.lisper@gmail.com">vijay.the.lisper@gmail.com</a>> wrote:<br>
><br>
> I found this code in examples/pthread/pthread.c:<br>
><br>
>  ___setup_params_struct setup_params;<br>
><br>
>   ___setup_params_reset (&setup_params);<br>
><br>
>   setup_params.version = ___VERSION;<br>
>   setup_params.linker  = SCHEME_LIBRARY_LINKER;<br>
><br>
>   ___setup (&setup_params);<br>
><br>
> What does ___setup_params_reset and ___setup do?<br>
><br>
> Thanks,<br>
><br>
> --Vijay<br>
</div></div>> _______________________________________________<br>
> Gambit-list mailing list<br>
> <a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
> <a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" rel="noreferrer" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
<br>
</blockquote></div><br></div>