37
GHashTable *cmds; /**< Callbacks that manage command response. */
38
GHashTable *msgs; /**< Callbacks that manage incoming messages. */
39
GHashTable *errors; /**< Callbacks that manage command errors. */
41
GHashTable *async; /**< Callbacks that manage incoming asyncronous messages. */
42
/* TODO: Does this one is really needed? */
43
GHashTable *fallback; /**< Fallback callback. */
47
* Create a new instance of a MsnTable which map commands, errors and messages
48
* with callbacks that will handle it.
50
* @return A new MsnTable.
45
52
MsnTable *msn_table_new(void);
57
* @param table The MsnTable to be destroyed.
46
59
void msn_table_destroy(MsnTable *table);
62
* Relate an incomming command from server with a callback able to handle
65
* @param table The MsnTable.
66
* @param command If NULL this add an incoming asyncronous command set in answer.
67
* Else, the command sent.
68
* @param answer The server answer to 'command'. If 'command' is NULL,
69
* the asyncronous command sent by the server.
70
* @param cb Callback to handle this event.
48
72
void msn_table_add_cmd(MsnTable *table, char *command, char *answer,
76
* Set a callback to handle incoming command errors.
78
* @param table The MsnTable.
79
* @param answer Incoming command with error.
80
* @param cb Callback to handle this error.
50
82
void msn_table_add_error(MsnTable *table, char *answer, MsnErrorCb cb);
85
* Relate a message Content-type with a callback able to handle it.
87
* @param table The MsnTable.
88
* @param type The Message Content-Type.
89
* @param cb Callback to handle this Content-type.
51
91
void msn_table_add_msg_type(MsnTable *table, char *type, MsnMsgTypeCb cb);
53
93
#endif /* MSN_TABLE_H */