ELinks 0.18.0
header.h File Reference
This graph shows which files directly or indirectly include this file:

Enumerations

enum  parse_header_param { HEADER_PARAM_FOUND , HEADER_PARAM_NOT_FOUND , HEADER_PARAM_OUT_OF_MEMORY }

Functions

char * parse_header (char *, const char *, char **)
 Searches for a message-header with the specified field-name.
enum parse_header_param parse_header_param (char *, const char *, char **, int)
char * get_header_param (char *, const char *)

Enumeration Type Documentation

◆ parse_header_param

Enumerator
HEADER_PARAM_FOUND 
HEADER_PARAM_NOT_FOUND 
HEADER_PARAM_OUT_OF_MEMORY 

Function Documentation

◆ get_header_param()

char * get_header_param ( char * e,
const char * name )

◆ parse_header()

char * parse_header ( char * head,
const char * item,
char ** ptr )

Searches for a message-header with the specified field-name.

Parameters
[in]headWhere to start searching in the message received from the server. This function actually ignores the line to which head points, and starts searching from the next line. Therefore, when parsing an HTTP message, head should initially point to the start-line, e.g. "HTTP/1.1 200 OK". Alternatively, if the caller has already found a message-header and wants to know if there are any more message-headers with the same field-name, then head can be the pointer that a previous call stored in *ptr.
[in]itemThe field-name for which this function searches.
[out]ptrIf ptr is not NULL, and this function finds a message-header, then this function stores in *ptr the address at which the field-content begins; the caller may pass that as head in a later call. Otherwise, this function does not modify *ptr.
Returns
NULL if not found or out of memory. Otherwise, a copy of the field-content of the message-header; the caller must eventually mem_free() it.

The terms message-header, field-name, start-line, and field-content are defined in RFC 2616 sections 4.1 and 4.2.

◆ parse_header_param()

enum parse_header_param parse_header_param ( char * str,
const char * name,
char ** ret,
int content_disposition )