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

63 lines
998 B
C

#ifndef CORE_CACHE_H
#define CORE_CACHE_H
#include <sqlite3.h>
#include <models/schedule.h>
#include <models/relay.h>
#include <models/controller.h>
extern sqlite3 *cache_database;
void
cache_init();
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);
char*
cache_get_json_relay(int relay_id, int status_relay);
void
cache_invalidate_relay(int relay_id, int status_relay);
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);
void
cache_invalidate_tagged(int tag_id);
#endif /* CORE_CACHE_H */