summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util')
-rw-r--r--src/lib/util/options.c17
-rw-r--r--src/lib/util/options.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/util/options.c b/src/lib/util/options.c
index d89ef85190a..78cab4f08cf 100644
--- a/src/lib/util/options.c
+++ b/src/lib/util/options.c
@@ -153,6 +153,12 @@ void core_options::entry::set_default_value(const char *defvalue)
}
+void core_options::entry::set_flag(UINT32 mask, UINT32 flag)
+{
+ m_flags = ( m_flags & mask ) | flag;
+}
+
+
//-------------------------------------------------
// revert - revert back to our default if we are
// at or below the given priority
@@ -641,6 +647,17 @@ bool core_options::set_value(const char *name, float value, int priority, astrin
}
+void core_options::set_flag(const char *name, UINT32 mask, UINT32 flag)
+{
+ // find the entry first
+ entry *curentry = m_entrymap.find(name);
+ if ( curentry == NULL )
+ {
+ return;
+ }
+ curentry->set_flag(mask, flag);
+}
+
//-------------------------------------------------
// reset - reset the options state, removing
// everything
diff --git a/src/lib/util/options.h b/src/lib/util/options.h
index 28e478afb73..452bd5dbac1 100644
--- a/src/lib/util/options.h
+++ b/src/lib/util/options.h
@@ -122,6 +122,7 @@ public:
// setters
void set_value(const char *newvalue, int priority);
void set_default_value(const char *defvalue);
+ void set_flag(UINT32 mask, UINT32 flag);
void revert(int priority);
private:
@@ -186,6 +187,7 @@ public:
bool set_value(const char *name, const char *value, int priority, astring &error_string);
bool set_value(const char *name, int value, int priority, astring &error_string);
bool set_value(const char *name, float value, int priority, astring &error_string);
+ void set_flag(const char *name, UINT32 mask, UINT32 flags);
// misc
static const char *unadorned(int x = 0) { return s_option_unadorned[MIN(x, MAX_UNADORNED_OPTIONS)]; }