From f736b3160344a3dee01983498510ad4fe9d2549a Mon Sep 17 00:00:00 2001 From: sgunderson Date: Sun, 17 Sep 2000 01:01:29 +0000 Subject: [PATCH] All header files should now be self-contained (ie. you shouldn't need to do any system #includes before #including them), and are now properly guarded against double inclusion. --- ascii.h | 5 +++++ cmds.h | 7 +++++++ ftpd.h | 20 ++++++++++++++++++++ nonroot.h | 4 ++++ 4 files changed, 36 insertions(+) diff --git a/ascii.h b/ascii.h index 7b2519c..df6696e 100644 --- a/ascii.h +++ b/ascii.h @@ -15,6 +15,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _ASCII_H +#define _ASCII_H 1 + int ascii_findlength(const char * const buffer, const int tranlen); int ascii_downloadfilter(const char * const buffer, char * const outbuffer, const int length); int ascii_uploadfilter(char * const buffer, const int length); + +#endif diff --git a/cmds.h b/cmds.h index 88b04d1..659524d 100644 --- a/cmds.h +++ b/cmds.h @@ -15,6 +15,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _CMDS_H +#define _CMDS_H 1 + +#include + /* * TRAP_ERROR: This is a quick way of doing a test for an error condition. * if an error occurs (or more precisely, if the value supplied is @@ -127,3 +132,5 @@ char *do_pwd(struct conn * const c, char * const retbuf, const char * const dir) #define POLLIN 0x001 #define POLLOUT 0x004 #endif + +#endif diff --git a/ftpd.h b/ftpd.h index 086df8a..11bb81a 100644 --- a/ftpd.h +++ b/ftpd.h @@ -15,6 +15,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _FTPD_H +#define _FTPD_H 1 + /* * This is the port you want BetaFTPD to listen on. The standard * FTP port is 21 -- if you really want to use BetaFTPD as your @@ -49,6 +52,22 @@ */ #define MAX_BLOCK_SIZE 4096 +#if HAVE_PWD_H +#include +#endif + +#if HAVE_SYS_TYPES_H +#include +#endif + +#if HAVE_NETINET_IN_H +#include +#endif + +#if HAVE_SYS_SOCKET_H +#include +#endif + #if HAVE_LINUX_SENDFILE && !HAVE_MMAP #warning sendfile() without mmap() is not supported -- disabling sendfile() #undef HAVE_LINUX_SENDFILE @@ -206,3 +225,4 @@ void dump_file(struct conn * const c, const int num, const char * const filename void list_readmes(struct conn * const c); #endif +#endif diff --git a/nonroot.h b/nonroot.h index fd23084..c8d697c 100644 --- a/nonroot.h +++ b/nonroot.h @@ -15,6 +15,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _NONROOT_H +#define _NONROOT_H 1 + int nr_userinfo(const char * const username, int * const uid, char * const homedir, char * const rootdir, const char * const password); @@ -28,3 +31,4 @@ int member_of_group(const uid_t uid, const gid_t gid); char *nr_get_uname(const uid_t uid); char *nr_get_gname(const gid_t gid); +#endif -- 2.39.2