2022-07-13 17:49:49 +00:00
|
|
|
|
/*
|
|
|
|
|
* db.h
|
|
|
|
|
*
|
|
|
|
|
* Created on: 13 июл. 2022 г.
|
|
|
|
|
* Author: alexander
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef DB_H_
|
|
|
|
|
#define DB_H_
|
|
|
|
|
|
|
|
|
|
#include "parameter.h"
|
|
|
|
|
#include "value.h"
|
|
|
|
|
|
2022-07-15 14:16:58 +00:00
|
|
|
|
typedef struct Host
|
|
|
|
|
{
|
|
|
|
|
char **data;
|
|
|
|
|
size_t size;
|
|
|
|
|
} Host;
|
|
|
|
|
|
|
|
|
|
typedef struct Hosts
|
|
|
|
|
{
|
|
|
|
|
Host **host;
|
|
|
|
|
size_t size;
|
|
|
|
|
} Hosts;
|
|
|
|
|
|
2022-07-13 17:49:49 +00:00
|
|
|
|
bool dbLoadData();
|
2022-07-15 14:16:58 +00:00
|
|
|
|
Hosts *dbGetHostsList();
|
|
|
|
|
void dbFreeHosts(Hosts *hosts);
|
2022-07-13 17:49:49 +00:00
|
|
|
|
bool dbWriteParameter(Parameter name, bool set);
|
|
|
|
|
bool dbWriteValue(Value name, bool set);
|
2022-07-15 14:16:58 +00:00
|
|
|
|
bool dbSetUserNameCurrent(char *current);
|
|
|
|
|
int dbAddServer(char *ip, char *dns);
|
2022-07-13 17:49:49 +00:00
|
|
|
|
|
|
|
|
|
#endif /* DB_H_ */
|