/* Read a hardware.ini if it is located in the skin directory */ static int _avdInfo_getBuildSkinHardwareIni( AvdInfo* i ) { char* skinName; char* skinDirPath; avdInfo_getSkinInfo(i, &skinName, &skinDirPath); if (skinDirPath == NULL) return 0; int result = avdInfo_getSkinHardwareIni(i, skinName, skinDirPath); AFREE(skinName); AFREE(skinDirPath); return result; }
/* Read a hardware.ini if it is located in the skin directory */ static int _avdInfo_getBuildSkinHardwareIni( AvdInfo* i ) { char* skinName; char* skinDirPath; char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp); avdInfo_getSkinInfo(i, &skinName, &skinDirPath); if (skinDirPath == NULL) return 0; int result = avdInfo_getSkinHardwareIni(i, skinName, skinDirPath); AFREE(skinName); AFREE(skinDirPath); return result; }
/* Read a hardware.ini if it is located in the skin directory */ static int _avdInfo_getBuildSkinHardwareIni( AvdInfo* i ) { char* skinName; char* skinDirPath; char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp); avdInfo_getSkinInfo(i, &skinName, &skinDirPath); if (skinDirPath == NULL) return 0; p = bufprint(temp, end, "%s/%s/hardware.ini", skinDirPath, skinName); if (p >= end || !path_exists(temp)) { DD("no skin-specific hardware.ini in %s", skinDirPath); return 0; } D("found skin-specific hardware.ini: %s", temp); i->skinHardwareIni = iniFile_newFromFile(temp); if (i->skinHardwareIni == NULL) return -1; return 0; }