summaryrefslogtreecommitdiff
path: root/libguile/print.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove the 'simple vector' conceptDaniel Llorens2021-08-161-1/+1
| | | | | | | | | | | | | | * Deprecate scm_is_simple_vector. * libguile/vectors.c (scm_vector_elements, scm_vector_writable_elements): These functions take an array; reword to make this clear. * libguile/print.h: Remove reference to 'simple vector'. * doc/ref/api-data.texi: Remove documentation for scm_is_simple_vector. Remove references to 'simple vector'. Fix documentation for scm_vector_elements, scm_vector_writable_elements. * test-suite/tests/arrays.test: * test-suite/tests/vectors.test: Remove references to 'simple vector'.
* Replace uses of scm_t_int8, scm_t_uintmax, etc with stdint typesAndy Wingo2018-06-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/bitvectors.c: * libguile/bitvectors.h: * libguile/bytevectors.c: * libguile/bytevectors.h: * libguile/chars.c: * libguile/continuations.c: * libguile/control.c: * libguile/conv-integer.i.c: * libguile/conv-uinteger.i.c: * libguile/dynstack.c: * libguile/dynstack.h: * libguile/foreign.c: * libguile/frames.c: * libguile/frames.h: * libguile/gc-inline.h: * libguile/gc.h: * libguile/gsubr.c: * libguile/gsubr.h: * libguile/hash.c: * libguile/i18n.c: * libguile/instructions.c: * libguile/intrinsics.c: * libguile/intrinsics.h: * libguile/loader.c: * libguile/loader.h: * libguile/numbers.c: * libguile/numbers.h: * libguile/pairs.c: * libguile/ports-internal.h: * libguile/ports.c: * libguile/ports.h: * libguile/posix.c: * libguile/print.c: * libguile/print.h: * libguile/programs.c: * libguile/programs.h: * libguile/r6rs-ports.c: * libguile/random.c: * libguile/random.h: * libguile/scm.h: * libguile/socket.c: * libguile/srfi-4.c: * libguile/srfi-4.h: * libguile/stacks.c: * libguile/stime.c: * libguile/strings.c: * libguile/struct.c: * libguile/struct.h: * libguile/symbols.c: * libguile/threads.c: * libguile/threads.h: * libguile/uniform.c: * libguile/vm-engine.c: * libguile/vm.c: * libguile/vm.h: * libguile/vports.c: * test-suite/standalone/test-conversion.c: * test-suite/standalone/test-ffi-lib.c: * test-suite/standalone/test-scm-take-u8vector.c: * test-suite/standalone/test-srfi-4.c: Replace e.g. scm_t_uint8 with uint8_t.
* Update license notices in all C filesAndy Wingo2018-06-201-17/+17
| | | | | Update to newest recommended license notices from the FSF. Everything stays LGPLv3+ except guile-readline which is GPLv3+.
* libguile header files have uniform format for copyright declarationsAndy Wingo2018-06-201-2/+2
|
* Remove (C) from copyright statementsAndy Wingo2018-06-201-1/+1
| | | | | | As the FSF advises, 'There is no legal significance to using the three-character sequence “(C)”, but it does no harm.' It does take up space though! For that reason, we remove it here from our C files.
* Rename __scm.h to scm.hAndy Wingo2018-06-201-2/+0
| | | | * libguile/scm.h: Rename. Update all includers.
* Remove Emacs local variables comments in Guile sourceAndy Wingo2018-06-201-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .dir-locals.el file in the repository is sufficient for Emacs users. * libguile/__scm.h: * libguile/alist.c: * libguile/alist.h: * libguile/array-handle.c: * libguile/array-handle.h: * libguile/array-map.c: * libguile/array-map.h: * libguile/arrays.c: * libguile/arrays.h: * libguile/async.c: * libguile/async.h: * libguile/backtrace.c: * libguile/backtrace.h: * libguile/bitvectors.c: * libguile/bitvectors.h: * libguile/boolean.c: * libguile/boolean.h: * libguile/chars.c: * libguile/chars.h: * libguile/chooks.c: * libguile/chooks.h: * libguile/continuations.c: * libguile/continuations.h: * libguile/control.c: * libguile/conv-integer.i.c: * libguile/debug-malloc.h: * libguile/debug.c: * libguile/debug.h: * libguile/deprecation.c: * libguile/deprecation.h: * libguile/dynl.c: * libguile/dynl.h: * libguile/dynstack.c: * libguile/dynstack.h: * libguile/dynwind.c: * libguile/dynwind.h: * libguile/eq.c: * libguile/eq.h: * libguile/error.c: * libguile/error.h: * libguile/eval.c: * libguile/eval.h: * libguile/evalext.c: * libguile/evalext.h: * libguile/expand.c: * libguile/expand.h: * libguile/extensions.c: * libguile/extensions.h: * libguile/feature.c: * libguile/feature.h: * libguile/filesys.c: * libguile/filesys.h: * libguile/fluids.c: * libguile/fluids.h: * libguile/foreign.c: * libguile/fports.c: * libguile/fports.h: * libguile/frames.c: * libguile/frames.h: * libguile/gc-inline.h: * libguile/gc.c: * libguile/gc.h: * libguile/generalized-arrays.c: * libguile/generalized-arrays.h: * libguile/generalized-vectors.c: * libguile/generalized-vectors.h: * libguile/gettext.c: * libguile/gettext.h: * libguile/goops.c: * libguile/goops.h: * libguile/gsubr.c: * libguile/gsubr.h: * libguile/guardians.c: * libguile/guardians.h: * libguile/guile.c: * libguile/hash.c: * libguile/hash.h: * libguile/hashtab.c: * libguile/hashtab.h: * libguile/hooks.c: * libguile/hooks.h: * libguile/i18n.c: * libguile/i18n.h: * libguile/init.c: * libguile/init.h: * libguile/instructions.c: * libguile/instructions.h: * libguile/intrinsics.c: * libguile/intrinsics.h: * libguile/ioext.c: * libguile/ioext.h: * libguile/iselect.h: * libguile/keywords.c: * libguile/keywords.h: * libguile/list.c: * libguile/list.h: * libguile/load.c: * libguile/load.h: * libguile/loader.c: * libguile/loader.h: * libguile/macros.c: * libguile/macros.h: * libguile/mallocs.c: * libguile/mallocs.h: * libguile/memmove.c: * libguile/memoize.c: * libguile/memoize.h: * libguile/modules.c: * libguile/modules.h: * libguile/net_db.c: * libguile/net_db.h: * libguile/null-threads.c: * libguile/null-threads.h: * libguile/numbers.c: * libguile/numbers.h: * libguile/objprop.c: * libguile/objprop.h: * libguile/options.c: * libguile/options.h: * libguile/pairs.c: * libguile/pairs.h: * libguile/poll.c: * libguile/poll.h: * libguile/ports.c: * libguile/ports.h: * libguile/posix.c: * libguile/posix.h: * libguile/print.c: * libguile/print.h: * libguile/procprop.c: * libguile/procprop.h: * libguile/procs.c: * libguile/procs.h: * libguile/programs.c: * libguile/programs.h: * libguile/promises.c: * libguile/promises.h: * libguile/pthread-threads.h: * libguile/random.c: * libguile/random.h: * libguile/rdelim.c: * libguile/rdelim.h: * libguile/read.c: * libguile/read.h: * libguile/regex-posix.c: * libguile/regex-posix.h: * libguile/rw.c: * libguile/rw.h: * libguile/scmsigs.c: * libguile/scmsigs.h: * libguile/script.c: * libguile/script.h: * libguile/simpos.c: * libguile/simpos.h: * libguile/smob.c: * libguile/smob.h: * libguile/snarf.h: * libguile/socket.c: * libguile/socket.h: * libguile/sort.c: * libguile/sort.h: * libguile/srcprop.c: * libguile/srcprop.h: * libguile/stackchk.c: * libguile/stackchk.h: * libguile/stacks.c: * libguile/stacks.h: * libguile/stime.c: * libguile/stime.h: * libguile/strerror.c: * libguile/strings.c: * libguile/strings.h: * libguile/strorder.c: * libguile/strorder.h: * libguile/strports.c: * libguile/strports.h: * libguile/struct.c: * libguile/struct.h: * libguile/symbols.c: * libguile/symbols.h: * libguile/syntax.c: * libguile/syscalls.h: * libguile/tags.h: * libguile/threads.c: * libguile/threads.h: * libguile/throw.c: * libguile/throw.h: * libguile/trees.h: * libguile/unicode.c: * libguile/unicode.h: * libguile/uniform.c: * libguile/uniform.h: * libguile/values.c: * libguile/values.h: * libguile/variable.c: * libguile/variable.h: * libguile/vectors.c: * libguile/vectors.h: * libguile/version.c: * libguile/vm-engine.c: * libguile/vm-expand.h: * libguile/vm.c: * libguile/vm.h: * libguile/vports.c: * libguile/vports.h: * libguile/weak-list.h: * libguile/weak-set.c: * libguile/weak-set.h: * libguile/weak-table.c: * libguile/weak-table.h: * libguile/weak-vector.c: * libguile/weak-vector.h: Remove needless trailing comments.
* Remove useless "classes: h_files" from Guile headers.Andy Wingo2018-06-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/__scm.h: * libguile/alist.h: * libguile/array-handle.h: * libguile/array-map.h: * libguile/arrays.h: * libguile/async.h: * libguile/backtrace.h: * libguile/bitvectors.h: * libguile/boolean.h: * libguile/chars.h: * libguile/chooks.h: * libguile/continuations.h: * libguile/debug-malloc.h: * libguile/debug.h: * libguile/deprecation.h: * libguile/dynl.h: * libguile/dynstack.h: * libguile/dynwind.h: * libguile/eq.h: * libguile/error.h: * libguile/eval.h: * libguile/evalext.h: * libguile/expand.h: * libguile/extensions.h: * libguile/feature.h: * libguile/filesys.h: * libguile/fluids.h: * libguile/fports.h: * libguile/gc-inline.h: * libguile/gc.h: * libguile/generalized-arrays.h: * libguile/generalized-vectors.h: * libguile/gettext.h: * libguile/goops.h: * libguile/gsubr.h: * libguile/guardians.h: * libguile/hash.h: * libguile/hashtab.h: * libguile/hooks.h: * libguile/i18n.h: * libguile/init.h: * libguile/inline.h: * libguile/ioext.h: * libguile/iselect.h: * libguile/keywords.h: * libguile/list.h: * libguile/load.h: * libguile/macros.h: * libguile/mallocs.c: * libguile/mallocs.h: * libguile/memoize.h: * libguile/modules.h: * libguile/net_db.h: * libguile/null-threads.h: * libguile/numbers.h: * libguile/objprop.h: * libguile/options.h: * libguile/pairs.h: * libguile/poll.h: * libguile/ports.h: * libguile/posix-w32.h: * libguile/posix.h: * libguile/print.h: * libguile/procprop.h: * libguile/procs.h: * libguile/promises.h: * libguile/pthread-threads.h: * libguile/random.h: * libguile/rdelim.h: * libguile/read.h: * libguile/regex-posix.h: * libguile/rw.h: * libguile/scmsigs.h: * libguile/script.h: * libguile/simpos.h: * libguile/smob.h: * libguile/snarf.h: * libguile/socket.h: * libguile/sort.h: * libguile/srcprop.h: * libguile/stackchk.h: * libguile/stacks.h: * libguile/stime.h: * libguile/strings.h: * libguile/strorder.h: * libguile/strports.h: * libguile/struct.h: * libguile/symbols.h: * libguile/syscalls.h: * libguile/tags.h: * libguile/threads.h: * libguile/throw.h: * libguile/trees.h: * libguile/unicode.h: * libguile/uniform.h: * libguile/values.h: * libguile/variable.h: * libguile/vectors.h: * libguile/vports.h: * libguile/weak-list.h: * libguile/weak-set.h: * libguile/weak-table.h: * libguile/weak-vector.h: Remove "classes: h_files". Reformat copyrights if needed.
* Devolve gc.hAndy Wingo2018-06-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | * libguile/_scm.h: Remove gc.h. * libguile/arrays.h: * libguile/bytevectors.h: * libguile/foreign.h: * libguile/fports.h: * libguile/frames.h: * libguile/hashtab.h: * libguile/modules.h: * libguile/numbers.h: * libguile/print.h: * libguile/programs.h: * libguile/smob.h: * libguile/snarf.h: * libguile/strports.h: * libguile/struct.h: * libguile/symbols.h: * libguile/variable.h: * libguile/vectors.h: * libguile/vm.h: Add gc.h to users of scm_cell_* interfaces. Not really visible right now given that e.g. numbers.h is already included in _scm.h.
* Devolve pairs.hAndy Wingo2018-06-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/_scm.h: Remove pairs.h. * libguile/alist.c: * libguile/array-handle.c: * libguile/array-map.c: * libguile/arrays.c: * libguile/async.c: * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/chars.c: * libguile/continuations.c: * libguile/control.c: * libguile/debug.c: * libguile/deprecation.c: * libguile/dynwind.c: * libguile/eq.c: * libguile/eval.c: * libguile/evalext.c: * libguile/expand.c: * libguile/fdes-finalizers.c: * libguile/feature.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/fports.c: * libguile/gc.c: * libguile/generalized-arrays.c: * libguile/goops.c: * libguile/guardians.c: * libguile/hash.c: * libguile/hashtab.c: * libguile/hooks.c: * libguile/i18n.c: * libguile/instructions.c: * libguile/ioext.c: * libguile/keywords.c: * libguile/list.c: * libguile/load.c: * libguile/loader.c: * libguile/memoize.c: * libguile/modules.c: * libguile/net_db.c: * libguile/numbers.c: * libguile/objprop.c: * libguile/options.c: * libguile/ports-internal.h: * libguile/ports.c: * libguile/posix.c: * libguile/print.c: * libguile/print.h: * libguile/procprop.c: * libguile/programs.c: * libguile/random.c: * libguile/rdelim.c: * libguile/read.c: * libguile/regex-posix.c: * libguile/scmsigs.c: * libguile/script.c: * libguile/socket.c: * libguile/sort.c: * libguile/srcprop.c: * libguile/srfi-1.c: * libguile/srfi-13.c: * libguile/srfi-14.c: * libguile/srfi-60.c: * libguile/stacks.c: * libguile/stime.c: * libguile/strings.c: * libguile/strorder.c: * libguile/struct.c: * libguile/symbols.c: * libguile/threads.c: * libguile/throw.c: * libguile/trees.c: * libguile/values.c: * libguile/vectors.c: * libguile/vm.c: * libguile/weak-list.h: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Add pairs.h.
* More validate.h devolutionAndy Wingo2018-06-181-2/+12
| | | | | | | | | | | | * libguile/validate.h: * libguile/alist.h (SCM_VALIDATE_ALISTCELL, SCM_VALIDATE_ALISTCELL_COPYSCM) * libguile/bytevectors.h (SCM_VALIDATE_BYTEVECTOR) * libguile/chars.h (SCM_VALIDATE_CHAR, SCM_VALIDATE_CHAR_COPY): * libguile/print.h (SCM_VALIDATE_OPORT_VALUE, SCM_VALIDATE_PRINTSTATE): * libguile/procs.h (SCM_VALIDATE_THUNK) * libguile/smob.h (SCM_VALIDATE_SMOB) * libguile/strings.h (SCM_VALIDATE_STRING): Devolve these macros from validate.h.
* Replace "pr" struct fields with "pw" fieldsAndy Wingo2017-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/struct.h (SCM_VTABLE_BASE_LAYOUT): Layout is a "pr" field. * module/ice-9/boot-9.scm (record-type-vtable): Record vtable fields are writable. (<parameter>): "pw" fields. * module/oop/goops.scm (<class>, %compute-layout): <read-only> fields are "pw" underneath. * module/rnrs/records/procedural.scm (record-type-vtable) (record-constructor-vtable, make-record-type-descriptor): Use "pw" fields in vtables. * module/srfi/srfi-35.scm (%condition-type-vtable) (struct-layout-for-condition): "pw" fields in vtables. * test-suite/tests/goops.test: * test-suite/tests/structs.test: Use "pw" fields only. * benchmark-suite/benchmarks/structs.bm: Update for make-struct/no-tail, to use pw fields, and also to remove useless tests that the compiler would optimize away. * doc/ref/api-data.texi (Vtables): Add a note about the now-vestigial permissions character and update documentation. (Structure Basics, Meta-Vtables): Update examples. * libguile/hash.c (scm_i_struct_hash): Remove code that would handle opaque/self fields. * libguile/print.h (SCM_PRINT_STATE_LAYOUT): Use "pw" fields. * libguile/struct.c (scm_struct_init): Simplify check for hidden fields. * libguile/values.c (scm_init_values): Field is "pw".
* Deprecate struct "self" slotsAndy Wingo2017-09-221-2/+2
| | | | | | | | | | | | | | | | * libguile/print.h (SCM_PRINT_STATE_LAYOUT): Use a normal slot instead of a self slot. * libguile/print.c (make_print_state): Initialize "handle" slot manually. * libguile/struct.c (issue_deprecation_warning_for_self_slots): New helper, called when making vtables to issue deprecation warnings for "self" slots. Avoids warning for the "self" slot that's part of the fixed vtable slots. (scm_i_struct_inherit_vtable_magic): Call issue_deprecation_warning_for_self_slots. * doc/ref/api-data.texi (Vtables, Structure Basics): Remove references to self slots. * NEWS: Add entry.
* Simplify string, symbol, char display/write implsAndy Wingo2016-05-301-2/+0
| | | | | * libguile/print.h: * libguile/print.c: Use the new routines from ports.[ch].
* Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver2012-10-301-1/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | Moved scm_i_struct_hash from struct.c to hash.c and made it static. The port's alist is now a field of 'scm_t_port'. Conflicts: libguile/arrays.c libguile/hash.c libguile/ports.c libguile/print.h libguile/read.c
| * Optimize `scm_lfwrite_substr', used by `scm_simple_format'.Ludovic Courtès2012-08-201-1/+4
| | | | | | | | | | | | | | | | | | | | Fixes <http://bugs.gnu.org/12033>. Reported by nalaginrut <nalaginrut@gmail.com>. * libguile/print.c (scm_i_display_substring): New function. * libguile/print.h (scm_i_display_substring): New internal declaration. * libguile/ports.c (scm_lfwrite_substr): Use it instead of `scm_display' + `scm_c_substring'.
* | optimize symbol printingAndy Wingo2012-03-061-2/+1
|/ | | | | | | | | | | | | * libguile/print.h: Remove internal declaration of scm_i_print_symbol_name. * libguile/print.c (symbol_has_extended_read_syntax): Optimize to avoid calling symbol_to_string if we know the symbol cannot be mistaken for a number. (print_normal_symbol): Optimize to call display_string directly, instead of jumping through scm_display. (print_symbol): Rename from scm_i_print_symbol_name. (scm_print_symbol_name, iprin1): Adapt to print_symbol name change.
* Factorize and optimize `write' for strings and characters.Ludovic Courtès2010-09-141-2/+1
| | | | | | | | | | | | | | | | | | According to `write.bm', this makes `write' 2.6 times faster for strings. * libguile/print.c (iprin1): Use `write_character' when `SCM_WRITINGP (pstate)' and `SCM_CHARP (exp)' or `scm_is_string (exp)'. (scm_i_charprint): Remove. (display_character, write_character): New functions. (scm_write_char): Use `display_character' instead of `scm_i_charprint'. * libguile/print.h (scm_i_charprint): Remove declaration. * benchmark-suite/benchmarks/write.bm: New file. * benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add `benchmarks/write.bm'.
* Add full Unicode capability to ports and the default readerMichael Gran2009-08-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ports are given two additional properties: a character encoding and a conversion failure strategy. These properties have getters and setters. The new properties are used to convert any locale text to/from the internal representation of strings. If unspecified, ports use a default value. The default value of these properties is held in a fluid. The default character encoding can be modified by calling setlocale. ISO-8859-1 is treated specially. Since it is a native encoding of strings, it can be processed more quickly. Source code is assumed to be ISO-8859-1 unless otherwise specified. The encoding of a source code file can be given as 'coding: XXXXX' in a magic comment at the top of a file. The C functions that deal with encoding often use a null pointer as shorthand for the native Latin-1 encoding, for efficiency's sake. * test-suite/tests/encoding-iso88591.test: new tests * test-suite/tests/encoding-iso88597.test: new tests * test-suite/tests/encoding-utf8.test: new tests * test-suite/tests/encoding-escapes.test: new tests * test-suite/tests/numbers.test: declare 'binary' encoding * test-suite/tests/ports.test: declare 'binary' encoding * test-suite/tests/r6rs-ports.test: declare 'binary' encoding * module/system/base/compile.scm (compile-file): use source-code file's self-declared encoding when compiling files * libguile/strports.c: store string ports in locale encoding (scm_strport_to_locale_u8vector, scm_call_with_output_locale_u8vector) (scm_open_input_locale_u8vector, scm_get_output_locale_u8vector): new functions * libguile/strings.h: new declaration for scm_i_string_contains_char * libguile/strings.c (scm_i_string_contains_char): new function (scm_from_stringn, scm_to_stringn): use NULL for Latin-1 (scm_from_locale_stringn, scm_to_locale_stringn): respect character encoding of input and output ports * libguile/read.h: declaration for scm_scan_for_encoding * libguile/read.c: (read_token): now takes scheme string instead of C string/length (read_complete_token): new function (scm_read_sexp, scm_read_number, scm_read_mixed_case_symbol) (scm_read_number_and_radix, scm_read_quote, scm_read_semicolon_comment) (scm_read_srfi4_vector, scm_read_bytevector, scm_read_guile_bit_vector) (scm_read_scsh_block_comment, scm_read_commented_expression) (scm_read_extended_symbol, scm_read_sharp_extension, scm_read_shart) (scm_read_expression): use scm_t_wchar for char type, use read_complete_token (scm_scan_for_encoding): new function to find a file's character encoding (scm_file_encoding): new function to find a port's character encoding * libguile/rdelim.c: don't unpack strings * libguile/print.h: declaration for modified function scm_i_charprint * libguile/print.c: use locale when printing characters and strings (scm_i_charprint): input parameter is now scm_t_wchar (scm_simple_format): don't unpack strings * libguile/posix.h: new declaration for scm_setbinary. * libguile/posix.c (scm_setlocale): set default and stdio port encodings based on the locale's character encoding (scm_setbinary): new function * libguile/ports.h (scm_t_port): add encoding and failed conversion handler to port type. Declarations for new or modified functions scm_getc, scm_unget_byte, scm_ungetc, scm_i_get_port_encoding, scm_i_set_port_encoding_x, scm_port_encoding, scm_set_port_encoding_x, scm_i_get_conversion_strategy, scm_i_set_conversion_strategy_x, scm_port_conversion_strategy, scm_set_port_conversion_strategy_x. * libguile/ports.c: assign the current ports to zero on startup so we can see if they've been set. (scm_current_input_port, scm_current_output_port, scm_current_error_port): return #f if the port is not yet initialized (scm_new_port_table_entry): set up a new port's encoding and illegal sequence handler based on the thread's current defaults (scm_i_remove_port): free port encoding name when port is removed (scm_i_mode_bits_n): now takes a scheme string instead of a c string and length. All callers changed. (SCM_MBCHAR_BUF_SIZE): new const (scm_getc): new function, since the scm_getc in inline.h is now scm_get_byte_or_eof. This pulls one codepoint from a port. (scm_lfwrite_substr, scm_lfwrite_str): now uses port's encoding (scm_unget_byte): new function, incorportaing the low-level functionality of scm_ungetc (scm_ungetc): uses scm_unget_byte * libguile/numbers.h (scm_t_wchar): compilation order problem with scm_t_wchar being use in functions in multiple headers. Forward declare scm_t_wchar. * libguile/load.c (scm_primitive_load): scan for file encoding at top of file and use it to set the load port's encoding * libguile/inline.h (scm_get_byte_or_eof): new function incorporating most of the functionality of scm_getc. * libguile/fports.c (fport_fill_input): now returns scm_t_wchar * libguile/chars.h (scm_t_wchar): avoid compilation order problem with declaration of scm_t_wchar
* Add initial support for wide symbolsMichael Gran2009-08-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/hash.c (scm_i_string_hash): new function (scm_hasher): don't unpack string: use scm_i_string_hash * libguile/hash.h: new declaration for scm_i_string_hash * libguile/print.c (quote_keywordish_symbol): use symbol accessors (scm_i_print_symbol_name): new function (scm_print_symbol_name): call scm_i_print_symbol_name (iprin1): use scm_i_print_symbol_name to print symbols * libguile/print.h: new declaration for scm_i_print_symbol_name * libguile/symbols.c (lookup_interned_symbol): now takes scheme string instead of c string; callers changed (lookup_interned_symbol): add wide symbol support (scm_i_c_mem2symbol): removed (scm_i_mem2symbol): removed and replaced with scm_i_str2symbol (scm_i_str2symbol): new function (scm_i_mem2uninterned_symbol): removed and replaced with scm_i_str2uninterned_symbol (scm_i_str2uninterned_symbol): new function (scm_make_symbol, scm_string_to_symbol, scm_from_locale_symbol) (scm_from_locale_symboln): use scm_i_str2symbol * test-suite/tests/symbols.test: new tests
* Make scm_charprint and scm_i_string_wide_chars SCM_INTERNAL.Michael Gran2009-08-101-1/+1
| | | | | | | | | | | | Also, scm_charprint is renamed to scm_i_charprint. * libguile/strings.h: make scm_i_string_wide_chars internal. * libguile/print.h: rename scm_charprint to scm_i_charprint. Make internal. * libguile/print.c (scm_i_charprint): renamed from scm_charprint (scm_charprint): renamed to scm_i_charprint. All callers changed.
* Add Unicode strings and symbolsMichael Gran2009-08-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds full Unicode strings as a datatype, and it adds some minimal functionality. The terminal and port encoding is assumed to be ISO-8859-1. Non-ISO-8859-1 characters are written or input as string character escapes. The string character escapes now have 3 forms: \xXX \uXXXX and \UXXXXXX, for unprintable characters that have 2, 4 or 6 hex digits. The process for writing to strings has been modified. There is now a function scm_i_string_start_writing that does the copy-on-write conversion if necessary. To compile strings that may be wide, the VM storage of strings and string-likes has changed. Most string-using functions have not yet been updated and may break when used with wide strings. * module/language/assembly/compile-bytecode.scm (write-bytecode): use variable width string bytecode format * module/language/assembly.scm (byte-length): use variable width bytecode format * libguile/vm-i-loader.c (load-string, load-symbol): (load-keyword, define): use variable-width bytecode format * libguile/vm-engine.h (FETCH_WIDTH): new macro * libguile/strings.h: new declarations * libguile/strings.c (make_wide_stringbuf): new function (widen_stringbuf): new function (scm_i_make_wide_string): new function (scm_i_is_narrow_string): new function (scm_i_string_wide_chars): new function (scm_i_string_start_writing): new function (scm_i_string_ref): new function (scm_i_string_set_x): new function (scm_i_is_narrow_symbol): new function (scm_i_symbol_wide_chars, scm_i_symbol_ref): new function (scm_string_width): new function (unistring_escapes_to_guile_escapes): new function (scm_to_stringn): new function (scm_i_stringbuf_free): modify for wide strings (scm_i_substring_copy): modify for wide strings (scm_i_string_chars, scm_string_append): modify for wide strings (scm_i_make_symbol, scm_to_locale_stringn): modify for wide strings (scm_string_dump, scm_symbol_dump, scm_to_locale_stringbuf): (scm_string, scm_i_deprecated_string_chars): modify for wide strings (scm_from_locale_string, scm_from_locale_stringn): add null test * libguile/srfi-13.c: add calls for scm_i_string_start_writing for each call of scm_i_string_stop_writing (scm_string_for_each): modify for wide strings * libguile/socket.c: add calls for scm_i_string_start_writing for each call of scm_i_string_stop_writing * libguile/rw.c: add calls for scm_i_string_start_writing for each call of scm_i_string_stop_writing * libguile/read.c (scm_read_string): allow reading of wide strings * libguile/print.h: add declaration for scm_charprint * libguile/print.c (iprin1): print wide strings and add new string escapes (scm_charprint): new function * libguile/ports.h: new declarations for scm_lfwrite_substr and scm_lfwrite_str * libguile/ports.c (update_port_lf): new function (scm_lfwrite): use update_port_lf (scm_lfwrite_substr): new function (scm_lfwrite_str): new function * test-suite/tests/asm-to-bytecode.test ("compiler"): add string width byte to sting-like asm tests
* Change Guile license to LGPLv3+Neil Jerram2009-06-171-6/+7
| | | | | | | | | | (Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )
* Add `SCM_INTERNAL' macro, use it.Ludovic Courtès2008-05-311-3/+3
|
* * backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.cHan-Wen Nienhuys2007-01-221-9/+0
| | | | | | | | eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c, read.h, stacks.c, symbols.c, throw.c: use private-options.h * private-options.h: new file: contain hardcoded option definitions.
* merge from 1.8 branchKevin Ryde2006-04-171-1/+1
|
* (SCM_PRINT_KEYWORD_STYLE_I, SCM_PRINT_KEYWORD_STYLE):Marius Vollmer2005-09-041-1/+3
| | | | | | | | | New. (sym_reader): New. (scm_print_opts): Added "quote-keywordish-symbols" option. (quote_keywordish_symbol): New, for evaluating the option. (scm_print_symbol_name): Use it. (scm_init_print): Initialize new option to sym_reader.
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
|
* (scm_print_state, SCM_PRINT_STATE_LAYOUT):Marius Vollmer2005-01-071-4/+4
| | | | | | Removed ref_stack field. (PSTATE_STACK_REF, PSTATE_STACK_SET): New, for accessing the stack of a print state. Use them everywhere instead of ref_stack.
* (scm_uintprint): New, for printing scm_t_uintmax values.Marius Vollmer2004-10-221-1/+2
| | | | (scm_intprint): Argument type changed to scm_t_intmax.
* (SCM_PRINT_HIGHLIGHT_PREFIX,Marius Vollmer2004-09-291-3/+5
| | | | | | | SCM_PRINT_HIGHLIGHT_SUFFIX): New printer options. (scm_iprin1): Use them instead of the previoulsy hardcoded strings. (scm_init_print): Initialize them.
* * print.h (scm_print_state): Added highlight_objects.Marius Vollmer2004-09-231-2/+3
| | | | | | | * print.c (make_print_state, scm_free_print_state): Initialize it to SCM_EOL. (scm_iprin1): Wrap output in '{...}' when object is contained in highlight_objects.
* * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it intoMarius Vollmer2004-07-271-2/+2
| | | | deprecated.h. Replaced all uses with scm_is_eq.
* * backtrace.c (scm_display_error_message): Introduced fancyMikael Djurfeldt2003-05-121-1/+2
| | | | | | | | | | | | | | printing with max level 7 and length 10. (Purpose: avoid printing gigantic objects in error messages.) * print.c, print.h (scm_i_port_with_print_state): New function. * print.c (scm_iprin1, scm_printer_apply, scm_port_with_print_state): Use scm_i_port_with_print_state. (scm_simple_format): Modified not to destroy print states. (print_state_mutex): New mutex. (scm_make_print_state, scm_free_print_state, scm_prin1): Lock/unlock print_state_mutex.
* Changed license terms to the plain LGPL thru-out.Marius Vollmer2003-04-051-35/+11
|
* Prefixed each each exported symbol with SCM_API.Marius Vollmer2001-11-021-25/+25
|
* * Renamed header macros to the SCM_<filename>_H format.Dirk Herrmann2001-08-311-3/+5
|
* Remove "face-lift" comment.Thien-Thi Nguyen2001-07-091-2/+0
|
* replace "scm_*_t" with "scm_t_*".Marius Vollmer2001-06-141-2/+2
|
* * print.c (scm_simple_format): Support "~~" and "~%". SignalMarius Vollmer2001-05-301-0/+1
| | | | | | | | | | | | error for unsupported format controls and for superflous arguments. Thanks to David Skarda! * print.h, print.c (scm_print_symbol_name): Factored out of scm_iprin1. (scm_iprin1): Call it. * print.c (scm_print_symbol_name): Symbols whose name starts with `#' or `:' or ends with `:' are considered weird.
* * validate.hMichael Livshin2001-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,BITS,UBITS,INT,UINT}[_DEF]): new macros. * unif.h: type renaming: scm_array -> scm_array_t scm_array_dim -> scm_array_dim_t the old names are deprecated, all in-Guile uses changed. * tags.h (scm_ubits_t): new typedef, representing unsigned scm_bits_t. * stacks.h: type renaming: scm_info_frame -> scm_info_frame_t scm_stack -> scm_stack_t the old names are deprecated, all in-Guile uses changed. * srcprop.h: type renaming: scm_srcprops -> scm_srcprops_t scm_srcprops_chunk -> scm_srcprops_chunk_t the old names are deprecated, all in-Guile uses changed. * gsubr.c, procs.c, print.c, ports.c, read.c, rdelim.c, ramap.c, rw.c, smob.c, sort.c, srcprop.c, stacks.c, strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c, unif.c, values.c, vectors.c, vports.c, weaks.c: various int/size_t -> size_t/scm_bits_t changes. * random.h: type renaming: scm_rstate -> scm_rstate_t scm_rng -> scm_rng_t scm_i_rstate -> scm_i_rstate_t the old names are deprecated, all in-Guile uses changed. * procs.h: type renaming: scm_subr_entry -> scm_subr_entry_t the old name is deprecated, all in-Guile uses changed. * options.h (scm_option_t.val): unsigned long -> scm_bits_t. type renaming: scm_option -> scm_option_t the old name is deprecated, all in-Guile uses changed. * objects.c: various long -> scm_bits_t changes. (scm_i_make_class_object): flags: unsigned long -> scm_ubits_t * numbers.h (SCM_FIXNUM_BIT): deprecated, renamed to SCM_I_FIXNUM_BIT. * num2integral.i.c: new file, multiply included by numbers.c, used to "templatize" the various integral <-> num conversion routines. * numbers.c (scm_mkbig, scm_big2num, scm_adjbig, scm_normbig, scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl): deprecated. (scm_i_mkbig, scm_i_big2inum, scm_i_adjbig, scm_i_normbig, scm_i_copybig, scm_i_short2big, scm_i_ushort2big, scm_i_int2big, scm_i_uint2big, scm_i_long2big, scm_i_ulong2big, scm_i_bits2big, scm_i_ubits2big, scm_i_size2big, scm_i_ptrdiff2big, scm_i_long_long2big, scm_i_ulong_long2big, scm_i_dbl2big, scm_i_big2dbl, scm_short2num, scm_ushort2num, scm_int2num, scm_uint2num, scm_bits2num, scm_ubits2num, scm_size2num, scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint, scm_num2bits, scm_num2ubits, scm_num2ptrdiff, scm_num2size): new functions. * modules.c (scm_module_reverse_lookup): i, n: int -> scm_bits_t.x * load.c: change int -> size_t in various places (where the variable is used to store a string length). (search-path): call scm_done_free, not scm_done_malloc. * list.c (scm_ilength): return a scm_bits_t, not long. some other {int,long} -> scm_bits_t changes. * hashtab.c: various [u]int -> scm_bits_t changes. scm_ihashx_closure -> scm_ihashx_closure_t (and made a typedef). (scm_ihashx): n: uint -> scm_bits_t use scm_bits2num instead of scm_ulong2num. * gsubr.c: various int -> scm_bits_t changes. * gh_data.c (gh_scm2double): no loss of precision any more. * gh.h (gh_str2scm): len: int -> size_t (gh_{get,set}_substr): start: int -> scm_bits_t, len: int -> size_t (gh_<num>2scm): n: int -> scm_bits_t (gh_*vector_length): return scm_[u]size_t, not unsigned long. (gh_length): return scm_bits_t, not unsigned long. * fports.h: type renaming: scm_fport -> scm_fport_t the old name is deprecated, all in-Guile uses changed. * fports.c (fport_fill_input): count: int -> scm_bits_t (fport_flush): init_size, remaining, count: int -> scm_bits_t * debug.h (scm_lookup_cstr, scm_lookup_soft, scm_evstr): removed those prototypes, as the functions they prototype don't exist. * fports.c (default_buffer_size): int -> size_t (scm_fport_buffer_add): read_size, write_size: int -> scm_bits_t default_size: int -> size_t (scm_setvbuf): csize: int -> scm_bits_t * fluids.c (n_fluids): int -> scm_bits_t (grow_fluids): old_length, i: int -> scm_bits_t (next_fluid_num, scm_fluid_ref, scm_fluid_set_x): n: int -> scm_bits_t (scm_c_with_fluids): flen, vlen: int -> scm_bits_t * filesys.c (s_scm_open_fdes): changed calls to SCM_NUM2LONG to the new and shiny SCM_NUM2INT. * extensions.c: extension -> extension_t (and made a typedef). * eval.h (SCM_IFRAME): cast to scm_bits_t, not int. just so there are no nasty surprises if/when the various deeply magic tag bits move somewhere else. * eval.c: changed the locals used to store results of SCM_IFRAME, scm_ilength and such to be of type scm_bits_t (and not int/long). (iqq): depth, edepth: int -> scm_bits_t (scm_eval_stack): int -> scm_bits_t (SCM_CEVAL): various vars are not scm_bits_t instead of int. (check_map_args, scm_map, scm_for_each): len: long -> scm_bits_t i: int -> scm_bits_t * environments.c: changed the many calls to scm_ulong2num to scm_ubits2num. (import_environment_fold): proc_as_ul: ulong -> scm_ubits_t * dynwind.c (scm_dowinds): delta: long -> scm_bits_t * debug.h: type renaming: scm_debug_info -> scm_debug_info_t scm_debug_frame -> scm_debug_frame_t the old names are deprecated, all in-Guile uses changed. (scm_debug_eframe_size): int -> scm_bits_t * debug.c (scm_init_debug): use scm_c_define instead of the deprecated scm_define. * continuations.h: type renaming: scm_contregs -> scm_contregs_t the old name is deprecated, all in-Guile uses changed. (scm_contregs_t.num_stack_items): size_t -> scm_bits_t (scm_contregs_t.num_stack_items): ulong -> scm_ubits_t * continuations.c (scm_make_continuation): change the type of stack_size form long to scm_bits_t. * ports.h: type renaming: scm_port_rw_active -> scm_port_rw_active_t (and made a typedef) scm_port -> scm_port_t scm_ptob_descriptor -> scm_ptob_descriptor_t the old names are deprecated, all in-Guile uses changed. (scm_port_t.entry): int -> scm_bits_t. (scm_port_t.line_number): int -> long. (scm_port_t.putback_buf_size): int -> size_t. * __scm.h (long_long, ulong_long): deprecated (they pollute the global namespace and have little value besides that). (SCM_BITS_LENGTH): new, is the bit size of scm_bits_t (i.e. of an SCM handle). (ifdef spaghetti): include sys/types.h and sys/stdtypes.h, if they exist (for size_t & ptrdiff_t) (scm_sizet): deprecated. * Makefile.am (noinst_HEADERS): add num2integral.i.c
* * Removed SCM_CDR misuse.Dirk Herrmann2001-05-171-12/+9
|
* Smob-related creanup.Keisuke Nishida2000-12-081-3/+3
|
* Updated copyrightsMikael Djurfeldt2000-06-121-1/+1
|
* Fixed some SCM/scm_bits_t mixups.Dirk Herrmann2000-04-181-1/+1
|
* Lots of fixes to make guile (at some time) compile with strict typing.Dirk Herrmann2000-04-031-2/+2
|
* * print.h, stacks.h, options.c, options.h: Changed C++Mikael Djurfeldt2000-03-201-1/+1
| | | | commentaries to C.
* * *.[hc]: add Emacs magic at the end of file, to ensure GNUMichael Livshin2000-03-191-0/+6
| | | | indentation style.
* *.[ch]: make a distinction between SCM as a genericGreg J. Badros2000-03-091-1/+2
| | | | | | | name for a Scheme object (now a void*), and SCM as 32 bit word for storing tags and immediates (now a long int). Introduced SCM_ASWORD and SCM_ASSCM for conversion. Fixed various dubious code in the process: arbiter.c (use macros), unif.c (scm_array_p),
* * list.c: Moved append docs to append! Thanks Dirk Hermann. Also,Greg J. Badros2000-03-021-18/+18
| | | | | | | | | | | | | | added append docs from R4RS. * strings.c: Docstring typo fix, + eliminate unneeded IMP tests. Thanks Dirk Hermann! * chars.h: Provide SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR and deprecate SCM_ICHRP, SCM_ICHR, SCM_MAKICHR. Thanks Dirk Hermann! * *.h, *.c: Use SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR throughout. Drop use of SCM_P for function prototypes... assume an ANSI C compiler. Thanks Dirk Hermann!