From 18b0de19830e7286ad5eecbba23013e835739cdc Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 26 Jun 2021 15:04:05 +0200 Subject: 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 . The rib now has its own struct rib_attr to set attributes such as size and last modified time. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- include/ouroboros/rib.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include') 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 #include 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); -- cgit v1.2.3