aboutsummaryrefslogtreecommitdiffstats
path: root/libglouglou/libglouglou.h
diff options
context:
space:
mode:
Diffstat (limited to 'libglouglou/libglouglou.h')
-rw-r--r--libglouglou/libglouglou.h49
1 files changed, 27 insertions, 22 deletions
diff --git a/libglouglou/libglouglou.h b/libglouglou/libglouglou.h
index cdb29e7..5c727b4 100644
--- a/libglouglou/libglouglou.h
+++ b/libglouglou/libglouglou.h
@@ -111,7 +111,7 @@ typedef struct gg_packet_props_t {
extern gg_packet_props_t gg_packet_props[];
struct gg_user {
- LIST_ENTRY(gg_user) entry;
+ LIST_ENTRY(gg_user) entry;
int id;
int sock;
struct sockaddr_in addr;
@@ -121,17 +121,17 @@ struct gg_user {
struct gg_server {
struct event_base *ev_base;
const char *ip;
- int port;
+ int port;
struct sockaddr_in addr;
struct event *ev;
- int sock;
+ int sock;
int (*handle_conn)(struct gg_server *, struct gg_user *);
int (*handle_packet)(struct gg_server *,
struct gg_user *, struct gg_packet *);
- void *usrdata;
+ void *usrdata;
LIST_HEAD(, gg_user) user_list;
- int user_count;
- int user_id_count;
+ int user_count;
+ int user_id_count;
};
enum client_status {
@@ -155,23 +155,28 @@ struct gg_client {
};
struct gg_server *gg_server_start(struct event_base *, char *, int,
- int (*handle_conn)(struct gg_server *, struct gg_user *),
- int (*handle_packet)(struct gg_server *, struct gg_user *, struct gg_packet *),
- void *);
-void gg_server_stop(struct gg_server *);
-int gg_server_send(struct gg_server *, struct gg_packet *, struct gg_user *);
-void gg_server_send_flush(struct gg_server *, struct gg_user *);
+ int (*handle_conn)(struct gg_server *,
+ struct gg_user *),
+ int (*handle_packet)(struct gg_server *,
+ struct gg_user *, struct gg_packet *),
+ void *);
+void gg_server_stop(struct gg_server *);
+int gg_server_send(struct gg_server *,
+ struct gg_packet *, struct gg_user *);
+void gg_server_send_flush(struct gg_server *,
+ struct gg_user *);
struct gg_client *gg_client_connect(struct event_base *, char *, int,
- int (*handle_conn)(struct gg_client *),
- int (*handle_packet)(struct gg_client *, struct gg_packet *),
- void *);
-void gg_client_disconnect(struct gg_client *);
-int gg_client_send(struct gg_client *, struct gg_packet *);
-void gg_client_send_flush(struct gg_client *);
+ int (*handle_conn)(struct gg_client *),
+ int (*handle_packet)(struct gg_client *,
+ struct gg_packet *),
+ void *);
+void gg_client_disconnect(struct gg_client *);
+int gg_client_send(struct gg_client *, struct gg_packet *);
+void gg_client_send_flush(struct gg_client *);
-int gg_verbosity_get(void);
-void gg_verbosity_set(int);
+int gg_verbosity_get(void);
+void gg_verbosity_set(int);
/* utils.c */
@@ -181,7 +186,7 @@ void gg_verbosity_set(int);
#define GGLOG_INFO 1
#define GGLOG_DEBUG 2
-int gg_log_init(char *, int);
+int gg_log_init(char *, int);
void gg_log_shutdown(void);
void gg_log_tmp(const char *, ...);
void gg_log_debug(const char *, ...);
@@ -197,7 +202,7 @@ void *xmalloc(size_t);
void *xcalloc(size_t, size_t);
void fd_nonblock(int);
void addrcpy(struct sockaddr_in *, struct sockaddr_in *);
-int addrcmp(struct sockaddr_in *, struct sockaddr_in *);
+int addrcmp(struct sockaddr_in *, struct sockaddr_in *);
void droppriv(char *, int, char *);
#endif /* _LIBGLOUGLOU_H_ */