gnutls_global_init(3)

πŸ’– gnutls_global_init(3) πŸ’–

okay bestie, we're doing gnutls_global_init from the gnutls manual, and honestly? this one is giving quiet luxury ✨ it's the "you probably don't even have to call me" icon of the API.


🌸 NAME 🌸

gnutls_global_init β€” API function πŸ’…


✨ SYNOPSIS ✨

#include <gnutls/gnutls.h>

int gnutls_global_init( void);

πŸŽ€ ARGUMENTS πŸŽ€

  • void β€” literally no arguments. she takes nothing. she gives everything. πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea πŸ“ β€” since GnuTLS 3.3.0 this function is no longer necessary to be explicitly called. she's already there for you. main character energy, no invitation needed.

but if you wanna be ✨different✨ and turn off that implicit call (which happens in a library constructor, iykyk), just set the environment variable GNUTLS_NO_IMPLICIT_INIT to 1. that's it. that's the whole vibe check.

so what does she actually do when she runs? she:

  • performs any required precalculations
  • detects the supported CPU capabilities
  • initializes the underlying cryptographic backend

and when you're done with gnutls and don't need her anymore? you should call gnutls_global_deinit() to free any resources taken by this call. no ghosting her resources, bestie. 🫢

here's the cute part: this function increments a global counter, so that gnutls_global_deinit() only releases resources when it's been called as many times as gnutls_global_init(). that's genuinely so useful when GnuTLS is used by more than one library in an application β€” everyone gets their turn, nobody steals the aux. 🎧

she can be called many times, but she'll only actually do something the first time. lowkey efficient. and she's thread safe since GnuTLS 3.3.0. periodt.

⚠️ one thing to know fr fr: a subsequent call of this function, if the initial call has failed, will return the same error code. she remembers. she holds grudges (affectionately). πŸ’€

⭐ RETURNS ⭐

on success, GNUTLS_E_SUCCESS (0) is returned πŸ’– otherwise a negative error code is returned. sad girl hours. 😭


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found something cursed? report bugs to bugs@gnutls.org. πŸ›

home page: https://www.gnutls.org


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. slay, and legally so. πŸ’…


🌈 SEE ALSO 🌈

the full documentation for gnutls is maintained as a Texinfo manual. if the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit:

https://www.gnutls.org/manual/


and that's the whole page, bestie 🧚 this was gnutls 3.8.13, gnutls_global_init(3), and she ate. no crumbs. bye pookie πŸ’œβœ¨

πŸ“¦ where this page comes from