summaryrefslogtreecommitdiff
path: root/libguile/socket.c
AgeCommit message (Collapse)AuthorFilesLines
2005-01-02Use new vector elements API or simple vector API, as appropriate.Marius Vollmer1-15/+15
Removed SCM_HAVE_ARRAYS ifdefery. Replaced all uses of SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
2004-12-10(scm_from_ipv6): Just use mpz_import. Don't bother tryingKevin Ryde1-59/+10
to fit scm_from_ulong_long, since that uses mpz_import anyway. Don't bother trying to fit scm_from_ulong, not really worth the trouble if addresses are more than 4 bytes usually.
2004-09-22*** empty log message ***Marius Vollmer1-5/+5
2004-08-27(scm_fill_sockaddr): Use HAVE_STRUCT_SOCKADDR_SIN_LEN andKevin Ryde1-4/+2
HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN for sockaddr fields, SIN_LEN and SIN_LEN6 are not defined on all systems. Reported by Michael Tuexen.
2004-08-19* strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,Marius Vollmer1-15/+23
scm_i_string_writable_chars, scm_i_string_stop_writing): New, to replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH. Updated all uses. (scm_i_make_string, scm_c_make_string): New, to replace scm_allocate_string. Updated all uses. (SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS, SCM_STRING_LENGTH): Deprecated. (scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string, scm_str2string, scm_makfrom0str, scm_makfrom0str_opt): Discouraged. Replaced all uses with scm_from_locale_string or similar, as appropriate. (scm_c_string_length, scm_c_string_ref, scm_c_string_set_x, scm_c_substring, scm_c_substring_shared, scm_c_substring_copy, scm_substring_shared, scm_substring_copy): New. * symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC, SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS, SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol, scm_str2symbol, scm_mem2uninterned_symbol): Discouraged. (SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str): Deprecated. (SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS, SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed. (scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln): New, to replace scm_str2symbol and scm_mem2symbol, respectively. Updated all uses. (scm_gensym): Generate only the number suffix in the buffer, just string-append the prefix.
2004-08-17(scm_init_socket): Add SOCK_SEQPACKET and SOCK_RDM.Kevin Ryde1-1/+11
2004-08-12* socket.c (scm_inet_aton, scm_inet_pton): Convert SCM strings toMarius Vollmer1-12/+35
locale strings instead of accessing their internals. (scm_recv, scm_send, scm_recvfrom, scm_sendto): Use SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH instead of SCM_STRING_CHARS and SCM_STRING_LENGTH. * socket.c, rw.c, deprecated.h, validate.h (SCM_VALIDATE_STRING_COPY): Deprecated. Replaced all uses with SCM_VALIDATE_STRING plus SCM_I_STRING_CHARS or scm_to_locale_string, etc. (SCM_VALIDATE_SUBSTRING_SPEC_COPY): Deprecated. Replaced as above, plus scm_i_get_substring_spec.
2004-08-10* stime.c, socket.c, simpos.c, procs.c, posix.c, ports.c,Marius Vollmer1-6/+11
net_db.c, fports.c, filesys.c, eval.c, deprecation.c, dynl.c: Replaced uses of SCM_STRING_CHARS with proper uses of scm_to_locale_string. Replaced SCM_STRINGP with scm_is_string. Replaced scm_mem2string with scm_from_locale_string. * simpos.c, posix.c (allocate_string_pointers, environ_list_to_c): Removed, replaced all uses with scm_i_allocate_string_pointers.
2004-08-02* numbers.h, numbers.c, discouraged.h, discouraged.c (scm_short2num,Marius Vollmer1-26/+29
scm_ushort2num, scm_int2num, scm_uint2num, scm_long2num, scm_ulong2num, scm_size2num, scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int, scm_num2uint, scm_num2long, scm_num2ulong, scm_num2size, scm_num2ptrdiff, scm_long_long2num, scm_ulong_long2num, scm_num2long_long, scm_num2ulong_long): Discouraged by moving to discouraged.h and discouraged.c and reimplementing in terms of scm_from_* and scm_to_*. Changed all uses to the new scm_from_* and scm_to_* functions.
2004-07-23* deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,Marius Vollmer1-38/+38
SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP and SCM_I_INUM, respectively and adding deprecated versions to deprecated.h and deprecated.c. Changed all uses to either use the SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate.
2004-07-10(ipv6_net_to_num, scm_from_ipv6): RenamedMarius Vollmer1-89/+48
ipv6_net_to_num to scm_from_ipv6, for converting from an IPv& byte-wise address to a SCM integer. Changed all uses. (ipv6_num_to_net, scm_to_ipv6): Renamed ipv6_num_to_net to scm_to_ipv6 and added type and range checking, for converting from an IPv& byte-wise address to a SCM integer. Changed all uses. (bignum_in_ipv6_range_p, VALIDATE_INET6): Removed, their function is now done by scm_to_ipv6. * validate.h, deprecated.h (SCM_VALIDATE_INUM, SCM_VALIDATE_INUM_COPY, SCM_VALIDATE_BIGINT, SCM_VALIDATE_INUM_MIN, SCM_VALIDATE_INUM_MIN_COPY, SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF, SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE, SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the fixnum/bignum distinction visible. Changed all uses to scm_to_size_t or similar.
2004-07-08* numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM toMarius Vollmer1-41/+41
SCM_I_MAKINUM and changed all uses.
2004-04-24Add a copyright year, based on the changelog.Kevin Ryde1-1/+1
2004-04-24(VALIDATE_INET6): Correction to bignum_in_ipv6_range_pKevin Ryde1-2/+3
call. Reported by Hyperdivision.
2003-04-16* socket.c: use SCM_CHAR_BIT.Rob Browning1-3/+3
2003-04-07*** empty log message ***Rob Browning1-1/+1
2003-04-05Changed license terms to the plain LGPL thru-out.Marius Vollmer1-36/+12
2003-04-04* socket.c (FLIPCPY_NET_HOST_128): new macro.Rob Browning1-40/+127
(ipv6_net_to_num, ipv6_num_to_net, bignum_in_ipv6_range_p): rewrite to handle GMP bignums.
2003-03-25* win32-socket.c: #include <config.h> if HAVE_CONFIG_H.Rob Browning1-15/+9
* socket.c: #include <config.h> if HAVE_CONFIG_H. Replace usage of uint32 and HAVE_UINT_32 with scm_t_int32.
2002-08-30(scm_addr_vector): Added size of address to arguments. Use it toMarius Vollmer1-7/+14
avoid accessing a non-existent path in a sockaddr_un. Changed all callers.
2002-08-16* mallocs.c (scm_malloc_obj): use scm_gc_malloc in stead ofHan-Wen Nienhuys1-3/+3
malloc. * gc-segment.c (scm_i_get_new_heap_segment): remove cluster cruft: only use SCM_MIN_HEAP_SEG_SIZE. * ports.c (scm_add_to_port_table): add backwards compatibility function * ports.h: use scm_i_ prefix for port table and port table size.
2002-07-21* macros.c: include deprecation.hHan-Wen Nienhuys1-16/+16
* vectors.c (s_scm_vector_move_right_x): remove side effect in macro arg. (s_scm_vector_move_left_x): idem. * net_db.c, posix.c, socket.c: variable naming: change ans to result. * sort.c (scm_merge_vector_x): accept vector as argument iso. SCM*. This is needed for full GC correctness. * gc.h: undo previous undocumented changes related to #ifdef GENGC.
2002-07-202002-07-20 Han-Wen <hanwen@cs.uu.nl>Han-Wen Nienhuys1-41/+40
* *.c: add space after commas everywhere. * *.c: use SCM_VECTOR_SET everywhere, where a vector is written. Document cases where SCM_WRITABLE_VELTS() is used. * vectors.h (SCM_VELTS): prepare for write barrier, and let SCM_VELTS() return a const pointer (SCM_VECTOR_SET): add macro. * autogen.sh (mscripts): find and check version number of autoconf. Complain if 2.53 is not found.
2002-07-10No need to check for Cygwin when including <winsock2.h>, this isMarius Vollmer1-2/+1
already check for by configure. Thus, revert change from 2002-07-07.
2002-07-07Do not include <winsock2.h> on Cygwin even when we have it.Marius Vollmer1-1/+2
2002-03-15Small docstring fixes.Neil Jerram1-1/+1
2002-03-14Retire inclusion guard macro SCM_MAGIC_SNARFER.Thien-Thi Nguyen1-2/+0
2002-01-282002-01-28 Stefan Jahn <stefan@lkcc.org>Stefan Jahn1-0/+3
* configure.in (guile_cv_have_uint32_t): Look also in `stdint.h' for uint32_t. 2002-01-28 Stefan Jahn <stefan@lkcc.org> * symbols.c (scm_c_symbol2str): New function, replacement for `gh_scm2newsymbol()'. * strings.c (scm_c_substring2str): New function. Proper replacement for `gh_get_substr()'. * socket.c: Include `stdint.h' if available for the `uint32_t' declaration. * scmsigs.c (s_scm_sigaction): Initialize `chandler' (inhibits compiler warning). * backtrace.c: Include `lang.h' for GUILE_DEBUG conditional.
2001-11-072001-11-07 Stefan Jahn <stefan@lkcc.org>Stefan Jahn1-0/+8
* configure.in: Include `win32-socket.o' in the list of object files if networking is enabled on Win32. 2001-11-07 Stefan Jahn <stefan@lkcc.org> * win32-socket.[ch]: New files. Defines Winsock-API error codes and makes them available through Guile. That is because the Winsock-API does not store its errors in `errno' and thus cannot return error messages via `strerror (errno)'. * socket.c (scm_init_socket): Initialize `win32-socket' part here under M$-Windows. * numbers.h: Added missing declaration of `scm_sys_check_number_conversions()'. * error.c: Local definition of SCM_I_STRERROR and SCM_I_ERRNO and use in `(strerror)' and `(system-error)'. * Makefile.am (EXTRA_libguile_la_SOURCES): Added `win32-socket.[ch]' to extra source and header files.
2001-08-31* Removed lots of deprecated stuff.Dirk Herrmann1-1/+0
2001-07-09Remove "face-lift" comment.Thien-Thi Nguyen1-2/+0
2001-06-28 * list.h (scm_list_1, scm_list_2, scm_list_3, scm_list_4, scm_list_5,Keisuke Nishida1-1/+1
scm_list_n): New functions. (SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify): Deprecated. (lots of files): Use the new functions. * goops.c (CALL_GF1, CALL_GF2, CALL_GF3, CALL_GF4): Use scm_call_N. * strings.c: #include "libguile/deprecation.h".
2001-06-26Make compilation under Windows easier.Martin Grabmüller1-1/+5
2001-06-26* Deprecated scm_makfromstr and added scm_mem2string as a replacement.Dirk Herrmann1-3/+2
* Eliminated some potential gc problems. * Eliminated some signedness problems. * Minor changes.
2001-05-28* strop.c (s_scm_string_capitalize_x): fix docstring quoting.Michael Livshin1-3/+3
* socket.c (s_scm_inet_pton): fix docstring quoting. (s_scm_inet_ntop): ditto. * num2integral.i.c (INTEGRAL2NUM): cast to fix a warning. * hashtab.c (scm_internal_hash_fold): fix argument position in SCM_ASSERT. * environments.c (s_scm_import_environment_set_imports_x): fix argument position in SCM_ASSERT. * debug.c (s_scm_make_gloc): fix SCM packing/unpacking. (s_scm_make_iloc): ditto.
2001-05-24* validate.hMichael Livshin1-8/+8
(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
2001-05-15Merge from mvo-vcell-cleanup-1-branch.Marius Vollmer1-36/+36
2001-05-05 * socket.c: use HAVE_IPV6 instead of AF_INET6 to enable IPv6Gary Houston1-5/+5
support.
2001-05-03 * socket.c: define uint32_t if netdb.h doesn't. thanks toGary Houston1-0/+10
Dale P. Smith.
2001-04-22 * socket.c: attempted to improve the docstrings slightly.Gary Houston1-122/+133
2001-04-22 * net_db.c: remove bogus "close" declaration.Gary Houston1-80/+287
(inet_aton declaration, scm_inet_aton, scm_inet_ntoa, scm_inet_netof, scm_lnaof, scm_inet_makeaddr, INADDR_ANY etc.): moved to socket.c. * net_db.h: declarations moved too. * socket.c (scm_htonl, scm_ntohl): use uint32_t instead of unsigned long. (ipv6_net_to_num, ipv6_num_to_net): new static procedures. (VALIDATE_INET6): new macro. (scm_inet_pton, scm_inet_ntop): new procedures, implementing inet-pton and inet-ntop. (scm_fill_sockaddr): use VALIDATE_INET6 and ipv6_num_to_net. (scm_addr_vector): use ipv6_net_to_num.
2001-04-21 * socket.c (FLIP_NET_HOST_128): new macro.Gary Houston1-18/+56
(scm_fill_sockaddr): use new macro. (scm_addr_vector): completed IPv6 address support. added const to the address parameter.
2001-04-20 * socket.c (scm_fill_sockaddr): call htons for sin6_port.Gary Houston1-24/+56
Don't assign sin6_scope_id in structure unless HAVE_SIN6_SCOPE_ID is defined. (scm_addr_vector): use a switch instead of multiple if statements. Add support for IPv6 (incomplete) . MAX_ADDR_SIZE: increase to size of struct sockaddr_in if needed.
2001-04-17 * some initial support for IPv6:Gary Houston1-21/+109
* socket.c (scm_fill_sockaddr): improve the argument validation. don't allocate memory until all args are checked. instead of unconditional memset of soka, try setting sin_len to 0 if SIN_LEN is defined. add support for AF_INET6. define FUNC_NAME. (scm_socket, scm_connect): extend docstrings for IPv6. (scm_init_socket): intern AF_INET6 and PF_INET6.
2001-04-10* Avoid redundant casting of argument numbers to char* and vice versa.Dirk Herrmann1-5/+5
2001-04-03Correct, update, improve and clean up a lot of docstrings in order to makeMartin Grabmüller1-58/+66
the documentation much more consistent.
2001-03-11Use SCM_LISTn instead of scm_listify.Keisuke Nishida1-1/+1
2001-03-10* _scm.h: Removed #include <errno.h>.Mikael Djurfeldt1-1/+3
* error.c, net_db.c, putenv.c, stime.c: Removed declaration of errno variable (can be a macro on some systems, for example when using linux libc with threads). * error.c, filesys.c, gc.c, ioext.c, iselect.c, net_db.c, ports.c, posix.c, print.c, putenv.c, scmsigs.c, script.c, simpos.c, smob.c, socket.c, srcprop.c, stime.c, strop.c, unif.c, vports.c: Added #include <errno.h> in these 20 out of 100 files.
2001-03-10 * socket.c: add a definition of SUN_LEN (from glibc) for when it'sGary Houston1-3/+7
not already defined.
2001-03-09Remove #include <stdio.h>. Add #include <string.h>.Keisuke Nishida1-2/+0