225 } |
225 } |
226 |
226 |
227 void |
227 void |
228 Init_lm_connection (VALUE lm_mLM) |
228 Init_lm_connection (VALUE lm_mLM) |
229 { |
229 { |
230 VALUE lm_mConnection; |
230 VALUE lm_cConnection; |
231 |
231 |
232 lm_mConnection = rb_define_class_under (lm_mLM, "Connection", |
232 lm_cConnection = rb_define_class_under (lm_mLM, "Connection", |
233 rb_cObject); |
233 rb_cObject); |
234 |
234 |
235 rb_define_alloc_func (lm_mConnection, conn_allocate); |
235 rb_define_alloc_func (lm_cConnection, conn_allocate); |
236 |
236 |
237 rb_define_method (lm_mConnection, "initialize", conn_initialize, 1); |
237 rb_define_method (lm_cConnection, "initialize", conn_initialize, 1); |
238 rb_define_method (lm_mConnection, "open", conn_open, -1); |
238 rb_define_method (lm_cConnection, "open", conn_open, -1); |
239 rb_define_method (lm_mConnection, "close", conn_close, 0); |
239 rb_define_method (lm_cConnection, "close", conn_close, 0); |
240 rb_define_method (lm_mConnection, "authenticate", conn_auth, -1); |
240 rb_define_method (lm_cConnection, "authenticate", conn_auth, -1); |
241 rb_define_method (lm_mConnection, "keep_alive_rate=", conn_set_keep_alive_rate, 1); |
241 rb_define_method (lm_cConnection, "keep_alive_rate=", conn_set_keep_alive_rate, 1); |
242 /* rb_define_method (lm_mConnection, "keep_alive_rate", conn_get_keep_alive_rate, 0); */ |
242 /* rb_define_method (lm_cConnection, "keep_alive_rate", conn_get_keep_alive_rate, 0); */ |
243 rb_define_method (lm_mConnection, "open?", conn_is_open, 0); |
243 rb_define_method (lm_cConnection, "open?", conn_is_open, 0); |
244 rb_define_method (lm_mConnection, "authenticated?", conn_is_authenticated, 0); |
244 rb_define_method (lm_cConnection, "authenticated?", conn_is_authenticated, 0); |
245 rb_define_method (lm_mConnection, "server", conn_get_server, 0); |
245 rb_define_method (lm_cConnection, "server", conn_get_server, 0); |
246 rb_define_method (lm_mConnection, "server=", conn_set_server, 1); |
246 rb_define_method (lm_cConnection, "server=", conn_set_server, 1); |
247 rb_define_method (lm_mConnection, "jid", conn_get_jid, 0); |
247 rb_define_method (lm_cConnection, "jid", conn_get_jid, 0); |
248 rb_define_method (lm_mConnection, "jid=", conn_set_jid, 1); |
248 rb_define_method (lm_cConnection, "jid=", conn_set_jid, 1); |
249 rb_define_method (lm_mConnection, "port", conn_get_port, 0); |
249 rb_define_method (lm_cConnection, "port", conn_get_port, 0); |
250 rb_define_method (lm_mConnection, "port=", conn_set_port, 1); |
250 rb_define_method (lm_cConnection, "port=", conn_set_port, 1); |
251 |
251 |
252 /* |
252 /* |
253 rb_define_method (lm_mConnection, "ssl", conn_get_ssl, 0); |
253 rb_define_method (lm_cConnection, "ssl", conn_get_ssl, 0); |
254 rb_define_method (lm_mConnection, "ssl=", conn_set_ssl, 1); |
254 rb_define_method (lm_cConnection, "ssl=", conn_set_ssl, 1); |
255 rb_define_method (lm_mConnection, "proxy", conn_get_proxy, 0); |
255 rb_define_method (lm_cConnection, "proxy", conn_get_proxy, 0); |
256 rb_define_method (lm_mConnection, "proxy=", conn_set_proxy, 1); |
256 rb_define_method (lm_cConnection, "proxy=", conn_set_proxy, 1); |
257 */ |
257 */ |
258 |
258 |
259 /* Use one send message and check if there is a block passed? */ |
259 /* Use one send message and check if there is a block passed? */ |
260 /* |
260 /* |
261 rb_define_method (lm_mConnection, "send", conn_send, 1); |
261 rb_define_method (lm_cConnection, "send", conn_send, 1); |
262 rb_define_method (lm_mConnection, "send_with_reply", conn_send_with_reply, -1); |
262 rb_define_method (lm_cConnection, "send_with_reply", conn_send_with_reply, -1); |
263 rb_define_method (lm_mConnection, "send_raw", conn_send_raw, 1); |
263 rb_define_method (lm_cConnection, "send_raw", conn_send_raw, 1); |
264 */ |
264 */ |
265 |
265 |
266 rb_define_method (lm_mConnection, "state", conn_get_state, 0); |
266 rb_define_method (lm_cConnection, "state", conn_get_state, 0); |
267 } |
267 } |