1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

Minor modifications.

This commit is contained in:
Keisuke Nishida 2001-02-05 19:14:20 +00:00
parent 35d99e4aeb
commit 5f17c66f82
4 changed files with 16 additions and 15 deletions

View file

@ -1,6 +1,7 @@
2001-02-05 Keisuke Nishida <kxn30@po.cwru.edu>
* dump.c, dump.h: Modified a lot.
(SCM_DUMP_COOKIE): Version 0.1
(scm_dump_mark): Removed.
(scm_restore_cell_object, scm_store_cell_object): New functions.

View file

@ -60,7 +60,7 @@
#include "libguile/validate.h"
#include "libguile/dump.h"
#define SCM_DUMP_COOKIE "\x7fGBF-0.0"
#define SCM_DUMP_COOKIE "\x7fGBF-0.1"
#define SCM_DUMP_HASH_SIZE 151
#define SCM_DUMP_IMAGE_SIZE 4096
@ -285,7 +285,7 @@ scm_store_string (const char *addr, scm_sizet size, SCM dstate)
}
void
scm_store_bytes (const char *addr, scm_sizet size, SCM dstate)
scm_store_bytes (const void *addr, scm_sizet size, SCM dstate)
{
struct scm_dstate *p = SCM_DSTATE_DATA (dstate);
while (p->image_index + size >= p->image_size)
@ -298,7 +298,7 @@ scm_store_bytes (const char *addr, scm_sizet size, SCM dstate)
void
scm_store_word (const scm_bits_t word, SCM dstate)
{
scm_store_bytes ((const char *) &word, sizeof (scm_bits_t), dstate);
scm_store_bytes (&word, sizeof (scm_bits_t), dstate);
}
void
@ -337,21 +337,21 @@ scm_restore_pad (SCM dstate)
}
const char *
scm_restore_string (SCM dstate, int *lenp)
scm_restore_string (scm_sizet *sizep, SCM dstate)
{
struct scm_dstate *p = SCM_DSTATE_DATA (dstate);
const char *addr = p->image_base + p->image_index;
*lenp = strlen (addr);
p->image_index += *lenp + 1;
*sizep = strlen (addr);
p->image_index += *sizep + 1;
scm_restore_pad (dstate);
return addr;
}
const char *
scm_restore_bytes (SCM dstate, scm_sizet size)
const void *
scm_restore_bytes (scm_sizet size, SCM dstate)
{
struct scm_dstate *p = SCM_DSTATE_DATA (dstate);
const char *addr = p->image_base + p->image_index;
const void *addr = p->image_base + p->image_index;
p->image_index += size;
scm_restore_pad (dstate);
return addr;
@ -510,14 +510,14 @@ scm_undump (SCM dstate)
case scm_tc7_symbol:
{
int len;
const char *mem = scm_restore_string (dstate, &len);
const char *mem = scm_restore_string (&len, dstate);
obj = scm_mem2symbol (mem, len);
goto store_object;
}
case scm_tc7_string:
{
int len;
const char *mem = scm_restore_string (dstate, &len);
const char *mem = scm_restore_string (&len, dstate);
obj = scm_makfromstr (mem, len, 0);
goto store_object;
}

View file

@ -46,13 +46,13 @@
#include "libguile/__scm.h"
extern void scm_store_string (const char *addr, scm_sizet size, SCM dstate);
extern void scm_store_bytes (const char *addr, scm_sizet size, SCM dstate);
extern void scm_store_bytes (const void *addr, scm_sizet size, SCM dstate);
extern void scm_store_word (const scm_bits_t word, SCM dstate);
extern void scm_store_object (SCM obj, SCM dstate);
extern void scm_store_cell_object (SCM cell, int n, SCM dstate);
extern const char *scm_restore_string (SCM dstate, int *lenp);
extern const char *scm_restore_bytes (SCM dstate, scm_sizet size);
extern const char *scm_restore_string (scm_sizet *sizep, SCM dstate);
extern const void *scm_restore_bytes (scm_sizet size, SCM dstate);
extern scm_bits_t scm_restore_word (SCM dstate);
extern void scm_restore_object (SCM *objp, SCM dstate);
extern void scm_restore_cell_object (SCM cell, int n, SCM dstate);

View file

@ -81,7 +81,7 @@ static SCM
keyword_undump (SCM dstate)
{
int len;
const char *mem = scm_restore_string (dstate, &len);
const char *mem = scm_restore_string (&len, dstate);
SCM sym = scm_mem2symbol (mem, len);
return scm_make_keyword_from_dash_symbol (sym);
}