c-icap-doc
0.1
|
Macros, functions and structures used for data type recognition
More...
Functions | |
struct ci_magics_db * | ci_magic_db_load (const char *filename) |
Read the magics db from a file and create a ci_magics_db object. More... | |
int | ci_magic_req_data_type (ci_request_t *req, int *isencoded) |
Return the type of data of an c-icap request object. More... | |
int | ci_magic_type_id (const char *name) |
Finds the type id from type name. More... | |
int | ci_magic_group_id (const char *group) |
Finds the group id from group name. More... | |
int | ci_magic_group_check (int type, int group) |
Checks if a magic type belongs to a magic types group. More... | |
int | ci_magic_types_count () |
The number of types stored in internal magic db. More... | |
int | ci_magic_groups_count () |
The number of groups stored in internal magic db. More... | |
char * | ci_magic_type_name (int type) |
Retrieve the name of a magic type. More... | |
char * | ci_magic_type_descr (int type) |
Retrieve the short description of a magic type. More... | |
char * | ci_magic_group_name (int group) |
Retrieve the name of a magic types group. More... | |
Macros, functions and structures used for data type recognition
struct ci_magics_db* ci_magic_db_load | ( | const char * | filename | ) |
Read the magics db from a file and create a ci_magics_db object.
The user normaly does not need to call this function inside c-icap server. It is not a thread safe function, should called only during icap library initialization before threads started.
filename | is the name of the file contains the db |
int ci_magic_group_check | ( | int | type, |
int | group | ||
) |
Checks if a magic type belongs to a magic types group.
type | is the type id to check |
group | is the group id |
int ci_magic_group_id | ( | const char * | group | ) |
Finds the group id from group name.
group | is the name of the group |
char* ci_magic_group_name | ( | int | group | ) |
Retrieve the name of a magic types group.
group | the group id |
int ci_magic_groups_count | ( | ) |
The number of groups stored in internal magic db.
int ci_magic_req_data_type | ( | ci_request_t * | req, |
int * | isencoded | ||
) |
Return the type of data of an c-icap request object.
This function checks the preview data of the request. If the data are encoded this function try to uncompress them before data type recognition
req | the c-icap request (ci_request_t) data |
isencoded | set to CI_ENCODE_GZIP, CI_ENCODE_DEFLATE or CI_ENCODE_UNKNOWN if the data are encoded with an unknown method |
char* ci_magic_type_descr | ( | int | type | ) |
Retrieve the short description of a magic type.
type | the type id |
int ci_magic_type_id | ( | const char * | name | ) |
Finds the type id from type name.
name | is the name of the magic type |
char* ci_magic_type_name | ( | int | type | ) |
Retrieve the name of a magic type.
type | the type id |
int ci_magic_types_count | ( | ) |
The number of types stored in internal magic db.