Jabber WindowGram Client (JWGC)

Introduction Screenshots Installation Downloads
Documentation Browse Source Resources Project Site

Stable Version
-none-

Latest Version
beta5



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

libjabber.h

Go to the documentation of this file.
00001 /*
00002  *  This program is free software; you can redistribute it and/or modify
00003  *  it under the terms of the GNU General Public License as published by
00004  *  the Free Software Foundation; either version 2 of the License, or
00005  *  (at your option) any later version.
00006  *
00007  *  This program is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  *  GNU General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00015  *
00016  *  Jabber
00017  *  Copyright (C) 1998-1999 The Jabber Team http://jabber.org/
00018  *
00019  */
00020 
00021 /* $Id: libjabber.h,v 1.11 2004/08/15 17:21:17 jadestorm Exp $ */
00022 
00023 #ifndef _LIBJABBER_H_
00024 #define _LIBJABBER_H_ 1
00025 
00026 #include <sysdep.h>
00027 #include "libxode.h"
00028 #include "libjabber_types.h"
00029 #include "libjwgc_types.h"
00030 
00031 
00032 
00033 /* --------------------------------------------------------- */
00034 /* jid.c                                                     */
00035 /* JID structures & constants                                */
00036 /* --------------------------------------------------------- */
00037 jid     jid_new(xode_pool p, char *idstr);
00038         /* Creates a jabber id from the idstr */
00039 void    jid_set(jid id, char *str, int item);
00040         /* Individually sets jid components */
00041 char    *jid_full(jid id);
00042         /* Builds a string type=user/resource@server from the jid data */
00043 jid     jid_user(jid a);
00044 int     jid_cmp(jid a, jid b);
00045         /* Compares two jid's, returns 0 for perfect match */
00046 int     jid_cmpx(jid a, jid b, int parts);
00047         /* Compares just the parts specified as JID_|JID_ */
00048 jid     jid_append(jid a, jid b);
00049         /* Appending b to a (list), no dups */
00050 xode    jid_xres(jid id);
00051         /* Returns xode representation of the resource?query=string */
00052 xode    jid_nodescan(jid id, xode x);
00053         /* Scans the children of the node for a matching jid attribute */
00054 
00055 
00056 
00057 /* --------------------------------------------------------- */
00058 /* jpacket.c                                                 */
00059 /* JPacket structures & constants                            */
00060 /* --------------------------------------------------------- */
00061 jabpacket       jabpacket_new(xode x);
00062         /* Creates a jabber packet from the xode */
00063 jabpacket       jabpacket_reset(jabpacket p);
00064         /* Resets the jpacket values based on the xode */
00065 int             jabpacket_subtype(jabpacket p);
00066         /* Returns the subtype value (looks at xode for it) */
00067 
00068 
00069 
00070 /* --------------------------------------------------------- */
00071 /* jconn.c                                                   */
00072 /* JConn structures & functions                              */
00073 /* --------------------------------------------------------- */
00074 jabconn jab_new(char *user, char *pass);
00075 void    jab_delete(jabconn j);
00076 void    jab_state_handler(jabconn j, jabconn_state_h h);
00077 void    jab_packet_handler(jabconn j, jabconn_packet_h h);
00078 void    jab_start(jabconn j, int ssl);
00079 void    jab_startup(jabconn j);
00080 void    jab_stop(jabconn j);
00081 int     jab_getfd(jabconn j);
00082 jid     jab_getjid(jabconn j);
00083 char    *jab_getsid(jabconn j);
00084 char    *jab_getid(jabconn j);
00085 void    jab_send(jabconn j, xode x);
00086 void    jab_send_raw(jabconn j, const char *str);
00087 void    jab_recv(jabconn j);
00088 void    jab_poll(jabconn j, int timeout);
00089 char    *jab_auth(jabconn j);
00090 char    *jab_reg(jabconn j);
00091 
00092 
00093 
00094 /* --------------------------------------------------------- */
00095 /* jutil.c                                                   */
00096 /* JUtil functions, types, and defines                       */
00097 /* --------------------------------------------------------- */
00098 xode    jabutil_presnew(int type, char *to, char *status, int priority);
00099         /* Create a skeleton presence packet */
00100 xode    jabutil_iqnew(int type, char *ns);
00101         /* Create a skeleton iq packet */
00102 xode    jabutil_msgnew(char *type, char *to, char *subj, char *body, char *encrypt);
00103         /* Create a skeleton message packet */
00104 xode    jabutil_pingnew(char *type, char *to);
00105         /* Create a skeleton composing packet */
00106 xode    jabutil_header(char* xmlns, char* server);
00107         /* Create a skeleton stream packet */
00108 int     jabutil_priority(xode x);
00109         /* Determine priority of this packet */
00110 void    jabutil_tofrom(xode x);
00111         /* Swaps to/from fields on a packet */
00112 xode    jabutil_iqresult(xode x);
00113         /* Generate a skeleton iq/result, given a iq/query */
00114 char    *jabutil_timestamp(void);
00115         /* Get stringified timestamp */
00116 void    jabutil_error(xode x, terror E);
00117         /* Append an <error> node to x */
00118 void    jabutil_delay(xode msg, char *reason);
00119         /* Append a delay packet to msg */
00120 char    *jabutil_regkey(char *key, char *seed);
00121         /* pass a seed to generate a key, pass the key again to */
00122         /* validate (returns it) */
00123 char    *jab_type_to_ascii(int j_type);
00124         /* converts a numeric type to an ascii string */
00125 char    *jab_subtype_to_ascii(int j_subtype);
00126         /* converts a numeric subtype to an ascii string */
00127 char    *jab_contype_to_ascii(int j_contype);
00128         /* converts a numeric connection type to an ascii string */
00129 
00130 
00131 #endif /* _LIBJABBER_H_ */


Last updated at Tue Dec 18 21:07:42 PST 2007. This site and project hosted by...SourceForge.net Logo
Source Perspective by Fisheye