Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

cr-enc-handler.c File Reference

The definition of the CREncHandler class. More...

#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)
 Gets the instance of encoding handler.
enum CRStatus cr_enc_handler_resolve_enc_alias (const guchar *a_alias_name, enum CREncoding *a_enc)
 Given an encoding name (called an alias name) the function returns the matching encoding type.
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)
 Converts a raw input buffer into an utf8 buffer.


Detailed Description

The definition of the CREncHandler class.

Definition in file cr-enc-handler.c.


Function Documentation

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
 

Converts a raw input buffer into an utf8 buffer.

Parameters:
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.
Returns:
CR_OK upon successfull completion, an error code otherwise.

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

References CR_BAD_PARAM_ERROR, CR_OK, and CRStatus.

Referenced by cr_input_new_from_buf().

CREncHandler* cr_enc_handler_get_instance enum CREncoding  a_enc  ) 
 

Gets the instance of encoding handler.

This function implements a singleton pattern.

Parameters:
a_enc the encoding of the Handler.
Returns:
the instance of CREncHandler.

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

References CREncHandler.

Referenced by cr_input_new_from_buf().

enum CRStatus cr_enc_handler_resolve_enc_alias const guchar *  a_alias_name,
enum CREncoding a_enc
 

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

Parameters:
a_alias_name the encoding name
a_enc output param. The returned encoding type or 0 if the alias is not supported.
Returns:
CR_OK upon successfull completion, an error code otherwise.

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

References CR_BAD_PARAM_ERROR, CRStatus, CREncAlias::name, and name.


Generated on Fri Oct 29 08:29:13 2004 for Libcroco by  doxygen 1.3.9.1