24
|
1 #ifndef __SERVER_H__
|
|
2 #define __SERVER_H__ 1
|
|
3
|
|
4 typedef enum {
|
|
5 SM_MESSAGE,
|
|
6 SM_PRESENCE,
|
|
7 SM_UNHANDLED
|
|
8 } SRV_MSGTYPE;
|
|
9
|
|
10 typedef struct {
|
|
11 SRV_MSGTYPE m; /* message type: see above! */
|
|
12 int connected; /* meaningful only with SM_PRESENCE */
|
|
13 char *from; /* sender */
|
|
14 char *body; /* meaningful only with SM_MESSAGE */
|
|
15 } srv_msg;
|
|
16
|
|
17 char *srv_poll(int sock);
|
|
18 int srv_connect(const char *server, unsigned int port);
|
|
19 char *srv_login(int sock, const char *server, const char *user,
|
|
20 const char *pass, const char *resource);
|
|
21 int srv_setpresence(int sock, const char *type);
|
|
22 char *srv_getroster(int sock);
|
|
23 int srv_sendtext(int sock, const char *to, const char *text,
|
|
24 const char *from);
|
|
25 int check_io(int fd1, int fd2);
|
|
26 srv_msg *readserver(int sock);
|
|
27 void srv_DelBuddy(int sock, char *jidname);
|
|
28 void srv_AddBuddy(int sock, char *jidname);
|
|
29 #endif
|