forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutility.h
43 lines (39 loc) · 1.5 KB
/
utility.h
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
/**
* @file utility.h
*
* @brief Contains functionality for handling Keys used throughout writing and reading.
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*/
#ifndef ELEKTRA_PLUGIN_TOML_UTILITY_H
#define ELEKTRA_PLUGIN_TOML_UTILITY_H
#include <kdb.h>
#include <stdbool.h>
#include <stddef.h>
Key * keyAppendIndex (size_t index, const Key * parent);
void keyUpdateArrayMetakey (Key * key, size_t newIndex);
char * indexToArrayString (size_t index);
size_t arrayStringToIndex (const char * indexStr);
bool isArrayIndex (const char * basename);
void setPlainIntMeta (Key * key, const char * metaKeyName, size_t value);
char * intToStr (size_t i);
void setOrderForKey (Key * key, size_t order);
bool isArrayElement (const Key * key);
bool isEmptyArray (Key * key);
bool isBareString (const char * str);
size_t getArrayMax (Key * key);
bool isArray (Key * key);
bool isSimpleTable (Key * key);
bool isTableArray (Key * key);
bool isInlineTable (Key * key);
bool isTomlType (Key * key, const char * type);
char * getRelativeName (Key * parent, Key * key);
char * getDirectSubKeyName (const Key * parent, const Key * key);
void keySetDiff (KeySet * whole, KeySet * part);
KeySet * keysByPredicate (KeySet * ks, bool (*pred) (Key *));
KeySet * collectSubKeys (KeySet * ks, Key * parent);
KeySet * extractSubKeys (KeySet * ks, Key * parent);
bool isLeaf (Key * leafCandidate, KeySet * ks);
bool isBase64String (const char * str);
bool isNullString (const char * str);
#endif // ELEKTRA_PLUGIN_TOML_UTILITY_H