mirror of
https://github.com/troglobit/libite.git
synced 2026-10-23 11:34:37 +00:00
Add simple parser for UNIX configuration files.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
db08b20f23
commit
c4eb5cb124
4 files changed
+250
-2
No files matched your search
@@ -133,6 +133,29 @@ Generic Functions
|
||||
Basic ifconfig like operations on an interface. Only supports IPv4
|
||||
adresses. Note that mask is not CIDR notation.
|
||||
|
||||
- `lfopen(file, sep)`, `lfclose(lf)`
|
||||
|
||||
API for parsing UNIX style configuration files like `/etc/protocols`
|
||||
and `/etc/services`.
|
||||
|
||||
- `lftok(lf)`
|
||||
|
||||
Read tokens, delimeted by `sep`, from file opened with `lfopen()`.
|
||||
|
||||
- `lfgetkey(lf, key)`
|
||||
|
||||
Find `key` in file opened with `lfopen()`, return value/argument.
|
||||
|
||||
- `lfgetint(lf, key)`
|
||||
|
||||
Wrapper for `lfgetkey()`, returns positive integer value to `key`,
|
||||
or `-1` if `key` is not found.
|
||||
|
||||
- `fgetint(file, sep, key)`
|
||||
|
||||
Wrapper for `lfopen()`, `lfgetint()`, and `lfclose()`. Useful for
|
||||
when only reading a single `key` from a file.
|
||||
|
||||
- `makepath(dir)`
|
||||
|
||||
Create all components of the specified directory.
|
||||
|
||||
Reference in new issue
Block a user