-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverinfo.h
54 lines (47 loc) · 1.03 KB
/
serverinfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef SERVERINFO_H
#define SERVERINFO_H
#include <libpq-fe.h>
struct server_type
{
const char *idx;
const char *db_name;
const char *name;
};
enum
{
SERVER_LEAF = 1,
SERVER_HUB,
SERVER_STAFF,
SERVER_BOTS
};
struct server_info
{
char *name;
int type;
char *numeric;
char *link_pass;
char *irc_ip_priv;
char *irc_ip_priv_local;
char *irc_ip_pub;
char *server_port;
char *description;
char *contact;
char *location1;
char *location2;
char *provider;
int sno_connexit;
char *ssh_user;
char *ssh_host;
char *ssh_port;
PGresult *db_res;
int free_self;
};
const char *serverinfo_db_from_type(struct server_info *info);
const char *serverinfo_name_from_type(struct server_info *info);
int serverinfo_type_from_db(const char *db_type);
struct server_info *serverinfo_load_pg(PGresult *res, int row);
struct server_info *serverinfo_load(const char *server);
struct server_info *serverinfo_prompt(struct server_info *current);
void serverinfo_show(struct server_info *info);
void serverinfo_free(struct server_info *info);
#endif