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

libjwgc.h

Go to the documentation of this file.
00001 /* $Id: libjwgc.h,v 1.40 2004/08/21 03:22:12 jadestorm Exp $ */
00002 
00003 #ifndef _LIBJWGC_H_
00004 #define _LIBJWGC_H_ 1
00005 
00006 #include <sysdep.h>
00007 #include "libxode.h"
00008 #include "libjwgc_types.h"
00009 #include "libjwgc_debug.h"
00010 #include "libjabber_types.h"
00011 
00012 
00013 
00014 /* --------------------------------------------------------- */
00015 /* JAuth.c                                                   */
00016 /* Auth string support                                       */
00017 /*                                                           */
00018 /* --------------------------------------------------------- */
00019 void    JGenerateAuth();
00020 int     JCheckAuth(char *str);
00021 char    *JGetAuth();
00022 
00023 
00024 
00025 /* --------------------------------------------------------- */
00026 /* JContact.c                                                */
00027 /* Contact management                                        */
00028 /*                                                           */
00029 /* --------------------------------------------------------- */
00030 int contact_status_change(jabpacket packet);
00031 char *find_nickname_from_jid(char *jid);
00032 char *find_jid_from_nickname(char *nickname);
00033 void list_contacts(jwgconn jwg, char *matchstr, int strictmatch, int skipnotavail);
00034 void list_contacts_bygroup(jwgconn jwg, char *matchstr, int strictmatch, int skipnotavail);
00035 void list_agents(xode x);
00036 int update_contact_status(char *jid, char *status, char *resource);
00037 void update_nickname(char *target, char *nickname);
00038 void update_group(char *target, char *group);
00039 void remove_from_contact_list(char *contact);
00040 int test_match(char *matchstr, xode contact, int exactmatch);
00041 char *find_match(char *searchstr);
00042 void insert_into_agent_list(char *jid, char *name, char *service, int flags);
00043 
00044 
00045 
00046 /* --------------------------------------------------------- */
00047 /* JEncryption.c                                             */
00048 /* GPG encryption functions                                  */
00049 /* --------------------------------------------------------- */
00050 #ifdef USE_GPGME
00051 char    *JDecrypt(char *data);
00052 char    *JEncrypt(char *data, char *recipient);
00053 char    *JSign(char *data);
00054 char    *JGetKeyID(char *jid);
00055 char    *JGetSignature(char *text, char *sig);
00056 char    *JTrimPGPMessage(char *msg);
00057 void    JUpdateKeyList(char *jid, char *textstring, char *sigstring);
00058 #endif /* USE_GPGME */
00059 
00060 
00061 
00062 /* --------------------------------------------------------- */
00063 /* JExpat.c                                                  */
00064 /* Expat functions                                           */
00065 /* --------------------------------------------------------- */
00066 void    expat_startElement(void* userdata, const char* name, const char** atts);
00067 void    expat_endElement(void* userdata, const char* name);
00068 void    expat_charData(void* userdata, const char* s, int len);
00069 xode    xode_str(char *str, int len);
00070 xode    xode_file(char *file);
00071 int     xode2file(char *file, xode node);
00072 void    xode_put_expat_attribs(xode owner, const char** atts);
00073 
00074 
00075 
00076 /* --------------------------------------------------------- */
00077 /* JFile.c                                                   */
00078 /* Communication record file functions                       */
00079 /* --------------------------------------------------------- */
00080 int     JSaveAuthPort();
00081 int     JGetAuthPort();
00082 void    JClearAuthPort();
00083 int     JSetupComm();
00084 int     JConnect();
00085 void    JCleanupSocket();
00086 
00087 
00088 
00089 /* --------------------------------------------------------- */
00090 /* JForm.c                                                   */
00091 /* Form handling routines                                    */
00092 /* --------------------------------------------------------- */
00093 xode    JFormHandler(xode form);
00094 
00095 
00096 
00097 /* --------------------------------------------------------- */
00098 /* JHashTable.c                                              */
00099 /* Hash table functions                                      */
00100 /* --------------------------------------------------------- */
00101 NAMED   *lookup(HASH_TABLE *table, KEY name, size_t createSize);
00102 void    hashTableInit(HASH_TABLE *);
00103 void    hashTableDestroy(HASH_TABLE *);
00104 void    hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *);
00105 NAMED   *hashTableIterNext(HASH_TABLE_ITER *);
00106 
00107 
00108 
00109 /* --------------------------------------------------------- */
00110 /* JNetSock.c                                                */
00111 /* Network socket routines                                   */
00112 /* --------------------------------------------------------- */
00113 #ifndef WIN32
00114 int     make_netsocket(u_short port, char *host, int type);
00115 int     get_netport();
00116 struct in_addr  *make_addr(char *host);
00117 int     set_fd_close_on_exec(int fd, int flag);
00118 #endif
00119 
00120 
00121 
00122 /* --------------------------------------------------------- */
00123 /* JSha.c                                                    */
00124 /* SHA calculations                                          */
00125 /* --------------------------------------------------------- */
00126 void    j_shaInit(j_SHA_CTX *ctx);
00127 void    j_shaUpdate(j_SHA_CTX *ctx, unsigned char *dataIn, int len);
00128 void    j_shaFinal(j_SHA_CTX *ctx, unsigned char hashout[20]);
00129 void    j_shaBlock(unsigned char *dataIn, int len, unsigned char hashout[20]);
00130 char    *j_shahash(char *str);
00131 void    j_shahash_r(const char* str, char hashbuf[41]);
00132 
00133 
00134 
00135 /* --------------------------------------------------------- */
00136 /* JStr.c                                                    */
00137 /* String management routines                                */
00138 /* --------------------------------------------------------- */
00139 char    *j_strdup(const char *str);
00140         /* provides NULL safe strdup wrapper */
00141 char    *j_strcat(char *dest, char *txt);
00142         /* strcpy() clone */
00143 int     j_strcmp(const char *a, const char *b);
00144         /* provides NULL safe strcmp wrapper */
00145 int     j_strcasecmp(const char *a, const char *b);
00146         /* provides NULL safe strcasecmp wrapper */
00147 int     j_strncmp(const char *a, const char *b, int i);
00148         /* provides NULL safe strncmp wrapper */
00149 int     j_strncasecmp(const char *a, const char *b, int i);
00150         /* provides NULL safe strncasecmp wrapper */
00151 int     j_strlen(const char *a);
00152         /* provides NULL safe strlen wrapper */
00153 int     j_atoi(const char *a, int def);
00154         /* checks for NULL and uses default instead, convienence */
00155 void    str_b64decode(char *str);
00156         /* what it says */
00157 void    trim_message(char *str);
00158         /* trim whitespace from end of string */
00159 xode_spool      spool_new(xode_pool p);
00160         /* create a string pool */
00161 void    spooler(xode_spool s, ...);
00162         /* append all the char* args to the pool, terminate args with s again */
00163 char    *spool_print(xode_spool s);
00164         /* return a big string */
00165 void    spool_add(xode_spool s, char *str);
00166         /* add a single char to the pool */
00167 char    *spools(xode_pool p, ...);
00168         /* wrap all the spooler stuff in one function, the happy fun ball! */
00169 char    *spools(xode_pool p, ...);
00170         /* wrap all the spooler stuff in one function, the happy fun ball! */
00171 /*char  *unicode_to_str(char *s); */
00172 int     unicode_to_str(const char *in, char **out);
00173         /* converts a string from unicode to the local charset */
00174 /*char  *str_to_unicode(char *s); */
00175 int     str_to_unicode(const char *in, char **out);
00176         /* converts a string from the local charset to unicode */
00177 /*char  *str_clear_unprintable(char *s); */
00178 int     str_clear_unprintable(const char *in, char **out); 
00179         /* converts all unprintable characters to spaces */
00180 
00181 
00182 
00183 /* --------------------------------------------------------- */
00184 /* JVariables.c                                              */
00185 /* Variable management routines                              */
00186 /* --------------------------------------------------------- */
00187 int     jVars_set_personal_var(char *var, char *value);
00188 int     jVars_inset_personal_var(char *var);
00189 int     jVars_init();
00190 void    jVars_set_error(char *errstr);
00191 char    *jVars_get_error();
00192 void    jVars_set_change_handler(jVar jvar, void (*handler) ());
00193 void    jVars_set_check_handler(jVar jvar, int (*handler) ());
00194 void    jVars_set_show_handler(jVar jvar, int (*handler) ());
00195 void    jVars_set_defaults_handler(void (*handler) ());
00196 void    *jVars_get(jVar name);
00197 char    *jVars_show(jVar name);
00198 int     jVars_set(jVar name, void *setting);
00199 char    *jVars_itos(jVar jvar);
00200 jVar    jVars_stoi(char *jvar);
00201 void    jVars_read_defaults();
00202 
00203 
00204 
00205 /* --------------------------------------------------------- */
00206 /* JXMLComm.c                                                */
00207 /* XML communication routines                                */
00208 /* --------------------------------------------------------- */
00209 jwgpacket       jwgpacket_new(xode x);
00210 jwgpacket       jwgpacket_reset(jwgpacket p);
00211 
00212 jwgconn jwg_new();
00213 void    jwg_delete(jwgconn j);
00214 void    jwg_packet_handler(jwgconn j, jwgconn_packet_h h);
00215 void    jwg_start(jwgconn j);
00216 void    jwg_stop(jwgconn j);
00217 int     jwg_getfd(jwgconn j);
00218 void    jwg_send(jwgconn j, xode x);
00219 void    jwg_servsend(jwgconn j, xode x);
00220 void    jwg_send_raw(jwgconn j, const char *str);
00221 void    jwg_servsend_raw(jwgconn j, const char *str);
00222 void    jwg_recv(jwgconn j);
00223 void    jwg_servrecv(jwgconn j);
00224 void    jwg_servsuccess(jwgconn jwg, char *text);
00225 void    jwg_serverror(jwgconn jwg, char *text);
00226 void    jwg_poll(jwgconn j, int timeout);
00227 void    jwg_servpoll(jwgconn j, int timeout);
00228 jwgconn jwg_server();
00229 
00230 
00231 #endif /* _LIBJWGC_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