ReactOS  0.4.13-dev-464-g6b95727
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 
8 typedef int (*qsort_proc_t)(const void *, const void *);
9 typedef int (*bsearch_proc_t)(const void *, const void *);
10 typedef void (*sigproc_t)(int);
11 typedef 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 */
56 void ToBase64(void *, const void *, size_t, int);
57 void FromBase64(void *, const void *, size_t, int);
58 void OutOfMemory(void);
59 void *Realloc(void *, size_t);
60 char *GetCWD(char *, size_t);
61 void MyInetAddr(char *, size_t, char **, int);
62 struct hostent *GetHostEntry(const char *, struct in_addr *);
63 void CompressPath(char *const dst, const char *const src, const size_t dsize);
64 void PathCat(char *const dst, const size_t dsize, const char *const cwd, const char *const src);
65 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);
66 void AbbrevStr(char *, const char *, size_t, int);
67 char *Path(char *const dst, const size_t siz, const char *const parent, const char *const fname);
68 char *OurDirectoryPath(char *const dst, const size_t siz, const char *const fname);
69 void InitOurDirectory(void);
70 void InitUserInfo(void);
71 int MayUseFirewall(const char *const, int, const char *const);
72 int StrToBool(const char *const);
73 void AbsoluteToRelative(char *const, const size_t, const char *const, const char *const, const size_t);
74 int GetHostByName(char *const volatile, size_t, const char *const, int);
75 time_t UnDate(char *dstr);
76 int DecodeDirectoryURL(const FTPCIPtr, char *, LineListPtr, char *, size_t);
77 char *OurInstallationPath(char *const dst, const size_t siz, const char *const fname);
78 #if defined(WIN32) || defined(_WINDOWS)
79 void SysPerror(const char *const errMsg);
80 #endif
81 
82 #if defined(HAVE_STRCOLL) && !defined(HAVE_STRNCOLL)
83 int strncoll(const char *a, const char *b, size_t n);
84 #endif
char * OurInstallationPath(char *const dst, const size_t siz, const char *const fname)
Definition: util.c:494
void ToBase64(void *, const void *, size_t, int)
Definition: util.c:83
void MyInetAddr(char *, size_t, char **, int)
Definition: util.c:185
int DecodeDirectoryURL(const FTPCIPtr, char *, LineListPtr, char *, size_t)
Definition: util.c:1086
int GetHostByName(char *const volatile, size_t, const char *const, int)
Definition: util.c:826
char * GetCWD(char *, size_t)
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
volatile sigproc_t vsigproc_t
Definition: util.h:11
void PathCat(char *const dst, const size_t dsize, const char *const cwd, const char *const src)
Definition: util.c:368
GLdouble n
Definition: glext.h:7729
int MayUseFirewall(const char *const, int, const char *const)
Definition: util.c:695
void OutOfMemory(void)
Definition: util.c:176
void AbbrevStr(char *, const char *, size_t, int)
Definition: util.c:451
pass
Definition: typegen.h:24
struct hostent * GetHostEntry(const char *, struct in_addr *)
Definition: util.c:215
int(* qsort_proc_t)(const void *, const void *)
Definition: util.h:8
int StrToBool(const char *const)
Definition: util.c:748
void InitUserInfo(void)
Definition: util.c:630
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define strncoll
Definition: util.h:37
r parent
Definition: btrfs.c:2708
static const WCHAR url[]
Definition: encode.c:1432
Definition: tcpip.h:125
void AbsoluteToRelative(char *const, const size_t, const char *const, const char *const, const size_t)
Definition: util.c:785
Definition: ncftp.h:84
void CompressPath(char *const dst, const char *const src, const size_t dsize)
Definition: util.c:247
time_t UnDate(char *dstr)
Definition: util.c:917
GLenum src
Definition: glext.h:6340
void(* sigproc_t)(int)
Definition: util.h:10
int(* bsearch_proc_t)(const void *, const void *)
Definition: util.h:9
void InitOurDirectory(void)
Definition: util.c:506
__kernel_time_t time_t
Definition: linux.h:252
GLenum GLenum dst
Definition: glext.h:6340
void * Realloc(void *, size_t)
void FromBase64(void *, const void *, size_t, int)
Definition: util.c:128
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
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
USHORT port
Definition: uri.c:227
void user(int argc, const char *argv[])
Definition: cmds.c:1350
char * OurDirectoryPath(char *const dst, const size_t siz, const char *const fname)
Definition: util.c:486
char * Path(char *const dst, const size_t siz, const char *const parent, const char *const fname)
Definition: util.c:475
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31