YAZ  5.34.0
Data Structures | Macros | Typedefs | Functions
zgdu.h File Reference

Header for the Z_GDU (HTTP or Z39.50 package) More...

#include <yaz/z-core.h>

Go to the source code of this file.

Data Structures

struct  Z_HTTP_Header
 
struct  Z_HTTP_Request
 
struct  Z_HTTP_Response
 
struct  Z_GDU
 

Macros

#define Z_GDU_Z3950   1
 
#define Z_GDU_HTTP_Request   2
 
#define Z_GDU_HTTP_Response   3
 

Typedefs

typedef struct Z_HTTP_Header Z_HTTP_Header
 

Functions

int z_GDU (ODR o, Z_GDU **p, int opt, const char *name)
 
void z_HTTP_header_add (ODR o, Z_HTTP_Header **hp, const char *n, const char *v)
 
void z_HTTP_header_set (ODR o, Z_HTTP_Header **hp, const char *n, const char *v)
 
void z_HTTP_header_add_content_type (ODR o, Z_HTTP_Header **hp, const char *content_type, const char *charset)
 
void z_HTTP_header_add_basic_auth (ODR o, Z_HTTP_Header **hp, const char *username, const char *password)
 
const char * z_HTTP_header_lookup (const Z_HTTP_Header *hp, const char *n)
 
const char * z_HTTP_header_remove (Z_HTTP_Header **hp, const char *n)
 
const char * z_HTTP_errmsg (int code)
 
Z_GDUz_get_HTTP_Response (ODR o, int code)
 
Z_GDUz_get_HTTP_Response_details (ODR o, int code, const char *details)
 
Z_GDUz_get_HTTP_Response_server (ODR o, int code, const char *details, const char *server, const char *server_url)
 
Z_GDUz_get_HTTP_Request (ODR o)
 
Z_GDUz_get_HTTP_Request_host_path (ODR odr, const char *host, const char *path)
 
Z_GDUz_get_HTTP_Request_uri (ODR odr, const char *uri, const char *args, int use_full_uri)
 
int yaz_decode_http_request (ODR o, Z_HTTP_Request **hr_p)
 
int yaz_decode_http_response (ODR o, Z_HTTP_Response **hr_p)
 
int yaz_encode_http_response (ODR o, Z_HTTP_Response *hr)
 
int yaz_encode_http_request (ODR o, Z_HTTP_Request *hr)
 
const char * yaz_check_location (ODR odr, const char *uri, const char *location, int *host_change)
 

Detailed Description

Header for the Z_GDU (HTTP or Z39.50 package)

Definition in file zgdu.h.

Macro Definition Documentation

◆ Z_GDU_HTTP_Request

#define Z_GDU_HTTP_Request   2

Definition at line 66 of file zgdu.h.

◆ Z_GDU_HTTP_Response

#define Z_GDU_HTTP_Response   3

Definition at line 67 of file zgdu.h.

◆ Z_GDU_Z3950

#define Z_GDU_Z3950   1

Definition at line 65 of file zgdu.h.

Typedef Documentation

◆ Z_HTTP_Header

typedef struct Z_HTTP_Header Z_HTTP_Header

Definition at line 1 of file zgdu.h.

Function Documentation

◆ yaz_check_location()

const char* yaz_check_location ( ODR  odr,
const char *  uri,
const char *  location,
int *  host_change 
)

Definition at line 659 of file http.c.

References cs_get_host_args(), and odr_malloc().

Referenced by handle_http(), and yaz_url_exec().

◆ yaz_decode_http_request()

int yaz_decode_http_request ( ODR  o,
Z_HTTP_Request **  hr_p 
)

◆ yaz_decode_http_response()

int yaz_decode_http_response ( ODR  o,
Z_HTTP_Response **  hr_p 
)

◆ yaz_encode_http_request()

int yaz_encode_http_request ( ODR  o,
Z_HTTP_Request hr 
)

◆ yaz_encode_http_response()

int yaz_encode_http_response ( ODR  o,
Z_HTTP_Response hr 
)

◆ z_GDU()

int z_GDU ( ODR  o,
Z_GDU **  p,
int  opt,
const char *  name 
)

◆ z_get_HTTP_Request()

Z_GDU* z_get_HTTP_Request ( ODR  o)

◆ z_get_HTTP_Request_host_path()

Z_GDU* z_get_HTTP_Request_host_path ( ODR  odr,
const char *  host,
const char *  path 
)

◆ z_get_HTTP_Request_uri()

Z_GDU* z_get_HTTP_Request_uri ( ODR  odr,
const char *  uri,
const char *  args,
int  use_full_uri 
)

◆ z_get_HTTP_Response()

Z_GDU* z_get_HTTP_Response ( ODR  o,
int  code 
)

Definition at line 384 of file http.c.

References z_get_HTTP_Response_details().

Referenced by ir_read(), and process_http_request().

◆ z_get_HTTP_Response_details()

Z_GDU* z_get_HTTP_Response_details ( ODR  o,
int  code,
const char *  details 
)

Definition at line 378 of file http.c.

References YAZ_VERSION, and z_get_HTTP_Response_server().

Referenced by z_get_HTTP_Response().

◆ z_get_HTTP_Response_server()

Z_GDU* z_get_HTTP_Response_server ( ODR  o,
int  code,
const char *  details,
const char *  server,
const char *  server_url 
)

◆ z_HTTP_errmsg()

const char* z_HTTP_errmsg ( int  code)

◆ z_HTTP_header_add()

void z_HTTP_header_add ( ODR  o,
Z_HTTP_Header **  hp,
const char *  n,
const char *  v 
)

◆ z_HTTP_header_add_basic_auth()

void z_HTTP_header_add_basic_auth ( ODR  o,
Z_HTTP_Header **  hp,
const char *  username,
const char *  password 
)

◆ z_HTTP_header_add_content_type()

void z_HTTP_header_add_content_type ( ODR  o,
Z_HTTP_Header **  hp,
const char *  content_type,
const char *  charset 
)

Definition at line 147 of file http.c.

References odr_malloc(), and z_HTTP_header_add().

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

◆ z_HTTP_header_lookup()

const char* z_HTTP_header_lookup ( const Z_HTTP_Header hp,
const char *  n 
)

◆ z_HTTP_header_remove()

const char* z_HTTP_header_remove ( Z_HTTP_Header **  hp,
const char *  n 
)

Definition at line 218 of file http.c.

References Z_HTTP_Header::next, and yaz_strcasecmp().

◆ z_HTTP_header_set()

void z_HTTP_header_set ( ODR  o,
Z_HTTP_Header **  hp,
const char *  n,
const char *  v 
)

Definition at line 200 of file http.c.

References Z_HTTP_Header::next, odr_malloc(), odr_strdup(), and yaz_strcasecmp().

Referenced by yaz_url_exec(), and z_HTTP_header_add_basic_auth().