Strophe 0.12
XMPP client library
Functions
Encodings

Functions

char * xmpp_base64_encode (xmpp_ctx_t *ctx, const unsigned char *data, size_t len)
 Base64 encoding routine. More...
 
char * xmpp_base64_decode_str (xmpp_ctx_t *ctx, const char *base64, size_t len)
 Base64 decoding routine. More...
 
void xmpp_base64_decode_bin (xmpp_ctx_t *ctx, const char *base64, size_t len, unsigned char **out, size_t *outlen)
 Base64 decoding routine. More...
 

Detailed Description

Function Documentation

◆ xmpp_base64_encode()

char * xmpp_base64_encode ( xmpp_ctx_t *  ctx,
const unsigned char *  data,
size_t  len 
)

Base64 encoding routine.

Returns an allocated string which must be freed with xmpp_free().

Parameters
ctxa Strophe context
databuffer to encode
lensize of the data buffer
Returns
an allocated null-terminated string or NULL on error

◆ xmpp_base64_decode_str()

char * xmpp_base64_decode_str ( xmpp_ctx_t *  ctx,
const char *  base64,
size_t  len 
)

Base64 decoding routine.

Returns an allocated string which must be freed with xmpp_free(). User calls this function when the result must be a string. When decoded buffer contains '\0' NULL is returned.

Parameters
ctxa Strophe context
base64encoded buffer
lensize of the buffer
Returns
an allocated null-terminated string or NULL on error

◆ xmpp_base64_decode_bin()

void xmpp_base64_decode_bin ( xmpp_ctx_t *  ctx,
const char *  base64,
size_t  len,
unsigned char **  out,
size_t *  outlen 
)

Base64 decoding routine.

Returns an allocated buffer which must be freed with xmpp_free().

Parameters
ctxa Strophe context
base64encoded buffer
lensize of the encoded buffer
outallocated buffer is stored here
outlensize of the allocated buffer
Note
on an error the *out will be NULL