Dillo v3.1.1-99-gf3103cc4
Loading...
Searching...
No Matches
datauri.c File Reference
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include "../dpip/dpip.h"
#include "dpiutil.h"
#include "../src/misc.h"
Include dependency graph for datauri.c:

Go to the source code of this file.

Macros

#define SILENT   1
 
#define _MSG(...)
 
#define MSG(...)
 

Functions

static void b64strip_illegal_chars (unsigned char *str)
 
static int b64decode (unsigned char *str)
 
static int Url_decode_hex_octet (const char *s)
 
char * a_Url_decode_hex_str (const char *str, size_t *p_sz)
 
static void send_decoded_data (const char *url, const char *mime_type, unsigned char *data, size_t data_sz)
 
static void send_failure_message (const char *url, const char *mime_type, unsigned char *data, size_t data_sz)
 
static char * datauri_get_mime (char *url)
 
static unsigned char * datauri_get_data (char *url, size_t *p_sz)
 
int main (void)
 

Variables

static Dshsh = NULL
 

Macro Definition Documentation

◆ _MSG

#define _MSG (   ...)

Definition at line 29 of file datauri.c.

◆ MSG

#define MSG (   ...)

Definition at line 31 of file datauri.c.

◆ SILENT

#define SILENT   1

Definition at line 28 of file datauri.c.

Function Documentation

◆ a_Url_decode_hex_str()

char * a_Url_decode_hex_str ( const char *  str,
size_t *  p_sz 
)

Definition at line 137 of file datauri.c.

References dNew, dRealloc(), and Url_decode_hex_octet().

Referenced by a_Nav_expect_done(), datauri_get_data(), and Html_tag_open_a().

◆ b64decode()

static int b64decode ( unsigned char *  str)
static

Definition at line 55 of file datauri.c.

Referenced by datauri_get_data().

◆ b64strip_illegal_chars()

static void b64strip_illegal_chars ( unsigned char *  str)
static

Definition at line 41 of file datauri.c.

References d_isascii, and MSG.

Referenced by datauri_get_data().

◆ datauri_get_data()

static unsigned char * datauri_get_data ( char *  url,
size_t *  p_sz 
)
static

◆ datauri_get_mime()

static char * datauri_get_mime ( char *  url)
static

Definition at line 221 of file datauri.c.

References dStrAsciiCasecmp(), dStrconcat(), dStrdup(), and dStrnAsciiCasecmp().

Referenced by main().

◆ main()

◆ send_decoded_data()

static void send_decoded_data ( const char *  url,
const char *  mime_type,
unsigned char *  data,
size_t  data_sz 
)
static

Definition at line 164 of file datauri.c.

References a_Dpip_build_cmd(), a_Dpip_dsh_write(), a_Dpip_dsh_write_str(), dFree(), and sh.

Referenced by main().

◆ send_failure_message()

static void send_failure_message ( const char *  url,
const char *  mime_type,
unsigned char *  data,
size_t  data_sz 
)
static

Definition at line 183 of file datauri.c.

References a_Dpip_build_cmd(), a_Dpip_dsh_write_str(), dFree(), and sh.

Referenced by main().

◆ Url_decode_hex_octet()

static int Url_decode_hex_octet ( const char *  s)
static

Definition at line 119 of file datauri.c.

Referenced by a_Url_decode_hex_str().

Variable Documentation

◆ sh