summaryrefslogtreecommitdiff
path: root/libguile/print.h
Commit message (Expand)AuthorAgeFilesLines
* Simplify string, symbol, char display/write impls...* libguile/print.h: * libguile/print.c: Use the new routines from ports.[ch]. Andy Wingo2016-05-301-2/+0
* Merge remote-tracking branch 'origin/stable-2.0'...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 Mark H Weaver2012-10-301-1/+4
|\
| * Optimize `scm_lfwrite_substr', used by `scm_simple_format'....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'. Ludovic Courtès2012-08-201-1/+4
* | optimize symbol printing...* 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. Andy Wingo2012-03-061-2/+1
|/
* Factorize and optimize `write' for strings and characters....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'. Ludovic Courtès2010-09-141-2/+1
* Add full Unicode capability to ports and the default reader...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 Michael Gran2009-08-251-1/+2
* Add initial support for wide symbols...* 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 Michael Gran2009-08-211-0/+1
* Make scm_charprint and scm_i_string_wide_chars SCM_INTERNAL....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. Michael Gran2009-08-101-1/+1
* Add Unicode strings and symbols...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 Michael Gran2009-08-081-0/+1
* Change Guile license to LGPLv3+...(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* ) Neil Jerram2009-06-171-6/+7
* Add `SCM_INTERNAL' macro, use it.Ludovic Courtès2008-05-311-3/+3
* * backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c...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. Han-Wen Nienhuys2007-01-221-9/+0
* merge from 1.8 branchKevin Ryde2006-04-171-1/+1
* (SCM_PRINT_KEYWORD_STYLE_I, SCM_PRINT_KEYWORD_STYLE):...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. Marius Vollmer2005-09-041-1/+3
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
* (scm_print_state, SCM_PRINT_STATE_LAYOUT):...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. Marius Vollmer2005-01-071-4/+4
* (scm_uintprint): New, for printing scm_t_uintmax values....(scm_intprint): Argument type changed to scm_t_intmax. Marius Vollmer2004-10-221-1/+2
* (SCM_PRINT_HIGHLIGHT_PREFIX,...SCM_PRINT_HIGHLIGHT_SUFFIX): New printer options. (scm_iprin1): Use them instead of the previoulsy hardcoded strings. (scm_init_print): Initialize them. Marius Vollmer2004-09-291-3/+5
* * print.h (scm_print_state): Added highlight_objects....* 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. Marius Vollmer2004-09-231-2/+3
* * tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into...deprecated.h. Replaced all uses with scm_is_eq. Marius Vollmer2004-07-271-2/+2
* * backtrace.c (scm_display_error_message): Introduced fancy...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. Mikael Djurfeldt2003-05-121-1/+2
* 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 "~%". Signal...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. Marius Vollmer2001-05-301-0/+1
* * validate.h...(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 Michael Livshin2001-05-241-1/+1
* * 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++...commentaries to C. Mikael Djurfeldt2000-03-201-1/+1
* * *.[hc]: add Emacs magic at the end of file, to ensure GNU... indentation style. Michael Livshin2000-03-191-0/+6
* *.[ch]: make a distinction between SCM as a generic...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), Greg J. Badros2000-03-091-1/+2
* * list.c: Moved append docs to append! Thanks Dirk Hermann. Also,...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! Greg J. Badros2000-03-021-18/+18
* * dynl.c, error.c, eval.c, feature.c, filesys.c, fports.c, list.c, load.c,...net_db.c, read.c, socket.c: Update error messages to use ~A for %s, ~S for %S to work with new `simple-format' format and be standardized better. * print.h, print.c (scm_simple_format): Added `simple-format' primitive. It's the old scm_display_error, with ARGS now a rest parameter, and the destination first instead of last (and a couple new capabilities inspired by `format' -- #t as destination means current-output-port, #f means return the formatted text as a string. * gh.h, gh_data.c, ports.h, ports.c: Added some missing const specifications. * backtrace.c (scm_display_error_message): Rewrote to use scm_simple_format() procedure. * __scm.h: Added commented-out #define of GUILE_DEBUG_FREELIST Greg J. Badros2000-01-111-0/+1
* * *.h: Use SCM_NIMP(X) && in all the FOOP macros....* *.[ch]: Use do { ... } while (0) idiom in macros that expanded to a bare block. Greg J. Badros1999-12-161-3/+6
* * print.h (SCM_PORT_WITH_PS_P, SCM_PORT_WITH_PS_PORT,...SCM_PORT_WITH_PS_PS): Represent ports with print states as a smob instead of a pair of a port and a print state. We'll need to cons once extra in scm_printer_apply but the type system will be cleaner, it will mix better with GOOPS, and, it will be even more transparent to the user. Mikael Djurfeldt1999-08-241-4/+10
* * __scm.h, alist.c, async.c, async.h, backtrace.h, chars.c,...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. Jim Blandy1998-10-191-1/+1
* Warning fixes from Greg Harvey:...* unif.c (scm_array_set_x): initializer for pos * throw.c (scm_ithrow): added initializer for jmpbuf (SCM_UNDEFINED) * struct.c (scm_struct_ref, scm_struct_set_x): Added initializers for field_type, since EGCS so desparately wants to play dumb * debug.h (scm_make_gloc, scm_gloc_p, scm_make_iloc, scm_memcons, scm_mem_to_proc, scm_proc_to_mem, scm_debug_hang): Added prototypes when GUILE_DEBUG is defined. * dynwind.h (scm_wind_chain): Same. * ports.h (scm_pt_size, scm_pt_member): Same. * print.h (scm_current_pstate): Same. * procs.h (scm_make_cclo): Same. Jim Blandy1998-10-151-0/+3
* * print.h (SCM_COERCE_OUTPORT): Check that the object is a pair...before taking the CDR. Mikael Djurfeldt1997-12-041-1/+3
* * print.h (SCM_COERCE_OPORT): Renamed to SCM_COERCE_OUTPORT. An...OPORT is an `open' port, not an output port. Marius Vollmer1997-10-251-3/+3
* 1997-10-03 Mikael Djurfeldt <mdj@nada.kth.se>... * print.h (SCM_PRINT_STATE_P): Removed SCM_NIMP test. (NIMP macros should by convention not test for NIMPness.) (SCM_COERCE_OPORT): Adjust indentation. * print.c (scm_valid_oport_value_p): Adjusted indentation; Added SCM_NIMP test before SCM_PRINT_STATE_P. * struct.c, struct.h, gc.c: Renamed: scm_struct_i_layout --> scm_vtable_index_layout scm_struct_i_vcell --> scm_vtable_index_vcell scm_struct_i_vtable --> scm_vtable_index_vtable scm_struct_i_printer --> scm_vtable_index_printer scm_struct_i_vtable_offset --> scm_vtable_offset_user * struct.c (scm_print_struct): Use new printer slot; Default printing: Also output hex code of vtable so that type identity will be indicated as well. (scm_init_struct): Updated required_vtable_fields to "pruosrpw"; Removed struct_printer_var; Removed struct-vtable-offset; (vtable-index-layout, vtable-index-vtable, vtable-index-printer, vtable-offset-user): New constants. * struct.h (scm_struct_i_vtable_offset): Bumped from 3 to 4. (scm_struct_i_printer, SCM_STRUCT_PRINTER): New slot in vtables. If this slot contains a procedure, use that to print structures of the type represented by this vtable. * print.c (scm_iprin1): Don't print arguments of macro transformers. (They are always: exp env.); Bugfix: Unmemoize transformer source with correct environment. Mikael Djurfeldt1997-10-031-5/+6
* * print.h (SCM_PRINT_STATE_P, SCM_COERCE_OPORT): New macros....(struct scm_print_state) [revealed]: New field. (scm_print_state_vtable): Make visible to the outside world for type checking purposes. (scm_valid_oport_value_p): New prototype. * print.c (scm_valid_oport_value_p): New function to check whether a certain value is acceptable as a port argument. (scm_print_state_vtable): New variable. (scm_free_print_state): Set `revealed' field to false. (scm_iprin1): Call user supplied closure printer with scm_printer_apply. Print in the traditional way when there isn't one or when it returns #f. (scm_prin1, scm_display, scm_write, scm_newline, scm_write_char): Accept a port/print-state pair in addition to just a port. (scm_prin1): Don't return the print_state to the pool when it has been `revealed'. (scm_printer_apply): Set `revealed' field of print_state to true. (scm_init_print): Set scm_print_state_vtable. (print_state_fluid, print_state_fluid_num): Removed. Marius Vollmer1997-10-021-2/+13
* * print.c (scm_iprin1): Enter printed structures into the print...state as nested data while they are printed. (print_state_fluid, print_state_fluid_num): New variables. (scm_init_print): Initialize them. (scm_iprin): If print_state_fluid carries a print_state, use that instead of creating a new one. (scm_printer_apply, apply_stub, struct apply_data): New definitions to help with calling printer functions written in Scheme. * print.h (scm_printer_apply): New prototype. Marius Vollmer1997-07-271-0/+1
* * Lots of files: New address for FSF.Jim Blandy1997-05-261-3/+3
* I think the Sun compiler has chosen a perverse way to interpret...ANSI declarations combined with K&R definitions. We'll appease it a little bit. But when it invades France, we fight. * print.c (scm_iprlist): Change 'tlr' argument to an int. * print.h (scm_iprlist): Here too. * numbers.c (scm_divbigdig): Change definition to match declaration in numbers.h. * unif.c (scm_makflo): Change definition to match declaration in unif.h. Jim Blandy1997-01-071-1/+1
* * print.c (make_print_state, grow_print_state), print.h: Modified...the print state representation: Don't use a tail array for recording of circular references. Resizing of the print state structure invalidates the print state pointer. To avoid passing around an indirect print state reference to all printing functions, we instead let the print state reference a resizable vector. Mikael Djurfeldt1996-10-151-3/+3