Undo checkin withbad line endings.

svn path=/trunk/boinc/; revision=5974
This commit is contained in:
Charlie Fenton 2005-04-29 08:14:55 +00:00
parent 06fcf21a6d
commit 5ecc2dabc7
1 changed files with 2 additions and 34 deletions

View File

@ -72,16 +72,6 @@
using std::string;
#ifdef __APPLE__
#include <CoreFoundation/CoreFoundation.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <IOKit/ps/IOPowerSources.h>
#include <IOKit/ps/IOPSKeys.h>
#ifdef __cplusplus
} // extern "C"
#endif
NXEventHandle gEventHandle;
#endif // __APPLE__
@ -125,31 +115,10 @@ int get_timezone() {
// Returns true if the host is currently running off battery power
// If you can't figure out, return false
//
// TODO: port this to other platforms (Windows, others?)
// TODO: port this to other platforms (Windows, Mac OS X, others?)
//
bool HOST_INFO::host_is_running_on_batteries() {
#if defined(__APPLE__)
CFDictionaryRef pSource = NULL;
CFStringRef psState;
int i;
bool retval = false;
CFTypeRef blob = IOPSCopyPowerSourcesInfo();
CFArrayRef list = IOPSCopyPowerSourcesList(blob);
for(i = 0; i < CFArrayGetCount(list); i++) {
pSource = IOPSGetPowerSourceDescription(blob, CFArrayGetValueAtIndex(list, i));
if(!pSource) break;
psState = (CFStringRef)CFDictionaryGetValue(pSource, CFSTR(kIOPSPowerSourceStateKey));
if(!CFStringCompare(psState,CFSTR(kIOPSBatteryPowerValue),0))
retval = true;
}
CFRelease(blob);
CFRelease(list);
return(retval);
#elif defined(linux)
#ifdef linux
bool retval = false;
FILE* fapm = fopen("/proc/apm", "r");
@ -618,4 +587,3 @@ bool HOST_INFO::users_idle(bool check_all_logins, double idle_time_to_run) {
const char *BOINC_RCSID_2cf92d205b = "$Id$";