20static 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) {
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 ==
'/'))
368PathCat(
char *
const dst,
const size_t dsize,
const char *
const cwd,
const char *
const src)
377 cp =
Strnpcpy(tmp, (
char *) cwd,
sizeof(tmp) - 1);
387FileToURL(
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';
475Path(
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);
695MayUseFirewall(
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;
828#if defined(WIN32) || defined(_WINDOWS)
832 if (
inet_addr(hn) != (
unsigned long) 0xFFFFFFFF) {
849#ifndef HAVE_INET_NTOP
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);
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)
1121void SysPerror(
const char *
const errMsg)
PRTL_UNICODE_STRING_BUFFER Path
char * Strncat(char *const, const char *const, const size_t)
char * Strncpy(char *const, const char *const, const size_t)
char * Strnpcpy(char *const, const char *const, size_t)
char * Strnpcat(char *const, const char *const, size_t)
int strcmp(const char *String1, const char *String2)
char * strstr(char *String1, char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strtok(char *String, const char *Delimiters)
char * strchr(const char *String, int ch)
CHAR FAR *WSAAPI inet_ntoa(IN IN_ADDR in)
ULONG WSAAPI inet_addr(IN CONST CHAR FAR *cp)
#define inet_aton(ap, inp)
static struct sockaddr_in sa
#define STRNCPY(dst, src, n)
void user(int argc, const char *argv[])
#define RegCloseKey(hKey)
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
PHOSTENT WSAAPI gethostbyname(IN const char FAR *name)
PHOSTENT WSAAPI gethostbyaddr(IN const char FAR *addr, IN int len, IN int type)
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
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
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
void MSVCRT() terminate()
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
int MkDirs(const char *const newdir, int mode1)
void MyInetAddr(char *dst, size_t siz, char **src, int i)
jmp_buf gGetHostByNameJmp
time_t UnDate(char *dstr)
void InitOurDirectory(void)
static void CancelGetHostByName(int sigNum)
int MayUseFirewall(const char *const hn, int firewallType, const char *const firewallExceptionList)
static const unsigned char B64DecodeTable[256]
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)
struct hostent * GetHostEntry(const char *host, struct in_addr *ip_address)
int DecodeDirectoryURL(const FTPCIPtr cip, char *url, LineListPtr cdlist, char *fn, size_t fnsize)
void ToBase64(void *dst0, const void *src0, size_t n, int terminate)
void AbsoluteToRelative(char *const dst, const size_t dsize, const char *const dir, const char *const root, const size_t rootlen)
void AbbrevStr(char *dst, const char *src, size_t max, int mode)
int StrToBool(const char *const s)
char * OurInstallationPath(char *const dst, const size_t siz, const char *const fname)
static const unsigned char B64EncodeTable[64]
int GetHostByName(char *const volatile dst, size_t dsize, const char *const hn, int t)
char * OurDirectoryPath(char *const dst, const size_t siz, const char *const fname)
char gOurInstallationPath[260]
char gOurDirectoryPath[260]
void FromBase64(void *dst0, const void *src0, size_t n, int terminate)
void PathCat(char *const dst, const size_t dsize, const char *const cwd, const char *const src)
void CompressPath(char *const dst, const char *const src, const size_t dsize)
#define kOurDirectoryName
volatile sigproc_t vsigproc_t
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define sprintf(buf, format,...)
int sigsetjmp(sigjmp_buf buf, int savesigs)
void siglongjmp(sigjmp_buf buf, int val)
#define StrRFindLocalPathDelim(a)
#define kFirewallNotInUse
int FTPDecodeURL(const FTPCIPtr cip, char *const url, LineListPtr cdlist, char *const fn, const size_t fnsize, int *const xtype, int *const wantnlst)
#define LOCAL_PATH_DELIM_STR
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
_CRTIMP time_t __cdecl mktime(struct tm *_Tm)
_CRTIMP struct tm *__cdecl localtime(const time_t *_Time)
const char *WSAAPI inet_ntop(int af, const void *src, char *dst, size_t cnt)
static GLenum _GLUfuncptr fn
DWORD WINAPI GetLastError(void)
#define FORMAT_MESSAGE_FROM_SYSTEM
*nSize LPSTR _Inout_ LPDWORD nSize
#define GetModuleFileName
#define HKEY_LOCAL_MACHINE