core-legacy/include/cache.h

64 lines
998 B
C
Raw Permalink Normal View History

2020-08-13 09:26:06 +00:00
#ifndef CORE_CACHE_H
#define CORE_CACHE_H
#include <sqlite3.h>
2020-08-13 14:29:26 +00:00
#include <models/schedule.h>
#include <models/relay.h>
#include <models/controller.h>
2020-08-13 09:26:06 +00:00
extern sqlite3 *cache_database;
void
cache_init();
2020-08-13 14:29:26 +00:00
void
cache_free();
void
cache_put_json_schedule(int schedule_id, char *schedule_json);
char*
cache_get_json_schedule(int schedule_id);
void
cache_invalidate_schedule(int schedule_id);
void
cache_put_json_relay(int relay_id, int status_relay, char *relay_json);
2020-08-13 14:29:26 +00:00
char*
cache_get_json_relay(int relay_id, int status_relay);
2020-08-13 14:29:26 +00:00
void
cache_invalidate_relay(int relay_id, int status_relay);
2020-08-13 14:29:26 +00:00
void
cache_put_json_controller(int controller_id, char *controller_json);
char*
cache_get_json_controller(int controller_id);
void
cache_invalidate_controller(int controller_id);
void
cache_put_json_macro(int macro_id, char *macro_json);
char*
cache_get_json_macro(int macro_id);
void
cache_invalidate_macro(int macro_id);
2020-08-13 14:29:26 +00:00
void
cache_invalidate_tagged(int tag_id);
2020-08-13 09:26:06 +00:00
#endif /* CORE_CACHE_H */