mirror of
https://github.com/AtlasLinux/docs.git
synced 2026-02-02 15:24:15 -08:00
libacl
This commit is contained in:
36
pages/libraries/libacl.md
Normal file
36
pages/libraries/libacl.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# libacl
|
||||
A config library
|
||||
|
||||
## Types
|
||||
* Some opaque types; mirrors internal structure
|
||||
```c
|
||||
typedef struct AclValue AclValue;
|
||||
typedef struct AclField AclField;
|
||||
typedef struct AclBlock AclBlock;
|
||||
typedef struct AclError AclError;
|
||||
```
|
||||
## Functions
|
||||
* Lifecycle (no-op for now)
|
||||
```c
|
||||
int acl_init(void);
|
||||
void acl_shutdown(void);
|
||||
```
|
||||
* Parse from file or in-memory string.
|
||||
Returns a heap-allocated AclBlock* (linked list of top-level blocks) on success,
|
||||
or NULL on failure (in which case an error may have been printed to stderr).
|
||||
```c
|
||||
AclBlock *acl_parse_file(const char *path);
|
||||
AclBlock *acl_parse_string(const char *text);
|
||||
```
|
||||
* Resolve references in-place. Returns 1 on success, 0 on failure.
|
||||
```c
|
||||
int acl_resolve_all(AclBlock *root);
|
||||
```
|
||||
* Utilities
|
||||
```c
|
||||
void acl_print(AclBlock *root, FILE *out);
|
||||
```
|
||||
* Free tree returned by parser
|
||||
```c
|
||||
void acl_free(AclBlock *root);
|
||||
```
|
||||
25
pages/libraries/stub.md
Normal file
25
pages/libraries/stub.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# libfoo
|
||||
A library
|
||||
|
||||
## Types
|
||||
* foo
|
||||
```c
|
||||
typedef int foo_t;
|
||||
```
|
||||
## Functions
|
||||
* bar
|
||||
```c
|
||||
void bar(void);
|
||||
```
|
||||
|
||||
## Macros
|
||||
* baz
|
||||
```c
|
||||
#define baz NULL
|
||||
```
|
||||
|
||||
## Variables
|
||||
* quux
|
||||
```c
|
||||
extern int quux;
|
||||
```
|
||||
Reference in New Issue
Block a user