20 static int gResolveSig;
23 #if defined(WIN32) || defined(_WINDOWS) 24 #elif defined(HAVE_SIGSETJMP) 36 'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
37 'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
38 'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
39 'Y',
'Z',
'a',
'b',
'c',
'd',
'e',
'f',
40 'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
41 'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
42 'w',
'x',
'y',
'z',
'0',
'1',
'2',
'3',
43 '4',
'5',
'6',
'7',
'8',
'9',
'+',
'/' 48 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
49 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
50 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
51 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
52 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
53 '\177',
'\177',
'\177',
'\76',
'\177',
'\177',
'\177',
'\77',
54 '\64',
'\65',
'\66',
'\67',
'\70',
'\71',
'\72',
'\73',
55 '\74',
'\75',
'\177',
'\177',
'\177',
'\100',
'\177',
'\177',
56 '\177',
'\0',
'\1',
'\2',
'\3',
'\4',
'\5',
'\6',
57 '\7',
'\10',
'\11',
'\12',
'\13',
'\14',
'\15',
'\16',
58 '\17',
'\20',
'\21',
'\22',
'\23',
'\24',
'\25',
'\26',
59 '\27',
'\30',
'\31',
'\177',
'\177',
'\177',
'\177',
'\177',
60 '\177',
'\32',
'\33',
'\34',
'\35',
'\36',
'\37',
'\40',
61 '\41',
'\42',
'\43',
'\44',
'\45',
'\46',
'\47',
'\50',
62 '\51',
'\52',
'\53',
'\54',
'\55',
'\56',
'\57',
'\60',
63 '\61',
'\62',
'\63',
'\177',
'\177',
'\177',
'\177',
'\177',
64 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
65 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
66 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
67 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
68 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
69 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
70 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
71 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
72 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
73 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
74 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
75 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
76 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
77 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
78 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
79 '\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
'\177',
86 const unsigned char *
src, *srclim;
87 unsigned int c0, c1, c2;
94 while (
src < srclim) {
110 ch = ((c0 << 4) & 060) | ((c1 >> 4) & 017);
113 ch = ((c1 << 2) & 074) | ((c2 >> 6) & 03);
131 const unsigned char *
src, *srclim;
132 unsigned int c0, c1, c2, c3;
139 while (
src < srclim) {
188 #ifndef HAVE_INET_NTOP 193 if (
src != (
char **) 0) {
195 #ifdef HAVE_INET_NTOP 199 if ((
cp != (
char *) 0) && (
cp != (
char *) -1) && (
cp[0] !=
'\0'))
233 if (ip_address !=
NULL)
254 if (
src[0] ==
'\0') {
265 if (((
s ==
src) || (
s[-1] ==
'/')) && ((
s[1] ==
'/') || (
s[1] ==
'\0'))) {
270 }
else if (
d < lim) {
275 }
else if (
c ==
'/') {
286 }
else if (
c ==
'.') {
291 }
else if (
c ==
'\0') {
301 }
else if (
c ==
'\0') {
303 if ((
d[-1] ==
'/') && (
d > (
dst + 1)))
307 }
else if (
d < lim) {
332 if ((
b[0] ==
'.') && (
b[1] ==
'.')) {
340 if ((
a[0] ==
'.') && (
a[1] ==
'.')) {
343 if ((
b ==
dst) && (*
dst ==
'/'))
348 }
else if (
a[2] ==
'\0') {
350 if ((
b <=
dst + 1) && (*
dst ==
'/'))
368 PathCat(
char *
const dst,
const size_t dsize,
const char *
const cwd,
const char *
const src)
377 cp =
Strnpcpy(tmp, (
char *) cwd,
sizeof(tmp) - 1);
387 FileToURL(
char *
url,
size_t urlsize,
const char *
const fn,
const char *
const rcwd,
const char *
const startdir,
const char *
const user,
const char *
const pass,
const char *
const hname,
const unsigned int port)
416 dsize = urlsize - ulen;
418 if ((startdir !=
NULL) && (startdir[0] !=
'\0') && (startdir[1] !=
'\0')) {
422 }
else if (isUser != 0) {
428 dst[dsize - 1] =
'\0';
429 dst[dsize - 2] =
'\0';
430 dst[dsize - 3] =
'\0';
431 dst[dsize - 4] =
'\0';
475 Path(
char *
const dst,
const size_t siz,
const char *
const parent,
const char *
const fname)
508 #if defined(WIN32) || defined(_WINDOWS) 519 "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\ncftp.exe",
567 if ((
cp !=
NULL) && (
cp[1] ==
'\0'))
574 if ((
cp !=
NULL) && (
cp[1] ==
'\0'))
578 if (
gUser[0] ==
'\0') {
632 #if defined(WIN32) || defined(_WINDOWS) 644 if ((
cp !=
NULL) && (
cp[1] ==
'\0'))
649 struct passwd *pwptr;
653 pwptr = getpwuid(
gUid);
659 (
void)
fprintf(
stderr,
"You have a user id number of %d, but no username associated with it.\n", (
int)
gUid);
695 MayUseFirewall(
const char *
const hn,
int firewallType,
const char *
const firewallExceptionList)
706 if (firewallExceptionList[0] ==
'\0') {
726 if (
strcmp(tok,
"localdomain") == 0)
803 #if defined(WIN32) || defined(_WINDOWS) 811 gResolveSig = sigNum;
813 #ifdef HAVE_SIGSETJMP 828 #if defined(WIN32) || defined(_WINDOWS) 832 if (
inet_addr(hn) != (
unsigned long) 0xFFFFFFFF) {
849 #ifndef HAVE_INET_NTOP 853 #ifdef HAVE_INET_ATON 867 #ifdef HAVE_SIGSETJMP 868 osigpipe = osigint = osigalrm = (
sigproc_t) 0;
871 osigpipe = osigint = osigalrm = (
sigproc_t) 0;
882 Trace(0,
"Canceled GetHostByName because of signal %d.\n", gResolveSig);
889 (
void) alarm((
unsigned int)
t);
897 #ifdef HAVE_INET_NTOP 937 if (
sscanf(dstr,
"%04d%02d%02d%02d%02d%02d",
967 #define wsize sizeof(word) 968 #define wmask (wsize - 1) 978 register char *
dst = (
char *) dst0;
979 register const char *
src = (
char *) src0;
988 #define TLOOP(s) if (t) TLOOP1(s) 989 #define TLOOP1(s) do { s; } while (--t) 991 if ((
unsigned long)
dst < (
unsigned long)
src) {
996 if ((
t | (
int)
dst) & wmask) {
1001 if ((
t ^ (
int)
dst) & wmask ||
length < wsize)
1004 t = wsize - (
t & wmask);
1024 if ((
t | (
int)
dst) & wmask) {
1025 if ((
t ^ (
int)
dst) & wmask ||
length <= wsize)
1045 #if defined(HAVE_STRCOLL) && !defined(HAVE_STRNCOLL) 1052 char sa[512],
sb[512];
1120 #if defined(WIN32) || defined(_WINDOWS) 1121 void SysPerror(
const char *
const errMsg)
#define memmove(s1, s2, n)
void CompressPath(char *const dst, const char *const src, const size_t dsize)
char gOurInstallationPath[260]
time_t UnDate(char *dstr)
ACPI_SIZE strlen(const char *String)
static GLenum _GLUfuncptr fn
char * strstr(char *String1, char *String2)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
volatile sigproc_t vsigproc_t
void AbbrevStr(char *dst, const char *src, size_t max, int mode)
*nSize LPSTR _Inout_ LPDWORD nSize
static const unsigned char B64EncodeTable[64]
char * OurDirectoryPath(char *const dst, const size_t siz, const char *const fname)
#define STRNCPY(dst, src, n)
DWORD WINAPI GetLastError(VOID)
int MkDirs(const char *const newdir, int mode1)
static void CancelGetHostByName(int sigNum)
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
#define kFirewallNotInUse
void AbsoluteToRelative(char *const dst, const size_t dsize, const char *const dir, const char *const root, const size_t rootlen)
#define sprintf(buf, format,...)
char * FileToURL(char *url, size_t urlsize, const char *const fn, const char *const rcwd, const char *const startdir, const char *const user, const char *const pass, const char *const hname, const unsigned int port)
GLenum GLuint GLenum GLsizei const GLchar * buf
char * Strncat(char *const, const char *const, const size_t)
PHOSTENT WSAAPI gethostbyaddr(IN const char FAR *addr, IN int len, IN int type)
void InitOurDirectory(void)
LONG WINAPI RegCloseKey(HKEY hKey)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
GLenum GLuint GLenum GLsizei length
void PathCat(char *const dst, const size_t dsize, const char *const cwd, const char *const src)
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
int longjmp(jmp_buf buf, int retval)
#define FORMAT_MESSAGE_FROM_SYSTEM
void ToBase64(void *dst0, const void *src0, size_t n, int terminate)
void siglongjmp(sigjmp_buf buf, int val)
PHOSTENT WSAAPI gethostbyname(IN const char FAR *name)
GLboolean GLboolean GLboolean b
void MSVCRT() terminate()
int GetHostByName(char *const volatile dst, size_t dsize, const char *const hn, int t)
static const unsigned char B64DecodeTable[256]
int sigsetjmp(sigjmp_buf buf, int savesigs)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
void MyInetAddr(char *dst, size_t siz, char **src, int i)
#define inet_aton(ap, inp)
#define GetModuleFileName
static void(WINAPI *pDeinitMapiUtil)(void)
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
#define memcpy(s1, s2, n)
int DecodeDirectoryURL(const FTPCIPtr cip, char *url, LineListPtr cdlist, char *fn, size_t fnsize)
_CRTIMP struct tm *__cdecl localtime(const time_t *_Time)
char gOurDirectoryPath[260]
struct hostent * GetHostEntry(const char *host, struct in_addr *ip_address)
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
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
void FromBase64(void *dst0, const void *src0, size_t n, int terminate)
int StrToBool(const char *const s)
char * Path(char *const dst, const size_t siz, const char *const parent, const char *const fname)
char * Strnpcat(char *const, const char *const, size_t)
char * Strncpy(char *const, const char *const, const size_t)
#define LOCAL_PATH_DELIM_STR
int FTPDecodeURL(const FTPCIPtr cip, char *const url, LineListPtr cdlist, char *const fn, const size_t fnsize, int *const xtype, int *const wantnlst)
char * OurInstallationPath(char *const dst, const size_t siz, const char *const fname)
jmp_buf gGetHostByNameJmp
_CRTIMP time_t __cdecl mktime(struct tm *_Tm)
#define kOurDirectoryName
char * strtok(char *String, const char *Delimiters)
char * strchr(const char *String, int ch)
char * Strnpcpy(char *const, const char *const, size_t)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
char * strcpy(char *DstString, const char *SrcString)
#define StrRFindLocalPathDelim(a)
int strcmp(const char *String1, const char *String2)
const char *WSAAPI inet_ntop(int af, const void *src, char *dst, size_t cnt)
GLboolean GLboolean GLboolean GLboolean a
int MayUseFirewall(const char *const hn, int firewallType, const char *const firewallExceptionList)
void user(int argc, const char *argv[])
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static struct sockaddr_in sa
#define HKEY_LOCAL_MACHINE