#ifndef UMBRELLA_UNIT_H #define UMBRELLA_UNIT_H #include "umbrella.h" /* * unit_load_all: scan UMBRELLA_UNITS_DIR and load all *.yaml files. * Populates g.units and g.unit_count. * Returns number of units loaded, -1 on fatal error. */ int unit_load_all(void); /* * unit_load_file: load a single unit yaml file. * Returns 0 on success, -1 on error. */ int unit_load_file(const char *path, Unit *out); /* * unit_find: look up a unit by name. * Returns pointer into g.units, or NULL if not found. */ Unit *unit_find(const char *name); /* * unit_state_str: human-readable state name. */ const char *unit_state_str(ProcessState state); /* * ring_init: allocate and zero a ring buffer. */ RingBuffer *ring_init(void); /* * ring_push: append a line to the ring buffer. */ void ring_push(RingBuffer *rb, const char *line, int len); /* * ring_free: free a ring buffer. */ void ring_free(RingBuffer *rb); #endif /* UMBRELLA_UNIT_H */