DC_CONTEXT_NEW(3)

πŸ“¦ version 0.9.0, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

dc_context_new β€” create a new device-handling context ✨

okay so welcome to DC_CONTEXT_NEW(3) from the Library Functions Manual, bestie β€” this is your lil’ gateway to making a device-handling context πŸ’…

πŸ¦‹ LIBRARY πŸ¦‹

library β€œlibdivecomputer” 🫢

✨ SYNOPSIS ✨

#include <libdivecomputer/context.h>

dc_status_t
dc_context_new(dc_context_t **context);

🌸 DESCRIPTION 🌸

So dc_context_new creates a context in which dive computers may be queried β€” main character setup energy πŸ”₯. The β€œcontext” is the thing that supplies logging messages and so on, and it may be re-used for multiple dive computer query sessions. It’s usually passed to dc_device_open(3) to query a specific dive computer device.

On success, you must free the context with dc_context_free(3) β€” no leaving it lying around like last week’s iced coffee 😭. You may configure the context with dc_context_set_loglevel(3) and dc_context_set_logfunc(3). This is highly recommended, fr fr, because the default logging behaviour of dc_context_new depends upon compile-time values. Periodt.

⭐ RETURN VALUES ⭐

This returns DC_STATUS_OK on success β€” in which case context is filled in β€” or an error code on failure. So yeah, check that return value, bestie πŸ’…

πŸ”₯ SEE ALSO πŸ”₯

πŸ‘‘ AUTHORS πŸ‘‘

The library β€œlibdivecomputer” library was written by Jef Driesen, jef@libdivecomputer.org πŸ’–. The manpages were written by Kristaps Dzonsons, kristaps@bsd.lv.


That’s the whole vibe check, bestie: Debian, January 5, 2017, DC_CONTEXT_NEW(3) β€” mwah! πŸŽ€βœ¨

πŸ“¦ where this page comes from