From: Yang Tse Date: Tue, 19 May 2009 19:00:28 +0000 (+0000) Subject: Initial ares_library_init(3) man page attempt X-Git-Tag: upstream/1.10.0~518 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e55839216b436b0d9859bf5a6173dbad6c97f2f;p=platform%2Fupstream%2Fc-ares.git Initial ares_library_init(3) man page attempt --- diff --git a/Makefile.inc b/Makefile.inc index 95686c1..98c93f3 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -22,4 +22,4 @@ MANPAGES= ares_destroy.3 ares_expand_name.3 ares_expand_string.3 ares_fds.3 \ ares_version.3 ares_cancel.3 ares_parse_aaaa_reply.3 ares_getnameinfo.3 \ ares_getsock.3 ares_parse_ns_reply.3 ares_dup.3 \ ares_destroy_options.3 ares_save_options.3 ares_gethostbyname_file.3 \ - ares_set_socket_callback.3 + ares_set_socket_callback.3 ares_library_init.3 diff --git a/ares_library_init.3 b/ares_library_init.3 new file mode 100644 index 0000000..a505750 --- /dev/null +++ b/ares_library_init.3 @@ -0,0 +1,78 @@ +.\" $Id$ +.\" +.\" Copyright 1998 by the Massachusetts Institute of Technology. +.\" Copyright (C) 2004-2009 by Daniel Stenberg +.\" +.\" Permission to use, copy, modify, and distribute this +.\" software and its documentation for any purpose and without +.\" fee is hereby granted, provided that the above copyright +.\" notice appear in all copies and that both that copyright +.\" notice and this permission notice appear in supporting +.\" documentation, and that the name of M.I.T. not be used in +.\" advertising or publicity pertaining to distribution of the +.\" software without specific, written prior permission. +.\" M.I.T. makes no representations about the suitability of +.\" this software for any purpose. It is provided "as is" +.\" without express or implied warranty. +.\" +.TH ARES_LIBRARY_INIT 3 "19 May 2009" +.SH NAME +ares_library_init \- c-ares library initialization +.SH SYNOPSIS +.nf +.B #include +.PP +.B int ares_library_init(int \fIflags\fP) +.fi +.SH DESCRIPTION +.PP +The +.B ares_library_init +function performs initializations internally required by the c-ares +library that must take place before any other c-ares function can be +used. +.PP +This function must be called one time within the life of a program +before the program actually executes any other c-ares library function +call. Initializations done by this function remain effective until a +call to \fIares_library_cleanup(3)\fP is performed. +.PP +Successive calls to this function are ignored, only the first one with +c-ares in an uninitialized state is effective. +.PP +The +.I flags +parameter is a bit pattern that tells c-ares exactly which features +should be initialized, as described below. Set the desired bits by +ORing the values together. In normal operation, you must specify +.I ARES_LIB_INIT_ALL. +Don't use any other value unless you are familiar with it and trying +to control some internal c-ares features. +.PP +.B This function is not thread safe. +You have to call it once the program +has started but must be called before the program starts any other thread. +Due to the fact that ares_library_init() might call functions from other +libraries that are thread unsafe, it could conflict with any other thread +that uses these other libraries. +.SH FLAGS +.TP 5 +.B ARES_LIB_INIT_ALL +Initialize everything possible. This sets all known bits. +.TP +.B ARES_LIB_INIT_WIN32 +Initialize Win32 specific libraries. +.TP +.B ARES_LIB_INIT_NONE +Initialize nothing extra. This sets no bit. +.SH RETURN VALUE +If this function returns non-zero, something went wrong and you cannot +use the other c-ares functions. +.SH NOTES +This function was first introduced in c-ares version 1.6.1 along with +the definition of preprocessor symbol CARES_HAVE_ARES_LIBRARY_INIT +as an indication of the availability of this function. +.SH SEE ALSO +.BR ares_library_cleanup (3) +.SH AUTHOR +Yang Tse