Nix 2.26.3
Nix, the purely functional package manager: C API (experimental)
 
Loading...
Searching...
No Matches
nix_api_external.h
Go to the documentation of this file.
1#ifndef NIX_API_EXTERNAL_H
2#define NIX_API_EXTERNAL_H
11
12#include "nix_api_expr.h"
13#include "nix_api_util.h"
14#include "nix_api_value.h"
15#include "stdbool.h"
16#include "stddef.h"
17#include "stdint.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22// cffi start
23
32typedef struct nix_printer nix_printer;
37
45void nix_set_string_return(nix_string_return * str, const char * c);
46
55nix_err nix_external_print(nix_c_context * context, nix_printer * printer, const char * str);
56
64nix_err nix_external_add_string_context(nix_c_context * context, nix_string_context * string_context, const char * c);
65
77{
84 void (*print)(void * self, nix_printer * printer);
90 void (*showType)(void * self, nix_string_return * res);
96 void (*typeOf)(void * self, nix_string_return * res);
112 void * self, nix_string_context * c, int coerceMore, int copyToStore, nix_string_return * res);
124 int (*equal)(void * self, void * other);
139 void * self, EvalState * state, bool strict, nix_string_context * c, bool copyToStore, nix_string_return * res);
157 void * self,
158 EvalState * state,
159 int strict,
160 int location,
161 void * doc,
163 void * drvsSeen,
164 int pos);
166
180
189
190// cffi end
191#ifdef __cplusplus
192}
193#endif
195
196#endif // NIX_API_EXTERNAL_H
nix_err nix_external_add_string_context(nix_c_context *context, nix_string_context *string_context, const char *c)
struct nix_string_return nix_string_return
Represents a string owned by the Nix language evaluator.
Definition nix_api_external.h:28
void nix_set_string_return(nix_string_return *str, const char *c)
Sets the contents of a nix_string_return.
struct nix_string_context nix_string_context
A list of string context items.
Definition nix_api_external.h:36
ExternalValue * nix_create_external_value(nix_c_context *context, NixCExternalValueDesc *desc, void *v)
Create an external value, that can be given to nix_init_external.
nix_err nix_external_print(nix_c_context *context, nix_printer *printer, const char *str)
struct nix_printer nix_printer
Wraps a stream that can output multiple string pieces.
Definition nix_api_external.h:32
void * nix_get_external_value_content(nix_c_context *context, ExternalValue *b)
Extract the pointer from a nix c external value.
struct ExternalValue ExternalValue
External Value.
Definition nix_api_value.h:74
nix_err
Type for error codes in the Nix system.
Definition nix_api_util.h:59
Main entry for the libexpr C bindings.
Main entry for the libutil C bindings.
libexpr C bindings dealing with values
Represents a state of the Nix language evaluator.
Definition for a class of external values.
Definition nix_api_external.h:77
void(* print)(void *self, nix_printer *printer)
Called when printing the external value.
Definition nix_api_external.h:84
int(* equal)(void *self, void *other)
Try to compare two external values.
Definition nix_api_external.h:124
void(* showType)(void *self, nix_string_return *res)
Called on :t.
Definition nix_api_external.h:90
void(* typeOf)(void *self, nix_string_return *res)
Called on builtins.typeOf
Definition nix_api_external.h:96
void(* printValueAsXML)(void *self, EvalState *state, int strict, int location, void *doc, nix_string_context *c, void *drvsSeen, int pos)
Convert the external value to XML.
Definition nix_api_external.h:156
void(* coerceToString)(void *self, nix_string_context *c, int coerceMore, int copyToStore, nix_string_return *res)
Called on "${str}" and builtins.toString.
Definition nix_api_external.h:111
void(* printValueAsJSON)(void *self, EvalState *state, bool strict, nix_string_context *c, bool copyToStore, nix_string_return *res)
Convert the external value to json.
Definition nix_api_external.h:138
This object stores error state.