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-heap.c
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 249 - (download) (as text) (annotate)
Sat Apr 17 18:57:03 1999 UTC (21 years, 3 months ago) by monnier
Original Path: sml/branches/SMLNJ/src/runtime/c-libs/smlnj-runtime/export-heap.c
File size: 911 byte(s)
version 110.16
/* export-heap.c
 *
 * COPYRIGHT (c) 1995 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_heap : string -> bool
 *
 * Export the world to the given file and return false (the exported version
 * returns true).
 */
ml_val_t _ml_RunT_export_heap (ml_state_t *msp, ml_val_t arg)
{
    char	fname[1024];
    FILE	*file;
    int		sts;

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

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

    msp->ml_arg = ML_true;
    sts = ExportHeapImage (msp, file);
    fclose (file);

    if (sts == SUCCESS)
	return ML_false;
    else
	return RAISE_ERROR(msp, "export failed");

} /* end of _ml_RunT_export_heap */


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