10#if defined(WIN32) || defined(_WINDOWS)
12extern void GetSpecialDir(
char *
dst,
size_t size,
int whichDir);
32 static char *cwdBuf =
NULL;
33 static size_t cwdBufSize = 0;
35 if (cwdBufSize == 0) {
37 cwdBuf = (
char *)
malloc(cwdBufSize);
52 cwdBuf = (
char *)
Realloc(cwdBuf, cwdBufSize);
58 static char *cwdBuf =
NULL;
93#elif defined(WIN32) || defined(_WINDOWS)
130#if defined(WIN32) || defined(_WINDOWS)
145 systemTime.
wHour * 3600 +
146 systemTime.
wDay * 86400;
158#if defined(WIN32) || defined(_WINDOWS)
190#elif defined(_CONSOLE) && (defined(WIN32) || defined(_WINDOWS))
191 static char pwbuf[128];
201 for (
dst = pwbuf, dlim =
dst +
sizeof(pwbuf) - 1;;) {
203 if ((
c == 0) || (
c == 0xe0)) {
207 if ((
c ==
'\r') || (
c ==
'\n'))
218 static char pwbuf[128];
221#if defined(WIN32) || defined(_WINDOWS)
242#if defined(WIN32) || defined(_WINDOWS)
243 const char *homedrive, *homepath;
245 homedrive =
getenv(
"HOMEDRIVE");
246 homepath =
getenv(
"HOMEPATH");
247 if ((homedrive !=
NULL) && (homepath !=
NULL)) {
269#if defined(USE_GETPWUID)
280 else if ((
cp = (
const char *)
getenv(
"LOGNAME")) ==
NULL)
292#if defined(WIN32) || defined(_WINDOWS)
315 else if ((
cp = (
const char *)
getenv(
"LOGNAME")) ==
NULL)
353 buf[
sizeof(
buf) - 1] =
'\0';
384 buf[
sizeof(
buf) - 1] =
'\0';
395 if (
buf[
len - 1] ==
'\n') {
398 if (
buf[
len - 2] ==
'.') {
402 }
else if (
buf[
len - 1] ==
'.') {
412 sprintf(errnostr,
sizeof(errnostr) - 1,
" (errno = %d)", errnum);
413 errnostr[
sizeof(errnostr) - 1] =
'\0';
415 sprintf(errnostr,
" (errno = %d)", errnum);
419 if (endsinperiod != 0)
421 if (endsinnewline != 0)
451 struct tm local_tm, utc_tm, *utc_tmptr;
452 time_t local_t, utc_t, utcOffset;
463 local_t =
mktime(&local_tm);
465 if (local_t != (
time_t) -1) {
466 utc_tmptr =
gmtime(&local_t);
475 utcOffset = (local_t - utc_t);
495 if (
strncmp(dstr,
"19100", 5) == 0) {
511 if (
sscanf(dstr,
"%04d%02d%02d%02d%02d%02d",
543 optsize =
sizeof(opt);
552 optsize =
sizeof(opt);
581 if (ssize > 0 || rsize > 0) {
583 optsize =
sizeof(opt);
590 optsize =
sizeof(opt);
595 optsize =
sizeof(opt);
615 k2 = (
unsigned char *)
key;
616 for (
i=0;
i < (
int) dsize - 1;
i++) {
629#if defined(WIN32) || defined(_WINDOWS)
630void WinSleep(
unsigned int seconds)
633 DWORD milliseconds = seconds * 1000;
635 if (milliseconds > 0) {
637 deadline =
now + milliseconds;
638 if (
now < deadline) {
641 milliseconds = deadline -
now;
644 }
while (
now < deadline);
648 milliseconds -= (0xFFFFFFFF -
now);
652 }
while (
now > deadline);
654 deadline =
now + milliseconds;
656 milliseconds = deadline -
now;
659 }
while (
now < deadline);
684 return ((
char *)
first);
704 return ((
char *)
last);
716 if ((
cp ==
NULL) || (
cp[1] !=
'\0'))
773 if ((
cp ==
NULL) || (
cp[1] !=
'\0'))
777 while ((
cp >
dst) && (*
cp ==
'/'))
785MkDirs(
const char *
const newdir,
int mode1)
790#if defined(WIN32) || defined(_WINDOWS)
798#if defined(WIN32) || defined(_WINDOWS)
799 if ((
isalpha(newdir[0])) && (newdir[1] ==
':')) {
806 }
else if (newdir[3] ==
'\0') {
816 if (
_access(newdir, 00) == 0) {
817 if (
_stat(newdir, &st) < 0)
827 if (
Stat(newdir, &st) < 0)
838 if (
s[
sizeof(
s) - 1] !=
'\0') {
849#if defined(WIN32) || defined(_WINDOWS)
857 }
else if (
cp[1] ==
'\0') {
868#if defined(WIN32) || defined(_WINDOWS)
889#if defined(WIN32) || defined(_WINDOWS)
943#if defined(WIN32) || defined(_WINDOWS)
968 char extnPattern[16];
970 extn = pathName +
strlen(pathName) - 1;
972 if (extn <= pathName)
982 if (
strlen(extn) > (
sizeof(extnPattern) - 2 - 1 - 1)) {
986 snprintf(extnPattern,
sizeof(extnPattern),
1025#ifdef HAVE_SIGACTION
1028 struct sigaction
sa, osa;
1030 (
void) sigemptyset(&
sa.sa_mask);
1033 if (signum == SIGALRM) {
1035 sa.sa_flags |= SA_INTERRUPT;
1039 sa.sa_flags |= SA_RESTART;
1042 if (sigaction(signum, &
sa, &osa) < 0)
1044 return (osa.sa_handler);
char * Strncat(char *const, const char *const, const size_t)
char * Strncpy(char *const, const char *const, const size_t)
#define gettimeofday(tv, tz)
static struct sockaddr_in sa
VOID WINAPI GetSystemTime(OUT LPSYSTEMTIME lpSystemTime)
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
UINT(* handler)(MSIPACKAGE *)
char *CDECL getenv(const char *name)
char *CDECL strerror(int err)
int CDECL fclose(FILE *file)
int WINAPIV fprintf(FILE *file, const char *format,...)
int CDECL vfprintf(FILE *file, const char *format, va_list valist)
char *CDECL fgets(char *s, int size, FILE *file)
int CDECL fputs(const char *s, FILE *file)
int CDECL _access(const char *filename, int mode)
int CDECL fflush(FILE *file)
int CDECL _fileno(FILE *file)
int CDECL _isatty(int fd)
static char * getcwd(char *buf, int size)
_ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl vsprintf(char *, const char *, va_list) __WINE_CRT_PRINTF_ATTR(2
_ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl sscanf(const char *, const char *,...) __WINE_CRT_SCANF_ATTR(2
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP char *__cdecl strstr(const char *, const char *)
_ACRTIMP int __cdecl strncmp(const char *, const char *, size_t)
_ACRTIMP char *__cdecl strrchr(const char *, int)
static struct tm * gmtime(const time_t *t)
static time_t mktime(struct tm *tm)
static struct tm * localtime(const time_t *t)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
char * getpass(const char *prompt)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLint GLboolean GLint GLenum access
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
time_t UnMDTMDate(char *dstr)
struct passwd * GetPwByName(void)
int MkDirs(const char *const newdir, int mode1)
static time_t GetUTCOffset(int mon, int mday)
int SetSockBufSize(int sockfd, size_t rsize, size_t ssize)
char * FTPGetLocalCWD(char *buf, size_t size)
void GetHomeDir(char *dst, size_t size)
int FilenameExtensionIndicatesASCII(const char *const pathName, const char *const extnList)
char * FGets(char *str, size_t size, FILE *fp)
void PrintF(const FTPCIPtr cip, const char *const fmt,...)
void GetUsrName(char *dst, size_t size)
void StrRemoveTrailingSlashes(char *dst)
char * GetPass(const char *const prompt)
int GetSockBufSize(int sockfd, size_t *rsize, size_t *ssize)
void Scramble(unsigned char *dst, size_t dsize, unsigned char *src, char *key)
void * Realloc(void *, size_t)
#define StrRFindLocalPathDelim(a)
#define StrFindLocalPathDelim(a)
#define StrRemoveTrailingLocalPathDelim
#define LocalPathToTVFSPath(s)
#define TVFSPathToLocalPath(s)
#define IsLocalPathDelim(c)
INT WSAAPI setsockopt(IN SOCKET s, IN INT level, IN INT optname, IN CONST CHAR FAR *optval, IN INT optlen)
INT WSAAPI getsockopt(IN SOCKET s, IN INT level, IN INT optname, OUT CHAR FAR *optval, IN OUT INT FAR *optlen)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
#define GetCurrentDirectory
void int int ULONGLONG int va_list * ap