Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/runtime/c-libs/smlnj-runtime/export-fun.c
ViewVC logotype

View of /sml/trunk/src/runtime/c-libs/smlnj-runtime/export-fun.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 569 - (download) (as text) (annotate)
Tue Mar 7 04:01:07 2000 UTC (19 years, 7 months ago) by blume
File size: 1100 byte(s)
- size info in BOOTLIST
     * no fixed upper limits for number of bootfiles or length of
       bootfile names in runtime
     * falling back to old behavior if no BOOTLIST size info found
- allocation size heuristics in .run-sml
     * tries to read cache size from /proc/cpuinfo (this is important for
        small-cache Celeron systems!)
- install.sh robustified
- CM manual updates
- paranoid mode
     * no more CMB.deliver() (i.e., all done by CMB.make())
     * can re-use existing sml.boot.* files
     * init.cmi now treated as library
     * library stamps for consistency checks
- sml.boot.<arch>-<os>/PIDMAP file
     * This file is read by the CM startup code.  This is used to minimize
       the amount of dynamic state that needs to be stowed away for the
       purpose of sharing between interactive system and user code.
- CM.Anchor.anchor instead of CM.Anchor.{set,cancel}
     * Upon request by Elsa.  Anchors now controlled by get-set-pair
       like most other CM state variables.
- Compiler.CMSA eliminated
     * No longer supported by CM anyway.
- fixed bugs in pickler that kept biting Stefan
     * past refs to past refs (was caused by the possibility that
       ad-hoc sharing is more discriminating than hash-cons sharing)
     * integer overflow on LargeInt.minInt
- ml-{lex,yacc} build scripts now use new mechanism
  for building standalone programs
- fixed several gcc -Wall warnings that were caused by missing header
  files, missing initializations, etc., in runtime (not all warnings
  eliminated, though)
/* export-fun.c
 *
 * COPYRIGHT (c) 1994 by AT&T Bell Laboratories.
 */

#include "ml-osdep.h"
#include <stdio.h>
#include <string.h>
#include "ml-base.h"
#include "ml-values.h"
#include "ml-state.h"
#include "heap-io.h"
#include "ml-c.h"
#include "cfun-proto-list.h"


/* _ml_RunT_export_fun : (string * ((string * string list) -> int)) -> unit
 *
 * Export the given ML function.
 */
ml_val_t _ml_RunT_export_fun (ml_state_t *msp, ml_val_t arg)
{
    char	fname[1024];
    ml_val_t	mlName = REC_SEL(arg, 0);
    ml_val_t	funct = REC_SEL(arg, 1);
    FILE	*file;
    int		sts;

    QualifyImageName (strcpy(fname, STR_MLtoC(mlName)));

    if ((file = fopen(fname, "wb")) == NULL)
	return RAISE_ERROR(msp, "unable to open file for writing");

    sts = ExportFnImage (msp, funct, file);
    fclose (file);

    if (sts == SUCCESS)
	Exit (0);
    else
	Die ("export failed");
/* NOTE: while it would be nice to raise a SysErr exception here, the ML state
 * has been trashed as a side-effect of the export operation.
	return RAISE_ERROR(msp, "export failed");
 */

} /* end of _ml_RunT_export_fun */

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0