2020-08-29 21:51:45 +00:00
|
|
|
#ifndef CORE_MACRO_H
|
|
|
|
#define CORE_MACRO_H
|
|
|
|
|
|
|
|
#include <uuid/uuid.h>
|
|
|
|
|
|
|
|
#include <cJSON.h>
|
|
|
|
|
|
|
|
#include <constants.h>
|
2020-09-03 22:28:49 +00:00
|
|
|
#include <models/macro_action.h>
|
2020-08-29 21:51:45 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
macro_t*
|
|
|
|
macro_get_by_id(int id);
|
|
|
|
|
|
|
|
macro_t*
|
|
|
|
macro_get_by_uid(uuid_t uid);
|
|
|
|
|
|
|
|
macro_t**
|
|
|
|
macro_get_all();
|
|
|
|
|
2020-09-06 11:12:33 +00:00
|
|
|
int*
|
|
|
|
macro_get_target_relay_ids(int macro_id);
|
|
|
|
|
2020-08-29 21:51:45 +00:00
|
|
|
#endif /* CORE_MACRO_H */
|