Loading and resolving of suite libraries.
[SquirrelJME.git] / nanocoat / include / sjme / vmConfig.h
blob06bbe47be517c6cb6858f941420e79ea1e549f83
1 /* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the Mozilla Public License Version 2.0.
7 // See license.mkd for licensing and copyright information.
8 // -------------------------------------------------------------------------*/
10 /**
11 * Virtual machine configuration.
13 * @since 2023/12/03
16 #ifndef SQUIRRELJME_VMCONFIG_H
17 #define SQUIRRELJME_VMCONFIG_H
19 #include "sjme/nvm.h"
21 /* Anti-C++. */
22 #ifdef __cplusplus
23 #ifndef SJME_CXX_IS_EXTERNED
24 #define SJME_CXX_IS_EXTERNED
25 #define SJME_CXX_SQUIRRELJME_VMCONFIG_H
26 extern "C" {
27 #endif /* #ifdef SJME_CXX_IS_EXTERNED */
28 #endif /* #ifdef __cplusplus */
30 /*--------------------------------------------------------------------------*/
32 /**
33 * The type of setting this is.
35 * @since 2023/12/08
37 typedef enum sjme_vmConfig_settingType
39 /** The number of setting types. */
40 SJME_NUM_VM_CONFIG_SETTING_TYPES
41 } sjme_vmConfig_settingType;
43 /**
44 * Indicates the category a given configuration setting is in.
46 * @since 2023/12/08
48 typedef enum sjme_vmConfig_categoryType
50 /** The number of category types available. */
51 SJME_NUM_VM_CONFIG_CATEGORY_TYPES
52 } sjme_vmConfig_categoryType;
54 /**
55 * A flag used for the configuration.
57 * @since 2023/12/08
59 typedef enum sjme_vmConfig_flag
61 /** Default value is defined. */
62 SJME_VM_CONFIG_FLAG_DEFAULT = 1,
64 /** Min/Max is defined. */
65 SJME_VM_CONFIG_FLAG_MIN_MAX = 2,
67 /** Ticks are defined. */
68 SJME_VM_CONFIG_FLAG_TICKS = 4,
69 } sjme_vmConfig_flag;
71 /**
72 * Represents a single value.
74 * @since 2023/12/08
76 typedef union sjme_vmConfig_value
78 /** Integer value. */
79 sjme_jint jint;
81 /** String value. */
82 sjme_lpcstr jstring;
83 } sjme_vmConfig_value;
85 /**
86 * Represents a single virtual machine configuration.
88 * @since 2023/12/08
90 typedef struct sjme_vmConfig_setting
92 /** The category this setting is in. */
93 sjme_vmConfig_categoryType category;
95 /** The name of this setting. */
96 sjme_lpcstr name;
98 /** The type of setting this is. */
99 sjme_vmConfig_settingType type;
101 /** Flags for the configuration setting. */
102 sjme_vmConfig_flag flags;
104 /** Contains the various values within. */
105 struct
107 /** The default value, if any. */
108 const sjme_vmConfig_value initial;
110 /** The minimum value, if applicable. */
111 const sjme_vmConfig_value min;
113 /** The maximum value, if applicable. */
114 const sjme_vmConfig_value max;
116 /** The option tick values that are possible, if applicable. */
117 const sjme_vmConfig_value ticks[sjme_flexibleArrayCount];
118 } value;
119 } sjme_vmConfig_setting;
121 /*--------------------------------------------------------------------------*/
123 /* Anti-C++. */
124 #ifdef __cplusplus
125 #ifdef SJME_CXX_SQUIRRELJME_VMCONFIG_H
127 #undef SJME_CXX_SQUIRRELJME_VMCONFIG_H
128 #undef SJME_CXX_IS_EXTERNED
129 #endif /* #ifdef SJME_CXX_SQUIRRELJME_VMCONFIG_H */
130 #endif /* #ifdef __cplusplus */
132 #endif /* SQUIRRELJME_VMCONFIG_H */