xine-lib 1.2.11
Data Structures | Functions | Variables
http_helper.c File Reference
#include <string.h>
#include <stdint.h>
#include <xine/xine_internal.h>
#include "http_helper.h"

Data Structures

struct  mrlp_t
 

Functions

static void unescape (char **d, const char *s, size_t len)
 
static size_t esclen (const char *s, size_t len)
 
static void escape (char **d, const char *s, size_t len)
 
int _x_url_parse2 (const char *mrl, xine_url_t *url)
 
void _x_url_init (xine_url_t *url)
 
void _x_url_cleanup (xine_url_t *url)
 
size_t _x_merge_mrl (char *dest, size_t dsize, const char *base_mrl, const char *new_mrl)
 merge a new, possibly relative mrl with a given base. result will always be 0 terminated. More...
 
const char * _x_url_user_agent (const char *url)
 

Variables

static const int8_t tab_unhex [256]
 
static const uint8_t tab_esclen [256]
 
static const uint8_t tab_hex [16] = "0123456789abcdef"
 
static const uint8_t tab_type [256]
 

Function Documentation

◆ _x_merge_mrl()

size_t _x_merge_mrl ( char *  dest,
size_t  dsize,
const char *  base_mrl,
const char *  new_mrl 
)

merge a new, possibly relative mrl with a given base. result will always be 0 terminated.

Parameters
destthe buffer to write the result to. may be NULL.
dsizethe size of *dest in bytes.
base_mrlthe base to fill missing parts with. may be the same as dest, or NULL.
new_mrlthe new mrl. may be NULL.
Returns
the string length of result. will be >= dsize when truncated.

References tab_type.

Referenced by hls_input_open(), hls_input_open_bump(), hls_input_open_item(), and http_plugin_handshake().

◆ _x_url_cleanup()

void _x_url_cleanup ( xine_url_t url)

◆ _x_url_init()

void _x_url_init ( xine_url_t url)

◆ _x_url_parse2()

int _x_url_parse2 ( const char *  mrl,
xine_url_t url 
)

◆ _x_url_user_agent()

const char * _x_url_user_agent ( const char *  url)

References NULL.

Referenced by http_can_handle(), and http_plugin_open().

◆ escape()

static void escape ( char **  d,
const char *  s,
size_t  len 
)
static

References tab_esclen, and tab_hex.

Referenced by _x_url_parse2().

◆ esclen()

static size_t esclen ( const char *  s,
size_t  len 
)
static

References tab_esclen.

Referenced by _x_url_parse2().

◆ unescape()

static void unescape ( char **  d,
const char *  s,
size_t  len 
)
static

References tab_unhex.

Referenced by _x_url_parse2().

Variable Documentation

◆ tab_esclen

const uint8_t tab_esclen[256]
static
Initial value:
= {
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
}

Referenced by escape(), and esclen().

◆ tab_hex

const uint8_t tab_hex[16] = "0123456789abcdef"
static

Referenced by escape().

◆ tab_type

const uint8_t tab_type[256]
static
Initial value:
= {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0, 0, 0,0xdd, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0xc5,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0x41,0xc1, 0, 0, 0,0xcd,
0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
}

Referenced by _x_mrl_unescape(), hexstr2uint32(), and unescape().