summaryrefslogtreecommitdiff
path: root/libguile/fports.h
Commit message (Collapse)AuthorAgeFilesLines
* Avoid throwing exceptions during early boot if stdin is closedAndy Wingo2019-12-131-1/+3
| | | | | | | | * libguile/fports.c (scm_i_fdes_is_valid): New internal helper. (scm_i_fdes_to_port): Use new helper. * libguile/fports.h: Declare new helper. * libguile/init.c (scm_standard_stream_to_port): Refactor to use scm_i_fdes_is_valid.
* 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+.
* 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-1/+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-1/+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 more validate macrosAndy Wingo2018-06-181-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile.h: Add chooks.h. * libguile/Makefile.am: Add chooks.h and chooks.c. * libguile/chooks.c: * libguile/chooks.h: New files, for the C implementation of hooks. Broken out to avoid cycles in gc.h includes. * libguile/gc.h: * libguile/gc.c (scm_i_gc_admin_mutex, scm_i_sweep_mutex): Remove unused mutexes. Include chooks instead of hooks in the main header. * libguile/deprecated.h (scm_gc_running_p): Deprecate this macro always defined to 0. (SCM_VALIDATE_VECTOR_OR_DVECTOR): Deprecate this weird one too. * libguile/array-map.c: Add procs.h include. * libguile/threads.h: * libguile/vm.c: * libguile/r6rs-ports.c: Add smob.h include. * libguile/atomic.h (SCM_VALIDATE_ATOMIC_BOX): Devolve. * libguile/deprecation.c (scm_c_issue_deprecation_warning): Remove use of scm_gc_running_p. * libguile/error.c (scm_error_scm): Remove use of scm_gc_running_p. * libguile/filesys.h (SCM_VALIDATE_DIR) * libguile/fluids.h (SCM_VALIDATE_FLUID) * libguile/fports.h (SCM_VALIDATE_FPORT, SCM_VALIDATE_OPFPORT) * libguile/generalized-arrays.h (SCM_VALIDATE_ARRAY) * libguile/hooks.h (SCM_VALIDATE_HOOK) * libguile/keywords.h (SCM_VALIDATE_KEYWORD) * libguile/ports.h (SCM_VALIDATE_PORT, SCM_VALIDATE_INPUT_PORT) (SCM_VALIDATE_OUTPUT_PORT, SCM_VALIDATE_OPINPORT) (SCM_VALIDATE_OPENPORT, SCM_VALIDATE_OPPORT, SCM_VALIDATE_OPOUTPORT) * libguile/procs.h (SCM_VALIDATE_PROC) * libguile/random.h (SCM_VALIDATE_RSTATE) * libguile/regex-posix.h (SCM_VALIDATE_RGXP) * libguile/stacks.h (SCM_VALIDATE_STACK, SCM_VALIDATE_FRAME) * libguile/strports.h (SCM_VALIDATE_OPOUTSTRPORT) * libguile/struct.h (SCM_VALIDATE_STRUCT SCM_VALIDATE_VTABLE) * libguile/symbols.h (SCM_VALIDATE_SYMBOL) * libguile/variable.h (SCM_VALIDATE_VARIABLE) * libguile/vectors.h (SCM_VALIDATE_VECTOR SCM_VALIDATE_VECTOR_LEN): Devolve. * libguile/validate.h: It's empty now! hooks squish
* Allow garbage collection of revealed file ports.Ludovic Courtès2017-10-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | Reported at <https://bugs.gnu.org/28784>. Discussed at <https://lists.gnu.org/archive/html/guile-devel/2017-10/msg00003.html>. * libguile/fports.c (revealed_ports, revealed_lock): Remove. (scm_revealed_count): Just return 'SCM_REVEALED (port)'. (scm_set_port_revealed_x, scm_adjust_port_revealed_x): Remove REVEALED_PORTS manipulation. (fport_close): Do nothing when SCM_REVEALED (port) > 0. * libguile/fports.h (scm_t_fport): Adjust comment; make 'revealed' unsigned. * libguile/ports.c (do_close): Call 'close_port' instead of 'scm_close_port'. (scm_close_port): Rename to... (close_port): ... this. Add 'explicit' parameter. Clear 'revealed' field when PORT is a file port and EXPLICIT is true. (scm_close_port): Call 'close_port'. * test-suite/tests/ports.test ("close-port & revealed port") ("revealed port fdes not closed"): New tests.
* Elide syscalls in fdes->portAndy Wingo2017-02-141-9/+20
| | | | | | | | | | | | | | | | | | | | * libguile/fports.h (scm_t_fport): Add options field. (SCM_FDES_RANDOM_P): Deprecate. (scm_i_fdes_to_port): Add options argument. * libguile/fports.c (scm_i_fdes_to_port): Add options argument. Only verify FD if SCM_FPORT_OPTION_VERIFY is there. (scm_fdes_to_port, scm_open_file_with_encoding): Adapt to scm_i_fdes_to_port changes. (fport_random_access_p): Don't try to seek if NOT_SEEKABLE option is set. * libguile/deprecated.h: * libguile/deprecated.c (SCM_FDES_RANDOM_P): Deprecate. * NEWS: Add deprecation. * libguile/filesys.c: * libguile/ioext.c: * libguile/posix.c: * libguile/read.c: * libguile/socket.c: Adapt callers.
* Allow mkstemp! to have optional "mode" argumentAndy Wingo2016-07-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * m4/mkstemp.m4: Remove. * lib/mkstemp.c: Remove. * lib/mkostemp.c: New file. * m4/mkostemp.m4: New file. * lib/Makefile.am: * m4/gnulib-cache.m4: * m4/gnulib-comp.m4: Remove mkstemp module, replace with mkostemp. * libguile/fports.h: * libguile/fports.c (scm_i_mode_to_open_flags): Factor out helper to parse mode string to open flags. (scm_open_file_with_encoding): Use the new helper. * libguile/filesys.c: (scm_i_mkstemp): Adapt to take optional second argument, being a mode string. Use mkostemp. (scm_mkstemp): Backwards compatible shim that calls scm_i_mkstemp. * doc/ref/posix.texi: * NEWS: Update. * module/system/base/compile.scm (call-with-output-file/atomic): Pass "wb" as mode, to cause O_BINARY to be added on MinGW.
* Use heap-allocated port types instead of ptobnumsAndy Wingo2016-05-131-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes a limitation on the number of port types, simplifies the API, and removes a central point of coordination. * libguile/ports-internal.h (struct scm_t_port_type): Rename from scm_t_ptob_descriptor, now that it's private. Add GOOPS class fields. (struct scm_t_port): Rename from struct scm_port, especially considering that deprecated.h redefines scm_port using the preprocessor :(. * libguile/ports.h: Add definitions of SCM_PORT and SCM_PORT_TYPE, though the scm_t_port and scm_t_port_type types are incomplete. (SCM_TC2PTOBNUM, SCM_PTOBNUM, SCM_PTOBNAME): Remove, as there are no more typecodes for port types. (scm_c_num_port_types, scm_c_port_type_ref, scm_c_port_type_add_x): Remove. (scm_make_port_type): Return a scm_t_port_type*. All methods adapted to take a scm_t_port_type* instead of a ptobnum. (scm_c_make_port_with_encoding, scm_c_make_port): Take a port type pointer instead of a tag. (scm_new_port_table_entry): Remove; not useful. * libguile/ports.c: Remove things related to the port kind table. Adapt uses of SCM_PORT_DESCRIPTOR / scm_t_ptob_descriptor to use SCM_PORT_TYPE and scm_t_port_type. * libguile/deprecated.c: * libguile/deprecated.h: * libguile/filesys.c: * libguile/fports.c: * libguile/fports.h: * libguile/print.c: * libguile/r6rs-ports.c: * libguile/strports.c: * libguile/strports.h: * libguile/tags.h: * libguile/vports.c: * test-suite/standalone/test-scm-c-read.c: Adapt to change. * libguile/goops.c (scm_class_of, make_port_classes) (scm_make_port_classes, create_port_classes): Adapt to store the classes in the ptob.
* Move setvbuf impl to ports.[ch]Andy Wingo2016-04-041-2/+0
| | | | | | | | * libguile/fports.h (scm_setbuf0): Remove extraneous declaration. * libguile/fports.c: * libguile/ports.c: * libguile/ports.c (scm_setvbuf): Move setvbuf to ports.[ch]. (scm_init_ports): Move _IONBF, _IOLBF, _IOFBF definitions here.
* Merge remote-tracking branch 'origin/stable-2.0'Mark H Weaver2013-04-141-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: GUILE-VERSION libguile/array-map.c libguile/fports.h libguile/gc.h libguile/inline.h libguile/ports.c libguile/ports.h libguile/print.c libguile/r6rs-ports.c libguile/read.c test-suite/tests/00-socket.test
| * Add keyword arguments to file opening procedures.Mark H Weaver2013-04-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/fports.c (scm_open_file_with_encoding): New API function, containing the code previously found in 'scm_open_file', but modified to accept the new 'guess_encoding' and 'encoding' arguments. (scm_open_file): Now just a simple wrapper that calls 'scm_open_file_with_encoding'. (scm_i_open_file): New implementation of 'open-file' that accepts keyword arguments '#:guess-encoding' and '#:encoding', and calls 'scm_open_file_with_encoding'. (scm_init_fports_keywords): New initialization function that gets called after keywords are initialized. * libguile/fports.h (scm_open_file_with_encoding, scm_init_fports_keywords): Add prototypes. * libguile/init.c (scm_i_init_guile): Call 'scm_init_fports_keywords'. * module/ice-9/boot-9.scm: Add enhanced versions of 'open-input-file', 'open-output-file', 'call-with-input-file', 'call-with-output-file', 'with-input-from-file', 'with-output-to-file', and 'with-error-to-file', that accept keyword arguments '#:binary', '#:encoding', and (for input port constructors) '#:guess-encoding'. * doc/ref/api-io.texi (File Ports): Update documentation. * test-suite/tests/ports.test ("keyword arguments for file openers"): Add tests.
* | move revealed-count mechanism to fports.cAndy Wingo2012-02-191-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/fports.c (scm_revealed_count, scm_port_revealed) (scm_set_port_revealed_x, scm_adjust_port_revealed_x): Move these APIs here, and only operate on fports. To keep revealed ports alive, now we will just keep them in a data structure that the GC knows about -- a static list. * libguile/fports.h: Add revealed count to scm_t_fport, and move decls of revealed-count functions here. * libguile/ports.h: * libguile/ports.c: Adapt to change. Remove SCM_REVEALED and SCM_SETREVEALED; since they only apply to fports now, keeping them around would be inviting type errors. (finalize_port): We don't need to worry about resuscitating ports here. * libguile/init.c: Use the scm_set_port_revealed_x function to set the revealed counts on stream ports.
* | refactor tc7 and tc16 checksAndy Wingo2011-10-241-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/tags.h (SCM_HAS_TYP7, SCM_HAS_TYP7S, SCM_HAS_TYP16): New macros. * libguile/bytevectors.h (SCM_BYTEVECTOR_P): * libguile/control.h (SCM_PROMPT_P): * libguile/filesys.h (SCM_DIRP): * libguile/fluids.h (SCM_WITH_FLUIDS_P, SCM_FLUID_P) (SCM_I_DYNAMIC_STATE_P): * libguile/foreign.h (SCM_POINTER_P): * libguile/fports.h (SCM_FPORTP): * libguile/frames.h (SCM_VM_FRAME_P): * libguile/hashtab.h (SCM_HASHTABLE_P): * libguile/inline.h (scm_get_byte_or_eof): * libguile/numbers.h (SCM_REALP, SCM_BIGP, SCM_COMPLEXP, SCM_FRACTIONP): * libguile/objcodes.h (SCM_OBJCODE_P): * libguile/ports.h (SCM_OUTPUT_PORT_P): * libguile/programs.h (SCM_PROGRAM_P): * libguile/smob.h (SCM_SMOB_PREDICATE): * libguile/srfi-14.h (SCM_CHARSETP): * libguile/strings.c (IS_STRING): * libguile/strports.h (SCM_STRPORTP): * libguile/symbols.h (scm_is_symbol): * libguile/variable.h (SCM_VARIABLEP): * libguile/vectors.h (SCM_I_IS_VECTOR, SCM_I_IS_NONWEAK_VECTOR): * libguile/vm-i-system.c (call, tail-call, mv-call) * libguile/vm.h (SCM_VM_P, SCM_VM_CONT_P): * libguile/weak-set.c (SCM_WEAK_SET_P): * libguile/weak-table.c (SCM_WEAK_TABLE_P): * libguile/weak-vector.h (SCM_I_WVECTP): Use them.
* Remove seek/truncate shortcuts to file ports.Ludovic Courtès2009-06-281-3/+1
| | | | | | | | | | | | | | Suggested by Neil. * libguile/fports.c (fport_seek_or_seek64): Rename to `fport_seek ()'. (fport_seek, scm_i_fport_seek, scm_i_fport_truncate): Remove. * libguile/fports.h (scm_i_fport_seek, scm_i_fport_truncate): Remove declarations. * libguile/ports.c (scm_seek): Remove shortcut that would call out to `scm_i_fport_seek ()'. (scm_truncate_file): Likewise.
* 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-5/+5
|
* merge from 1.8 branchKevin Ryde2006-10-091-0/+3
|
* merge from 1.8 branchKevin Ryde2006-04-171-1/+1
|
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
|
* * fports.h, fports.c (scm_i_fdes_to_port): New, likeMarius Vollmer2004-08-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | scm_fdes_to_port, but take mode bits directly instead of as a C string. (scm_i_fdes_to_port): Implement using above. (scm_open_file): Use scm_i_fdes_to_port together with scm_i_mode_bits to avoid accessing internals of SCM string from C. * vports.c (scm_make_soft_port): Use scm_i_fdes_to_port together with scm_i_mode_bits to avoid accessing internals of SCM string from C. * ports.h (scm_i_mode_bits): New, same as scm_mode_bits but with a SCM string as argument. * ports.c (scm_i_void_port): New, like scm_void_port but take mode bits directly instead of C string. (scm_void_port): Implement using above. (scm_sys_make_void_port): Use scm_i_void_port together with scm_i_mode_bits to avoid accessing internals of SCM string. * convert.i.c, backtrace.c, strop.c, strorder.c, strports.c, struct.c, unif.c, ports.c: Use SCM_I_STRING_CHARS, SCM_I_STRING_UCHARS, and SCM_I_STRING_LENGTH instead of SCM_STRING_CHARS, SCM_STRING_UCHARS, and SCM_STRING_LENGTH, respectively. Also, replaced scm_return_first with more explicit scm_remember_upto_here_1, etc, or introduced them in the first place.
* 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-8/+8
|
* * Remove deprecated macros and typenames.Dirk Herrmann2001-08-311-11/+8
| | | | | * Rename header macros to SCM_<filename>_H. * Prefer !SCM_<foo> over SCM_N<foo>.
* * alist.c, arbiters.c, async.h, backtrace.h, boolean.c, chars.c,Martin Grabmüller2001-07-191-1/+1
| | | | | | | | | | | | | | chars.h, continuations.h, debug-malloc.h, dynl.c, feature.c, feature.h, filesys.h, fluids.h, fports.h, gc_os_dep.c, gdb_interface.h, gh_eval.c, gh_funcs.c, gh_io.c, gh_list.c, gh_predicates.c, gsubr.c, gsubr.h, guardians.h, guile-func-name-check.in, guile-snarf-docs-texi.in, guile-snarf-docs.in, guile-snarf.awk.in, guile-snarf.in, hashtab.h, iselect.h, keywords.h, lang.c, list.h, load.h, objprop.c, objprop.h, options.c, options.h, random.h, regex-posix.h, root.c, root.h, script.c, snarf.h, stackchk.c, strerror.c, strop.h, strports.h, threads.h, values.c, values.h, version.c, version.h: Updated copyright notice.
* Remove "face-lift" comment.Thien-Thi Nguyen2001-07-091-2/+0
|
* replace "scm_*_t" with "scm_t_*".Marius Vollmer2001-06-141-5/+5
|
* * validate.hMichael Livshin2001-05-241-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* * Added a file-port? primitive.Dirk Herrmann2001-01-251-0/+1
|
* * Made the port implementations less tightly coupled within guile.Dirk Herrmann2001-01-251-4/+6
|
* *** empty log message ***Gary Houston2001-01-241-1/+0
|
* Updated copyrightsMikael Djurfeldt2000-06-121-1/+1
|
* * Replace SCM_UNPACK_CAR appropriately.Dirk Herrmann2000-05-251-4/+4
| | | | | * Only access cons cells via SCM_{SET}?C[AD]R. * gc.c: Remove unused struct member variable 'valid'.
* * *.[hc]: add Emacs magic at the end of file, to ensure GNUMichael Livshin2000-03-191-0/+6
| | | | indentation style.
* *** empty log message ***Mikael Djurfeldt2000-03-121-3/+3
|
* * async.c, boolean.h, debug.c, dynl.c, dynwind.c, eval.c, eval.h,Mikael Djurfeldt2000-03-121-3/+3
| | | | | | | | | | | feature.h, filesys.h, fluids.h, fports.c, fports.h, gc.c, gc.h, hash.c, keywords.h, macros.c, numbers.c, numbers.h, objects.c, objects.h, options.c, pairs.h, ports.c, ports.h, print.c, procs.h, ramap.c, read.c, smob.c, smob.h, srcprop.h, stacks.c, stacks.h, strports.c, struct.c, struct.h, tag.c, tags.h, throw.c, unif.c, unif.h, variable.h, vectors.h, weaks.c, weaks.h (SCM_SCM, SCM_BITS, SCM_CARBITS): Renamed from SCM_ASSCM, SCM_ASWORD, SCM_CARW).
* *.[ch]: make a distinction between SCM as a genericGreg J. Badros2000-03-091-3/+3
| | | | | | | 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-1/+1
| | | | | | | | | | | | | | 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!
* * *.h: Use SCM_NIMP(X) && in all the FOOP macros.Greg J. Badros1999-12-161-4/+7
| | | | | * *.[ch]: Use do { ... } while (0) idiom in macros that expanded to a bare block.
* *** empty log message ***Mikael Djurfeldt1999-07-241-2/+0
|
* * fports.c, fports.h, gc.c, gdbint.c, ioext.c, ports.c, ports.h,Jim Blandy1999-06-121-9/+1
| | | | | | scmsigs.c, strports.c, vports.c: Install the sources which actually correspond to the changes described below. I got the ChangeLog entries and the patch from two different places...
* * ports.h (scm_port): make read_pos a pointer to const.Jim Blandy1999-06-091-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strports.c: take care of rw_active and rw_randow. fports.c: scm_fport_drain_input: removed. do it all in ports.c. strports.c (scm_mkstrport): check that pos is reasonable. ioext.c (scm_ftell, scm_fseek): use lseek. (SCM_CLEAR_BUFFERS): macro deleted. ioext.c (redirect_port: use ptob fflush, read_flush. ports.h (scm_ptobfuns): add ftruncate. ports.c (scm_newptob): set ftruncate. adjust ptob tables. * ports.c (scm_ftruncate): new procedure. fports.c (local_ftrunate), strports.c (str_ftruncate): new procs. strports.c (st_seek, st_grow_port): new procs. fports.h (scm_port): change size types from int to off_t. ports.c (scm_init_ports): initialise the seek symbols here instead of in ioext.c. strports.c (scm_call_with_output_string): start with an empty string, so seek and ftruncate can be used. * ports.h (scm_ptobfuns): add a read_flush procedure which is the equivalent to fflush for the read buffer. * ports.c (scm_newptob): set read_flush. ports.c (void_port_ptob): set read_flush. fports.c (local_read_flush): new proc. add to ptob. strport.c (st_read_flush): likewise. vport.c (sf_read_flush): likewise. fports.h (struct scm_fport): remove random member. there's nothing left but fdes. leaving it as a struct to allow for future changes. fports.c: replace usage of scm_fport::random with scm_port::rw_random. ports.c: (scm_putc, scm_puts, scm_lfwrite): call the read_flush ptob proc if the read buffer is filled. * fports.h (SCM_FPORT_CLEAR_BUFFERS): rename to SCM_CLEAR_BUFFERS and move to ioext.c. * fports.h (SCM_MAYBE_DRAIN_INPUT): moved to ports.c. use ptob for seek. take ptob instead of fport arg. * fports.h (SCM_FDES_RANDOM_P): new macro. use it in scm_fdes_to_port and scm_redirect_port. * fports.h (SCM_CLEAR_BUFFERS): new macro. * fports.h (SCM_FPORT_FDES): new macro. * posix.c (scm_pipe): use fport buffer. * unif.c: include fports.h instead of genio.h. * fports.c (scm_fdes_wait_for_input, scm_fport_fill_buffer): new procedures. (local_fgetc): use them. (local_ffwrite): use buffer. (local_fgets): use buffer. (scm_setbuf0): deleted. (scm_setvbuf): set the buffer. (scm_setfileno): deleted. (scm_evict_ports): set fdes directly. * (scm_freopen): deleted. doesn't seem useful in Guile. (scm_stdio_to_port): deleted. fports.h (struct scm_fport): add shortbuf member to avoid separate code for unbuffered ports. (SCM_FPORTP, SCM_OPFPORTP, SCM_OPINFPORTP, SCM_OPOUTFPORTP): moved from ports.h. * fports.c, fports.h (scm_fport_drain_input): new procedure. * ports.c (scm_drain_input): call scm_fport_drain_input. * scm_fdes_waiting_p: new procedure. * fports.c (scm_fdes_to_port): allocate read and/or write buffers. (scm_input_waiting_p): check the buffer. (local_fgetc, local_fflush, local_fputc): likewise. * fports.h (scm_fport): read/write_buf,_pos,_buf_end,,_buf_size: new members. * init.c (scm_init_standard_ports): pass fdes instead of FILE *. * * ports.c (scm_drain_input): new procedure. ports.h: prototype. * fports.c (FPORT_READ_SAFE, FPORT_WRITE_SAFE, FPORT_ALL_OKAY, pre_read, pre_write): removed. (local_fputc, local_fputs, local_ffwrite): use write, not stdio. (scm_standard_stream_to_port): change first arg from FILE * to int fdes. (local_fflush): flush fdes, not FILE *. * fports.h (SCM_NOFTELL): removed. * genio.c, ports.c: don't include filesys.h. * genio.c (scm_getc): don't use scm_internal_select if FPORT. do it in fports.c:local_fgetc. * genio.c: don't use SCM_SYSCALL when calling ptob procedures. do it where it's needed in the port smobs. * filesys.c (scm_input_waiting_p): moved to fports.c, stdio buffer support removed. take SCM arg, not FILE *. * filesys.h: prototype moved too. * fports.c (scm_fdes_to_port): new procedure. (local_fgetc): use read not fgetc. (local_fclose): use close, not fclose. (local_fgets): use read, not fgets * fports.h: prototype for scm_fdes_to_port. * fports.h (scm_fport): new struct. * fports.c (scm_open_file): use open, not fopen. #include fcntl.h * ports.h (struct scm_port_table): change stream from SCM to void *. * ports.c (scm_add_to_port_table): check for memory allocation error. (scm_prinport): remove MSDOS hair. (scm_void_port): set stream to 0 instead of SCM_BOOL_F. (scm_close_port): don't throw errors: do it in fports.c.
* * __scm.h, alist.c, async.c, async.h, backtrace.h, chars.c,Jim Blandy1998-10-191-1/+1
| | | | | | | | | | | | | | | | | | | continuations.c, debug.c, debug.h, dynl-dl.c, dynl.c, dynl.h, dynwind.c, dynwind.h, eq.c, error.c, error.h, eval.c, eval.h, feature.c, filesys.c, filesys.h, fports.c, fports.h, gc.c, gc.h, genio.c, genio.h, gh.h, gh_data.c, gsubr.c, gsubr.h, hash.c, hashtab.c, init.c, init.h, ioext.c, ioext.h, kw.c, libguile.h, list.c, list.h, load.c, load.h, mallocs.c, markers.c, mit-pthreads.c, net_db.c, numbers.c, numbers.h, options.c, ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c, procprop.h, procs.c, procs.h, ramap.c, ramap.h, regex-posix.c, regex-posix.h, root.c, root.h, scmsigs.c, scmsigs.h, script.c, script.h, simpos.c, simpos.h, smob.c, smob.h, snarf.h, socket.c, srcprop.c, stackchk.c, stackchk.h, stacks.c, stime.c, stime.h, strings.c, strings.h, strports.c, struct.c, struct.h, symbols.c, symbols.h, tags.h, threads.c, throw.h, unif.c, variable.c, vectors.c, vectors.h, version.h, vports.c, weaks.c: Update copyright years.
* * fports.h (scm_setbuf0, scm_setvbuf, scm_setfileno,Jim Blandy1998-10-091-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | scm_evict_ports, scm_open_file, scm_stdio_to_port): Get rid of SCM_P macro. Centralize the creation of port objects based on stdio FILE * in fports.c; don't just throw them together anywhere. * fports.c (scm_stdio_to_port): Make NAME a SCM value, which is what the rest of Guile wants. Don't set the revealed count; that's only appropriate for stdin, stdout, stderr. (scm_standard_stream_to_port): This function does set the revealed count. * init.c (scm_init_standard_ports): Use scm_standard_stream_to_port, not scm_stdio_to_port. * filesys.c (scm_open): Call scm_stdio_to_port; don't write it out. * fports.c (scm_open_file): Same. * posix.c (scm_pipe): Same. * socket.c (scm_sock_fd_to_port): Same. * ioext.c (scm_fdopen): Same. (scm_freopen): Moved from here to... * fports.c (scm_freopen): ... here. This is really something that munges the internals of an fport, so it should go here. * fports.h (scm_stdio_to_port): Adjust prototype. (scm_standard_stream_to_port, scm_freopen): New protoypes. * ioext.h (scm_freopen): Prototype removed.
* * ioext.h: fix up prototypes.Gary Houston1997-07-291-0/+2
| | | | | | | | | | | | | | | | | | | * ioext.c (scm_dup_to_fdes): renamed from scm_primitive_dup2. Scheme name is now dup->fdes. (scm_dup_to_fdes): make the second argument optional and fold in the functionality of scm_primitive_dup. (scm_primitive_dup): deleted. * fports.h (SCM_P): prototypes for scm_setvbuf, scm_setfileno. * fports.c (scm_setbuf0): don't disable the setbuf if MSDOS or ultrix are defined. Use setvbuf instead of setbuf. (scm_setvbuf): new procedure. (scm_init_fports): intern _IOFBF, _IOLBF, _IONBF. (scm_setfileno): moved from ioext.c. (scm_fgets): cast SCM_STREAM to (FILE *), remove unused lp variable. (top of file): Delete 25 lines of probably obsolete CPP hair for MSDOS. * boot-9.scm (move->fdes, dup->port): use dup->fdes, not primitive-dup. (dup->fdes): deleted, now done in C.
* * fluids.c (next_fluid_num): don't doGary Houston1997-07-201-2/+1
| | | | | | | | | | | | | | | | | | | | SCM_THREAD_CRITICAL_SECTION_START/END unless USE_THREADS is defined. * ports.h: prototypes too. * ports.c (scm_mode_bits, scm_port_mode): moved from fports.c. * fports.h: prototype too. * fports.c (scm_evict_ports): moved from ioext.c. * ports.c (scm_close_port): return a boolean instead of unspecified. throw an error if an error other than EBADF occurs. * filesys.h: scm_close prototype. * filesys.c (scm_close): new procedure, can close file descriptors and ports (scsh compatible). * ports.c (scm_flush_all_ports): SCM_PROC incorrectly allowed an optional argument.
* * Lots of files: New address for FSF.Jim Blandy1997-05-261-3/+3
|