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

engine_xmpp.h File Reference

#include <iksemel.h>
#include <openssl/BIO.h>

Go to the source code of this file.

Data Structures

struct  engine_xmpp_session_t
 Contains all data related to a connection to a Jabber server. More...

struct  engine_xmpp_t
 Structure containing all data related to the XMPP connection. More...


Defines

#define ENGINE_XMPP_SESSION(engine_xmpp)   (engine_xmpp->session)
 A convenience macro used to extract session from the engine_xmpp_t structure.


Typedefs

typedef void(* engine_xmpp_msg_handler_t )(void *engine_xmpp, char *from, char *message)
 Callback that is called when a message is received from the XMPP-server.


Functions

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

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

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_disconnect (engine_xmpp_t *engine_xmpp)
 Disconnect from the XMPP-server.

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_set_logger (engine_xmpp_t *engine_xmpp, BIO *logger)
 Set the loggger to use for this subsystem.

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.

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


Define Documentation

#define ENGINE_XMPP_SESSION engine_xmpp   )     (engine_xmpp->session)
 

A convenience macro used to extract session from the engine_xmpp_t structure.


Typedef Documentation

typedef void(* engine_xmpp_msg_handler_t)(void* engine_xmpp, char* from, char* message)
 

Callback that is called when a message is received from the XMPP-server.

Parameters:
engine_xmpp pointer that the developer must cast into a engine_xmpp_t*
from The Jabber ID of client sending the message
message The message from the client


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