mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-12 23:37:38 +02:00
Add line/column numbers to port type
This commit is contained in:
parent
28952d1056
commit
a9e0d86fea
3 changed files with 9 additions and 3 deletions
2
gc.c
2
gc.c
|
@ -486,6 +486,8 @@ char *gc_copy_obj(object dest, char *obj, gc_thread_data * thd)
|
||||||
hp->fp = ((port_type *) obj)->fp;
|
hp->fp = ((port_type *) obj)->fp;
|
||||||
hp->mode = ((port_type *) obj)->mode;
|
hp->mode = ((port_type *) obj)->mode;
|
||||||
hp->flags = ((port_type *) obj)->flags;
|
hp->flags = ((port_type *) obj)->flags;
|
||||||
|
hp->line_num = ((port_type *) obj)->line_num;
|
||||||
|
hp->col_num = ((port_type *) obj)->col_num;
|
||||||
hp->mem_buf = ((port_type *)obj)->mem_buf;
|
hp->mem_buf = ((port_type *)obj)->mem_buf;
|
||||||
hp->mem_buf_len = ((port_type *)obj)->mem_buf_len;
|
hp->mem_buf_len = ((port_type *)obj)->mem_buf_len;
|
||||||
return (char *)hp;
|
return (char *)hp;
|
||||||
|
|
|
@ -779,8 +779,8 @@ typedef struct {
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int mode;
|
int mode;
|
||||||
unsigned char flags;
|
unsigned char flags;
|
||||||
// TODO: int line_num;
|
unsigned int line_num;
|
||||||
// TODO: int char_num;
|
unsigned int col_num;
|
||||||
char *mem_buf;
|
char *mem_buf;
|
||||||
size_t mem_buf_len;
|
size_t mem_buf_len;
|
||||||
} port_type;
|
} port_type;
|
||||||
|
@ -796,6 +796,8 @@ typedef struct {
|
||||||
p.fp = f; \
|
p.fp = f; \
|
||||||
p.mode = m; \
|
p.mode = m; \
|
||||||
p.flags = 0; \
|
p.flags = 0; \
|
||||||
|
p.line_num = 0; \
|
||||||
|
p.col_num = 0; \
|
||||||
p.mem_buf = NULL; \
|
p.mem_buf = NULL; \
|
||||||
p.mem_buf_len = 0;
|
p.mem_buf_len = 0;
|
||||||
|
|
||||||
|
@ -807,6 +809,8 @@ typedef struct {
|
||||||
p.fp = f; \
|
p.fp = f; \
|
||||||
p.mode = m; \
|
p.mode = m; \
|
||||||
p.flags = 1; \
|
p.flags = 1; \
|
||||||
|
p.line_num = 0; \
|
||||||
|
p.col_num = 0; \
|
||||||
p.mem_buf = malloc(IO_BUF_LEN); \
|
p.mem_buf = malloc(IO_BUF_LEN); \
|
||||||
p.mem_buf_len = 0;
|
p.mem_buf_len = 0;
|
||||||
|
|
||||||
|
|
|
@ -5678,6 +5678,6 @@ void Cyc_import_shared_object(void *data, object cont, object filename, object e
|
||||||
void Cyc_read(void *data, object cont, object port)
|
void Cyc_read(void *data, object cont, object port)
|
||||||
{
|
{
|
||||||
//Cyc_check_port(data, port);
|
//Cyc_check_port(data, port);
|
||||||
port_type *p = (port_type *)port;
|
//port_type *p = (port_type *)port;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue