58 lines
992 B
C
58 lines
992 B
C
/*
|
||
* db.h
|
||
*
|
||
* Created on: 13 июл. 2022 г.
|
||
* Author: alexander
|
||
*/
|
||
|
||
#ifndef DB_H_
|
||
#define DB_H_
|
||
|
||
#include <stdlib.h>
|
||
#include <stdbool.h>
|
||
|
||
#include "parameter.h"
|
||
#include "value.h"
|
||
|
||
typedef struct Host
|
||
{
|
||
char **data;
|
||
size_t size;
|
||
} Host;
|
||
|
||
typedef struct Hosts
|
||
{
|
||
Host **host;
|
||
size_t size;
|
||
} Hosts;
|
||
|
||
typedef struct Monitor
|
||
{
|
||
char **data;
|
||
size_t size;
|
||
} Monitor;
|
||
|
||
typedef struct Monitors
|
||
{
|
||
Monitor **monitor;
|
||
size_t size;
|
||
} Monitors;
|
||
|
||
char *getPathDB(char *path);
|
||
|
||
bool dbLoadData();
|
||
Hosts *dbGetHostsList();
|
||
void dbFreeHosts(Hosts *hosts);
|
||
Monitors *dbGetMonitorsList();
|
||
void dbFreeMonitors(Monitors *monitors);
|
||
bool deleteAllMonitors();
|
||
int dbAddMonitor(char *monitor, bool set);
|
||
int dbSaveMonitors(char *name);
|
||
bool dbWriteParameter(Parameter name, bool set);
|
||
bool dbWriteValue(Value name, bool set);
|
||
bool dbSetUserNameCurrent(char *current);
|
||
int dbAddServer(char *ip, char *dns);
|
||
int dbInsertHistory(char *login, char *host);
|
||
|
||
#endif /* DB_H_ */
|