core-legacy/include/models/macro.h
Tobias Reisinger 0103b0b2ff add: more basic macro stuff
add: more efficient relay loading (only ids)
2020-08-29 23:51:45 +02:00

45 lines
587 B
C

#ifndef CORE_MACRO_H
#define CORE_MACRO_H
#include <uuid/uuid.h>
#include <cJSON.h>
#include <constants.h>
#include <models/period.h>
typedef struct
{
int id;
uuid_t uid;
char name[MAX_NAME_LENGTH + 1];
} macro_t;
int
macro_save(macro_t *macro);
int
macro_remove(macro_t *macro);
void
macro_free(macro_t *macro);
void
macro_free_list(macro_t **macro);
cJSON*
macro_to_json(macro_t *macro);
void
macro_free_list(macro_t **macros_list);
macro_t*
macro_get_by_id(int id);
macro_t*
macro_get_by_uid(uuid_t uid);
macro_t**
macro_get_all();
#endif /* CORE_MACRO_H */