From 20c2069231c446f2312c6d4d36b73eb61cc66b1f Mon Sep 17 00:00:00 2001 From: jpekkila Date: Tue, 1 Oct 2019 15:45:56 +0300 Subject: [PATCH] Made the utility library more consistent with the core library --- src/utils/config_loader.c | 8 ++++---- src/utils/config_loader.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/config_loader.c b/src/utils/config_loader.c index 2b22f73..f12175d 100644 --- a/src/utils/config_loader.c +++ b/src/utils/config_loader.c @@ -109,12 +109,12 @@ update_config(AcMeshInfo* config) /** \brief Loads data from astaroth.conf into a config struct. -\return 0 on success, -1 if there are potentially uninitialized values. +\return AC_SUCCESS on success, AC_FAILURE if there are potentially uninitialized values. */ -int +AcResult acLoadConfig(const char* config_path, AcMeshInfo* config) { - int retval = 0; + int retval = AC_SUCCESS; assert(config_path); // memset reads the second parameter as a byte even though it says int in @@ -136,7 +136,7 @@ acLoadConfig(const char* config_path, AcMeshInfo* config) if (((uint32_t*)config)[i] == (uint32_t)0xFFFFFFFF) { fprintf(stderr, "Some config values may be uninitialized. " "See that all are defined in astaroth.conf\n"); - retval = -1; + retval = AC_FAILURE; } } return retval; diff --git a/src/utils/config_loader.h b/src/utils/config_loader.h index 4eb2c50..1775705 100644 --- a/src/utils/config_loader.h +++ b/src/utils/config_loader.h @@ -30,7 +30,7 @@ extern "C" { #endif /** Loads data from the config file */ -int acLoadConfig(const char* config_path, AcMeshInfo* config); +AcResult acLoadConfig(const char* config_path, AcMeshInfo* config); #ifdef __cplusplus } // extern "C"