loc_new(3)

loc_new3

Create a new libloc context

Usage

#include <libloc/libloc.h>

struct loc_ctx;

int loc_new(struct loc_ctx** ctx);

struct loc_ctx* loc_ref(struct loc_ctx* ctx);

struct loc_ctx* loc_unref(struct loc_ctx* ctx);

Overview

Every operation in libloc requires to set up a context first. This is done by calling loc_new(3).

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().

Releases

3 releases since Debian 12 (Bookworm); the text changed 2 times.

  1. 12
  2. 13
  3. Arch

Authors

Michael Tremer

From libloc 0.9.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.