wxStrncpy(zBuf, zSysname, nMaxSize - 1);
zBuf[nMaxSize] = _T('\0');
#endif
- return *zBuf ? TRUE : FALSE;
+ return *zBuf ? true : false;
}
// Get user ID e.g. jacs
long lrc;
// UPM procs return 0 on success
lrc = U32ELOCU((unsigned char*)zBuf, (unsigned long *)&nType);
- if (lrc == 0) return TRUE;
+ if (lrc == 0) return true;
#endif
- return FALSE;
+ return false;
}
bool wxGetUserName(
#else
wxStrncpy(zBuf, _T("Unknown User"), nMaxSize);
#endif
- return TRUE;
+ return true;
}
int wxKill(
long lPid
, wxSignal eSig
, wxKillError* peError
+, int flags
)
{
return((int)::DosKillProcess(0, (PID)lPid));
bool wxShutdown(wxShutdownFlags wFlags)
{
// TODO
- return FALSE;
+ return false;
+}
+
+wxPowerType wxGetPowerType()
+{
+ // TODO
+ return wxPOWER_UNKNOWN;
+}
+
+wxBatteryState wxGetBatteryState()
+{
+ // TODO
+ return wxBATTERY_UNKNOWN_STATE;
}
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
-long wxGetFreeMemory()
+wxMemorySize wxGetFreeMemory()
{
void* pMemptr = NULL;
- ULONG lSize;
+ LONG lSize;
ULONG lMemFlags;
APIRET rc;
lMemFlags = PAG_FREE;
- rc = ::DosQueryMem(pMemptr, &lSize, &lMemFlags);
+ rc = ::DosQueryMem(pMemptr, (PULONG)&lSize, &lMemFlags);
if (rc != 0)
- return -1L;
- return (long)lSize;
+ lSize = -1L;
+ return (wxMemorySize)lSize;
+}
+
+// Get Process ID
+unsigned long wxGetProcessId()
+{
+ return (unsigned long)getpid();
}
// ----------------------------------------------------------------------------
// wxGetenv is defined as getenv()
wxChar *p = wxGetenv(var);
if ( !p )
- return FALSE;
+ return false;
if ( value )
{
*value = p;
}
- return TRUE;
+ return true;
}
bool wxSetEnv(const wxString& variable, const wxChar *value)
return putenv(buf) == 0;
#else // no way to set an env var
- return FALSE;
+ return false;
#endif
}
-void wxUsleep(
+void wxMilliSleep(
unsigned long ulMilliseconds
)
{
::DosSleep(ulMilliseconds);
}
+void wxMicroSleep(
+ unsigned long ulMicroseconds
+)
+{
+ ::DosSleep(ulMicroseconds/1000);
+}
+
void wxSleep(
int nSecs
)
wxToolkitInfo & wxConsoleAppTraits::GetToolkitInfo()
{
- static wxToolkitInfo vInfo;
- ULONG ulSysInfo[QSV_MAX] = {0};
- APIRET ulrc;
+ static wxToolkitInfo vInfo;
+ ULONG ulSysInfo[QSV_MAX] = {0};
+ APIRET ulrc;
vInfo.name = _T("wxBase");
ulrc = ::DosQuerySysInfo( 1L
char *wxBuffer = new wxChar[256];
#ifndef __EMX__
- if (sUser1 != _T(""))
+ if (!sUser1.empty())
{
wxChar zTmp[64];
}
}
#endif
- if (sUser1 == _T(""))
+ if (sUser1.empty())
{
if ((zHome = wxGetenv(_T("HOME"))) != NULL)
{
return NULL; // No home known!
}
-bool wxDirExists(
- const wxString& rDir
-)
-{
- return (::DosSetCurrentDir(WXSTRINGCAST rDir));
-}
-
wxString WXDLLEXPORT wxPMErrorToStr(
ERRORID vError
)