Next: , Previous: guile-tools scan-api, Up: Miscellaneous Tools


13.38 guile-tools scan-md-module

Usage: scan-md-module [--catalog] [FILE ...]

Scan binary-module FILE... and display module information one per line.
By default the output format INFO is one of the forms:

  (MODULE-NAME spec MODSPEC-ID UPSTREAMS)
  (MODULE-NAME scm_init_module LINK-FUNC UPSTREAMS)

Optional arg `--catalog' means to use format:

  (INFO . FILENAME)

MODULE-NAME is a list of symbols.  MODSPEC-ID is a string, the tail
part of the C `struct scm_module_initspec guilemodspec_MODSPEC-ID'.
LINK-FUNC is a string, the name of the C function used to dynamically
link the module (note that this is different from the "module init
function".  UPSTREAMS is a (possibly empty) list of module names which
must be completely loaded before full linking of this one can occur.
FILENAME is the same as FILE.

If the file's object format is not recognized, the output is simply
"#f".  If the file format is recognized but there are other problems,
the output is a list whose car is #f and the rest of the elements
unspecified.


Usage from Scheme:

 (scan-md-module-file filename) => sexp
 (attach filename) => proc, or #f

SEXP has the default format described in the "Usage" section above.
To get a "--catalog" style result (presuming the scan is successful),
use `(append SEXP FILENAME)'.

For `attach', if the object file format is not recognized, return #f.
Ohterwise, return PROC, a procedure that accepts the following commands:

#:access-info  -- return same value as `scan-md-module-file' (above)
#:exports-list -- return list of symbols

Note that the exports list may be incomplete for `scm_init_module'
type modules; those have no way to specify non-procedure exports.