ekg2  GIT master
Definicje | Funkcje
Dokumentacja pliku misc.c
#include "ekg2.h"
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include "zlib.h"
#include "jabber.h"
#include "jabber-ssl.h"
Wykres zależności załączania dla misc.c:

Definicje

#define ZLIB_BUF_SIZE   1024
 

Funkcje

static char * jabber_gpg_strip_header_footer (char *data)
 
char * jabber_openpgp (session_t *s, const char *fromto, enum jabber_opengpg_type_t way, char *message, char *key, char **error)
 
char * jabber_zlib_compress (const char *buf, int *len)
 
char * jabber_zlib_decompress (const char *buf, int *len)
 
int JABBER_COMMIT_DATA (watch_t *w)
 
char * jabber_attr (char **atts, const char *att)
 
char * jabber_escape (const char *text)
 
char * jabber_unescape (const char *text)
 
char * tlen_encode (const char *what)
 
char * tlen_decode (const char *what)
 
int jabber_handle_write (int type, int fd, const char *watch, void *data)
 
int jabber_conversation_find (jabber_private_t *j, const char *uid, const char *subject, const char *thread, jabber_conversation_t **result, const int can_add)
 
jabber_conversation_tjabber_conversation_get (jabber_private_t *j, const int n)
 
char * jabber_thread_gen (jabber_private_t *j, const char *uid)
 
static guint32 jabber_formatchar (const char c)
 
static int jabber_fc_check (const char *curr, const char *beginning, const int mode)
 
guint32 * jabber_msg_format (const char *plaintext, const xmlnode_t *html)
 

Dokumentacja definicji

◆ ZLIB_BUF_SIZE

#define ZLIB_BUF_SIZE   1024

Dokumentacja funkcji

◆ jabber_attr()

char* jabber_attr ( char **  atts,
const char *  att 
)

◆ JABBER_COMMIT_DATA()

int JABBER_COMMIT_DATA ( watch_t w)

◆ jabber_conversation_find()

int jabber_conversation_find ( jabber_private_t j,
const char *  uid,
const char *  subject,
const char *  thread,
jabber_conversation_t **  result,
const int  can_add 
)

jabber_conversation_find() searches session's conversation list for matching one.

Parametry
j- private data of session.
uid- UID of recipient.
subject- message subject (for non-threaded conversations).
thread- jabber thread ID, if threaded.
result- place to write address of jabber_conversation_t or NULL, if not needed.
can_add- if nonzero, we can create new conversation, if none match.
Zwraca
Reply-ID of conversation.

◆ jabber_conversation_get()

jabber_conversation_t* jabber_conversation_get ( jabber_private_t j,
const int  n 
)

jabber_conversation_get() is used to get conversation by its Reply-ID.

Parametry
j- private data of session.
n- Reply-ID.
Zwraca
Pointer to jabber_conversation_t or NULL, when no conversation found.

◆ jabber_escape()

char* jabber_escape ( const char *  text)

jabber_escape()

Convert charset from config_console_charset to "utf-8"
Escape xml chars using xml_escape()

Nota
If config_use_unicode is set, this function return only xml_escape(text)
Parametry
text- text to reencode+escape
Zobacz również
jabber_unescape() - For function reconverting charset back to config_console_charset
Zwraca
Dynamic allocated string, which should be xfree()'d

◆ jabber_fc_check()

static int jabber_fc_check ( const char *  curr,
const char *  beginning,
const int  mode 
)
inlinestatic

◆ jabber_formatchar()

static guint32 jabber_formatchar ( const char  c)
inlinestatic

◆ jabber_gpg_strip_header_footer()

static char* jabber_gpg_strip_header_footer ( char *  data)
static

◆ jabber_handle_write()

int jabber_handle_write ( int  type,
int  fd,
const char *  watch,
void *  data 
)

◆ jabber_msg_format()

guint32* jabber_msg_format ( const char *  plaintext,
const xmlnode_t html 
)

◆ jabber_openpgp()

char* jabber_openpgp ( session_t s,
const char *  fromto,
enum jabber_opengpg_type_t  way,
char *  message,
char *  key,
char **  error 
)

◆ jabber_thread_gen()

char* jabber_thread_gen ( jabber_private_t j,
const char *  uid 
)

jabber_thread_gen() generates new thread-ID for outgoing messages.

Parametry
j- private data of session.
uid- recipient UID.
Zwraca
New, session-unique thread-ID.

◆ jabber_unescape()

char* jabber_unescape ( const char *  text)

jabber_unescape()

Convert charset from "utf-8" to config_console_charset.
xml escaped chars are already changed by expat. so we don't care about them.

Nota
If config_use_unicode is set, this function only xstrdup(text)
Parametry
text- text to reencode.
Zobacz również
jabber_escape() - for function escaping xml chars + reencoding string to utf-8
Zwraca
Dynamic allocated string, which should be xfree()'d

◆ jabber_zlib_compress()

char* jabber_zlib_compress ( const char *  buf,
int *  len 
)

◆ jabber_zlib_decompress()

char* jabber_zlib_decompress ( const char *  buf,
int *  len 
)

◆ tlen_decode()

char* tlen_decode ( const char *  what)

tlen_decode()

Decode string ,,encoded'' with urldecode [in ISO-8859-2] and convert charset to config_console_charset

Nota
It was ripped from libtlen. (c) Libtlen developers see: http://libtlen.sourceforge.net/
Do zrobienia:
Try to rewrite
Parametry
what- string to decode.
Zobacz również
tlen_encode() - for urlencode.
Zwraca
Dynamic allocated string, which should be xfree()'d

◆ tlen_encode()

char* tlen_encode ( const char *  what)

tlen_encode()

Convert charset from config_console_charset to ISO-8859-2
,,encode'' string with urlencode

Nota
It was ripped from libtlen. (c) Libtlen developers see: http://libtlen.sourceforge.net/
Do zrobienia:
Try to rewrite.
Parametry
what- string to encode.
Zobacz również
tlen_decode() - for urldecode.
Zwraca
Dynamic allocated string, which should be xfree()'d