Main Page | Data Structures | File List | Data Fields | Globals

engine_xmpp.c File Reference

#include <iksemel.h>
#include <engine_xmpp.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>

Defines

#define USE_TLS
#define ENGINE_XMPP_LOG(text)   if( engine_xmpp->logger != NULL ) BIO_puts(engine_xmpp->logger, text);

Functions

engine_xmpp_tengine_xmpp_new ()
 Allocates and returns a engine_xmpp_t structure and initializes it with default values.

void engine_xmpp_set_server (engine_xmpp_t *engine_xmpp, char *server)
 Set XMPP-server.

void engine_xmpp_set_account (engine_xmpp_t *engine_xmpp, char *jid, char *password, int set_roster)
 Set XMPP-account the API shall use.

void engine_xmpp_set_logger (engine_xmpp_t *engine_xmpp, BIO *logger)
 Set the loggger to use for this subsystem.

void engine_xmpp_connect (engine_xmpp_t *engine_xmpp)
 Connect to the XMPP server with the set account.

int engine_xmpp_process (engine_xmpp_t *engine_xmpp)
 Process messages from XMPP-server and return when done This function uses polling to see if there are any messages from the server. If we have not received any messages during a period it will return. Call the function at regular intervals to keep the connection.

void engine_xmpp_disconnect (engine_xmpp_t *engine_xmpp)
 Disconnect from the XMPP-server.

void engine_xmpp_send_msg (engine_xmpp_t *engine_xmpp, char *to, char *message)
 Send a message to a given XMPP-client.

void engine_xmpp_add_msg_handler (engine_xmpp_t *engine_xmpp, engine_xmpp_msg_handler_t handler)
 Add a callback-function that is called when a message is received from the XMPP-server.


Define Documentation

#define ENGINE_XMPP_LOG text   )     if( engine_xmpp->logger != NULL ) BIO_puts(engine_xmpp->logger, text);
 

#define USE_TLS
 


Function Documentation

void engine_xmpp_add_msg_handler engine_xmpp_t engine_xmpp,
engine_xmpp_msg_handler_t  callback
 

Add a callback-function that is called when a message is received from the XMPP-server.

Parameters:
engine_xmpp 
callback The callback function beeing called when a message is received from the XMPP-server

void engine_xmpp_connect engine_xmpp_t engine_xmpp  ) 
 

Connect to the XMPP server with the set account.

Parameters:
engine_xmpp 

void engine_xmpp_disconnect engine_xmpp_t engine_xmpp  ) 
 

Disconnect from the XMPP-server.

Parameters:
engine_xmpp 

engine_xmpp_t* engine_xmpp_new  ) 
 

Allocates and returns a engine_xmpp_t structure and initializes it with default values.

Returns:
A newly allocated and initialized engine_xmpp_t structure

int engine_xmpp_process engine_xmpp_t engine_xmpp  ) 
 

Process messages from XMPP-server and return when done This function uses polling to see if there are any messages from the server. If we have not received any messages during a period it will return. Call the function at regular intervals to keep the connection.

Parameters:
engine_xmpp 

void engine_xmpp_send_msg engine_xmpp_t engine_xmpp,
char *  to,
char *  message
 

Send a message to a given XMPP-client.

Parameters:
engine_xmpp 
to Jabber ID that is the receipient of this message
message Message to send

void engine_xmpp_set_account engine_xmpp_t engine_xmpp,
char *  jid,
char *  password,
int  set_roster
 

Set XMPP-account the API shall use.

Parameters:
engine_xmpp 
jid The Jabber ID the engine will use
password The password associated with this Jabber ID
set_roster Set to 0 if the roster shall not be downloaded.

void engine_xmpp_set_logger engine_xmpp_t engine_xmpp,
BIO *  logger
 

Set the loggger to use for this subsystem.

Parameters:
engine_xmpp 
logger A openssl structure created by BIO_new or BIO_set

void engine_xmpp_set_server engine_xmpp_t engine_xmpp,
char *  server
 

Set XMPP-server.

Parameters:
engine_xmpp 
server The XMPP-server


Generated on Wed Mar 14 20:32:17 2007 for GloPosCom by doxygen 1.3.4