Mercurial > hg > octave-kai > gnulib-hg
changeset 653:b63f146fd963
indent cpp-directives
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Mon, 15 Jul 1996 03:56:06 +0000 |
parents | 46c7775739ce |
children | 6470fee04491 |
files | 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 |
diffstat | 26 files changed, 146 insertions(+), 146 deletions(-) [+] |
line wrap: on
line diff
--- 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 <config.h> +# include <config.h> #endif /* Return NAME with any leading path stripped off.
--- 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 <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 @@ 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);
--- a/lib/error.h +++ b/lib/error.h @@ -16,22 +16,22 @@ 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 @@ 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;
--- a/lib/gethostname.c +++ b/lib/gethostname.c @@ -18,11 +18,11 @@ /* 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.
--- a/lib/getline.c +++ b/lib/getline.c @@ -42,17 +42,17 @@ #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
--- a/lib/getline.h +++ b/lib/getline.h @@ -15,17 +15,17 @@ 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));
--- a/lib/getugroups.c +++ b/lib/getugroups.c @@ -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
--- a/lib/getusershell.c +++ b/lib/getusershell.c @@ -18,19 +18,19 @@ /* 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 ();
--- 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 <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"
--- 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 ();
--- a/lib/modechange.h +++ b/lib/modechange.h @@ -45,11 +45,11 @@ #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));
--- a/lib/putenv.c +++ b/lib/putenv.c @@ -21,7 +21,7 @@ #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 @@ #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
--- a/lib/readtokens.c +++ b/lib/readtokens.c @@ -28,23 +28,23 @@ */ #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 */
--- 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 @@ }; 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));
--- a/lib/setenv.c +++ b/lib/setenv.c @@ -19,23 +19,23 @@ 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
--- 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));
--- a/lib/stime.c +++ b/lib/stime.c @@ -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>
--- 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 <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
--- a/lib/strftime.c +++ b/lib/strftime.c @@ -62,19 +62,19 @@ #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 @@ #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
--- a/lib/strtol.c +++ b/lib/strtol.c @@ -108,12 +108,12 @@ #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 @@ #undef __P #if defined (__STDC__) && __STDC__ -#define __P(args) args +# define __P(args) args #else -#define __P(args) () +# define __P(args) () #endif /* Prototype. */
--- a/lib/xgetcwd.c +++ b/lib/xgetcwd.c @@ -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 @@ #ifndef HAVE_GETCWD char *getwd (); -#define getcwd(buf, max) getwd (buf) +# define getcwd(buf, max) getwd (buf) #else char *getcwd (); #endif
--- a/lib/xgethostname.c +++ b/lib/xgethostname.c @@ -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 *xrealloc (); #ifndef INITIAL_HOSTNAME_LENGTH -#define INITIAL_HOSTNAME_LENGTH 33 +# define INITIAL_HOSTNAME_LENGTH 33 #endif char *
--- 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 <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 @@ #endif #ifndef EXIT_FAILURE -#define EXIT_FAILURE 1 +# define EXIT_FAILURE 1 #endif /* Exit value when the requested amount of memory is not available.
--- a/lib/xstrtod.c +++ b/lib/xstrtod.c @@ -18,11 +18,11 @@ /* 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
--- 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));