blob: 2362b59f71284b880f7d1360cc1012d922ad0a50 [file] [log] [blame]
The Android Open Source Projectdf7881f2008-12-17 18:04:49 -08001/* 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*/
The Android Open Source Projectc27f8132009-02-10 15:43:59 -080012#include "android/avd/hw-config.h"
The Android Open Source Projectdf7881f2008-12-17 18:04:49 -080013#include "android/utils/ini.h"
14#include <string.h>
15#include <stdlib.h>
16
17
18/* the global variable containing the hardware config for this device */
19AndroidHwConfig android_hw[1];
20
21int
22androidHwConfig_read( AndroidHwConfig* config,
23 IniFile* ini )
24{
25 if (ini == NULL)
26 return -1;
27
28 /* use the magic of macros to implement the hardware configuration loaded */
29
30#define HWCFG_BOOL(n,s,d,a,t) config->n = iniFile_getBoolean(ini, s, d);
31#define HWCFG_INT(n,s,d,a,t) config->n = iniFile_getInteger(ini, s, d);
32#define HWCFG_STRING(n,s,d,a,t) config->n = iniFile_getString(ini, s, d);
33#define HWCFG_DOUBLE(n,s,d,a,t) config->n = iniFile_getDouble(ini, s, d);
34#define HWCFG_DISKSIZE(n,s,d,a,t) config->n = iniFile_getDiskSize(ini, s, d);
35
The Android Open Source Projectc27f8132009-02-10 15:43:59 -080036#include "android/avd/hw-config-defs.h"
The Android Open Source Projectdf7881f2008-12-17 18:04:49 -080037
38 return 0;
39}