gsasl  1.8.0
Functions
base64.c File Reference
#include "internal.h"
#include "base64.h"

Go to the source code of this file.

Functions

int gsasl_base64_to (const char *in, size_t inlen, char **out, size_t *outlen)
int gsasl_base64_from (const char *in, size_t inlen, char **out, size_t *outlen)

Function Documentation

int gsasl_base64_from ( const char *  in,
size_t  inlen,
char **  out,
size_t *  outlen 
)

gsasl_base64_from:

Parameters:
ininput byte array
inlensize of input byte array
outpointer to newly allocated output byte array
outlenpointer to size of newly allocated output byte array

Decode Base64 data. The buffer must be deallocated by the caller.

Return value: Returns GSASL_OK on success, GSASL_BASE64_ERROR if input was invalid, and GSASL_MALLOC_ERROR on memory allocation errors.

Since: 0.2.2

Definition at line 74 of file base64.c.

int gsasl_base64_to ( const char *  in,
size_t  inlen,
char **  out,
size_t *  outlen 
)

gsasl_base64_to:

Parameters:
ininput byte array
inlensize of input byte array
outpointer to newly allocated output byte array
outlenpointer to size of newly allocated output byte array

Encode data as base64. The string is zero terminated, and holds the length excluding the terminating zero. The buffer must be deallocated by the caller.

Return value: Returns GSASL_OK on success, or GSASL_MALLOC_ERROR if input was too large or memory allocation fail.

Since: 0.2.2

Definition at line 44 of file base64.c.