This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
/
highlevel.h.mustache
160 lines (136 loc) · 5.42 KB
/
highlevel.h.mustache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// clang-format off
{{!
This template file is licensed under BSD Zero Clause License (0BSD).
For the full text see ./highlevel/LICENSE.txt
}}
{{=/*% %*/=}}
// clang-format on
/**
* @file
*
* This file was automatically generated using `kdb gen highlevel`.
* Any changes will be overwritten, when the file is regenerated.
*
* @copyright BSD Zero Clause License
*
* Copyright (c) Elektra Initiative (https://www.libelektra.org)
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef /*%& include_guard %*/
#define /*%& include_guard %*/
#ifdef __cplusplus
extern "C" {
#endif
#include <elektra.h>
#include <kdbhelper.h>
#include <string.h>
/*%# more_headers %*/
#include "/*% . %*/"
/*%/ more_headers %*/
/*%# use_commands? %*/
#include "/*% commands_header %*/"
/*%/ use_commands? %*/
/*%> partial.enum.decl.h %*/
/*%> partial.union.decl.h %*/
/*%> partial.struct.decl.h %*/
/*%> partial.keys.tags.h %*/
/*%> partial.keys.fun.h %*/
int /*%& init_function_name %*/ (Elektra ** elektra,
/*%# init_with_pointers? %*/
int argc, const char * const * argv, const char * const * envp,
/*%/ init_with_pointers? %*/
/*%^ init_with_pointers? %*/
size_t argsSize, const char * args, size_t envSize, const char * envs,
/*%/ init_with_pointers? %*/
ElektraError ** error);
void /*%& help_function_name %*/ (Elektra * elektra, const char * usage, const char * prefix);
void /*%& specload_function_name %*/ (int argc, const char * const * argv);
/*%# use_commands? %*/
int /*%& run_commands_function_name %*/ (Elektra * elektra, void * userData);
/*%/ use_commands? %*/
/*%={{ }}=%*/
/**
* @param elektra The elektra instance initialized with {{{ init_function_name }}}().
* @param tag The tag to look up.
*
* @return The value stored at the given key.
* The lifetime of returned pointers is documented in the ELEKTRA_GET(*) functions above.
*/// {{=/*% %*/=}}
#define elektraGet(elektra, tag) ELEKTRA_GET (tag) (elektra)
/*%={{ }}=%*/
/**
* @param elektra The elektra instance initialized with {{{ init_function_name }}}().
* @param tag The tag to look up.
* @param ... Variable arguments depending on the given tag.
*
* @return The value stored at the given key.
* The lifetime of returned pointers is documented in the ELEKTRA_GET(*) functions above.
*/// {{=/*% %*/=}}
#define elektraGetV(elektra, tag, ...) ELEKTRA_GET (tag) (elektra, __VA_ARGS__)
/*%={{ }}=%*/
/**
* @param elektra The elektra instance initialized with {{{ init_function_name }}}().
* @param result Points to the struct into which results will be stored.
* The lifetime of pointers in this struct is documented in the ELEKTRA_GET(*) functions above.
* @param tag The tag to look up.
*/// {{=/*% %*/=}}
#define elektraFillStruct(elektra, result, tag) ELEKTRA_GET (tag) (elektra, result)
/*%={{ }}=%*/
/**
* @param elektra The elektra instance initialized with {{{ init_function_name }}}().
* @param result Points to the struct into which results will be stored.
* The lifetime of pointers in this struct is documented in the ELEKTRA_GET(*) functions above.
* @param tag The tag to look up.
* @param ... Variable arguments depending on the given tag.
*/// {{=/*% %*/=}}
#define elektraFillStructV(elektra, result, tag, ...) ELEKTRA_GET (tag) (elektra, result, __VA_ARGS__)
/*%# generate_setters? %*/
/*%={{ }}=%*/
/**
* @param elektra The elektra instance initialized with the {{{ init_function_name }}}().
* @param tag The tag to write to.
* @param value The new value.
* @param error Pass a reference to an ElektraError pointer.
*/// {{=/*% %*/=}}
#define elektraSet(elektra, tag, value, error) ELEKTRA_SET (tag) (elektra, value, error)
/*%={{ }}=%*/
/**
* @param elektra The elektra instance initialized with the {{{ init_function_name }}}().
* @param tag The tag to write to.
* @param value The new value.
* @param error Pass a reference to an ElektraError pointer.
* @param ... Variable arguments depending on the given tag.
*/// {{=/*% %*/=}}
#define elektraSetV(elektra, tag, value, error, ...) ELEKTRA_SET (tag) (elektra, value, __VA_ARGS__, error)
/*%/ generate_setters? %*/
/*%={{ }}=%*/
/**
* @param elektra The elektra instance initialized with {{{ init_function_name }}}().
* @param tag The array tag to look up.
*
* @return The size of the array below the given key.
*/// {{=/*% %*/=}}
#define elektraSize(elektra, tag) ELEKTRA_SIZE (tag) (elektra)
/*%={{ }}=%*/
/**
* @param elektra The elektra instance initialized with {{{ init_function_name }}}().
* @param tag The array tag to look up.
* @param ... Variable arguments depending on the given tag.
*
* @return The size of the array below the given key.
*/// {{=/*% %*/=}}
#define elektraSizeV(elektra, tag, ...) ELEKTRA_SIZE (tag) (elektra, __VA_ARGS__)
#ifdef __cplusplus
}
#endif
#endif // /*%& include_guard %*/