summaryrefslogtreecommitdiff
path: root/libguile/net_db.c
Commit message (Expand)AuthorAgeFilesLines
* Fix unused static variables in net_db.c...* libguile/net_db.c (SCM_DEFINE_CONSTANT): New helper. Use it to define constants and avoid the unneeded static variables that were used before, named "sym_" but actually holding variables. Thanks to Eli Zaretskii for the report. Andy Wingo2016-07-251-55/+28
* getaddrinfo: Document the missing errno value for EAI_SYSTEM....In response to <http://bugs.gnu.org/13958>. Reported by Lluís Batlle i Rossell <viric@viric.name>. * doc/ref/posix.texi (Network Databases): Document the missing errno value for EAI_SYSTEM. * libguile/net_db.c (scm_getaddrinfo): Likewise. Ludovic Courtès2013-03-251-2/+4
* fix include-order problem in net_db.c for mingw...* libguile/net_db.c: Reorder includes to avoid include-order problem on mingw. Andy Wingo2013-03-091-10/+10
* remove mingw32 implementations of {get,end,set}{serv,proto}ent...* libguile/win32-socket.h: * libguile/win32-socket.c (getservent, endservent, setservent) (getprotoent, endprotoent, setprotoent): Remove mingw32 wrappers. Their place is in gnulib, if anywhere. Andy Wingo2013-03-091-15/+9
* net_db.c doesn't import winsock2.h...* libguile/net_db.c: Don't include winsock2.h; gnulib handles this for us as necessary. Andy Wingo2013-02-201-5/+1
* tests: Have `getaddrinfo' test work for Darwin 8....* doc/ref/posix.texi (Network Databases): Update description of `EAI_NODATA' to mention that Darwin provides it. * libguile/net_db.c (scm_getaddrinfo): Likewise. * test-suite/tests/net-db.test ("getaddrinfo")["wrong service name"]: Accept `EAI_NODATA' too. Reported by David Fang <fang@csl.cornell.edu>, see <http://bugs.gnu.org/10684>. Ludovic Courtès2012-02-031-5/+10
* compile-time assertion in net_db uses constant expressions...* libguile/net_db.c: Use constant expressions for EAI_BADFLAGS and AI_ALL representations. Andy Wingo2011-05-131-2/+2
* Change `getaddrinfo' test to handle the GNU-specific `EAI_NODATA'....* doc/ref/posix.texi (Network Databases): Mention `EAI_NODATA'. * libguile/net_db.c (scm_getaddrinfo): Likewise for the docstring. * test-suite/tests/net-db.test ("getaddrinfo")["no name"]: Handle `EAI_NODATA'. Ludovic Courtès2011-01-051-1/+6
* Update to Gnulib v0.0-3448-g6078aa4 for its <netdb.h> fix....Reverts commit 691b9ec196203fa5d6da3530d5355b2f73e707d1 ("getaddrinfo: Define macros lacking in NetBSD 5.0."). * libguile/net_db.c (AI_ALL, AI_V4MAPPED, AI_ADDRCONFIG): Remove placeholder definitions, how provided by Gnulib's <netdb.h>. Ludovic Courtès2010-02-171-11/+0
* getaddrinfo: Define macros lacking in NetBSD 5.0....* libguile/net_db.c (AI_ALL, AI_V4MAPPED, AI_ADDRCONFIG): New macros, when not already defined. Ludovic Courtès2010-02-171-0/+11
* Use `#f' for `addrinfo:canonname' when it wasn't supplied by getaddrinfo(3)....* libguile/net_db.c (scm_from_addrinfo): Use `#f' when `ai_canonname' isn't set. Ludovic Courtès2010-02-151-2/+5
* Add `getaddrinfo' and related procedures....* libguile/net_db.c (sym_getaddrinfo_error, sym_ai_passive, sym_ai_canonname, sym_ai_numerichost, sym_ai_numericserv, sym_ai_v4mapped, sym_ai_all, sym_ai_addrconfig, sym_eai_badflags, sym_eai_noname, sym_eai_again, sym_eai_fail, sym_eai_family, sym_eai_socktype, sym_eai_service, sym_eai_memory, sym_eai_system, sym_eai_overflow, sym_eai_nodata, sym_eai_addrfamily, sym_eai_inprogress, sym_eai_canceled, sym_eai_notcanceled, sym_eai_alldone, sym_eai_intr, sym_eai_idn_encode): New variables. (scm_from_addrinfo, scm_getaddrinfo, scm_gai_strerror): New functions. * libguile/net_db.h (scm_getaddrinfo, scm_gai_strerror): New functions. * module/ice-9/networking.scm (addrinfo:flags, addrinfo:fam, addrinfo:socktype, addrinfo:protocol, addrinfo:addr, addrinfo:canonname): New procedures. * test-suite/tests/net-db.test: New file. * test-suite/Makefile.am (SCM_TESTS): Add `tests/net-db.test'. * doc/ref/posix.texi (Network Databases)[getaddrinfo]: New subsection. [The Host Database]: Suggest using `getaddrinfo'. Ludovic Courtès2010-02-141-1/+291
* 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
* Work around the lack of hstrerror(3) declaration on Tru64....* configure.in: Look for the declaration of hstrerror(3). * libguile/net_db.c: Add hstrerror(3) declaration if `HAVE_DECL_HSTRERROR' is undefined. Ludovic Courtès2009-05-211-1/+7
* Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès2008-09-131-1/+1
* merge from 1.8 branchKevin Ryde2006-04-171-1/+1
* Renamed the "frames" that are related to dynamic-wind to "dynamic...contexts. Renamed all functions from scm_frame_ to scm_dynwind_. Updated documentation. Marius Vollmer2006-01-291-3/+3
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
* Use new vector elements API or simple vector API, as appropriate....Removed SCM_HAVE_ARRAYS ifdefery. Replaced all uses of SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET. Marius Vollmer2005-01-021-17/+17
* * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,...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. Marius Vollmer2004-08-191-5/+5
* * stime.c, socket.c, simpos.c, procs.c, posix.c, ports.c,...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. Marius Vollmer2004-08-101-23/+53
* (scm_resolv_error): don't cause an exception while...trying to throw an exception -- call scm_misc_error with correct arguments. The previous arguments needed a format escape that wasn't in any of the format strings. Rob Browning2004-08-071-1/+1
* * numbers.h, numbers.c, discouraged.h, discouraged.c (scm_short2num,...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. Marius Vollmer2004-08-021-1/+1
* * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,...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. Marius Vollmer2004-07-231-6/+6
* * 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. Marius Vollmer2004-07-101-3/+4
* * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to...SCM_I_MAKINUM and changed all uses. Marius Vollmer2004-07-081-5/+5
* * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,...SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h". Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively. Marius Vollmer2004-07-061-4/+4
* Changed license terms to the plain LGPL thru-out.Marius Vollmer2003-04-051-36/+12
* * net_db.c: #include <config.h> if HAVE_CONFIG_H.Rob Browning2003-03-251-0/+4
* * macros.c: include deprecation.h...* 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. Han-Wen Nienhuys2002-07-211-39/+28
* 2002-07-20 Han-Wen <hanwen@cs.uu.nl>...* *.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. Han-Wen Nienhuys2002-07-201-22/+23
* No need to check for Cygwin when including <winsock2.h>, this is...already check for by configure. Thus, revert change from 2002-07-07. Marius Vollmer2002-07-101-2/+1
* Do not include <winsock2.h> on Cygwin even when we have it.Marius Vollmer2002-07-071-1/+2
* Retire inclusion guard macro SCM_MAGIC_SNARFER.Thien-Thi Nguyen2002-03-141-2/+0
* 2001-11-21 Stefan Jahn <stefan@lkcc.org>... * win32-socket.c (getservent, setservent, endservent, getprotoent, setprotoent, endprotoent): New functions. Appropriate replacements for M$-Windows. * numbers.c (SIZE_MAX, PTRDIFF_MAX, PTRDIFF_MIN): Reintroduced these definitions for GUILE_DEBUG. * net_db.c: Include "win32-socket.h" if compiling with a native M$-Windows compiler. Include some pieces of code (protoent and servent interface) protected by HAVE_* macros when using a native M$-Windows compiler. Stefan Jahn2001-11-211-4/+8
* * Adding C function declarations from the SCM interface to the... reference manual documentation. Neil Jerram2001-11-161-8/+8
* Disable extern declaration of `h_errno' for __CYGWIN__,...too. Put `scm_return_entry()' into HAVE_GETSERVENT conditional. Marius Vollmer2001-11-021-2/+2
* * Removed lots of deprecated stuff.Dirk Herrmann2001-08-311-5/+0
* Remove "face-lift" comment.Thien-Thi Nguyen2001-07-091-2/+0
* * list.h (scm_list_1, scm_list_2, scm_list_3, scm_list_4, scm_list_5,... 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". Keisuke Nishida2001-06-281-3/+3
* Make compilation under Windows easier.Martin Grabmüller2001-06-261-1/+6
* * Deprecated scm_makfromstr and added scm_mem2string as a replacement....* Eliminated some potential gc problems. * Eliminated some signedness problems. * Minor changes. Dirk Herrmann2001-06-261-10/+9
* * 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-5/+5
* * net_db.c: remove bogus "close" declaration.... (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. Gary Houston2001-04-221-124/+1
* * Avoid redundant casting of argument numbers to char* and vice versa.Dirk Herrmann2001-04-101-6/+6
* Correct, update, improve and clean up a lot of docstrings in order to make...the documentation much more consistent. Martin Grabmüller2001-04-031-20/+22
* * net_db.c: define h_errno if configure didn't define HAVE_H_ERRNO.... normally it would be found in netdb.h. Gary Houston2001-03-181-0/+6
* Use SCM_LISTn instead of scm_listify.Keisuke Nishida2001-03-111-6/+3
* * _scm.h: Removed #include <errno.h>....* 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. Mikael Djurfeldt2001-03-101-5/+3
* Remove #include <stdio.h>. Add #include <string.h>.Keisuke Nishida2001-03-091-1/+0