1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

refactored more struct cfg stuff

This commit is contained in:
Steffen Vogel 2017-02-18 10:49:42 -05:00
parent 309ec9f6a6
commit 7e411ed5ab
4 changed files with 9 additions and 12 deletions

View file

@ -27,12 +27,14 @@
#include "list.h"
/* The configuration of hook parameters is done in "config.h" */
#include "cfg.h"
/* Forward declarations */
struct path;
struct hook;
struct sample;
struct settings;
struct cfg;
/** This is a list of hooks which can be used in the configuration file. */
extern struct list hooks;
@ -99,7 +101,7 @@ struct hook {
};
/** Save references to global nodes, paths and settings */
void hook_init(struct list *nodes, struct list *paths, struct settings *set);
void hook_init(struct cfg *cfg);
/** Sort hook list according to the their priority. See hook::priority. */
int hooks_sort_priority(const void *a, const void *b);

View file

@ -23,7 +23,6 @@
extern struct list node_types; /**< Vtable for virtual node sub types */
/* Forward declarations */
struct config_setting_t cfg;
struct node_type;
/** The data structure for a node.

View file

@ -99,7 +99,7 @@
#define BIT(nr) (1UL << (nr))
/* Forward declarations */
struct settings;
struct cfg;
struct timespec;
/** Print copyright message to screen. */

View file

@ -16,19 +16,15 @@
#include "path.h"
#include "utils.h"
#include "node.h"
#include "cfg.h"
struct list hooks;
/* Those references can be used inside the hook callbacks after initializing them with hook_init() */
struct list *hook_nodes = NULL;
struct list *hook_paths = NULL;
struct settings *hook_settings = NULL;
struct cfg *cfg = NULL;
void hook_init(struct list *nodes, struct list *paths, struct settings *set)
void hook_init(struct cfg *c)
{
hook_nodes = nodes;
hook_paths = paths;
hook_settings = set;
cfg = c;
}
int hooks_sort_priority(const void *a, const void *b) {