Nix 2.29.0
Nix, the purely functional package manager: C API (experimental)
 
Loading...
Searching...
No Matches
nix_api_util.h File Reference

Main entry for the libutil C bindings. More...

Go to the source code of this file.

Typedefs

typedef enum nix_err nix_err
 
typedef struct nix_c_context nix_c_context
 
typedef void(* nix_get_string_callback) (const char *start, unsigned int n, void *user_data)
 Called to get the value of a string owned by Nix.
 

Enumerations

enum  nix_err {
  NIX_OK = 0 , NIX_ERR_UNKNOWN = -1 , NIX_ERR_OVERFLOW = -2 , NIX_ERR_KEY = -3 ,
  NIX_ERR_NIX_ERROR = -4
}
 Type for error codes in the Nix system. More...
 

Functions

nix_c_contextnix_c_context_create ()
 Allocate a new nix_c_context.
 
void nix_c_context_free (nix_c_context *context)
 Free a nix_c_context. Does not fail.
 
nix_err nix_libutil_init (nix_c_context *context)
 Initializes nix_libutil and its dependencies.
 
nix_err nix_setting_get (nix_c_context *context, const char *key, nix_get_string_callback callback, void *user_data)
 Retrieves a setting from the nix global configuration.
 
nix_err nix_setting_set (nix_c_context *context, const char *key, const char *value)
 Sets a setting in the nix global configuration.
 
const char * nix_version_get ()
 Retrieves the nix library version.
 
const char * nix_err_msg (nix_c_context *context, const nix_c_context *ctx, unsigned int *n)
 Retrieves the most recent error message from a context.
 
nix_err nix_err_info_msg (nix_c_context *context, const nix_c_context *read_context, nix_get_string_callback callback, void *user_data)
 Retrieves the error message from errorInfo in a context.
 
nix_err nix_err_name (nix_c_context *context, const nix_c_context *read_context, nix_get_string_callback callback, void *user_data)
 Retrieves the error name from a context.
 
nix_err nix_err_code (const nix_c_context *read_context)
 Retrieves the most recent error code from a nix_c_context.
 
nix_err nix_set_err_msg (nix_c_context *context, nix_err err, const char *msg)
 Set an error message on a nix context.
 
void nix_clear_err (nix_c_context *context)
 Clear the error message from a nix context.
 

Detailed Description

Main entry for the libutil C bindings.

Also contains error handling utilities