Libcroco
Data Structures | Functions
cr-enc-handler.c File Reference
#include "cr-enc-handler.h"
#include "cr-utils.h"
#include <string.h>

Go to the source code of this file.

Data Structures

struct  CREncAlias
 

Functions

CREncHandlercr_enc_handler_get_instance (enum CREncoding a_enc)
 cr_enc_handler_get_instance: @a_enc: the encoding of the Handler. More...
 
enum CRStatus cr_enc_handler_resolve_enc_alias (const guchar *a_alias_name, enum CREncoding *a_enc)
 cr_enc_handler_resolve_enc_alias: @a_alias_name: the encoding name. More...
 
enum CRStatus cr_enc_handler_convert_input (CREncHandler *a_this, const guchar *a_in, gulong *a_in_len, guchar **a_out, gulong *a_out_len)
 cr_enc_handler_convert_input: @a_this: the current instance of CREncHandler. More...
 

Detailed Description

The definition of the CREncHandler class.

Definition in file cr-enc-handler.c.

Function Documentation

◆ cr_enc_handler_convert_input()

enum CRStatus cr_enc_handler_convert_input ( CREncHandler a_this,
const guchar *  a_in,
gulong *  a_in_len,
guchar **  a_out,
gulong *  a_out_len 
)

cr_enc_handler_convert_input: @a_this: the current instance of CREncHandler.

@a_in: the input buffer to convert. @a_in_len: in/out parameter. The len of the input buffer to convert. After return, contains the number of bytes actually consumed. @a_out: output parameter. The converted output buffer. Must be freed by the buffer. @a_out_len: output parameter. The length of the output buffer.

Converts a raw input buffer into an utf8 buffer.

Returns CR_OK upon successfull completion, an error code otherwise.

Definition at line 149 of file cr-enc-handler.c.

References CR_BAD_PARAM_ERROR, and CR_OK.

◆ cr_enc_handler_get_instance()

CREncHandler* cr_enc_handler_get_instance ( enum CREncoding  a_enc)

cr_enc_handler_get_instance: @a_enc: the encoding of the Handler.

Gets the instance of encoding handler. This function implements a singleton pattern.

Returns the instance of CREncHandler.

Definition at line 86 of file cr-enc-handler.c.

◆ cr_enc_handler_resolve_enc_alias()

enum CRStatus cr_enc_handler_resolve_enc_alias ( const guchar *  a_alias_name,
enum CREncoding a_enc 
)

cr_enc_handler_resolve_enc_alias: @a_alias_name: the encoding name.

@a_enc: output param. The returned encoding type or 0 if the alias is not supported.

Given an encoding name (called an alias name) the function returns the matching encoding type.

Returns CR_OK upon successfull completion, an error code otherwise.

Definition at line 111 of file cr-enc-handler.c.

References CR_BAD_PARAM_ERROR, and CR_ENCODING_NOT_FOUND_ERROR.