*** empty log message ***

This commit is contained in:
hyung-hwan 2005-05-20 04:01:12 +00:00
parent 4f49c6d2db
commit 733827b0b4
7 changed files with 53 additions and 19 deletions

31
ase/conf_vms.h Normal file
View File

@ -0,0 +1,31 @@
/* TODO: please complete this file */
#define XP_ENDIAN_LITTLE
#define SIZEOF_CHAR 1
#define SIZEOF_SHORT 2
#define SIZEOF_INT 4
#ifdef _WIN64
#define SIZEOF_LONG 8
#else
#define SIZEOF_LONG 4
#endif
#define SIZEOF_LONG_LONG 0
#define SIZEOF___INT8 1
#define SIZEOF___INT16 2
#define SIZEOF___INT32 4
#define SIZEOF___INT64 8
#define SIZEOF___INT128 0
#ifdef _WIN64
#define SIZEOF_VOID_P 8
#else
#define SIZEOF_VOID_P 4
#endif
#define SIZEOF_FLOAT 4
#define SIZEOF_DOUBLE 8
#define SIZEOF_LONG_DOUBLE 16

View File

@ -4,7 +4,7 @@ OBJS = $(SRCS:.c=.obj)
OUT = xpstx.lib OUT = xpstx.lib
CC = c:\tc\tcc CC = c:\tc\tcc
CFLAGS = -I..\.. -D_DOS -mh -w CFLAGS = -I..\.. -D_DOS -ml -w
all: $(OBJS) all: $(OBJS)
c:\tc\tlib $(OUT) @&&! c:\tc\tlib $(OUT) @&&!

View File

@ -1,5 +1,5 @@
/* /*
* $Id: memory.c,v 1.10 2005-05-19 16:41:10 bacon Exp $ * $Id: memory.c,v 1.11 2005-05-20 04:01:12 bacon Exp $
*/ */
#include <xp/stx/memory.h> #include <xp/stx/memory.h>
@ -70,7 +70,11 @@ xp_stx_word_t xp_stx_memory_alloc (xp_stx_memory_t* mem, xp_stx_word_t nbytes)
if (object == XP_NULL) { if (object == XP_NULL) {
xp_stx_memory_gc (mem); xp_stx_memory_gc (mem);
object = (xp_stx_object_t*)xp_stx_malloc (nbytes); object = (xp_stx_object_t*)xp_stx_malloc (nbytes);
if (object == XP_NULL) return mem->capacity; /*if (object == XP_NULL) return mem->capacity;*/
if (object == XP_NULL) {
xp_stx_assert (XP_TEXT("MEMORY ALLOCATION ERROR\n") == XP_NULL);
exit (1);
}
} }
slot = mem->free; slot = mem->free;

View File

@ -1,5 +1,5 @@
/* /*
* $Id: stx.h,v 1.15 2005-05-19 16:41:10 bacon Exp $ * $Id: stx.h,v 1.16 2005-05-20 04:01:12 bacon Exp $
*/ */
#ifndef _XP_STX_STX_H_ #ifndef _XP_STX_STX_H_
@ -15,8 +15,10 @@ typedef xp_size_t xp_stx_size_t;
typedef xp_size_t xp_stx_index_t; typedef xp_size_t xp_stx_index_t;
typedef struct xp_stx_object_t xp_stx_object_t; typedef struct xp_stx_object_t xp_stx_object_t;
/*
typedef struct xp_stx_byte_object_t xp_stx_byte_object_t; typedef struct xp_stx_byte_object_t xp_stx_byte_object_t;
typedef struct xp_stx_string_object_t xp_stx_string_object_t; typedef struct xp_stx_string_object_t xp_stx_string_object_t;
*/
typedef struct xp_stx_memory_t xp_stx_memory_t; typedef struct xp_stx_memory_t xp_stx_memory_t;
typedef struct xp_stx_t xp_stx_t; typedef struct xp_stx_t xp_stx_t;
@ -107,6 +109,7 @@ struct xp_stx_t
#define XP_STX_OBJECT(stx,idx) (((stx)->memory).slots[idx]) #define XP_STX_OBJECT(stx,idx) (((stx)->memory).slots[idx])
#define XP_STX_CLASS(stx,idx) (XP_STX_OBJECT(stx,(idx))->class) #define XP_STX_CLASS(stx,idx) (XP_STX_OBJECT(stx,(idx))->class)
#define XP_STX_ACCESS(stx,idx) (XP_STX_OBJECT(stx,(idx))->access) #define XP_STX_ACCESS(stx,idx) (XP_STX_OBJECT(stx,(idx))->access)
#define XP_STX_DATA(stx,idx) ((void*)(XP_STX_OBJECT(stx,idx) + 1))
#define XP_STX_TYPE(stx,idx) (XP_STX_ACCESS(stx,idx) & 0x03) #define XP_STX_TYPE(stx,idx) (XP_STX_ACCESS(stx,idx) & 0x03)
#define XP_STX_SIZE(stx,idx) (XP_STX_ACCESS(stx,idx) >> 0x02) #define XP_STX_SIZE(stx,idx) (XP_STX_ACCESS(stx,idx) >> 0x02)

View File

@ -3,8 +3,8 @@ OBJS = stx.obj
OUT = stx.exe OUT = stx.exe
CC = \tc\tcc CC = \tc\tcc
CFLAGS = -I..\..\.. -mh -D_DOS -w CFLAGS = -I..\..\.. -ml -D_DOS -w
LIBS = \tc\lib\ch.lib \tc\lib\c0h.obj ..\..\..\xp\stx\xpstx.lib LIBS = \tc\lib\cl.lib \tc\lib\c0l.obj ..\..\..\xp\stx\xpstx.lib
all: $(OBJS) all: $(OBJS)
\tc\tlink $(OBJS),$(OUT),,$(LIBS) \tc\tlink $(OBJS),$(OUT),,$(LIBS)

View File

@ -14,17 +14,13 @@
void print_symbol_names (xp_stx_t* stx, xp_stx_word_t sym) void print_symbol_names (xp_stx_t* stx, xp_stx_word_t sym)
{ {
/* xp_printf (XP_TEXT("%lu [%s]\n"), (unsigned long)sym, &XP_STX_CHARAT(stx,sym,0));
xp_stx_word_t key = XP_STX_AT(stx,idx,1);
xp_printf (XP_TEXT("%u -> %s\n"), key, &XP_STX_CHARAT(stx,key,0));
*/
xp_printf (XP_TEXT("%u -> %s\n"), sym, &XP_STX_CHARAT(stx,sym,0));
} }
void print_symbol_names_2 (xp_stx_t* stx, xp_stx_word_t idx) void print_symbol_names_2 (xp_stx_t* stx, xp_stx_word_t idx)
{ {
xp_stx_word_t key = XP_STX_AT(stx,idx,1); xp_stx_word_t key = XP_STX_AT(stx,idx,1);
xp_printf (XP_TEXT("%u -> %s\n"), key, &XP_STX_CHARAT(stx,key,0)); xp_printf (XP_TEXT("%lu [%s]\n"), (unsigned long)key, &XP_STX_CHARAT(stx,key,0));
} }
int xp_main (int argc, xp_char_t* argv[]) int xp_main (int argc, xp_char_t* argv[])
@ -48,9 +44,9 @@ int xp_main (int argc, xp_char_t* argv[])
return -1; return -1;
} }
xp_printf (XP_TEXT("stx.nil %d\n"), stx.nil); xp_printf (XP_TEXT("stx.nil %lu\n"), (unsigned long)stx.nil);
xp_printf (XP_TEXT("stx.true %d\n"), stx.true); xp_printf (XP_TEXT("stx.true %lu\n"), (unsigned long)stx.true);
xp_printf (XP_TEXT("stx.false %d\n"), stx.false); xp_printf (XP_TEXT("stx.false %lu\n"), (unsigned long)stx.false);
xp_printf (XP_TEXT("-------------\n")); xp_printf (XP_TEXT("-------------\n"));
xp_stx_traverse_symbol_table (&stx, print_symbol_names); xp_stx_traverse_symbol_table (&stx, print_symbol_names);
@ -86,7 +82,7 @@ int xp_main (int argc, xp_char_t* argv[])
} }
xp_stx_close (&stx); xp_stx_close (&stx);
xp_printf (XP_TEXT("End of program\n")); xp_printf (XP_TEXT("== End of program ==\n"));
return 0; return 0;
} }

View File

@ -1,5 +1,5 @@
/* /*
* $Id: types.h,v 1.25 2005-05-19 16:41:09 bacon Exp $ * $Id: types.h,v 1.26 2005-05-20 04:01:12 bacon Exp $
*/ */
#ifndef _XP_TYPES_H_ #ifndef _XP_TYPES_H_
@ -8,9 +8,9 @@
#if defined(_DOS) #if defined(_DOS)
#include <xp/conf_dos.h> #include <xp/conf_dos.h>
#elif defined(_WIN32) #elif defined(_WIN32)
#include <xp/config_win32.h> #include <xp/conf_win.h>
#elif defined(__VMS) #elif defined(__VMS)
#include <xp/config_vms.h> #include <xp/conf_vms.h>
#else #else
#include <xp/config.h> #include <xp/config.h>
#endif #endif