From 783c1624bd8b027a65b3fba57d3213ccb1a6ddbd Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 15 Jul 1996 03:56:06 +0000 Subject: [PATCH] indent cpp-directives --- lib/basename.c | 2 +- lib/canon-host.c | 22 +++++++++++----------- lib/error.h | 24 ++++++++++++------------ lib/gethostname.c | 4 ++-- lib/getline.c | 14 +++++++------- lib/getline.h | 18 +++++++++--------- lib/getugroups.c | 8 ++++---- lib/getusershell.c | 6 +++--- lib/group-member.c | 6 +++--- lib/group-member.h | 2 +- lib/modechange.h | 10 +++++----- lib/putenv.c | 14 +++++++------- lib/readtokens.c | 14 +++++++------- lib/readtokens.h | 26 +++++++++++++------------- lib/setenv.c | 10 +++++----- lib/setenv.h | 14 +++++++------- lib/stime.c | 2 +- lib/strcspn.c | 12 ++++++------ lib/strftime.c | 24 ++++++++++++------------ lib/strtol.c | 16 ++++++++-------- lib/xgetcwd.c | 4 ++-- lib/xgethostname.c | 4 ++-- lib/xmalloc.c | 10 +++++----- lib/xstrtod.c | 4 ++-- lib/xstrtod.h | 16 ++++++++-------- lib/xstrtoul.h | 6 +++--- 26 files changed, 146 insertions(+), 146 deletions(-) diff --git a/lib/basename.c b/lib/basename.c index 5c619c96f..f1a7266ad 100644 --- a/lib/basename.c +++ b/lib/basename.c @@ -16,7 +16,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H -#include +# include #endif /* Return NAME with any leading path stripped off. diff --git a/lib/canon-host.c b/lib/canon-host.c index 0096aca29..161fdb34f 100644 --- a/lib/canon-host.c +++ b/lib/canon-host.c @@ -19,27 +19,27 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H -#include +# include #endif #ifdef HAVE_UNISTD_H -#include +# include #endif #ifdef HAVE_STRING_H -#include +# include #endif #ifdef HAVE_NETDB_H -#include +# include #endif #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #ifdef HAVE_NETINET_IN_H -#include +# include #endif #ifdef HAVE_ARPA_INET_H -#include +# include #endif /* Returns the canonical hostname associated with HOST (allocated in a static @@ -53,24 +53,24 @@ canon_host (host) if (he) { -#ifdef HAVE_GETHOSTBYADDR +# ifdef HAVE_GETHOSTBYADDR char *addr = 0; /* Try and get an ascii version of the numeric host address. */ switch (he->h_addrtype) { -#ifdef HAVE_INET_NTOA +# ifdef HAVE_INET_NTOA case AF_INET: addr = inet_ntoa (*(struct in_addr *) he->h_addr); break; -#endif /* HAVE_INET_NTOA */ +# endif /* HAVE_INET_NTOA */ } if (addr && strcmp (he->h_name, addr) == 0) /* gethostbyname() cheated! Lookup the host name via the address this time to get the actual host name. */ he = gethostbyaddr (he->h_addr, he->h_length, he->h_addrtype); -#endif /* HAVE_GETHOSTBYADDR */ +# endif /* HAVE_GETHOSTBYADDR */ if (he) return (char *) (he->h_name); diff --git a/lib/error.h b/lib/error.h index 3439f37b2..d0dfda94f 100644 --- a/lib/error.h +++ b/lib/error.h @@ -16,22 +16,22 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _error_h_ -#define _error_h_ +# define _error_h_ -#ifndef __attribute__ +# ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ -# define __attribute__(Spec) /* empty */ -# endif +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ +# define __attribute__(Spec) /* empty */ +# endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) -# define __format__ format -# define __printf__ printf +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __format__ format +# define __printf__ printf +# endif # endif -#endif -#if defined (__STDC__) && __STDC__ +# if defined (__STDC__) && __STDC__ /* Print a message with `fprintf (stderr, FORMAT, ...)'; if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). @@ -49,11 +49,11 @@ extern void error_at_line (int status, int errnum, const char *fname, function without parameters instead. */ extern void (*error_print_progname) (void); -#else +# else void error (); void error_at_line (); extern void (*error_print_progname) (); -#endif +# endif /* This variable is incremented each time `error' is called. */ extern unsigned int error_message_count; diff --git a/lib/gethostname.c b/lib/gethostname.c index e37e72189..3d66dc936 100644 --- a/lib/gethostname.c +++ b/lib/gethostname.c @@ -18,11 +18,11 @@ /* David MacKenzie */ #ifdef HAVE_CONFIG_H -#include +# include #endif #ifdef HAVE_UNAME -#include +# include #endif /* Put up to LEN chars of the host name into NAME. diff --git a/lib/getline.c b/lib/getline.c index 3a1366561..ba05abb73 100644 --- a/lib/getline.c +++ b/lib/getline.c @@ -42,17 +42,17 @@ getline (lineptr, n, stream) #else /* ! have getdelim */ -#define NDEBUG -#include +# define NDEBUG +# include -#if STDC_HEADERS -# include -#else +# if STDC_HEADERS +# include +# else char *malloc (), *realloc (); -#endif +# endif /* Always add at least this many bytes when extending the buffer. */ -#define MIN_CHUNK 64 +# define MIN_CHUNK 64 /* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR + OFFSET (and null-terminate it). *LINEPTR is a pointer returned from diff --git a/lib/getline.h b/lib/getline.h index b22136d1e..f0bdf0f82 100644 --- a/lib/getline.h +++ b/lib/getline.h @@ -15,17 +15,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _getline_h_ -#define _getline_h_ 1 +# define _getline_h_ 1 -#include +# include -#ifndef PARAMS -# if defined (__GNUC__) || __STDC__ -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif /* GCC. */ -#endif /* Not PARAMS. */ +# ifndef PARAMS +# if defined (__GNUC__) || __STDC__ +# define PARAMS(args) args +# else +# define PARAMS(args) () +# endif /* GCC. */ +# endif /* Not PARAMS. */ int getline PARAMS ((char **_lineptr, size_t *_n, FILE *_stream)); diff --git a/lib/getugroups.c b/lib/getugroups.c index c80207161..6c818f110 100644 --- a/lib/getugroups.c +++ b/lib/getugroups.c @@ -18,7 +18,7 @@ /* Written by David MacKenzie. */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include @@ -26,7 +26,7 @@ #include #ifdef HAVE_UNISTD_H -#include +# include #endif /* setgrent, getgrent, and endgrent are not specified by POSIX.1, @@ -36,9 +36,9 @@ struct group *getgrent (); #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) -#include +# include #else -#include +# include #endif /* Like `getgroups', but for user USERNAME instead of for diff --git a/lib/getusershell.c b/lib/getusershell.c index f11bde61d..dfed7a6c4 100644 --- a/lib/getusershell.c +++ b/lib/getusershell.c @@ -18,19 +18,19 @@ /* Written by David MacKenzie */ #ifdef HAVE_CONFIG_H -#include +# include #endif #ifndef SHELLS_FILE /* File containing a list of nonrestricted shells, one per line. */ -#define SHELLS_FILE "/etc/shells" +# define SHELLS_FILE "/etc/shells" #endif #include #include #ifdef STDC_HEADERS -#include +# include #else char *malloc (); char *realloc (); diff --git a/lib/group-member.c b/lib/group-member.c index eda707321..9a079e293 100644 --- a/lib/group-member.c +++ b/lib/group-member.c @@ -16,18 +16,18 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include #include #ifdef STDC_HEADERS -#include +# include #endif #ifdef HAVE_UNISTD_H -#include +# include #endif #include "group-member.h" diff --git a/lib/group-member.h b/lib/group-member.h index 407e85ea0..813b1a3c9 100644 --- a/lib/group-member.h +++ b/lib/group-member.h @@ -1,5 +1,5 @@ #ifndef _group_member_h_ -#define _group_member_h_ 1 +# define _group_member_h_ 1 int group_member (); diff --git a/lib/modechange.h b/lib/modechange.h index eaf854e15..ab6eb9634 100644 --- a/lib/modechange.h +++ b/lib/modechange.h @@ -45,11 +45,11 @@ struct mode_change #define MODE_MEMORY_EXHAUSTED (struct mode_change *) 1 #ifndef __P -#if defined (__GNUC__) || (defined (__STDC__) && __STDC__) -#define __P(args) args -#else -#define __P(args) () -#endif /* GCC. */ +# if defined (__GNUC__) || (defined (__STDC__) && __STDC__) +# define __P(args) args +# else +# define __P(args) () +# endif /* GCC. */ #endif /* Not __P. */ struct mode_change *mode_compile __P ((const char *, unsigned)); diff --git a/lib/putenv.c b/lib/putenv.c index a7060506c..ee3ccc04a 100644 --- a/lib/putenv.c +++ b/lib/putenv.c @@ -21,7 +21,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #ifdef HAVE_CONFIG_H -#include +# include #endif /* Define-away any (possibly conflicting) prototype of putenv. @@ -29,26 +29,26 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define putenv _sys_putenv #if defined (__GNU_LIBRARY__) || defined (HAVE_STDLIB_H) -#include +# include #endif #if defined (__GNU_LIBRARY__) || defined (HAVE_STRING_H) -#include +# include #endif #if defined (__GNU_LIBRARY__) || defined (HAVE_UNISTD_H) -#include +# include #endif #undef putenv #if !defined (__GNU_LIBRARY__) && !defined (HAVE_STRCHR) -#define strchr index +# define strchr index #endif #if !defined (__GNU_LIBRARY__) && !defined (HAVE_MEMCPY) -#define memcpy(d,s,n) bcopy ((s), (d), (n)) +# define memcpy(d,s,n) bcopy ((s), (d), (n)) #endif #if HAVE_GNU_LD -#define environ __environ +# define environ __environ #else extern char **environ; #endif diff --git a/lib/readtokens.c b/lib/readtokens.c index ccd8f4b65..651b5efb6 100644 --- a/lib/readtokens.c +++ b/lib/readtokens.c @@ -28,23 +28,23 @@ */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include #ifdef STDC_HEADERS -#include +# include #endif #if defined (STDC_HEADERS) || defined(HAVE_STRING_H) -#include +# include /* An ANSI string.h and pre-ANSI memory.h might conflict. */ -#if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H) -#include -#endif /* not STDC_HEADERS and HAVE_MEMORY_H */ +# if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H) +# include +# endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #else /* not STDC_HEADERS and not HAVE_STRING_H */ -#include +# include /* memory.h and strings.h conflict on some systems. */ #endif /* not STDC_HEADERS and not HAVE_STRING_H */ diff --git a/lib/readtokens.h b/lib/readtokens.h index b35cf6e33..a2e0b9d73 100644 --- a/lib/readtokens.h +++ b/lib/readtokens.h @@ -1,12 +1,12 @@ #ifndef H_READTOKENS_H -#define H_READTOKENS_H +# define H_READTOKENS_H -#ifndef INITIAL_TOKEN_LENGTH -#define INITIAL_TOKEN_LENGTH 20 -#endif +# ifndef INITIAL_TOKEN_LENGTH +# define INITIAL_TOKEN_LENGTH 20 +# endif -#ifndef TOKENBUFFER_DEFINED -#define TOKENBUFFER_DEFINED +# ifndef TOKENBUFFER_DEFINED +# define TOKENBUFFER_DEFINED struct tokenbuffer { long size; @@ -14,14 +14,14 @@ struct tokenbuffer }; typedef struct tokenbuffer token_buffer; -#endif /* not TOKENBUFFER_DEFINED */ +# endif /* not TOKENBUFFER_DEFINED */ -#undef __P -#if defined (__STDC__) && __STDC__ -#define __P(x) x -#else -#define __P(x) () -#endif +# undef __P +# if defined (__STDC__) && __STDC__ +# define __P(x) x +# else +# define __P(x) () +# endif void init_tokenbuffer __P ((token_buffer *tokenbuffer)); diff --git a/lib/setenv.c b/lib/setenv.c index b24cecce5..429f5f8fe 100644 --- a/lib/setenv.c +++ b/lib/setenv.c @@ -19,23 +19,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include #if _LIBC || HAVE_STDLIB_H -#include +# include #endif #if _LIBC || HAVE_STRING_H -#include +# include #endif #if _LIBC || HAVE_UNISTD_H -#include +# include #endif #ifndef HAVE_GNU_LD -#define __environ environ +# define __environ environ #endif int diff --git a/lib/setenv.h b/lib/setenv.h index 932a852d7..54d7963c1 100644 --- a/lib/setenv.h +++ b/lib/setenv.h @@ -1,12 +1,12 @@ #ifndef SETENV_H -#define SETENV_H 1 +# define SETENV_H 1 -#undef __P -#if defined (__STDC__) && __STDC__ -#define __P(x) x -#else -#define __P(x) () -#endif +# undef __P +# if defined (__STDC__) && __STDC__ +# define __P(x) x +# else +# define __P(x) () +# endif int setenv __P ((const char *name, const char *value, int replace)); diff --git a/lib/stime.c b/lib/stime.c index 1756110e3..5a8255b83 100644 --- a/lib/stime.c +++ b/lib/stime.c @@ -18,7 +18,7 @@ /* David MacKenzie */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include diff --git a/lib/strcspn.c b/lib/strcspn.c index d174330d9..1e14c3779 100644 --- a/lib/strcspn.c +++ b/lib/strcspn.c @@ -15,16 +15,16 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H -#include +# include #endif #ifdef HAVE_STRING_H -#include +# include #else -#include -#ifndef strchr -#define strchr index -#endif +# include +# ifndef strchr +# define strchr index +# endif #endif /* Return the length of the maximum inital segment of S diff --git a/lib/strftime.c b/lib/strftime.c index 16a9bb2b4..89ce66136 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -62,19 +62,19 @@ USA. */ #endif #ifndef __P -#if defined (__GNUC__) || (defined (__STDC__) && __STDC__) -#define __P(args) args -#else -#define __P(args) () -#endif /* GCC. */ +# if defined (__GNUC__) || (defined (__STDC__) && __STDC__) +# define __P(args) args +# else +# define __P(args) () +# endif /* GCC. */ #endif /* Not __P. */ #ifndef PTR -#ifdef __STDC__ -#define PTR void * -#else -#define PTR char * -#endif +# ifdef __STDC__ +# define PTR void * +# else +# define PTR char * +# endif #endif static unsigned int week __P((const struct tm *const, int, int)); @@ -96,9 +96,9 @@ static unsigned int week __P((const struct tm *const, int, int)); #define cpy(n, s) add((n), memcpy((PTR) p, (PTR) (s), (n))) #ifdef _LIBC -#define fmt(n, args) add((n), if (sprintf args != (n)) return 0) +# define fmt(n, args) add((n), if (sprintf args != (n)) return 0) #else -#define fmt(n, args) add((n), sprintf args; if (strlen (p) != (n)) return 0) +# define fmt(n, args) add((n), sprintf args; if (strlen (p) != (n)) return 0) #endif diff --git a/lib/strtol.c b/lib/strtol.c index b2336a197..ad0804931 100644 --- a/lib/strtol.c +++ b/lib/strtol.c @@ -108,12 +108,12 @@ extern int errno; #else # define LONG long -#ifndef ULONG_MAX -# define ULONG_MAX ((unsigned long) ~(unsigned long) 0) -#endif -#ifndef LONG_MAX -# define LONG_MAX ((long int) (ULONG_MAX >> 1)) -#endif +# ifndef ULONG_MAX +# define ULONG_MAX ((unsigned long) ~(unsigned long) 0) +# endif +# ifndef LONG_MAX +# define LONG_MAX ((long int) (ULONG_MAX >> 1)) +# endif #endif #ifdef USE_WIDE_CHAR @@ -342,9 +342,9 @@ noconv: #undef __P #if defined (__STDC__) && __STDC__ -#define __P(args) args +# define __P(args) args #else -#define __P(args) () +# define __P(args) () #endif /* Prototype. */ diff --git a/lib/xgetcwd.c b/lib/xgetcwd.c index 7aa04efa4..84164acb3 100644 --- a/lib/xgetcwd.c +++ b/lib/xgetcwd.c @@ -18,7 +18,7 @@ /* Written by David MacKenzie . */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include @@ -31,7 +31,7 @@ extern int errno; #ifndef HAVE_GETCWD char *getwd (); -#define getcwd(buf, max) getwd (buf) +# define getcwd(buf, max) getwd (buf) #else char *getcwd (); #endif diff --git a/lib/xgethostname.c b/lib/xgethostname.c index cd74aa7ce..d20967574 100644 --- a/lib/xgethostname.c +++ b/lib/xgethostname.c @@ -18,7 +18,7 @@ /* Written by Jim Meyering, meyering@comco.com */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include @@ -28,7 +28,7 @@ char *xmalloc (); char *xrealloc (); #ifndef INITIAL_HOSTNAME_LENGTH -#define INITIAL_HOSTNAME_LENGTH 33 +# define INITIAL_HOSTNAME_LENGTH 33 #endif char * diff --git a/lib/xmalloc.c b/lib/xmalloc.c index a9f1975b9..33ac504e2 100644 --- a/lib/xmalloc.c +++ b/lib/xmalloc.c @@ -16,19 +16,19 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H -#include +# include #endif #if __STDC__ -#define VOID void +# define VOID void #else -#define VOID char +# define VOID char #endif #include #if STDC_HEADERS -#include +# include #else VOID *malloc (); VOID *realloc (); @@ -44,7 +44,7 @@ void free (); #endif #ifndef EXIT_FAILURE -#define EXIT_FAILURE 1 +# define EXIT_FAILURE 1 #endif /* Exit value when the requested amount of memory is not available. diff --git a/lib/xstrtod.c b/lib/xstrtod.c index f6edefcce..1e55cd152 100644 --- a/lib/xstrtod.c +++ b/lib/xstrtod.c @@ -18,11 +18,11 @@ /* Written by Jim Meyering. */ #ifdef HAVE_CONFIG_H -#include +# include #endif #ifdef STDC_HEADERS -#include +# include #else double strtod (); #endif diff --git a/lib/xstrtod.h b/lib/xstrtod.h index 15b85f446..d40d5124b 100644 --- a/lib/xstrtod.h +++ b/lib/xstrtod.h @@ -1,13 +1,13 @@ #ifndef XSTRTOD_H -#define XSTRTOD_H 1 +# define XSTRTOD_H 1 -#ifndef __P -# if defined (__GNUC__) || (defined (__STDC__) && __STDC__) -# define __P(args) args -# else -# define __P(args) () -# endif /* GCC. */ -#endif /* Not __P. */ +# ifndef __P +# if defined (__GNUC__) || (defined (__STDC__) && __STDC__) +# define __P(args) args +# else +# define __P(args) () +# endif /* GCC. */ +# endif /* Not __P. */ int xstrtod __P ((const char *str, const char **ptr, double *result)); diff --git a/lib/xstrtoul.h b/lib/xstrtoul.h index 8251c57db..2e7aec07f 100644 --- a/lib/xstrtoul.h +++ b/lib/xstrtoul.h @@ -1,7 +1,7 @@ #ifndef _xstrtoul_h_ -#define _xstrtoul_h_ 1 +# define _xstrtoul_h_ 1 -#define STRING_TO_UNSIGNED 1 -#include "xstrtol.h" +# define STRING_TO_UNSIGNED 1 +# include "xstrtol.h" #endif /* _xstrtoul_h_ */ -- 2.11.0