DC_CONTEXT_NEW(3)
π 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
- nixos 26.05: libdivecomputer 0.9.0
- nixpkgs unstable: libdivecomputer 0.9.0
- Copyright (C) 2017 Kristaps Dzonsons <kristaps@bsd.lv>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms