More of the string constants that are used in main.d are now statically allocated.

This commit is contained in:
Juan Jose Garcia Ripoll 2010-08-21 13:25:16 +02:00
parent b400db086b
commit bac154bc98
4 changed files with 329 additions and 265 deletions

113
src/c/features.h Normal file
View file

@ -0,0 +1,113 @@
/* -*- mode: c; c-basic-offset: 8 -*- */
/*
features.h -- names of features compiled into ECL
*/
/*
Copyright (c) 1984, Taiichi Yuasa and Masami Hagiya.
Copyright (c) 1990, Giuseppe Attardi.
Copyright (c) 2001, Juan Jose Garcia Ripoll.
ECL is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
See file '../Copyright' for full details.
*/
ecl_def_string_array(feature_names,static,const) = {
ecl_def_string_array_elt("ECL"),
ecl_def_string_array_elt("COMMON"),
ecl_def_string_array_elt(ECL_ARCHITECTURE),
ecl_def_string_array_elt("FFI"),
ecl_def_string_array_elt("PREFIXED-API"),
#ifdef ECL_IEEE_FP
ecl_def_string_array_elt("IEEE-FLOATING-POINT"),
#endif
#ifdef WITH_GMP
ecl_def_string_array_elt("COMMON-LISP"),
ecl_def_string_array_elt("ANSI-CL"),
#endif /* WITH_GMP */
#if defined(GBC_BOEHM)
ecl_def_string_array_elt("BOEHM-GC"),
#endif
#ifdef ECL_THREADS
ecl_def_string_array_elt("THREADS"),
#endif
#ifdef ECL_SEMAPHORES
ecl_def_string_array_elt("SEMAPHORES"),
#endif
#ifdef CLOS
ecl_def_string_array_elt("CLOS"),
#endif
#ifdef ENABLE_DLOPEN
ecl_def_string_array_elt("DLOPEN"),
#endif
#ifdef ECL_OLD_LOOP
ecl_def_string_array_elt("OLD-LOOP"),
#endif
ecl_def_string_array_elt("ECL-PDE"),
#ifdef unix
ecl_def_string_array_elt("UNIX"),
#endif
#ifdef BSD
ecl_def_string_array_elt("BSD"),
#endif
#ifdef SYSV
ecl_def_string_array_elt("SYSTEM-V"),
#endif
#ifdef MSDOS
ecl_def_string_array_elt("MS-DOS"),
#endif
#if defined(__MINGW32__)
ecl_def_string_array_elt("MINGW32"),
ecl_def_string_array_elt("WIN32"),
#endif
#ifdef _MSC_VER
ecl_def_string_array_elt("MSVC"),
#endif
#if defined(_MSC_VER) || defined(__MINGW32__)
ecl_def_string_array_elt("WINDOWS"),
#endif
#ifdef ECL_CMU_FORMAT
ecl_def_string_array_elt("CMU-FORMAT"),
#endif
#ifdef ECL_CLOS_STREAMS
ecl_def_string_array_elt("CLOS-STREAMS"),
#endif
#if defined(ECL_DYNAMIC_FFI) || defined(HAVE_LIBFFI)
ecl_def_string_array_elt("DFFI"),
#endif
#ifdef ECL_UNICODE
ecl_def_string_array_elt("UNICODE"),
#endif
#ifdef ECL_LONG_FLOAT
ecl_def_string_array_elt("LONG-FLOAT"),
#endif
#ifdef ECL_RELATIVE_PACKAGE_NAMES
ecl_def_string_array_elt("RELATIVE-PACKAGE-NAMES"),
#endif
#ifdef ecl_uint16_t
ecl_def_string_array_elt("UINT16-T"),
#endif
#ifdef ecl_uint32_t
ecl_def_string_array_elt("UINT32-T"),
#endif
#ifdef ecl_uint64_t
ecl_def_string_array_elt("UINT64-T"),
#endif
#ifdef ecl_long_long_t
ecl_def_string_array_elt("LONG-LONG"),
#endif
#ifdef ECL_EXTERNALIZABLE
ecl_def_string_array_elt("EXTERNALIZABLE"),
#endif
#ifdef __cplusplus
ecl_def_string_array_elt("C++"),
#endif
#ifdef ECL_SSE2
ecl_def_string_array_elt("SSE2"),
#endif
ecl_def_string_array_elt(0)
};

View file

@ -1,130 +1,146 @@
static const char *char_names[] = {
"Nul",
"Soh",
"Stx",
"Etx",
"Eot",
"Enq",
"Ack",
"Bel",
"Backspace",
"Tab",
"Newline",
"Vt",
"Page",
"Return",
"So",
"Si",
"Dle",
"Dc1",
"Dc2",
"Dc3",
"Dc4",
"Nak",
"Syn",
"Etb",
"Can",
"Em",
"Sub",
"Esc",
"Fs",
"Gs",
"Rs",
"Us",
"Space",
"EXCLAMATION_MARK",
"QUOTATION_MARK",
"NUMBER_SIGN",
"DOLLAR_SIGN",
"PERCENT_SIGN",
"AMPERSAND",
"APOSTROPHE",
"LEFT_PARENTHESIS",
"RIGHT_PARENTHESIS",
"ASTERISK",
"PLUS_SIGN",
"COMMA",
"HYPHEN-MINUS",
"FULL_STOP",
"SOLIDUS",
"DIGIT_ZERO",
"DIGIT_ONE",
"DIGIT_TWO",
"DIGIT_THREE",
"DIGIT_FOUR",
"DIGIT_FIVE",
"DIGIT_SIX",
"DIGIT_SEVEN",
"DIGIT_EIGHT",
"DIGIT_NINE",
"COLON",
"SEMICOLON",
"LESS-THAN_SIGN",
"EQUALS_SIGN",
"GREATER-THAN_SIGN",
"QUESTION_MARK",
"COMMERCIAL_AT",
"LATIN_CAPITAL_LETTER_A",
"LATIN_CAPITAL_LETTER_B",
"LATIN_CAPITAL_LETTER_C",
"LATIN_CAPITAL_LETTER_D",
"LATIN_CAPITAL_LETTER_E",
"LATIN_CAPITAL_LETTER_F",
"LATIN_CAPITAL_LETTER_G",
"LATIN_CAPITAL_LETTER_H",
"LATIN_CAPITAL_LETTER_I",
"LATIN_CAPITAL_LETTER_J",
"LATIN_CAPITAL_LETTER_K",
"LATIN_CAPITAL_LETTER_L",
"LATIN_CAPITAL_LETTER_M",
"LATIN_CAPITAL_LETTER_N",
"LATIN_CAPITAL_LETTER_O",
"LATIN_CAPITAL_LETTER_P",
"LATIN_CAPITAL_LETTER_Q",
"LATIN_CAPITAL_LETTER_R",
"LATIN_CAPITAL_LETTER_S",
"LATIN_CAPITAL_LETTER_T",
"LATIN_CAPITAL_LETTER_U",
"LATIN_CAPITAL_LETTER_V",
"LATIN_CAPITAL_LETTER_W",
"LATIN_CAPITAL_LETTER_X",
"LATIN_CAPITAL_LETTER_Y",
"LATIN_CAPITAL_LETTER_Z",
"LEFT_SQUARE_BRACKET",
"REVERSE_SOLIDUS",
"RIGHT_SQUARE_BRACKET",
"CIRCUMFLEX_ACCENT",
"LOW_LINE",
"GRAVE_ACCENT",
"LATIN_SMALL_LETTER_A",
"LATIN_SMALL_LETTER_B",
"LATIN_SMALL_LETTER_C",
"LATIN_SMALL_LETTER_D",
"LATIN_SMALL_LETTER_E",
"LATIN_SMALL_LETTER_F",
"LATIN_SMALL_LETTER_G",
"LATIN_SMALL_LETTER_H",
"LATIN_SMALL_LETTER_I",
"LATIN_SMALL_LETTER_J",
"LATIN_SMALL_LETTER_K",
"LATIN_SMALL_LETTER_L",
"LATIN_SMALL_LETTER_M",
"LATIN_SMALL_LETTER_N",
"LATIN_SMALL_LETTER_O",
"LATIN_SMALL_LETTER_P",
"LATIN_SMALL_LETTER_Q",
"LATIN_SMALL_LETTER_R",
"LATIN_SMALL_LETTER_S",
"LATIN_SMALL_LETTER_T",
"LATIN_SMALL_LETTER_U",
"LATIN_SMALL_LETTER_V",
"LATIN_SMALL_LETTER_W",
"LATIN_SMALL_LETTER_X",
"LATIN_SMALL_LETTER_Y",
"LATIN_SMALL_LETTER_Z",
"LEFT_CURLY_BRACKET",
"VERTICAL_LINE",
"RIGHT_CURLY_BRACKET",
"TILDE",
"Rubout",
0};
/* -*- mode: c; c-basic-offset: 8 -*- */
/*
iso_latin_names.h -- character names in ISO-LATIN-1
*/
/*
Copyright (c) 2008, Juan Jose Garcia Ripoll.
ECL is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
See file '../Copyright' for full details.
*/
ecl_def_string_array(char_names,static,const) = {
ecl_def_string_array_elt("Nul"),
ecl_def_string_array_elt("Soh"),
ecl_def_string_array_elt("Stx"),
ecl_def_string_array_elt("Etx"),
ecl_def_string_array_elt("Eot"),
ecl_def_string_array_elt("Enq"),
ecl_def_string_array_elt("Ack"),
ecl_def_string_array_elt("Bel"),
ecl_def_string_array_elt("Backspace"),
ecl_def_string_array_elt("Tab"),
ecl_def_string_array_elt("Newline"),
ecl_def_string_array_elt("Vt"),
ecl_def_string_array_elt("Page"),
ecl_def_string_array_elt("Return"),
ecl_def_string_array_elt("So"),
ecl_def_string_array_elt("Si"),
ecl_def_string_array_elt("Dle"),
ecl_def_string_array_elt("Dc1"),
ecl_def_string_array_elt("Dc2"),
ecl_def_string_array_elt("Dc3"),
ecl_def_string_array_elt("Dc4"),
ecl_def_string_array_elt("Nak"),
ecl_def_string_array_elt("Syn"),
ecl_def_string_array_elt("Etb"),
ecl_def_string_array_elt("Can"),
ecl_def_string_array_elt("Em"),
ecl_def_string_array_elt("Sub"),
ecl_def_string_array_elt("Esc"),
ecl_def_string_array_elt("Fs"),
ecl_def_string_array_elt("Gs"),
ecl_def_string_array_elt("Rs"),
ecl_def_string_array_elt("Us"),
ecl_def_string_array_elt("Space"),
ecl_def_string_array_elt("EXCLAMATION_MARK"),
ecl_def_string_array_elt("QUOTATION_MARK"),
ecl_def_string_array_elt("NUMBER_SIGN"),
ecl_def_string_array_elt("DOLLAR_SIGN"),
ecl_def_string_array_elt("PERCENT_SIGN"),
ecl_def_string_array_elt("AMPERSAND"),
ecl_def_string_array_elt("APOSTROPHE"),
ecl_def_string_array_elt("LEFT_PARENTHESIS"),
ecl_def_string_array_elt("RIGHT_PARENTHESIS"),
ecl_def_string_array_elt("ASTERISK"),
ecl_def_string_array_elt("PLUS_SIGN"),
ecl_def_string_array_elt("COMMA"),
ecl_def_string_array_elt("HYPHEN-MINUS"),
ecl_def_string_array_elt("FULL_STOP"),
ecl_def_string_array_elt("SOLIDUS"),
ecl_def_string_array_elt("DIGIT_ZERO"),
ecl_def_string_array_elt("DIGIT_ONE"),
ecl_def_string_array_elt("DIGIT_TWO"),
ecl_def_string_array_elt("DIGIT_THREE"),
ecl_def_string_array_elt("DIGIT_FOUR"),
ecl_def_string_array_elt("DIGIT_FIVE"),
ecl_def_string_array_elt("DIGIT_SIX"),
ecl_def_string_array_elt("DIGIT_SEVEN"),
ecl_def_string_array_elt("DIGIT_EIGHT"),
ecl_def_string_array_elt("DIGIT_NINE"),
ecl_def_string_array_elt("COLON"),
ecl_def_string_array_elt("SEMICOLON"),
ecl_def_string_array_elt("LESS-THAN_SIGN"),
ecl_def_string_array_elt("EQUALS_SIGN"),
ecl_def_string_array_elt("GREATER-THAN_SIGN"),
ecl_def_string_array_elt("QUESTION_MARK"),
ecl_def_string_array_elt("COMMERCIAL_AT"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_A"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_B"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_C"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_D"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_E"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_F"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_G"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_H"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_I"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_J"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_K"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_L"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_M"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_N"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_O"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_P"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_Q"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_R"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_S"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_T"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_U"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_V"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_W"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_X"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_Y"),
ecl_def_string_array_elt("LATIN_CAPITAL_LETTER_Z"),
ecl_def_string_array_elt("LEFT_SQUARE_BRACKET"),
ecl_def_string_array_elt("REVERSE_SOLIDUS"),
ecl_def_string_array_elt("RIGHT_SQUARE_BRACKET"),
ecl_def_string_array_elt("CIRCUMFLEX_ACCENT"),
ecl_def_string_array_elt("LOW_LINE"),
ecl_def_string_array_elt("GRAVE_ACCENT"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_A"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_B"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_C"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_D"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_E"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_F"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_G"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_H"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_I"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_J"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_K"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_L"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_M"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_N"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_O"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_P"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_Q"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_R"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_S"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_T"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_U"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_V"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_W"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_X"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_Y"),
ecl_def_string_array_elt("LATIN_SMALL_LETTER_Z"),
ecl_def_string_array_elt("LEFT_CURLY_BRACKET"),
ecl_def_string_array_elt("VERTICAL_LINE"),
ecl_def_string_array_elt("RIGHT_CURLY_BRACKET"),
ecl_def_string_array_elt("TILDE"),
ecl_def_string_array_elt("Rubout"),
ecl_def_string_array_elt(0)
};

View file

@ -44,6 +44,9 @@
#include <ecl/ecl-inl.h>
extern int GC_dont_gc;
#include "features.h"
#include "iso_latin_names.h"
/******************************* EXPORTS ******************************/
#if !defined(ECL_THREADS)
@ -97,98 +100,6 @@ static char stdin_buf[BUFSIZ];
static char stdout_buf[BUFSIZ];
#endif
static const char *feature_names[] = {
"ECL", "COMMON", ECL_ARCHITECTURE, "FFI", "PREFIXED-API",
#ifdef ECL_IEEE_FP
"IEEE-FLOATING-POINT",
#endif
#ifdef WITH_GMP
"COMMON-LISP",
"ANSI-CL",
#endif /* WITH_GMP */
#if defined(GBC_BOEHM)
"BOEHM-GC",
#endif
#ifdef ECL_THREADS
"THREADS",
#endif
#ifdef ECL_SEMAPHORES
"SEMAPHORES",
#endif
#ifdef CLOS
"CLOS",
#endif
#ifdef ENABLE_DLOPEN
"DLOPEN",
#endif
#ifdef ECL_OLD_LOOP
"OLD-LOOP",
#endif
"ECL-PDE",
#ifdef unix
"UNIX",
#endif
#ifdef BSD
"BSD",
#endif
#ifdef SYSV
"SYSTEM-V",
#endif
#ifdef MSDOS
"MS-DOS",
#endif
#if defined(__MINGW32__)
"MINGW32",
"WIN32",
#endif
#ifdef _MSC_VER
"MSVC",
#endif
#if defined(_MSC_VER) || defined(__MINGW32__)
"WINDOWS",
#endif
#ifdef ECL_CMU_FORMAT
"CMU-FORMAT",
#endif
#ifdef ECL_CLOS_STREAMS
"CLOS-STREAMS",
#endif
#if defined(ECL_DYNAMIC_FFI) || defined(HAVE_LIBFFI)
"DFFI",
#endif
#ifdef ECL_UNICODE
"UNICODE",
#endif
#ifdef ECL_LONG_FLOAT
"LONG-FLOAT",
#endif
#ifdef ECL_RELATIVE_PACKAGE_NAMES
"RELATIVE-PACKAGE-NAMES",
#endif
#ifdef ecl_uint16_t
"UINT16-T",
#endif
#ifdef ecl_uint32_t
"UINT32-T",
#endif
#ifdef ecl_uint64_t
"UINT64-T",
#endif
#ifdef ecl_long_long_t
"LONG-LONG",
#endif
#ifdef ECL_EXTERNALIZABLE
"EXTERNALIZABLE",
#endif
#ifdef __cplusplus
"C++",
#endif
#ifdef ECL_SSE2
"SSE2",
#endif
0
};
cl_fixnum
ecl_get_option(int option)
{
@ -268,8 +179,6 @@ ecl_init_env(cl_env_ptr env)
env->trap_fpe_bits = 0;
}
#include "iso_latin_names.h"
void
_ecl_dealloc_env(cl_env_ptr env)
{
@ -404,7 +313,7 @@ ecl_def_ct_base_string(str_common_lisp,"COMMON-LISP",11,static,const);
ecl_def_ct_base_string(str_common_lisp_user,"COMMON-LISP-USER",16,static,const);
ecl_def_ct_base_string(str_cl,"CL",2,static,const);
ecl_def_ct_base_string(str_cl_user,"CL-USER",7,static,const);
ecl_def_ct_base_string(str_lisp,"LISP",4,static,const);
ecl_def_ct_base_string(str_LISP,"LISP",4,static,const);
ecl_def_ct_base_string(str_user,"USER",4,static,const);
ecl_def_ct_base_string(str_keyword,"KEYWORD",7,static,const);
ecl_def_ct_base_string(str_si,"SI",2,static,const);
@ -419,6 +328,26 @@ ecl_def_ct_base_string(str_multiprocessing,"MULTIPROCESSING",15,static,const);
#ifdef ECL_CLOS_STREAMS
ecl_def_ct_base_string(str_gray,"GRAY",4,static,const);
#endif
ecl_def_ct_base_string(str_null,"Null",4,static,const);
ecl_def_ct_base_string(str_linefeed,"Linefeed",8,static,const);
ecl_def_ct_base_string(str_bell,"Bell",4,static,const);
ecl_def_ct_base_string(str_escape,"Escape",6,static,const);
ecl_def_ct_base_string(str_star_dot_star,"*.*",3,static,const);
ecl_def_ct_base_string(str_rel_star_dot_star,"./*.*",5,static,const);
ecl_def_ct_base_string(str_empty,"",0,static,const);
ecl_def_ct_base_string(str_G,"G",1,static,const);
ecl_def_ct_base_string(str_T,"T",1,static,const);
#ifdef ENABLE_DLOPEN
ecl_def_ct_base_string(str_fas,"fas",3,static,const);
ecl_def_ct_base_string(str_fasl,"fasl",4,static,const);
#endif
ecl_def_ct_base_string(str_fasb,"fasb",4,static,const);
ecl_def_ct_base_string(str_FASB,"FASB",4,static,const);
ecl_def_ct_base_string(str_lsp,"lsp",3,static,const);
ecl_def_ct_base_string(str_LSP,"LSP",3,static,const);
ecl_def_ct_base_string(str_lisp,"lisp",4,static,const);
ecl_def_ct_base_string(str_NIL,"NIL",3,static,const);
ecl_def_ct_base_string(str_slash,"/",1,static,const);
int
cl_boot(int argc, char **argv)
@ -470,7 +399,7 @@ cl_boot(int argc, char **argv)
Cnil_symbol->symbol.t = t_symbol;
Cnil_symbol->symbol.dynamic = 0;
Cnil_symbol->symbol.value = Cnil;
Cnil_symbol->symbol.name = make_constant_base_string("NIL");
Cnil_symbol->symbol.name = str_NIL;
Cnil_symbol->symbol.gfdef = Cnil;
Cnil_symbol->symbol.plist = Cnil;
Cnil_symbol->symbol.hpack = Cnil;
@ -483,7 +412,7 @@ cl_boot(int argc, char **argv)
Ct->symbol.t = (short)t_symbol;
Ct->symbol.dynamic = 0;
Ct->symbol.value = Ct;
Ct->symbol.name = make_constant_base_string("T");
Ct->symbol.name = str_T;
Ct->symbol.gfdef = Cnil;
Ct->symbol.plist = Cnil;
Ct->symbol.hpack = Cnil;
@ -498,7 +427,7 @@ cl_boot(int argc, char **argv)
#else
cl_core.path_max = MAXPATHLEN;
#endif
cl_core.slash = make_constant_base_string("/");
cl_core.slash = str_slash;
cl_core.rehash_size = default_rehash_size;
cl_core.rehash_threshold = default_rehash_threshold;
@ -508,7 +437,7 @@ cl_boot(int argc, char **argv)
cl_core.lisp_package =
ecl_make_package(str_common_lisp,
cl_list(2, str_cl, str_lisp),
cl_list(2, str_cl, str_LISP),
Cnil);
cl_core.user_package =
ecl_make_package(str_common_lisp_user,
@ -599,37 +528,28 @@ cl_boot(int argc, char **argv)
cl_core.rehash_size,
cl_core.rehash_threshold,
Cnil); /* thread-safe */
for (i = 0; char_names[i]; i++) {
cl_object name = make_constant_base_string(char_names[i]);
for (i = 0; char_names[i].elt.self; i++) {
cl_object name = (cl_object)(char_names + i);
cl_object code = MAKE_FIXNUM(i);
ecl_sethash(name, aux, code);
ecl_sethash(code, aux, name);
}
{
/* Linefeed is redundant with one of the names given
* in iso_latin_names.h, but it can not be associated
* to the code 10, because the default name must be
* Newline. Similar to the other codes. */
static struct {
const char *name;
int code;
} extra_names[] = { { "Null", 0 },
{ "Linefeed", 10 },
{ "Bell", 7 },
{ "Escape", 27 } };
for (i = 0; i < 4; i++) {
cl_object name = make_constant_base_string(extra_names[i].name);
ecl_sethash(name, aux, MAKE_FIXNUM(extra_names[i].code));
}
}
/* Linefeed is redundant with one of the names given in
* iso_latin_names.h, but it can not be associated to the code
* 10, because the default name must be Newline. Similar to
* the other codes. */
ecl_sethash(str_null, aux, MAKE_FIXNUM(0));
ecl_sethash(str_linefeed, aux, MAKE_FIXNUM(10));
ecl_sethash(str_bell, aux, MAKE_FIXNUM(7));
ecl_sethash(str_escape, aux, MAKE_FIXNUM(27));
/*
* Initialize logical pathname translations. This must come after
* the character database has been filled.
*/
@si::pathname-translations(2,make_constant_base_string("SYS"),
cl_list(1,cl_list(2,make_constant_base_string("*.*"),
make_constant_base_string("./*.*"))));
@si::pathname-translations(2,str_sys,
ecl_list1(cl_list(2,str_star_dot_star,
str_rel_star_dot_star)));
/*
* Initialize constants (strings, numbers and time).
@ -643,7 +563,7 @@ cl_boot(int argc, char **argv)
cl_core.gc_counter = Cnil;
cl_core.gc_stats = FALSE;
cl_core.null_string = make_constant_base_string("");
cl_core.null_string = str_empty;
cl_core.null_stream = Cnil; /* Filled in file.d */
@ -653,8 +573,8 @@ cl_boot(int argc, char **argv)
cl_core.rehash_threshold,
Ct); /* thread-safe */
cl_core.gensym_prefix = make_constant_base_string("G");
cl_core.gentemp_prefix = make_constant_base_string("T");
cl_core.gensym_prefix = str_G;
cl_core.gentemp_prefix = str_T;
cl_core.gentemp_counter = MAKE_FIXNUM(0);
init_number();
@ -685,18 +605,18 @@ cl_boot(int argc, char **argv)
#endif
aux = cl_list(
#ifdef ENABLE_DLOPEN
10,CONS(make_constant_base_string("fas"), @'si::load-binary'),
CONS(make_constant_base_string("fasl"), @'si::load-binary'),
CONS(make_constant_base_string("fasb"), @'si::load-binary'),
10,CONS(str_fas, @'si::load-binary'),
CONS(str_fasl, @'si::load-binary'),
CONS(str_fasb, @'si::load-binary'),
#else
7,
#endif
CONS(make_constant_base_string("lsp"), @'si::load-source'),
CONS(make_constant_base_string("lisp"), @'si::load-source'),
CONS(make_constant_base_string("LSP"), @'si::load-source'),
CONS(make_constant_base_string("LISP"), @'si::load-source'),
CONS(make_constant_base_string("fasb"), @'si::load-source'),
CONS(make_constant_base_string("FASB"), @'si::load-source'),
CONS(str_lsp, @'si::load-source'),
CONS(str_lisp, @'si::load-source'),
CONS(str_LSP, @'si::load-source'),
CONS(str_LISP, @'si::load-source'),
CONS(str_fasb, @'si::load-source'),
CONS(str_FASB, @'si::load-source'),
CONS(Cnil, @'si::load-source'));
ECL_SET(@'si::*load-hooks*', aux);
init_error();
@ -722,8 +642,11 @@ cl_boot(int argc, char **argv)
cl_list(8, @'&optional', @'&rest', @'&key', @'&allow-other-keys',
@'&aux', @'&whole', @'&environment', @'&body'));
for (i = 0, features = Cnil; feature_names[i]; i++) {
features = CONS(ecl_make_keyword(feature_names[i]),features);
for (i = 0, features = Cnil; feature_names[i].elt.self; i++) {
int flag;
cl_object name = (cl_object)(feature_names + i);
cl_object key = ecl_intern(name, cl_core.keyword_package, &flag);
features = CONS(key, features);
}
ECL_SET(@'*features*', features);

View file

@ -60,6 +60,18 @@
#define ecl_cast_ptr(type,n) ((type)(n))
#endif
#define ecl_def_string_array(name,static,const) \
static const union { \
struct ecl_base_string elt; \
cl_fixnum padding[(sizeof(struct ecl_base_string)+3)/4*4]; \
} name[]
#define ecl_def_string_array_elt(chars) { \
(int8_t)t_base_string, 0, aet_bc, 0, \
Cnil, (cl_index)(sizeof(chars))-1, \
(cl_index)(sizeof(chars))-1, \
(ecl_base_char*)(chars) }
#define ecl_def_ct_base_string(name,chars,len,static,const) \
static const struct ecl_base_string name ## data = { \
(int8_t)t_base_string, 0, aet_bc, 0, \