NetSurf
Functions
content-type.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "utils/http.h"
#include "utils/http/generics.h"
#include "utils/http/parameter_internal.h"
#include "utils/http/primitives.h"
Include dependency graph for content-type.c:

Go to the source code of this file.

Functions

nserror http_parse_content_type (const char *header_value, http_content_type **result)
 Parse an HTTP Content-Type header value. More...
 
void http_content_type_destroy (http_content_type *victim)
 Destroy a content type object. More...
 

Function Documentation

◆ http_content_type_destroy()

void http_content_type_destroy ( http_content_type victim)

Destroy a content type object.

Parameters
victimObject to destroy

Definition at line 122 of file content-type.c.

References http_parameter_list_destroy(), http_content_type::media_type, and http_content_type::parameters.

Referenced by content_factory_create_content(), download_context_process_headers(), and mimesniff_compute_effective_type().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ http_parse_content_type()

nserror http_parse_content_type ( const char *  header_value,
http_content_type **  result 
)

Parse an HTTP Content-Type header value.

Parameters
header_valueHeader value to parse
resultPointer to location to receive result
Returns
NSERROR_OK on success, NSERROR_NOMEM on memory exhaustion

Definition at line 30 of file content-type.c.

References http__item_list_parse, http__parse_parameter(), http__parse_token(), http__skip_LWS(), http_parameter_list_destroy(), http_content_type::media_type, NSERROR_NOMEM, NSERROR_NOT_FOUND, NSERROR_OK, http_content_type::parameters, result, and type.

Referenced by content_factory_create_content(), download_context_process_headers(), and mimesniff_compute_effective_type().

Here is the call graph for this function:
Here is the caller graph for this function: