54 lines
851 B
C
54 lines
851 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_invalidate_tagged(int tag_id);
|
|
|
|
#endif /* CORE_CACHE_H */
|