EditorConfig
Configuration file format for defining coding styles in shared projects.
 All Files Functions Typedefs Macros Pages
editorconfig.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2013 EditorConfig Team
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24  * POSSIBILITY OF SUCH DAMAGE.
25  */
184 #ifndef __EDITORCONFIG_EDITORCONFIG_H__
185 #define __EDITORCONFIG_EDITORCONFIG_H__
186 
187 /* When included from a user program, EDITORCONFIG_EXPORT may not be defined,
188  * and we define it here*/
189 #ifndef EDITORCONFIG_EXPORT
190 # define EDITORCONFIG_EXPORT
191 #endif
192 
194 
195 #ifdef __cplusplus
196 extern "C" {
197 #endif
198 
233 EDITORCONFIG_EXPORT
234 int editorconfig_parse(const char* full_filename, editorconfig_handle h);
235 
248 EDITORCONFIG_EXPORT
249 const char* editorconfig_get_error_msg(int err_num);
250 
255 #define EDITORCONFIG_PARSE_NOT_FULL_PATH (-2)
256 
259 #define EDITORCONFIG_PARSE_MEMORY_ERROR (-3)
260 
264 #define EDITORCONFIG_PARSE_VERSION_TOO_NEW (-4)
265 
284 EDITORCONFIG_EXPORT
285 void editorconfig_get_version(int* major, int* minor, int* subminor);
286 
293 EDITORCONFIG_EXPORT
294 const char* editorconfig_get_version_suffix(void);
295 
296 #ifdef __cplusplus
297 }
298 #endif
299 
300 #endif /* !__EDITORCONFIG_EDITORCONFIG_H__ */
301 
void * editorconfig_handle
The editorconfig handle object type.
Definition: editorconfig_handle.h:50
int editorconfig_parse(const char *full_filename, editorconfig_handle h)
Parse editorconfig files corresponding to the file path given by full_filename, and related informati...
const char * editorconfig_get_version_suffix(void)
Get the version suffix.
Header file of EditorConfig handle.
void editorconfig_get_version(int *major, int *minor, int *subminor)
Get the version number of EditorConfig.
const char * editorconfig_get_error_msg(int err_num)
Get the error message from the error number returned by editorconfig_parse().