YAZ  5.23.1
Functions
uri.c File Reference

Implements URI utilities. More...

#include <stdlib.h>
#include <yaz/srw.h>
#include <yaz/matchstr.h>
#include <yaz/yaz-iconv.h>

Go to the source code of this file.

Functions

static int hex_digit (int ch)
 
static void encode_uri_char (char *dst, char ch)
 
void yaz_encode_uri_component (char *dst, const char *uri)
 encodes URI component More...
 
static unsigned char decode_uri_char (const char *path, size_t *len)
 
void yaz_decode_uri_component (char *dst, const char *uri, size_t len)
 decodes URI component More...
 
void yaz_array_to_uri (char **path, ODR o, char **name, char **value)
 
int yaz_uri_to_array (const char *path, ODR o, char ***name, char ***val)
 

Detailed Description

Implements URI utilities.

Definition in file uri.c.

Function Documentation

static unsigned char decode_uri_char ( const char *  path,
size_t *  len 
)
static

Definition at line 55 of file uri.c.

References hex_digit().

Referenced by yaz_decode_uri_component(), and yaz_uri_to_array().

static void encode_uri_char ( char *  dst,
char  ch 
)
static

Definition at line 29 of file uri.c.

Referenced by yaz_encode_uri_component().

static int hex_digit ( int  ch)
static

Definition at line 18 of file uri.c.

Referenced by decode_uri_char().

void yaz_array_to_uri ( char **  path,
ODR  o,
char **  name,
char **  value 
)

Definition at line 98 of file uri.c.

References odr_malloc(), and yaz_encode_uri_component().

Referenced by yaz_solr_encode_request(), yaz_sru_get_encode(), and yaz_sru_post_encode().

void yaz_decode_uri_component ( char *  dst,
const char *  uri,
size_t  len 
)

decodes URI component

Parameters
dstdestination string (should be at least strlen(uri)+1)
uriURI component buffer (source)
lennumber of bytes to decode from uri

Definition at line 86 of file uri.c.

References decode_uri_char().

void yaz_encode_uri_component ( char *  dst,
const char *  uri 
)

encodes URI component

Parameters
dstdestination string (should be at least 3*strlen(uri)+1)
uriURI component C-string (source)

Definition at line 45 of file uri.c.

References encode_uri_char().

Referenced by rdf_lookup_node(), and yaz_array_to_uri().

int yaz_uri_to_array ( const char *  path,
ODR  o,
char ***  name,
char ***  val 
)

Definition at line 121 of file uri.c.

References decode_uri_char(), odr_malloc(), odr_strdup(), and odr_strdupn().

Referenced by yaz_encode_sru_extra(), yaz_sru_decode(), and ztest_search().