libcss
Loading...
Searching...
No Matches
Macros | Functions
detect.c File Reference
#include <stdbool.h>
#include <string.h>
#include <parserutils/charset/mibenum.h>
#include "charset/detect.h"
#include "utils/utils.h"

Macros

#define CHARSET_BE   "\0\0\0@\0\0\0c\0\0\0h\0\0\0a\0\0\0r\0\0\0s\0\0\0e\0\0\0t\0\0\0 \0\0\0\""
 
#define CHARSET_LE   "@\0\0\0c\0\0\0h\0\0\0a\0\0\0r\0\0\0s\0\0\0e\0\0\0t\0\0\0 \0\0\0\"\0\0\0"
 
#define CHARSET_BE   "\0@\0c\0h\0a\0r\0s\0e\0t\0 \0\""
 
#define CHARSET_LE   "@\0c\0h\0a\0r\0s\0e\0t\0 \0\"\0"
 
#define CHARSET   "@charset \""
 

Functions

parserutils_error css__charset_extract (const uint8_t *data, size_t len, uint16_t *mibenum, uint32_t *source)
 

Macro Definition Documentation

◆ CHARSET

#define CHARSET   "@charset \""

◆ CHARSET_BE [1/2]

#define CHARSET_BE   "\0\0\0@\0\0\0c\0\0\0h\0\0\0a\0\0\0r\0\0\0s\0\0\0e\0\0\0t\0\0\0 \0\0\0\""

◆ CHARSET_BE [2/2]

#define CHARSET_BE   "\0@\0c\0h\0a\0r\0s\0e\0t\0 \0\""

◆ CHARSET_LE [1/2]

#define CHARSET_LE   "@\0\0\0c\0\0\0h\0\0\0a\0\0\0r\0\0\0s\0\0\0e\0\0\0t\0\0\0 \0\0\0\"\0\0\0"

◆ CHARSET_LE [2/2]

#define CHARSET_LE   "@\0c\0h\0a\0r\0s\0e\0t\0 \0\"\0"

Function Documentation

◆ css__charset_extract()

parserutils_error css__charset_extract ( const uint8_t *  data,
size_t  len,
uint16_t *  mibenum,
uint32_t *  source 
)

Extract a charset from a chunk of data

Parameters
dataPointer to buffer containing data
lenBuffer length
mibenumPointer to location containing current MIB enum
sourcePointer to location containing current charset source
Returns
PARSERUTILS_OK on success, appropriate error otherwise

::mibenum and ::source will be updated on exit

CSS 2.1 $4.4