38 lines
698 B
C++
38 lines
698 B
C++
|
#include "wxinc.h"
|
||
|
#include "xvt.h"
|
||
|
|
||
|
BOOLEAN aga_get_host_name(char* name, int maxlen)
|
||
|
{
|
||
|
wxString str = wxGetHostName();
|
||
|
const int len = str.Length();
|
||
|
strncpy(name, str, maxlen);
|
||
|
name[maxlen-1] = '\0';
|
||
|
return len > 0;
|
||
|
}
|
||
|
|
||
|
BOOLEAN aga_get_user_name(char* name, int maxlen)
|
||
|
{
|
||
|
wxString str = wxGetUserId();
|
||
|
str.MakeUpper();
|
||
|
const int len = str.Length();
|
||
|
strncpy(name, str, maxlen);
|
||
|
name[maxlen-1] = '\0';
|
||
|
return len > 0;
|
||
|
}
|
||
|
|
||
|
void aga_log(const char* fmt, ...)
|
||
|
{
|
||
|
static bool bStarted = false;
|
||
|
FILE* log = fopen("aga.log", bStarted ? "a" : "w");
|
||
|
|
||
|
va_list argptr;
|
||
|
va_start(argptr,fmt);
|
||
|
vfprintf(log, fmt, argptr);
|
||
|
va_end(argptr);
|
||
|
fprintf(log, "\n");
|
||
|
|
||
|
fclose(log);
|
||
|
bStarted = true;
|
||
|
}
|
||
|
|