declare and document scheme_set_dll_path() for Windows embedding

This commit is contained in:
Matthew Flatt 2015-11-13 06:49:07 -07:00
parent 825902f8e6
commit fb1432e70e
5 changed files with 35 additions and 8 deletions

View File

@ -1,5 +1,6 @@
#lang scribble/doc
@(require "utils.rkt")
@(require "utils.rkt"
scribble/bnf)
@(define cgc-v-3m "CGC versus 3m")
@ -114,16 +115,28 @@ To embed Racket CGC in a program, follow these steps:
into the top-level environment.
To embed a module like @racketmodname[racket/base] (along with all
its dependencies), use @exec{raco ctool --c-mods}, which generates a C file
its dependencies), use
@seclink["c-mods" #:doc raco-doc]{@exec{raco ctool --c-mods @nonterm{dest}}},
which generates a C file @nonterm{dest}
that contains modules in bytecode form as encapsulated in a static
array. The generated C file defines a @cppi{declare_modules}
function that takes a @cpp{Scheme_Env*}, installs the modules into
the environment, and adjusts the module name resolver to access the
embedded declarations.
embedded declarations. If embedded modules refer to runtime files
that need to be carried along, supply @DFlag{runtime} to
@exec{raco ctool --c-mods} to collect the runtime files into a
directory; see @secref[#:doc raco-doc "c-mods"] for more information.
Alternately, use @cpp{scheme_set_collects_path} and
Alternatively, use @cpp{scheme_set_collects_path} and
@cpp{scheme_init_collection_paths} to configure and install a path
for finding modules at run time.}
for finding modules at run time.
On Windows, @exec{raco ctool --c-mods @nonterm{dest} --runtime
@nonterm{dest-dir}} includes in @nonterm{dest-dir} optional DLLs
that are referenced by the Racket library to support @tech[#:doc
reference-doc]{extflonums} and @racket[bytes-open-converter]. Call
@cpp{scheme_set_dll_path} to register @nonterm{dest-dir} so that
those DLLs can be found at run time.}
@item{Access Racket through @cppi{scheme_dynamic_require},
@cppi{scheme_load}, @cppi{scheme_eval}, and/or other functions

View File

@ -91,6 +91,15 @@ Like @cpp{scheme_init_collection_paths_post}, but with @racket[null]
as the last argument.}
@function[(void scheme_set_dll_path
[wchar_t* path])]{
On Windows only, sets the path used to find optional DLLs that are used
by the runtime system: @filepath{longdouble.dll} and one of @filepath{iconv.dll},
@filepath{libiconv.dll}, or @filepath{libiconv-2.dll}. The given @var{path}
should be an absolute path.}
@function[(void scheme_seal_parameters)]{
Takes a snapshot of the current values of built-in parameters. These

View File

@ -12,6 +12,7 @@
function subfunction
FormatD
tech-place
reference-doc raco-doc
(except-out (all-from-out scribble/manual) var)
(for-label (all-from-out scheme/base)))
@ -157,8 +158,11 @@
(define mzc (exec "raco ctool"))
(define reference-doc '(lib "scribblings/reference/reference.scrbl"))
(define raco-doc '(lib "scribblings/raco/raco.scrbl"))
(define (refsecref s)
(secref #:doc '(lib "scribblings/reference/reference.scrbl") s))
(secref #:doc reference-doc s))
(define Racket
(other-manual '(lib "scribblings/reference/reference.scrbl")))

View File

@ -106,8 +106,6 @@ static void (*console_printf)(char *str, ...);
# define PRINTF console_printf
#endif
MZ_EXTERN void scheme_set_dll_path(wchar_t *s);
static void record_dll_path(void)
{
if (_dlldir[_dlldir_offset] != '<') {

View File

@ -1946,6 +1946,9 @@ MZ_EXTERN void scheme_set_addon_dir(Scheme_Object *p);
MZ_EXTERN void scheme_set_command_line_arguments(Scheme_Object *vec);
MZ_EXTERN void scheme_set_compiled_file_paths(Scheme_Object *list);
MZ_EXTERN void scheme_set_compiled_file_roots(Scheme_Object *list);
#ifdef DOS_FILE_SYSTEM
MZ_EXTERN void scheme_set_dll_path(wchar_t *s);
#endif
MZ_EXTERN void scheme_init_collection_paths(Scheme_Env *global_env, Scheme_Object *extra_dirs);
MZ_EXTERN void scheme_init_collection_paths_post(Scheme_Env *global_env, Scheme_Object *extra_dirs, Scheme_Object *extra_post_dirs);