---
name: "rinit"
section: "3"
platform: "linux"
package: "libroy-dev"
version: "1.0.8-1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/rinit"
---

# rinit(3)

initalize the roy library

## NAME

rinit - initalize the roy library

## SYNOPSIS

\#include \<roy.h\>

void rinit (void);

void rinit\_threaded (void);

void rcleanup (void);

void rcleanup\_add\_hook (RCleanupHook function)

typedef void (\*RCleanupHook) (void);

## DESCRIPTION

Call [*rinit*(3)](/rinit/3.md) before calling any roy api functions or macros. This call setups important globals needed by many of the data structures and helper functions.

*rinit\_threaded*(3) is identical to [*rinit*(3)](/rinit/3.md) except this must be used in its place if you are planning to do any threading work. This enables the locks around [*rchunk*(3)](/rchunk/3.md) and other data structures within roy.

[*rcleanup*(3)](/rcleanup/3.md) cleans up any memory used by roy in globals.

*rcleanup\_add\_hook*(3) adds a function to be called when [*rcleanup*(3)](/rcleanup/3.md) is called.  The function should be defined as RCleanupHook above,  for example:

void cleanuphook (void);

## RETURN VALUE

These calls returns no value.

## ERRORS

A call to [*rinit*(3)](/rinit/3.md), *rinit\_threaded*(3), [*rcleanup*(3)](/rcleanup/3.md) or  *rcleanup\_add\_hook*(3) will never fail.

## SEE ALSO

[*roy*(3)](/roy/3.md)
