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  */
192 #ifndef __EDITORCONFIG_EDITORCONFIG_H__
193 #define __EDITORCONFIG_EDITORCONFIG_H__
194 
195 /* When included from a user program, EDITORCONFIG_EXPORT may not be defined,
196  * and we define it here*/
197 #ifndef EDITORCONFIG_EXPORT
198 # define EDITORCONFIG_EXPORT
199 #endif
200 
202 
203 #ifdef __cplusplus
204 extern "C" {
205 #endif
206 
241 EDITORCONFIG_EXPORT
242 int editorconfig_parse(const char* full_filename, editorconfig_handle h);
243 
256 EDITORCONFIG_EXPORT
257 const char* editorconfig_get_error_msg(int err_num);
258 
263 #define EDITORCONFIG_PARSE_NOT_FULL_PATH (-2)
264 
267 #define EDITORCONFIG_PARSE_MEMORY_ERROR (-3)
268 
272 #define EDITORCONFIG_PARSE_VERSION_TOO_NEW (-4)
273 
292 EDITORCONFIG_EXPORT
293 void editorconfig_get_version(int* major, int* minor, int* patch);
294 
301 EDITORCONFIG_EXPORT
302 const char* editorconfig_get_version_suffix(void);
303 
304 #ifdef __cplusplus
305 }
306 #endif
307 
308 #endif /* !__EDITORCONFIG_EDITORCONFIG_H__ */
309 
void * editorconfig_handle
The editorconfig handle object type.
Definition: editorconfig_handle.h:50
void editorconfig_get_version(int *major, int *minor, int *patch)
Get the version number of EditorConfig.
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.
const char * editorconfig_get_error_msg(int err_num)
Get the error message from the error number returned by editorconfig_parse().