45 lines
595 B
C
45 lines
595 B
C
#ifndef CORE_MACRO_H
|
|
#define CORE_MACRO_H
|
|
|
|
#include <uuid/uuid.h>
|
|
|
|
#include <cJSON.h>
|
|
|
|
#include <constants.h>
|
|
#include <models/macro_action.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);
|
|
|
|
macro_t*
|
|
macro_get_by_id(int id);
|
|
|
|
macro_t*
|
|
macro_get_by_uid(uuid_t uid);
|
|
|
|
macro_t**
|
|
macro_get_all();
|
|
|
|
int*
|
|
macro_get_target_relay_ids(int macro_id);
|
|
|
|
#endif /* CORE_MACRO_H */
|