YAZ  5.25.0
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.


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

◆ decode_uri_char()

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

Definition at line 55 of file uri.c.

References hex_digit().

Referenced by yaz_decode_uri_component(), and yaz_uri_to_array().

◆ encode_uri_char()

static void encode_uri_char ( char *  dst,
char  ch 

Definition at line 29 of file uri.c.

Referenced by yaz_encode_uri_component().

◆ hex_digit()

static int hex_digit ( int  ch)

Definition at line 18 of file uri.c.

Referenced by decode_uri_char().

◆ yaz_array_to_uri()

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().

◆ yaz_decode_uri_component()

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

decodes URI component

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().

◆ yaz_encode_uri_component()

void yaz_encode_uri_component ( char *  dst,
const char *  uri 

encodes URI component

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().

◆ yaz_uri_to_array()

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().