indent cpp-directives
authorJim Meyering <jim@meyering.net>
Mon, 15 Jul 1996 03:56:06 +0000 (03:56 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 15 Jul 1996 03:56:06 +0000 (03:56 +0000)
26 files changed:
lib/basename.c
lib/canon-host.c
lib/error.h
lib/gethostname.c
lib/getline.c
lib/getline.h
lib/getugroups.c
lib/getusershell.c
lib/group-member.c
lib/group-member.h
lib/modechange.h
lib/putenv.c
lib/readtokens.c
lib/readtokens.h
lib/setenv.c
lib/setenv.h
lib/stime.c
lib/strcspn.c
lib/strftime.c
lib/strtol.c
lib/xgetcwd.c
lib/xgethostname.c
lib/xmalloc.c
lib/xstrtod.c
lib/xstrtod.h
lib/xstrtoul.h

index 5c619c9..f1a7266 100644 (file)
@@ -16,7 +16,7 @@
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 /* Return NAME with any leading path stripped off.
index 0096aca..161fdb3 100644 (file)
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #ifdef HAVE_UNISTD_H
-#include <unistd.h>
+# include <unistd.h>
 #endif
 #ifdef HAVE_STRING_H
-#include <string.h>
+# include <string.h>
 #endif
 #ifdef HAVE_NETDB_H
-#include <netdb.h>
+# include <netdb.h>
 #endif
 #ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
+# include <sys/socket.h>
 #endif
 
 #ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
+# include <netinet/in.h>
 #endif
 #ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
+# include <arpa/inet.h>
 #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);
index 3439f37..d0dfda9 100644 (file)
@@ -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;
index e37e721..3d66dc9 100644 (file)
 /* David MacKenzie <djm@gnu.ai.mit.edu> */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #ifdef HAVE_UNAME
-#include <sys/utsname.h>
+# include <sys/utsname.h>
 #endif
 
 /* Put up to LEN chars of the host name into NAME.
index 3a13665..ba05abb 100644 (file)
@@ -42,17 +42,17 @@ getline (lineptr, n, stream)
 
 #else /* ! have getdelim */
 
-#define NDEBUG
-#include <assert.h>
+# define NDEBUG
+# include <assert.h>
 
-#if STDC_HEADERS
-# include <stdlib.h>
-#else
+# if STDC_HEADERS
+#  include <stdlib.h>
+# 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
index b22136d..f0bdf0f 100644 (file)
@@ -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 <stdio.h>
+# include <stdio.h>
 
-#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));
index c802071..6c818f1 100644 (file)
@@ -18,7 +18,7 @@
 /* Written by David MacKenzie. */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #include <sys/types.h>
@@ -26,7 +26,7 @@
 #include <grp.h>
 
 #ifdef HAVE_UNISTD_H
-#include <unistd.h>
+# include <unistd.h>
 #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 <string.h>
+# include <string.h>
 #else
-#include <strings.h>
+# include <strings.h>
 #endif
 
 /* Like `getgroups', but for user USERNAME instead of for
index f11bde6..dfed7a6 100644 (file)
 /* Written by David MacKenzie <djm@gnu.ai.mit.edu> */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #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 <stdio.h>
 #include <ctype.h>
 
 #ifdef STDC_HEADERS
-#include <stdlib.h>
+# include <stdlib.h>
 #else
 char *malloc ();
 char *realloc ();
index eda7073..9a079e2 100644 (file)
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #include <stdio.h>
 #include <sys/types.h>
 
 #ifdef STDC_HEADERS
-#include <stdlib.h>
+# include <stdlib.h>
 #endif
 
 #ifdef HAVE_UNISTD_H
-#include <unistd.h>
+# include <unistd.h>
 #endif
 
 #include "group-member.h"
index 407e85e..813b1a3 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef _group_member_h_
-#define _group_member_h_ 1
+# define _group_member_h_ 1
 
 int
   group_member ();
index eaf854e..ab6eb96 100644 (file)
@@ -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));
index a706050..ee3ccc0 100644 (file)
@@ -21,7 +21,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include <errno.h>
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #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 <stdlib.h>
+# include <stdlib.h>
 #endif
 #if defined (__GNU_LIBRARY__) || defined (HAVE_STRING_H)
-#include <string.h>
+# include <string.h>
 #endif
 #if defined (__GNU_LIBRARY__) || defined (HAVE_UNISTD_H)
-#include <unistd.h>
+# include <unistd.h>
 #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
index ccd8f4b..651b5ef 100644 (file)
    */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #include <stdio.h>
 
 #ifdef STDC_HEADERS
-#include <stdlib.h>
+# include <stdlib.h>
 #endif
 
 #if defined (STDC_HEADERS) || defined(HAVE_STRING_H)
-#include <string.h>
+# include <string.h>
 /* An ANSI string.h and pre-ANSI memory.h might conflict.  */
-#if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
-#include <memory.h>
-#endif /* not STDC_HEADERS and HAVE_MEMORY_H */
+# if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
+#  include <memory.h>
+# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
 #else /* not STDC_HEADERS and not HAVE_STRING_H */
-#include <strings.h>
+# include <strings.h>
 /* memory.h and strings.h conflict on some systems.  */
 #endif /* not STDC_HEADERS and not HAVE_STRING_H */
 
index b35cf6e..a2e0b9d 100644 (file)
@@ -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));
 
index b24cecc..429f5f8 100644 (file)
@@ -19,23 +19,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 USA.  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #include <errno.h>
 
 #if _LIBC || HAVE_STDLIB_H
-#include <stdlib.h>
+# include <stdlib.h>
 #endif
 #if _LIBC || HAVE_STRING_H
-#include <string.h>
+# include <string.h>
 #endif
 #if _LIBC || HAVE_UNISTD_H
-#include <unistd.h>
+# include <unistd.h>
 #endif
 
 #ifndef        HAVE_GNU_LD
-#define        __environ       environ
+# define       __environ       environ
 #endif
 
 int
index 932a852..54d7963 100644 (file)
@@ -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));
index 1756110..5a8255b 100644 (file)
@@ -18,7 +18,7 @@
 /* David MacKenzie <djm@ai.mit.edu> */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #include <sys/types.h>
index d174330..1e14c37 100644 (file)
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #ifdef HAVE_STRING_H
-#include <string.h>
+# include <string.h>
 #else
-#include <strings.h>
-#ifndef strchr
-#define strchr index
-#endif
+# include <strings.h>
+# ifndef strchr
+#  define strchr index
+# endif
 #endif
 
 /* Return the length of the maximum inital segment of S
index 16a9bb2..89ce661 100644 (file)
@@ -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
 
 
index b2336a1..ad08049 100644 (file)
@@ -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.  */
index 7aa04ef..84164ac 100644 (file)
@@ -18,7 +18,7 @@
 /* Written by David MacKenzie <djm@gnu.ai.mit.edu>.  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #include <stdio.h>
@@ -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
index cd74aa7..d209675 100644 (file)
@@ -18,7 +18,7 @@
 /* Written by Jim Meyering, meyering@comco.com */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #include <sys/types.h>
@@ -28,7 +28,7 @@ char *xmalloc ();
 char *xrealloc ();
 
 #ifndef INITIAL_HOSTNAME_LENGTH
-#define INITIAL_HOSTNAME_LENGTH 33
+# define INITIAL_HOSTNAME_LENGTH 33
 #endif
 
 char *
index a9f1975..33ac504 100644 (file)
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #if __STDC__
-#define VOID void
+# define VOID void
 #else
-#define VOID char
+# define VOID char
 #endif
 
 #include <sys/types.h>
 
 #if STDC_HEADERS
-#include <stdlib.h>
+# include <stdlib.h>
 #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.
index f6edefc..1e55cd1 100644 (file)
 /* Written by Jim Meyering.  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #ifdef STDC_HEADERS
-#include <stdlib.h>
+# include <stdlib.h>
 #else
 double strtod ();
 #endif
index 15b85f4..d40d512 100644 (file)
@@ -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));
index 8251c57..2e7aec0 100644 (file)
@@ -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_ */