making image save/load functions public

This commit is contained in:
Alex Shinn 2016-03-08 23:13:16 +09:00
parent 3714964cff
commit 524179388d
4 changed files with 20 additions and 20 deletions

View file

@ -39,7 +39,7 @@ COMPILED_LIBS = $(CHIBI_COMPILED_LIBS) $(CHIBI_IO_COMPILED_LIBS) \
lib/srfi/98/env$(SO) lib/scheme/time$(SO)
BASE_INCLUDES = include/chibi/sexp.h include/chibi/features.h include/chibi/install.h include/chibi/bignum.h
INCLUDES = $(BASE_INCLUDES) include/chibi/eval.h
INCLUDES = $(BASE_INCLUDES) include/chibi/eval.h include/chibi/gc_heap.h
MODULE_DOCS := app ast config disasm equiv filesystem generic heap-stats io \
loop match mime modules net parse pathname process repl scribble stty \

View file

@ -2,7 +2,7 @@
/* Copyright (c) 2016 Chris Walsh. All rights reserved. */
/* BSD-style license: http://synthcode.com/license.txt */
#include "gc_heap.h"
#include "chibi/gc_heap.h"
#if SEXP_USE_IMAGE_LOADING

View file

@ -2,8 +2,8 @@
/* Copyright (c) 2016 Chris Walsh. All rights reserved. */
/* BSD-style license: http://synthcode.com/license.txt */
#ifndef GC_HEAP_H
#define GC_HEAP_H
#ifndef SEXP_GC_HEAP_H
#define SEXP_GC_HEAP_H
#include "chibi/sexp.h"
@ -25,7 +25,8 @@
elements of the heap were walked normally. Any other return
value indicates an abnormal return condition.
*/
sexp sexp_gc_heap_walk(sexp ctx, /* a possibly incomplete context */
SEXP_API sexp sexp_gc_heap_walk(
sexp ctx, /* a possibly incomplete context */
sexp_heap h, /* normally set to sexp_context_heap(ctx) */
sexp *types, /* normally set to sexp_context_types(ctx) */
size_t types_cnt, /* normally set to sexp_context_num_types(ctx) */
@ -48,7 +49,7 @@ sexp sexp_gc_heap_walk(sexp ctx, /* a possibly incomplete context */
single packed heap just large enough to hold all sexps from the
original heap.
*/
sexp sexp_gc_heap_pack(sexp ctx, sexp_uint_t heap_free_size);
SEXP_API sexp sexp_gc_heap_pack(sexp ctx, sexp_uint_t heap_free_size);
/* Creates a new packed heap from the provided context, and saves
@ -63,7 +64,7 @@ sexp sexp_gc_heap_pack(sexp ctx, sexp_uint_t heap_free_size);
In all cases, upon completion the temporary packed context is deleted
and the context provided as an argument is not changed.
*/
sexp sexp_save_image (sexp ctx, const char* filename);
SEXP_API sexp sexp_save_image (sexp ctx, const char* filename);
/* Loads a previously saved image, and returns the context associated with
@ -81,19 +82,18 @@ sexp sexp_save_image (sexp ctx, const char* filename);
to provide a description of the error encountered. An sexp exception cannot be
returned because there is not a valid context in which to put the exception.
*/
sexp sexp_load_image (const char* filename, sexp_uint_t heap_free_size, sexp_uint_t heap_max_size);
SEXP_API sexp sexp_load_image (const char* filename, sexp_uint_t heap_free_size, sexp_uint_t heap_max_size);
/* In the case that sexp_load_image() returns NULL, this function will return
a string containing a description of the error condition.
*/
char* sexp_load_image_err();
SEXP_API char* sexp_load_image_err();
/* Debugging tool. Prints a summary of the heap structure to stdout.
*/
void sexp_gc_heap_stats_print(sexp ctx);
SEXP_API void sexp_gc_heap_stats_print(sexp ctx);
#endif
#endif /* ! SEXP_GC_HEAP_H */

2
main.c
View file

@ -7,7 +7,7 @@
#endif
#include "chibi/eval.h"
#include "gc_heap.h"
#include "chibi/gc_heap.h"
#define sexp_argv_symbol "command-line"