Improve ResourceLimits interface to be more forward compatible
[platform/upstream/glslang.git] / glslang / Public / resource_limits_c.h
1 /**
2 BSD 2-Clause License
3
4 Copyright (c) 2020, Travis Fort
5 All rights reserved.
6
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9
10 1. Redistributions of source code must retain the above copyright notice, this
11    list of conditions and the following disclaimer.
12
13 2. Redistributions in binary form must reproduce the above copyright notice,
14    this list of conditions and the following disclaimer in the documentation
15    and/or other materials provided with the distribution.
16
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 **/
28
29 #ifndef _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_
30 #define _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_
31
32 #include "../glslang/Include/glslang_c_interface.h"
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 // Returns a struct that can be use to create custom resource values.
39 glslang_resource_t* glslang_resource(void);
40
41 // These are the default resources for TBuiltInResources, used for both
42 //  - parsing this string for the case where the user didn't supply one,
43 //  - dumping out a template for user construction of a config file.
44 const glslang_resource_t* glslang_default_resource(void);
45
46 // Returns the DefaultTBuiltInResource as a human-readable string.
47 // NOTE: User is responsible for freeing this string.
48 const char* glslang_default_resource_string();
49
50 // Decodes the resource limits from |config| to |resources|.
51 void glslang_decode_resource_limits(glslang_resource_t* resources, char* config);
52
53 #ifdef __cplusplus
54 }
55 #endif
56
57 #endif // _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_