Tizen 2.0 Release
[external/libgnutls26.git] / doc / manpages / gnutls_global_init.3
1 .\" DO NOT MODIFY THIS FILE!  It was generated by gdoc.
2 .TH "gnutls_global_init" 3 "2.12.6.1" "gnutls" "gnutls"
3 .SH NAME
4 gnutls_global_init \- API function
5 .SH SYNOPSIS
6 .B #include <gnutls/gnutls.h>
7 .sp
8 .BI "int gnutls_global_init( " void ");"
9 .SH ARGUMENTS
10 .IP " void" 12
11 .SH "DESCRIPTION"
12
13 This function initializes the global data to defaults.  Every
14 gnutls application has a global data which holds common parameters
15 shared by gnutls session structures.  You should call
16 \fBgnutls_global_deinit()\fP when gnutls usage is no longer needed
17
18 Note that this function will also initialize the underlying crypto
19 backend, if it has not been initialized before.  
20
21 This function increment a global counter, so that
22 \fBgnutls_global_deinit()\fP only releases resources when it has been
23 called as many times as \fBgnutls_global_init()\fP.  This is useful when
24 GnuTLS is used by more than one library in an application.  This
25 function can be called many times, but will only do something the
26 first time.
27
28 Note!  This function is not thread safe.  If two threads call this
29 function simultaneously, they can cause a race between checking
30 the global counter and incrementing it, causing both threads to
31 execute the library initialization code.  That would lead to a
32 memory leak.  To handle this, your application could invoke this
33 function after aquiring a thread mutex.  To ignore the potential
34 memory leak is also an option.
35 .SH "RETURNS"
36 On success, \fBGNUTLS_E_SUCCESS\fP (zero) is returned,
37 otherwise an error code is returned.
38 .SH "REPORTING BUGS"
39 Report bugs to <bug-gnutls@gnu.org>.
40 GnuTLS home page: http://www.gnu.org/software/gnutls/
41 General help using GNU software: http://www.gnu.org/gethelp/
42 .SH COPYRIGHT
43 Copyright \(co 2008 Free Software Foundation.
44 .br
45 Copying and distribution of this file, with or without modification,
46 are permitted in any medium without royalty provided the copyright
47 notice and this notice are preserved.
48 .SH "SEE ALSO"
49 The full documentation for
50 .B gnutls
51 is maintained as a Texinfo manual.  If the
52 .B info
53 and
54 .B gnutls
55 programs are properly installed at your site, the command
56 .IP
57 .B info gnutls
58 .PP
59 should give you access to the complete manual.