editorconfig_sys/
bindings.rs1pub const EDITORCONFIG_PARSE_NOT_FULL_PATH: i32 = -2;
4pub const EDITORCONFIG_PARSE_MEMORY_ERROR: i32 = -3;
5pub const EDITORCONFIG_PARSE_VERSION_TOO_NEW: i32 = -4;
6#[doc = " @brief The editorconfig handle object type"]
7pub type editorconfig_handle = *mut ::std::os::raw::c_void;
8extern "C" {
9 #[doc = " @brief Create and intialize a default editorconfig_handle object.\n\n @retval NULL Failed to create the editorconfig_handle object.\n\n @retval non-NULL The created editorconfig_handle object is returned."]
10 pub fn editorconfig_handle_init() -> editorconfig_handle;
11}
12extern "C" {
13 #[doc = " @brief Destroy an editorconfig_handle object\n\n @param h The editorconfig_handle object needs to be destroyed.\n\n @retval zero The editorconfig_handle object is destroyed successfully.\n\n @retval non-zero Failed to destroy the editorconfig_handle object."]
14 pub fn editorconfig_handle_destroy(h: editorconfig_handle) -> ::std::os::raw::c_int;
15}
16extern "C" {
17 #[doc = " @brief Get the err_file field of an editorconfig_handle object\n\n @param h The editorconfig_handle object whose err_file needs to be obtained.\n\n @retval NULL No error file exists.\n\n @retval non-NULL The pointer to the path of the file caused the parsing\n error is returned."]
18 pub fn editorconfig_handle_get_err_file(
19 h: editorconfig_handle,
20 ) -> *const ::std::os::raw::c_char;
21}
22extern "C" {
23 #[doc = " @brief Get the version fields of an editorconfig_handle object.\n\n @param h The editorconfig_handle object whose version field need to be\n obtained.\n\n @param major If not null, the integer pointed by major will be filled with\n the major version field of the editorconfig_handle object.\n\n @param minor If not null, the integer pointed by minor will be filled with\n the minor version field of the editorconfig_handle object.\n\n @param patch If not null, the integer pointed by patch will be filled\n with the patch version field of the editorconfig_handle object.\n\n @return None."]
24 pub fn editorconfig_handle_get_version(
25 h: editorconfig_handle,
26 major: *mut ::std::os::raw::c_int,
27 minor: *mut ::std::os::raw::c_int,
28 patch: *mut ::std::os::raw::c_int,
29 );
30}
31extern "C" {
32 #[doc = " @brief Set the version fields of an editorconfig_handle object.\n\n @param h The editorconfig_handle object whose version fields need to be set.\n\n @param major If not less than 0, the major version field will be set to\n major. If this parameter is less than 0, the major version field of the\n editorconfig_handle object will remain unchanged.\n\n @param minor If not less than 0, the minor version field will be set to\n minor. If this parameter is less than 0, the minor version field of the\n editorconfig_handle object will remain unchanged.\n\n @param patch If not less than 0, the patch version field will be set to\n patch. If this parameter is less than 0, the patch version field of the\n editorconfig_handle object will remain unchanged.\n\n @return None."]
33 pub fn editorconfig_handle_set_version(
34 h: editorconfig_handle,
35 major: ::std::os::raw::c_int,
36 minor: ::std::os::raw::c_int,
37 patch: ::std::os::raw::c_int,
38 );
39}
40extern "C" {
41 #[doc = " @brief Set the conf_file_name field of an editorconfig_handle object.\n\n @param h The editorconfig_handle object whose conf_file_name field needs to\n be set.\n\n @param conf_file_name The new value of the conf_file_name field of the\n editorconfig_handle object.\n\n @return None."]
42 pub fn editorconfig_handle_set_conf_file_name(
43 h: editorconfig_handle,
44 conf_file_name: *const ::std::os::raw::c_char,
45 );
46}
47extern "C" {
48 #[doc = " @brief Get the conf_file_name field of an editorconfig_handle object.\n\n @param h The editorconfig_handle object whose conf_file_name field needs to\n be obtained.\n\n @return The value of the conf_file_name field of the editorconfig_handle\n object."]
49 pub fn editorconfig_handle_get_conf_file_name(
50 h: editorconfig_handle,
51 ) -> *const ::std::os::raw::c_char;
52}
53extern "C" {
54 #[doc = " @brief Get the nth name and value fields of an editorconfig_handle object.\n\n @param h The editorconfig_handle object whose name and value fields need to\n be obtained.\n\n @param n The zero-based index of the name and value fields to be obtained.\n\n @param name If not null, *name will be set to point to the obtained name.\n\n @param value If not null, *value will be set to point to the obtained value.\n\n @return None."]
55 pub fn editorconfig_handle_get_name_value(
56 h: editorconfig_handle,
57 n: ::std::os::raw::c_int,
58 name: *mut *const ::std::os::raw::c_char,
59 value: *mut *const ::std::os::raw::c_char,
60 );
61}
62extern "C" {
63 #[doc = " @brief Get the count of name and value fields of an editorconfig_handle\n object.\n\n @param h The editorconfig_handle object whose count of name and value fields\n need to be obtained.\n\n @return the count of name and value fields of the editorconfig_handle\n object."]
64 pub fn editorconfig_handle_get_name_value_count(
65 h: editorconfig_handle,
66 ) -> ::std::os::raw::c_int;
67}
68extern "C" {
69 #[doc = " @brief Parse editorconfig files corresponding to the file path given by\n full_filename, and related information is input and output in h.\n\n An example is available at\n <a href=https://github.com/editorconfig/editorconfig-core/blob/master/src/bin/main.c>src/bin/main.c</a>\n in EditorConfig C Core source code.\n\n @param full_filename The full path of a file that is edited by the editor\n for which the parsing result is.\n\n @param h The @ref editorconfig_handle to be used and returned from this\n function (including the parsing result). The @ref editorconfig_handle should\n be created by editorconfig_handle_init().\n\n @retval 0 Everything is OK.\n\n @retval \"Positive Integer\" A parsing error occurs. The return value would be\n the line number of parsing error. err_file obtained from h by calling\n editorconfig_handle_get_err_file() will also be filled with the file path\n that caused the parsing error.\n\n @retval \"Negative Integer\" Some error occured. See below for the reason of\n the error for each return value.\n\n @retval EDITORCONFIG_PARSE_NOT_FULL_PATH The full_filename is not a full\n path name.\n\n @retval EDITORCONFIG_PARSE_MEMORY_ERROR A memory error occurs.\n\n @retval EDITORCONFIG_PARSE_VERSION_TOO_NEW The required version specified in\n @ref editorconfig_handle is greater than the current version.\n"]
70 pub fn editorconfig_parse(
71 full_filename: *const ::std::os::raw::c_char,
72 h: editorconfig_handle,
73 ) -> ::std::os::raw::c_int;
74}
75extern "C" {
76 #[doc = " @brief Get the error message from the error number returned by\n editorconfig_parse().\n\n An example is available at\n <a href=https://github.com/editorconfig/editorconfig-core/blob/master/src/bin/main.c>src/bin/main.c</a>\n in EditorConfig C Core source code.\n\n @param err_num The error number that is used to obtain the error message.\n\n @return The error message corresponding to err_num."]
77 pub fn editorconfig_get_error_msg(
78 err_num: ::std::os::raw::c_int,
79 ) -> *const ::std::os::raw::c_char;
80}
81extern "C" {
82 #[doc = " @brief Get the version number of EditorConfig.\n\n An example is available at\n <a href=https://github.com/editorconfig/editorconfig-core/blob/master/src/bin/main.c>src/bin/main.c</a>\n in EditorConfig C Core source code.\n\n @param major If not null, the integer pointed by major will be filled with\n the major version of EditorConfig.\n\n @param minor If not null, the integer pointed by minor will be filled with\n the minor version of EditorConfig.\n\n @param patch If not null, the integer pointed by patch will be filled\n with the patch version of EditorConfig.\n\n @return None."]
83 pub fn editorconfig_get_version(
84 major: *mut ::std::os::raw::c_int,
85 minor: *mut ::std::os::raw::c_int,
86 patch: *mut ::std::os::raw::c_int,
87 );
88}
89extern "C" {
90 #[doc = " @brief Get the version suffix.\n\n @return The version suffix, such as \"-development\" for a development\n version, empty string for a stable version."]
91 pub fn editorconfig_get_version_suffix() -> *const ::std::os::raw::c_char;
92}