Add a connect callback.

This commit is contained in:
Ian Gulliver
2015-06-18 04:27:17 +00:00
parent c72f2ff30e
commit d0d0ed1e21
3 changed files with 62 additions and 1 deletions

View File

@@ -10,6 +10,7 @@
#define COSMO_UUID_SIZE 37
typedef struct {
void (*connect)(void *);
void (*logout)(void *);
void (*message)(const json_t *, void *);
} cosmo_callbacks;
@@ -30,6 +31,18 @@ typedef struct {
uint64_t next_delay_ms;
unsigned int seedp;
enum {
INITIAL_CONNECT,
CONNECTED,
DISCONNECTED,
} connect_state;
enum {
LOGIN_UNKNOWN,
LOGGED_OUT,
LOGGED_IN,
} login_state;
pthread_t thread;
CURL *curl;
} cosmo;