diff --git a/Makefile b/Makefile index ca66e22a..96278927 100644 --- a/Makefile +++ b/Makefile @@ -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 \ diff --git a/gc_heap.c b/gc_heap.c index ea397e96..ec021c5e 100644 --- a/gc_heap.c +++ b/gc_heap.c @@ -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 diff --git a/gc_heap.h b/include/chibi/gc_heap.h similarity index 76% rename from gc_heap.h rename to include/chibi/gc_heap.h index d4f416fb..e392736a 100644 --- a/gc_heap.h +++ b/include/chibi/gc_heap.h @@ -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,14 +25,15 @@ 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_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) */ - void *user, /* arbitrary data passed to callbacks */ - sexp (*heap_callback)(sexp ctx, sexp_heap h, void *user), - sexp (*free_callback)(sexp ctx, sexp_free_list f, void *user), - sexp (*sexp_callback)(sexp ctx, sexp s, void *user)); +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) */ + void *user, /* arbitrary data passed to callbacks */ + sexp (*heap_callback)(sexp ctx, sexp_heap h, void *user), + sexp (*free_callback)(sexp ctx, sexp_free_list f, void *user), + sexp (*sexp_callback)(sexp ctx, sexp s, void *user)); /* Returns a new context which contains a single, packed heap. @@ -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 */ diff --git a/main.c b/main.c index 871c5d5a..fa928c06 100644 --- a/main.c +++ b/main.c @@ -7,7 +7,7 @@ #endif #include "chibi/eval.h" -#include "gc_heap.h" +#include "chibi/gc_heap.h" #define sexp_argv_symbol "command-line"