Graphviz 13.0.0~dev.20250210.0415
Loading...
Searching...
No Matches
base64.h File Reference

Base64 encoding. More...

#include <stddef.h>
Include dependency graph for base64.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define UTIL_API   /* nothing */
 

Functions

UTIL_API size_t gv_base64_size (size_t source_size)
 
UTIL_API char * gv_base64 (const unsigned char *source, size_t size)
 

Macro Definition Documentation

◆ UTIL_API

#define UTIL_API   /* nothing */

hide the symbols this header declares by default

The expectation is that users of this header (applications, shared libraries, or static libraries) want to call gv_base64 but not re-export it to their users. This annotation is only correct while the containing library is built statically. If it were built as a shared library, gv_base64 would need to have default visibility (and thus be unavoidably re-exported) in order to be callable.

Definition at line 17 of file base64.h.

Function Documentation

◆ gv_base64()

UTIL_API char * gv_base64 ( const unsigned char *  source,
size_t  size 
)

Base64 encode some data

This function does not return on failure, like memory allocation. It calls exit. The caller is expected to free the returned pointer.

Parameters
sourcePointer to the start of data to encode
sizeNumber of bytes in the source
Returns
A buffer of the encoded data

Definition at line 14 of file base64.c.

References base64_alphabet, gv_alloc(), and gv_base64_size().

Referenced by core_loadimage_svg(), and kitty_write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gv_base64_size()

UTIL_API size_t gv_base64_size ( size_t  source_size)

how many bytes does it take to encode a given source data length?

Parameters
source_sizeThe number of bytes in the source to encoding
Returns
The number of bytes required in the destination of encoding

Definition at line 12 of file base64.c.

References div_up().

Referenced by core_loadimage_svg(), gv_base64(), and kitty_write().

Here is the call graph for this function:
Here is the caller graph for this function: