'\" t
.\" Title: loc_new
.\" Author: [see the "Authors" section]
.\" Generator: DocBook XSL Stylesheets vsnapshot
.\" Date: 02/01/2024
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "LOC_NEW" "3" "" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
loc_new \- Create a new libloc context
.SH "SYNOPSIS"
.sp
.nf
#include
.fi
.sp
struct loc_ctx;
.sp
int loc_new(struct loc_ctx** ctx);
.sp
struct loc_ctx* loc_ref(struct loc_ctx* ctx);
.sp
struct loc_ctx* loc_unref(struct loc_ctx* ctx);
.SH "DESCRIPTION"
.sp
Every operation in libloc requires to set up a context first\&. This is done by calling loc_new(3)\&.
.sp
Every time another part of your code is holding a reference to the context, you will need to call loc_ref() to increase the reference counter\&. If you no longer need the context, you will need to call loc_unref()\&.
.SH "SEE ALSO"
.sp
\fBlibloc\fR(3)
.SH "AUTHORS"
.sp
Michael Tremer