EditorConfig
Configuration file format for defining coding styles in shared projects.
 All Files Functions Typedefs Macros Pages
editorconfig_handle.h File Reference

Header file of EditorConfig handle. More...

Go to the source code of this file.

Typedefs

typedef void * editorconfig_handle
 The editorconfig handle object type.
 

Functions

editorconfig_handle editorconfig_handle_init (void)
 Create and intialize a default editorconfig_handle object. More...
 
int editorconfig_handle_destroy (editorconfig_handle h)
 Destroy an editorconfig_handle object. More...
 
const char * editorconfig_handle_get_err_file (editorconfig_handle h)
 Get the err_file field of an editorconfig_handle object. More...
 
void editorconfig_handle_get_version (const editorconfig_handle h, int *major, int *minor, int *patch)
 Get the version fields of an editorconfig_handle object. More...
 
void editorconfig_handle_set_version (const editorconfig_handle h, int major, int minor, int patch)
 Set the version fields of an editorconfig_handle object. More...
 
void editorconfig_handle_set_conf_file_name (editorconfig_handle h, const char *conf_file_name)
 Set the conf_file_name field of an editorconfig_handle object. More...
 
const char * editorconfig_handle_get_conf_file_name (const editorconfig_handle h)
 Get the conf_file_name field of an editorconfig_handle object. More...
 
void editorconfig_handle_get_name_value (const editorconfig_handle h, int n, const char **name, const char **value)
 Get the nth name and value fields of an editorconfig_handle object. More...
 
int editorconfig_handle_get_name_value_count (const editorconfig_handle h)
 Get the count of name and value fields of an editorconfig_handle object. More...
 

Detailed Description

Header file of EditorConfig handle.

Author
EditorConfig Team

Function Documentation

int editorconfig_handle_destroy ( editorconfig_handle  h)

Destroy an editorconfig_handle object.

Parameters
hThe editorconfig_handle object needs to be destroyed.
Return values
zeroThe editorconfig_handle object is destroyed successfully.
non-zeroFailed to destroy the editorconfig_handle object.
const char* editorconfig_handle_get_conf_file_name ( const editorconfig_handle  h)

Get the conf_file_name field of an editorconfig_handle object.

Parameters
hThe editorconfig_handle object whose conf_file_name field needs to be obtained.
Returns
The value of the conf_file_name field of the editorconfig_handle object.
const char* editorconfig_handle_get_err_file ( editorconfig_handle  h)

Get the err_file field of an editorconfig_handle object.

Parameters
hThe editorconfig_handle object whose err_file needs to be obtained.
Return values
NULLNo error file exists.
non-NULLThe pointer to the path of the file caused the parsing error is returned.
void editorconfig_handle_get_name_value ( const editorconfig_handle  h,
int  n,
const char **  name,
const char **  value 
)

Get the nth name and value fields of an editorconfig_handle object.

Parameters
hThe editorconfig_handle object whose name and value fields need to be obtained.
nThe zero-based index of the name and value fields to be obtained.
nameIf not null, *name will be set to point to the obtained name.
valueIf not null, *value will be set to point to the obtained value.
Returns
None.
int editorconfig_handle_get_name_value_count ( const editorconfig_handle  h)

Get the count of name and value fields of an editorconfig_handle object.

Parameters
hThe editorconfig_handle object whose count of name and value fields need to be obtained.
Returns
the count of name and value fields of the editorconfig_handle object.
void editorconfig_handle_get_version ( const editorconfig_handle  h,
int *  major,
int *  minor,
int *  patch 
)

Get the version fields of an editorconfig_handle object.

Parameters
hThe editorconfig_handle object whose version field need to be obtained.
majorIf not null, the integer pointed by major will be filled with the major version field of the editorconfig_handle object.
minorIf not null, the integer pointed by minor will be filled with the minor version field of the editorconfig_handle object.
patchIf not null, the integer pointed by patch will be filled with the patch version field of the editorconfig_handle object.
Returns
None.
editorconfig_handle editorconfig_handle_init ( void  )

Create and intialize a default editorconfig_handle object.

Return values
NULLFailed to create the editorconfig_handle object.
non-NULLThe created editorconfig_handle object is returned.
void editorconfig_handle_set_conf_file_name ( editorconfig_handle  h,
const char *  conf_file_name 
)

Set the conf_file_name field of an editorconfig_handle object.

Parameters
hThe editorconfig_handle object whose conf_file_name field needs to be set.
conf_file_nameThe new value of the conf_file_name field of the editorconfig_handle object.
Returns
None.
void editorconfig_handle_set_version ( const editorconfig_handle  h,
int  major,
int  minor,
int  patch 
)

Set the version fields of an editorconfig_handle object.

Parameters
hThe editorconfig_handle object whose version fields need to be set.
majorIf not less than 0, the major version field will be set to major. If this parameter is less than 0, the major version field of the editorconfig_handle object will remain unchanged.
minorIf not less than 0, the minor version field will be set to minor. If this parameter is less than 0, the minor version field of the editorconfig_handle object will remain unchanged.
patchIf not less than 0, the patch version field will be set to patch. If this parameter is less than 0, the patch version field of the editorconfig_handle object will remain unchanged.
Returns
None.