diff options
author | David 'Digit' Turner <digit@android.com> | 2011-02-10 17:40:04 +0100 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2011-02-10 18:39:33 +0100 |
commit | 59e8e1969c6543cc9375b1a4372ef2e3e8afa183 (patch) | |
tree | 6f58c0180400fd423d0088f43da7f221d03f0e93 /android/utils | |
parent | 5377c5bfde6ba62490417bb0a7d7c1be1151692e (diff) | |
download | external_qemu-59e8e1969c6543cc9375b1a4372ef2e3e8afa183.zip external_qemu-59e8e1969c6543cc9375b1a4372ef2e3e8afa183.tar.gz external_qemu-59e8e1969c6543cc9375b1a4372ef2e3e8afa183.tar.bz2 |
Add hw.keyboard.lid
This is used to control the lid switch virtual device.
+ Add support for a "version <number>" field to the skin format.
This will later be used for skin format #3.
+ Fix a bug where string hw properties didn't work/compile
Change-Id: I678a0988d2cd24169dd0c2ece96e7ab0b2822104
Diffstat (limited to 'android/utils')
-rw-r--r-- | android/utils/ini.c | 9 | ||||
-rw-r--r-- | android/utils/ini.h | 9 |
2 files changed, 9 insertions, 9 deletions
diff --git a/android/utils/ini.c b/android/utils/ini.c index 1a1449c..a5914dd 100644 --- a/android/utils/ini.c +++ b/android/utils/ini.c @@ -326,12 +326,15 @@ iniFile_saveToFile( IniFile* f, const char* filepath ) } char* -iniFile_getString( IniFile* f, const char* key ) +iniFile_getString( IniFile* f, const char* key, const char* defaultValue ) { const char* val = iniFile_getValue(f, key); - if (!val) - return NULL; + if (!val) { + if (!defaultValue) + return NULL; + val= defaultValue; + } return ASTRDUP(val); } diff --git a/android/utils/ini.h b/android/utils/ini.h index 77d760f..5730ee0 100644 --- a/android/utils/ini.h +++ b/android/utils/ini.h @@ -48,9 +48,10 @@ int iniFile_getPairCount( IniFile* f ); */ const char* iniFile_getValue( IniFile* f, const char* key ); -/* returns a copy of the value of a given key, or NULL +/* returns a copy of the value of a given key, or NULL if defaultValue is NULL. + * caller must free() it. */ -char* iniFile_getString( IniFile* f, const char* key ); +char* iniFile_getString( IniFile* f, const char* key, const char* defaultValue ); /* returns an integer value, or a default in case the value string is * missing or badly formatted @@ -67,10 +68,6 @@ int64_t iniFile_getInt64( IniFile* f, const char* key, int64_t defaultValue ) */ double iniFile_getDouble( IniFile* f, const char* key, double defaultValue ); -/* returns a copy of a given key's value, if any, or NULL if it is missing - * caller must call free() to release it */ -char* iniFile_getString( IniFile* f, const char* key ); - /* parses a key value as a boolean. Accepted values are "1", "0", "yes", "YES", * "no" and "NO". Returns either 1 or 0. * note that the default value must be provided as a string too |