ReactOS 0.4.15-dev-7670-g69b08be
util.h
Go to the documentation of this file.
1/* util.h
2 *
3 * Copyright (c) 1992-2001 by Mike Gleason.
4 * All rights reserved.
5 *
6 */
7
8typedef int (*qsort_proc_t)(const void *, const void *);
9typedef int (*bsearch_proc_t)(const void *, const void *);
10typedef void (*sigproc_t)(int);
11typedef volatile sigproc_t vsigproc_t;
12
13#define STREQ(a,b) (strcmp(a,b) == 0)
14#define STRNEQ(a,b,s) (strncmp(a,b,(size_t)(s)) == 0)
15
16#ifndef ISTRCMP
17# ifdef HAVE_STRCASECMP
18# define ISTRCMP strcasecmp
19# define ISTRNCMP strncasecmp
20# else
21# define ISTRCMP strcmp
22# define ISTRNCMP strncmp
23# endif
24#endif
25
26#define ISTREQ(a,b) (ISTRCMP(a,b) == 0)
27#define ISTRNEQ(a,b,s) (ISTRNCMP(a,b,(size_t)(s)) == 0)
28#define YESNO(i) ((i == 0) ? "no" : "yes")
29#define ONOFF(i) ((i == 0) ? "off" : "on")
30#define TRUEFALSE(i) ((i == 0) ? "false" : "true")
31
32#ifndef HAVE_STRCOLL
33# ifndef strcoll
34# define strcoll strcmp
35# endif
36# ifndef strncoll
37# define strncoll strncmp
38# endif
39#endif
40
41#ifndef F_OK
42# define F_OK 0
43#endif
44
45#define kOurDirectoryName ".ncftp"
46
47#define kPasswordMagic "*encoded*"
48#define kPasswordMagicLen 9
49
50#if defined(WIN32) || defined(_WINDOWS)
51# define kNcFTPBookmarksMailslot "\\\\.\\mailslot\\ncftpbm.slt"
52# define kNcFTPBookmarksMailslotMsgSize 128
53#endif
54
55/* util.c */
56void ToBase64(void *, const void *, size_t, int);
57void FromBase64(void *, const void *, size_t, int);
58void OutOfMemory(void);
59void *Realloc(void *, size_t);
60char *GetCWD(char *, size_t);
61void MyInetAddr(char *, size_t, char **, int);
62struct hostent *GetHostEntry(const char *, struct in_addr *);
63void CompressPath(char *const dst, const char *const src, const size_t dsize);
64void PathCat(char *const dst, const size_t dsize, const char *const cwd, const char *const src);
65char *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);
66void AbbrevStr(char *, const char *, size_t, int);
67char *Path(char *const dst, const size_t siz, const char *const parent, const char *const fname);
68char *OurDirectoryPath(char *const dst, const size_t siz, const char *const fname);
69void InitOurDirectory(void);
70void InitUserInfo(void);
71int MayUseFirewall(const char *const, int, const char *const);
72int StrToBool(const char *const);
73void AbsoluteToRelative(char *const, const size_t, const char *const, const char *const, const size_t);
74int GetHostByName(char *const volatile, size_t, const char *const, int);
75time_t UnDate(char *dstr);
76int DecodeDirectoryURL(const FTPCIPtr, char *, LineListPtr, char *, size_t);
77char *OurInstallationPath(char *const dst, const size_t siz, const char *const fname);
78#if defined(WIN32) || defined(_WINDOWS)
79void SysPerror(const char *const errMsg);
80#endif
81
82#if defined(HAVE_STRCOLL) && !defined(HAVE_STRNCOLL)
83int strncoll(const char *a, const char *b, size_t n);
84#endif
PRTL_UNICODE_STRING_BUFFER Path
void user(int argc, const char *argv[])
Definition: cmds.c:1350
USHORT port
Definition: uri.c:228
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
r parent
Definition: btrfs.c:3010
__kernel_time_t time_t
Definition: linux.h:252
GLdouble n
Definition: glext.h:7729
GLenum src
Definition: glext.h:6340
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum GLenum dst
Definition: glext.h:6340
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
int GetHostByName(char *const volatile, size_t, const char *const, int)
Definition: util.c:826
int MayUseFirewall(const char *const, int, const char *const)
Definition: util.c:695
time_t UnDate(char *dstr)
Definition: util.c:917
int(* qsort_proc_t)(const void *, const void *)
Definition: util.h:8
void InitOurDirectory(void)
Definition: util.c:506
char * GetCWD(char *, size_t)
void ToBase64(void *, const void *, size_t, int)
Definition: util.c:83
volatile sigproc_t vsigproc_t
Definition: util.h:11
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)
Definition: util.c:387
void MyInetAddr(char *, size_t, char **, int)
Definition: util.c:185
void * Realloc(void *, size_t)
char * OurInstallationPath(char *const dst, const size_t siz, const char *const fname)
Definition: util.c:494
int(* bsearch_proc_t)(const void *, const void *)
Definition: util.h:9
void(* sigproc_t)(int)
Definition: util.h:10
void FromBase64(void *, const void *, size_t, int)
Definition: util.c:128
#define strncoll
Definition: util.h:37
int StrToBool(const char *const)
Definition: util.c:748
char * OurDirectoryPath(char *const dst, const size_t siz, const char *const fname)
Definition: util.c:486
struct hostent * GetHostEntry(const char *, struct in_addr *)
Definition: util.c:215
void InitUserInfo(void)
Definition: util.c:630
int DecodeDirectoryURL(const FTPCIPtr, char *, LineListPtr, char *, size_t)
Definition: util.c:1086
void OutOfMemory(void)
Definition: fc.c:64
void AbbrevStr(char *, const char *, size_t, int)
Definition: util.c:451
void PathCat(char *const dst, const size_t dsize, const char *const cwd, const char *const src)
Definition: util.c:368
void AbsoluteToRelative(char *const, const size_t, const char *const, const char *const, const size_t)
Definition: util.c:785
void CompressPath(char *const dst, const char *const src, const size_t dsize)
Definition: util.c:247
static const WCHAR url[]
Definition: encode.c:1432
Definition: ncftp.h:84
Definition: tcpip.h:126
pass
Definition: typegen.h:25
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159