Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Have --fake-super turn a symlink into a file when
[rsync/rsync.git]
/
popt
/
system.h
diff --git
a/popt/system.h
b/popt/system.h
index
b147af7
..
f835a58
100644
(file)
--- a/
popt/system.h
+++ b/
popt/system.h
@@
-2,7
+2,17
@@
#include "config.h"
#endif
#include "config.h"
#endif
+#if defined (__GLIBC__) && defined(__LCLINT__)
+/*@-declundef@*/
+/*@unchecked@*/
+extern __const __int32_t *__ctype_tolower;
+/*@unchecked@*/
+extern __const __int32_t *__ctype_toupper;
+/*@=declundef@*/
+#endif
+
#include <ctype.h>
#include <ctype.h>
+
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
@@
-12,11
+22,32
@@
#endif
#include <stdio.h>
#endif
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
-#if
HAVE_UNISTD_H
-#
include <unistd.h>
+#if
ndef __GNUC__
+#
define __attribute__(x)
#endif
#ifdef __NeXT
#endif
#ifdef __NeXT
@@
-26,11
+57,12
@@
#endif
#if defined(__LCLINT__)
#endif
#if defined(__LCLINT__)
-/*@-declundef -incondefs -redecl@*/ /* LCL: missing annotation */
-/*@only@*/ void * alloca (size_t __size)
+/*@-declundef -incondefs @*/ /* LCL: missing annotation */
+/*@only@*/ /*@out@*/
+void * alloca (size_t __size)
/*@ensures MaxSet(result) == (__size - 1) @*/
/*@*/;
/*@ensures MaxSet(result) == (__size - 1) @*/
/*@*/;
-/*@=declundef =incondefs
=redecl
@*/
+/*@=declundef =incondefs @*/
#endif
/* AIX requires this to be the first thing in the file. */
#endif
/* AIX requires this to be the first thing in the file. */
@@
-41,9
+73,9
@@
# ifdef _AIX
#pragma alloca
# else
# ifdef _AIX
#pragma alloca
# else
-# if HAVE_ALLOCA
+# if
def
HAVE_ALLOCA
# ifndef alloca /* predefined by HP cc +Olibcalls */
# ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca
(
);
+char *alloca
(size_t size
);
# endif
# else
# ifdef alloca
# endif
# else
# ifdef alloca
@@
-57,22
+89,42
@@
char *alloca ();
#define alloca __builtin_alloca
#endif
#define alloca __builtin_alloca
#endif
-/*@-redecl -redef@*/
-/*@mayexit@*/ /*@only@*/ char * xstrdup (const char *str)
- /*@*/;
-/*@=redecl =redef@*/
+#ifndef HAVE_STRLCPY
+size_t strlcpy(char *d, const char *s, size_t bufsize);
+#endif
+
+#ifndef HAVE_STRLCAT
+size_t strlcat(char *d, const char *s, size_t bufsize);
+#endif
#if HAVE_MCHECK_H && defined(__GNUC__)
#if HAVE_MCHECK_H && defined(__GNUC__)
-#define vmefail() (fprintf(stderr, "virtual memory exhausted.\n"), exit(EXIT_FAILURE), NULL)
-#define xstrdup(_str) (strcpy((malloc(strlen(_str)+1) ? : vmefail()), (_str)))
+static inline char *
+xstrdup(const char *s)
+{
+ size_t memsize = strlen(s) + 1;
+ char *ptr = malloc(memsize);
+ if (!ptr) {
+ fprintf(stderr, "virtual memory exhausted.\n");
+ exit(EXIT_FAILURE);
+ }
+ strlcpy(ptr, s, memsize);
+ return ptr;
+}
#else
#define xstrdup(_str) strdup(_str)
#endif /* HAVE_MCHECK_H && defined(__GNUC__) */
#else
#define xstrdup(_str) strdup(_str)
#endif /* HAVE_MCHECK_H && defined(__GNUC__) */
-#if defined(__GNUC__) || !(defined(__hpux) || defined(_hpux) || defined (hpux))
-#define UNUSED(x) x __attribute__((__unused__))
-#else
-#define UNUSED(x) x
+#if HAVE___SECURE_GETENV && !defined(__LCLINT__)
+#define getenv(_s) __secure_getenv(_s)
#endif
#endif
+#if !defined HAVE_SNPRINTF || !defined HAVE_C99_VSNPRINTF
+#define snprintf rsync_snprintf
+int snprintf(char *str,size_t count,const char *fmt,...);
+#endif
+
+#define UNUSED(x) x __attribute__((__unused__))
+
+#define PACKAGE "rsync"
+
#include "popt.h"
#include "popt.h"