1 /* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
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 // -------------------------------------------------------------------------*/
11 * Virtual machine configuration.
16 #ifndef SQUIRRELJME_VMCONFIG_H
17 #define SQUIRRELJME_VMCONFIG_H
23 #ifndef SJME_CXX_IS_EXTERNED
24 #define SJME_CXX_IS_EXTERNED
25 #define SJME_CXX_SQUIRRELJME_VMCONFIG_H
27 #endif /* #ifdef SJME_CXX_IS_EXTERNED */
28 #endif /* #ifdef __cplusplus */
30 /*--------------------------------------------------------------------------*/
33 * The type of setting this is.
37 typedef enum sjme_vmConfig_settingType
39 /** The number of setting types. */
40 SJME_NUM_VM_CONFIG_SETTING_TYPES
41 } sjme_vmConfig_settingType
;
44 * Indicates the category a given configuration setting is in.
48 typedef enum sjme_vmConfig_categoryType
50 /** The number of category types available. */
51 SJME_NUM_VM_CONFIG_CATEGORY_TYPES
52 } sjme_vmConfig_categoryType
;
55 * A flag used for the configuration.
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,
72 * Represents a single value.
76 typedef union sjme_vmConfig_value
83 } sjme_vmConfig_value
;
86 * Represents a single virtual machine configuration.
90 typedef struct sjme_vmConfig_setting
92 /** The category this setting is in. */
93 sjme_vmConfig_categoryType category
;
95 /** The name of this setting. */
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. */
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
];
119 } sjme_vmConfig_setting
;
121 /*--------------------------------------------------------------------------*/
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 */