mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-13 04:42:13 -08:00
READ/WRITE-BYTE cannot be implemented in terms of ecl_read_byte8, because there are streams that do not have information about the underlying byte size. Added flags for big/little endian.
This commit is contained in:
parent
167a62765b
commit
3f4f7b08ff
4 changed files with 377 additions and 351 deletions
706
src/c/file.d
706
src/c/file.d
File diff suppressed because it is too large
Load diff
|
|
@ -1740,6 +1740,8 @@ cl_symbols[] = {
|
|||
{EXT_ "MAKE-ENCODING", EXT_ORDINARY, NULL, -1, OBJNULL},
|
||||
|
||||
{KEY_ "US-ASCII", KEYWORD, NULL, -1, OBJNULL},
|
||||
{KEY_ "LITTLE-ENDIAN", KEYWORD, NULL, -1, OBJNULL},
|
||||
{KEY_ "BIG-ENDIAN", KEYWORD, NULL, -1, OBJNULL},
|
||||
|
||||
/* Tag for end of list */
|
||||
{NULL, CL_ORDINARY, NULL, -1, OBJNULL}};
|
||||
|
|
|
|||
|
|
@ -1740,6 +1740,8 @@ cl_symbols[] = {
|
|||
{EXT_ "MAKE-ENCODING",NULL},
|
||||
|
||||
{KEY_ "US-ASCII",NULL},
|
||||
{KEY_ "LITTLE-ENDIAN",NULL},
|
||||
{KEY_ "BIG-ENDIAN",NULL},
|
||||
|
||||
/* Tag for end of list */
|
||||
{NULL,NULL}};
|
||||
|
|
|
|||
|
|
@ -482,6 +482,9 @@ struct ecl_file_ops {
|
|||
cl_index (*write_byte8)(cl_object strm, unsigned char *c, cl_index n);
|
||||
cl_index (*read_byte8)(cl_object strm, unsigned char *c, cl_index n);
|
||||
|
||||
void (*write_byte)(cl_object c, cl_object strm);
|
||||
cl_object (*read_byte)(cl_object strm);
|
||||
|
||||
int (*read_char)(cl_object strm);
|
||||
int (*write_char)(cl_object strm, int c);
|
||||
void (*unread_char)(cl_object strm, int c);
|
||||
|
|
@ -511,7 +514,7 @@ struct ecl_file_ops {
|
|||
|
||||
enum {
|
||||
ECL_STREAM_BINARY = 0,
|
||||
ECL_STREAM_FORMAT = 0x2F,
|
||||
ECL_STREAM_FORMAT = 0xFF,
|
||||
#ifndef ECL_UNICODE
|
||||
ECL_STREAM_DEFAULT_FORMAT = 1,
|
||||
#else
|
||||
|
|
@ -520,19 +523,20 @@ enum {
|
|||
ECL_STREAM_LATIN_1 = 1,
|
||||
ECL_STREAM_UTF_8 = 2,
|
||||
ECL_STREAM_UCS_2 = 3,
|
||||
ECL_STREAM_UCS_2LE = 4,
|
||||
ECL_STREAM_UCS_2LE = 5 + 128,
|
||||
ECL_STREAM_UCS_2BE = 5,
|
||||
ECL_STREAM_UCS_4 = 6,
|
||||
ECL_STREAM_UCS_4LE = 7,
|
||||
ECL_STREAM_UCS_4BE = 8,
|
||||
ECL_STREAM_USER_FORMAT = 9,
|
||||
ECL_STREAM_UCS_4LE = 7 + 128,
|
||||
ECL_STREAM_UCS_4BE = 7,
|
||||
ECL_STREAM_USER_FORMAT = 8,
|
||||
ECL_STREAM_US_ASCII = 10,
|
||||
#endif
|
||||
ECL_STREAM_CR = 16,
|
||||
ECL_STREAM_LF = 32,
|
||||
ECL_STREAM_SIGNED_BYTES = 64,
|
||||
ECL_STREAM_C_STREAM = 128,
|
||||
ECL_STREAM_MIGHT_SEEK = 256
|
||||
ECL_STREAM_LITTLE_ENDIAN = 128,
|
||||
ECL_STREAM_C_STREAM = 256,
|
||||
ECL_STREAM_MIGHT_SEEK = 512
|
||||
};
|
||||
|
||||
typedef int (*cl_eformat_encoder)(cl_object stream, unsigned char *buffer, int c);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue