diff options
author | Søren Sandmann <sandmann@redhat.com> | 2009-08-30 21:50:51 -0400 |
---|---|---|
committer | Søren Sandmann <sandmann@redhat.com> | 2009-08-30 21:50:51 -0400 |
commit | e947945d98e54fbd72c7764418b6556c7df7c7cc (patch) | |
tree | 88854705a9aa8b78a65f130f71ad3b1a5b89031b /connection.h |
Diffstat (limited to 'connection.h')
-rw-r--r-- | connection.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/connection.h b/connection.h new file mode 100644 index 0000000..9d6322b --- /dev/null +++ b/connection.h @@ -0,0 +1,43 @@ +#ifndef _CONNECTION_H_ +#define _CONNECTION_H_ + +typedef struct Connection Connection; +typedef union ConnectionEvent ConnectionEvent; + +typedef enum +{ + CONNECTION_READ, + CONNECTION_CLOSE, + CONNECTION_ERROR +} ConnectionEventType; + +union ConnectionEvent +{ + ConnectionEventType type; + + struct + { + ConnectionEventType type; + } read; + + struct + { + ConnectionEventType type; + } close; + + struct + { + ConnectionEventType type; + } error; +}; + +typedef void (* ConnectionFunc) (Connection *connection, + ConnectionEvent *event); + +Connection *connection_new (int fd, + MainContext *context, + ConnectionFunc func, + gpointer data); + + +#endif |