| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
* buf.c (bufp): New function.
(buf_init): Registered bufp intrisic.
* buf.h (bufp): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Old style casts have crept into the code base.
* buf.c (make_buf, buf_grow, buf_get_i8, buf_get_u8): Replace
old style cast with macro.
* ffi.c (align_sw_get, align_sw_put, ffi_be_i32_get,
ffi_be_u32_get, ffi_le_i32_put, ffi_le_i32_get,
ffi_le_u32_get, ffi_be_i64_put, ffi_be_i64_get,
ffi_be_u64_get, ffi_le_i64_put, ffi_le_i64_get,
ffi_le_u64_get, ffi_sbit_put, ffi_sbit_get,
ffi_init_extra_types): Likewise.
* hash.c (hash_buf): Likewise.
* itypes.c (c_i32, c_i64, c_u64): Likewise.
* stream.c (stdio_put_buf, stdio_fill_buf): Likewise.
|
|
|
|
| |
* buf.c, ffi.c: Must include <stdarg.h> for va_list.
|
|
|
|
|
|
|
| |
* buf.c (buf_put_bytes): We must extend the buffer based
on looking at the end position of the data transfer,
not the start position, so the buffer is large enough to
old the entire transfer.
|
|
|
|
|
|
|
| |
* buf.c (buf_shrink): If a buffer has zero length,
don't shrink the allocation size all the way down to
zero, because that value indicates a non-resizeable
buffer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Backing out of the scheme of (ptr buf) passing the
address of the internal pointer within buf objects.
Also giving buf in handlers, to prevent the fallback
on get.
* buf.c (buf_addr_of): Function removed.
* buf.h (buf_addr_of): Declaration removed.
* ffi.c (ffi_buf_in, ffi_buf_d_in): New functions.
(ffi_buf_alloc): Function removed.
(ffi_type_compile, ffi_init_types): Remove specialty alloc and
free functions from buffers, so the regular fixed allocator is
used. Give buffers the new in functions.
|
|
|
|
|
|
| |
* buf.c (make_duplicate_buf): A duplicated buf is dynamic,
so the size must not be nil, which indicates a static or
borrowed one. Set the size properly, so finalize will free it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The buf FFI type's alloc virtual should return a pointer to
the buffer's pointer, not the buffer itself.
What's currently going on is something silly, whereby
the pointer to the buffer is stored into the buffer
itself.
* buf.c (buf_addr_of): New function.
* buf.c (buf_addr_of): Declared.
* ffi.c (ffi_buf_alloc): Use buf_addr_of instead of buf_get.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* buf.c (make_duplicate_buf, buf_get, buf_fill): New
functions.
* buf.h (make_duplicate_buf, buf_get, buf_fill): Declared.
* ffi.c (struct txr_ffi_type): New member, nelem.
Keeps track of number of elements, for types that are
FFI pointers. This lets us support the get method so that
a buf can be a C function return value, if its size is
declared in our FFI type system.
(ffi_buf_put, ffi_buf_get, ffi_buf_fill): New functions.
(ffi_type_compile): Handle two new cases of syntax for
buffers: (buf <size>) and buf.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* buf.c (buf_put_float, buf_put_cptr, buf_get_float,
buf_get_cptr, align_float, align_cptr, size_float, size_cptr):
New functions.
(buf_init): Registered intrinsics buf-put-float, buf-put-cptr,
buf-get-float, buf-get-cptr, align-float, align-cptr,
size-float, size_cptr.
* buf.h (buf_put_float, buf_put_cptr, buf_get_float,
buf_get_cptr, align_float, align_cptr, size_float, size_cptr):
Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (unum): New function.
* arith.h (unum): Declared.
* buf.c (buf_get_bytes): New static function.
(buf_get_i8, buf_get_u8, buf_get_i16, buf_get_u16,
buf_get_i32, buf_get_u32, buf_get_i64, buf_get_u64,
buf_get_char, buf_get_uchar, buf_get_short, buf_get_ushort,
buf_get_int, buf_get_uint, buf_get_long, buf_get_ulong,
buf_get_double): Stubs implemented.
|
|
* Makefile (OBJS): New objects itypes.o and buf.o.
* buf.c, buf.h: New files.
* itypes.c, itypes.h: New files.
* lib.c (obj_print_impl): Handle BUF via buf_print and
buf_pprint.
(init): Call itypes_init and buf_init.
* parser.h (end_of_buflit): Declared.
* parser.l (BUFLIT): New exclusive state.
(grammar): New rules for recognizing start of buffer
literal and its interior.
(end_of_buflit): New function.
* parser.y (HASH_B_QUOTE): New token.
(buflit, buflit_items, buflit_item): New nonterminals
and corresponding grammar rules.
(i_expr, n_expr): These symbols now generate a buflit;
a buffer literal is a kind of expression.
(yybadtoken): Handle HASH_B_QUOTE case.
|