12 #include <sys/types.h>
17 #ifdef HAVE_SYS_PARAM_H
18 #include <sys/param.h>
21 /* <unistd.h> should be included before any preprocessor test
25 #if !defined(__GLIBC__)
27 #include <crt_externs.h>
28 #define environ (*_NSGetEnviron())
30 extern char ** environ;
31 #endif /* __APPLE__ */
36 # if !STDC_HEADERS && HAVE_MEMORY_H
44 #if !defined(HAVE_STPCPY)
45 char * stpcpy(char * dest, const char * src);
48 #if !defined(HAVE_STPNCPY)
49 char * stpncpy(char * dest, const char * src, size_t n);
57 #if HAVE___SECURE_GETENV
58 #define getenv(_s) __secure_getenv(_s)
63 #define getopt system_getopt
66 #else /* not STDC_HEADERS */
67 char *getenv (const char *name);
68 #endif /* STDC_HEADERS */
70 /* XXX solaris2.5.1 has not */
71 #if !defined(EXIT_FAILURE)
72 #define EXIT_FAILURE 1
83 # define NLENGTH(direct) (strlen((direct)->d_name))
84 #else /* not HAVE_DIRENT_H */
85 # define dirent direct
86 # define NLENGTH(direct) ((direct)->d_namlen)
87 # ifdef HAVE_SYS_NDIR_H
88 # include <sys/ndir.h>
89 # endif /* HAVE_SYS_NDIR_H */
90 # ifdef HAVE_SYS_DIR_H
92 # endif /* HAVE_SYS_DIR_H */
95 # endif /* HAVE_NDIR_H */
96 #endif /* HAVE_DIRENT_H */
105 #ifdef _POSIX_PATH_MAX
106 #define PATH_MAX _POSIX_PATH_MAX
107 #elif defined MAXPATHLEN
108 #define PATH_MAX MAXPATHLEN
115 #include <selinux/selinux.h>
117 typedef char * security_context_t;
121 #define setfilecon(_fn, _c) (-1)
122 #define lsetfilecon(_fn, _c) (-1)
124 #define is_selinux_enabled() (0)
126 #define matchpathcon_init(_fn) (-1)
127 #define matchpathcon_fini() (0)
128 #define matchpathcon(_fn, _fm, _c) (-1)
130 #define rpm_execcon(_v, _fn, _av, _envp) (0)
133 #include "rpmio/rpmutil.h"
134 /* compatibility macros to avoid a mass-renaming all over the codebase */
135 #define xmalloc(_size) rmalloc((_size))
136 #define xcalloc(_nmemb, _size) rcalloc((_nmemb), (_size))
137 #define xrealloc(_ptr, _size) rrealloc((_ptr), (_size))
138 #define xstrdup(_str) rstrdup((_str))
139 #define _free(_ptr) rfree((_ptr))
141 /* Retrofit glibc __progname */
142 #if defined __GLIBC__ && __GLIBC__ >= 2
143 #if __GLIBC_MINOR__ >= 1
144 #define __progname __assert_program_name
146 #define setprogname(pn)
148 #define __progname program_name
149 #define setprogname(pn) \
150 { if ((__progname = strrchr(pn, '/')) != NULL) __progname++; \
151 else __progname = pn; \
154 extern const char *__progname;
156 /* Take care of NLS matters. */
159 # include <libintl.h>
160 # define _(Text) dgettext (PACKAGE, Text)
162 # define _(Text) Text
165 #define N_(Text) Text
167 /* ============== from misc/miscfn.h */
169 #if !defined(USE_GNU_GLOB)
178 #include "misc/glob.h"
179 #include "misc/fnmatch.h"
186 #endif /* H_SYSTEM */