EditorConfig
Configuration file format for defining coding styles in shared projects.
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  */
198 #ifndef __EDITORCONFIG_EDITORCONFIG_H__
199 #define __EDITORCONFIG_EDITORCONFIG_H__
200 
201 /* When included from a user program, EDITORCONFIG_EXPORT may not be defined,
202  * and we define it here*/
203 #ifndef EDITORCONFIG_EXPORT
204 # define EDITORCONFIG_EXPORT
205 #endif
206 
208 
209 #ifdef __cplusplus
210 extern "C" {
211 #endif
212 
247 EDITORCONFIG_EXPORT
248 int editorconfig_parse(const char* full_filename, editorconfig_handle h);
249 
262 EDITORCONFIG_EXPORT
263 const char* editorconfig_get_error_msg(int err_num);
264 
269 #define EDITORCONFIG_PARSE_NOT_FULL_PATH (-2)
273 #define EDITORCONFIG_PARSE_MEMORY_ERROR (-3)
278 #define EDITORCONFIG_PARSE_VERSION_TOO_NEW (-4)
279 
298 EDITORCONFIG_EXPORT
299 void editorconfig_get_version(int* major, int* minor, int* patch);
300 
307 EDITORCONFIG_EXPORT
309 
310 #ifdef __cplusplus
311 }
312 #endif
313 
314 #endif /* !__EDITORCONFIG_EDITORCONFIG_H__ */
315 
const char * editorconfig_get_version_suffix(void)
Get the version suffix.
void editorconfig_get_version(int *major, int *minor, int *patch)
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().
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...
Header file of EditorConfig handle.
void * editorconfig_handle
The editorconfig handle object type.
Definition: editorconfig_handle.h:50