1 /* Copyright (C) 2008 The Android Open Source Project 2 ** 3 ** This software is licensed under the terms of the GNU General Public 4 ** License version 2, as published by the Free Software Foundation, and 5 ** may be copied, distributed, and modified under those terms. 6 ** 7 ** This program is distributed in the hope that it will be useful, 8 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 9 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 ** GNU General Public License for more details. 11 */ 12 #ifndef _ANDROID_AVD_HW_CONFIG_H 13 #define _ANDROID_AVD_HW_CONFIG_H 14 15 #include <stdint.h> 16 #include "android/utils/ini.h" 17 18 typedef char hw_bool_t; 19 typedef int hw_int_t; 20 typedef int64_t hw_disksize_t; 21 typedef char* hw_string_t; 22 typedef double hw_double_t; 23 24 /* these macros are used to define the fields of AndroidHwConfig 25 * declared below 26 */ 27 #define HWCFG_BOOL(n,s,d,a,t) hw_bool_t n; 28 #define HWCFG_INT(n,s,d,a,t) hw_int_t n; 29 #define HWCFG_STRING(n,s,d,a,t) hw_string_t n; 30 #define HWCFG_DOUBLE(n,s,d,a,t) hw_double_t n; 31 #define HWCFG_DISKSIZE(n,s,d,a,t) hw_disksize_t n; 32 33 typedef struct { 34 #include "android/avd/hw-config-defs.h" 35 } AndroidHwConfig; 36 37 /* reads a hardware configuration file from disk. 38 * returns -1 if the file could not be read, or 0 in case of success. 39 * 40 * note that default values are written to hwConfig if the configuration 41 * file doesn't have the corresponding hardware properties. 42 */ 43 int androidHwConfig_read( AndroidHwConfig* hwConfig, 44 IniFile* configFile ); 45 46 #endif /* _ANDROID_AVD_HW_CONFIG_H */ 47