ReactOS 0.4.15-dev-7942-gd23573b
errno.c File Reference
#include "syshdrs.h"
Include dependency graph for errno.c:

Go to the source code of this file.

Macros

#define _libncftp_errno_c_   1
 

Functions

const charFTPStrError (int e)
 
void FTPPerror (const FTPCIPtr cip, const int err, const int eerr, const char *const s1, const char *const s2)
 

Variables

static const chargErrList [kErrLast - kErrFirst+2]
 
int gLibNcFTP_Uses_Me_To_Quiet_Variable_Unused_Warnings = 0
 

Macro Definition Documentation

◆ _libncftp_errno_c_

#define _libncftp_errno_c_   1

Definition at line 8 of file errno.c.

Function Documentation

◆ FTPPerror()

void FTPPerror ( const FTPCIPtr  cip,
const int  err,
const int  eerr,
const char *const  s1,
const char *const  s2 
)

Definition at line 134 of file errno.c.

135{
136 if (err != kNoErr) {
137 if (err == eerr) {
138 if ((s2 == NULL) || (s2[0] == '\0')) {
139 if ((s1 == NULL) || (s1[0] == '\0')) {
140 (void) fprintf(stderr, "server said: %s\n", cip->lastFTPCmdResultStr);
141 } else {
142 (void) fprintf(stderr, "%s: server said: %s\n", s1, cip->lastFTPCmdResultStr);
143 }
144 } else if ((s1 == NULL) || (s1[0] == '\0')) {
145 (void) fprintf(stderr, "%s: server said: %s\n", s2, cip->lastFTPCmdResultStr);
146 } else {
147 (void) fprintf(stderr, "%s %s: server said: %s\n", s1, s2, cip->lastFTPCmdResultStr);
148 }
149 } else {
150 if ((s2 == NULL) || (s2[0] == '\0')) {
151 if ((s1 == NULL) || (s1[0] == '\0')) {
152 (void) fprintf(stderr, "%s.\n", FTPStrError(cip->errNo));
153 } else {
154 (void) fprintf(stderr, "%s: %s.\n", s1, FTPStrError(cip->errNo));
155 }
156 } else if ((s1 == NULL) || (s1[0] == '\0')) {
157 (void) fprintf(stderr, "%s: %s.\n", s2, FTPStrError(cip->errNo));
158 } else {
159 (void) fprintf(stderr, "%s %s: %s.\n", s1, s2, FTPStrError(cip->errNo));
160 }
161 }
162 }
163} /* FTPPerror */
#define NULL
Definition: types.h:112
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
struct S1 s1
struct S2 s2
const char * FTPStrError(int e)
Definition: errno.c:114
#define kNoErr
Definition: ncftp_errno.h:9
#define err(...)
char lastFTPCmdResultStr[128]
Definition: ncftp.h:214

Referenced by CatCmd(), ChdirCmd(), ChmodCmd(), DeleteCmd(), DoOpen(), EchoCmd(), GetCmd(), LocalRmCmd(), LocalRmdirCmd(), MkdirCmd(), MlsCmd(), OpenCmd(), OpenURL(), PageCmd(), PutCmd(), PwdCmd(), RenameCmd(), RGlobCmd(), RmdirCmd(), RmtHelpCmd(), SpoolGetCmd(), SpoolPutCmd(), SymlinkCmd(), TypeCmd(), and UmaskCmd().

◆ FTPStrError()

const char * FTPStrError ( int  e)

Definition at line 114 of file errno.c.

115{
116 if (e == kErrGeneric) {
117 return ("miscellaneous error");
118 } else if (e == kNoErr) {
119 return ("no error");
120 } else {
121 if (e < 0)
122 e = -e;
123 if ((e >= kErrFirst) && (e <= kErrLast)) {
124 return (gErrList[e - kErrFirst]);
125 }
126 }
127 return ("unrecognized error number");
128} /* FTPStrError */
#define e
Definition: ke_i.h:82
static const char * gErrList[kErrLast - kErrFirst+2]
Definition: errno.c:11
#define kErrFirst
Definition: ncftp_errno.h:16
#define kErrLast
Definition: ncftp_errno.h:113
#define kErrGeneric
Definition: ncftp_errno.h:13

Referenced by FTPPerror(), FTPPutOneF(), InitConnectionInfo(), and PreInit().

Variable Documentation

◆ gErrList

const char* gErrList[kErrLast - kErrFirst+2]
static

Definition at line 11 of file errno.c.

Referenced by FTPStrError().

◆ gLibNcFTP_Uses_Me_To_Quiet_Variable_Unused_Warnings

int gLibNcFTP_Uses_Me_To_Quiet_Variable_Unused_Warnings = 0

Definition at line 111 of file errno.c.