diff options
author | Dimitri Staessens <[email protected]> | 2021-06-26 15:04:05 +0200 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2021-06-28 15:29:19 +0200 |
commit | 18b0de19830e7286ad5eecbba23013e835739cdc (patch) | |
tree | 6c7f1cadb2c1fd4a19c388c1e42ac94700a568aa /include | |
parent | cb70b78c443de5f8b95c4469dd8eb7f77af880ed (diff) | |
download | ouroboros-18b0de19830e7286ad5eecbba23013e835739cdc.tar.gz ouroboros-18b0de19830e7286ad5eecbba23013e835739cdc.zip |
lib: Remove struct stat from RIB API
The RIB API had a struct stat in the getattr() function, which made
all components that exposed variables via the RIB dependent on
<sys/stat.h>. The rib now has its own struct rib_attr to set
attributes such as size and last modified time.
Signed-off-by: Dimitri Staessens <[email protected]>
Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'include')
-rw-r--r-- | include/ouroboros/rib.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/ouroboros/rib.h b/include/ouroboros/rib.h index c2812bcd..3a74bee3 100644 --- a/include/ouroboros/rib.h +++ b/include/ouroboros/rib.h @@ -25,18 +25,22 @@ #define RIB_PATH_LEN 128 -#include <sys/stat.h> #include <sys/types.h> struct rib; +struct rib_attr { + size_t size; /* Size of RIB document */ + time_t mtime; /* Last modified time */ +}; + struct rib_ops { int (* read)(const char * path, char * buf, size_t len); int (* readdir)(char *** entries); - int (* getattr)(const char * path, - struct stat * st); + int (* getattr)(const char * path, + struct rib_attr * attr); }; int rib_init(const char * prefix); |