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__ */
35 #if !defined(HAVE_STPCPY)
36 char * stpcpy(char * dest, const char * src);
39 #if !defined(HAVE_STPNCPY)
40 char * stpncpy(char * dest, const char * src, size_t n);
48 #if HAVE___SECURE_GETENV
49 #define getenv(_s) __secure_getenv(_s)
60 # define NLENGTH(direct) (strlen((direct)->d_name))
61 #else /* not HAVE_DIRENT_H */
62 # define dirent direct
63 # define NLENGTH(direct) ((direct)->d_namlen)
64 # ifdef HAVE_SYS_NDIR_H
65 # include <sys/ndir.h>
66 # endif /* HAVE_SYS_NDIR_H */
67 # ifdef HAVE_SYS_DIR_H
69 # endif /* HAVE_SYS_DIR_H */
72 # endif /* HAVE_NDIR_H */
73 #endif /* HAVE_DIRENT_H */
82 #ifdef _POSIX_PATH_MAX
83 #define PATH_MAX _POSIX_PATH_MAX
84 #elif defined MAXPATHLEN
85 #define PATH_MAX MAXPATHLEN
92 #include <selinux/selinux.h>
94 typedef char * security_context_t;
98 #define setfilecon(_fn, _c) (-1)
99 #define lsetfilecon(_fn, _c) (-1)
101 #define is_selinux_enabled() (0)
103 #define matchpathcon_init(_fn) (-1)
104 #define matchpathcon_fini() (0)
105 #define matchpathcon(_fn, _fm, _c) (-1)
107 #define rpm_execcon(_v, _fn, _av, _envp) (0)
110 #include "rpmio/rpmutil.h"
111 /* compatibility macros to avoid a mass-renaming all over the codebase */
112 #define xmalloc(_size) rmalloc((_size))
113 #define xcalloc(_nmemb, _size) rcalloc((_nmemb), (_size))
114 #define xrealloc(_ptr, _size) rrealloc((_ptr), (_size))
115 #define xstrdup(_str) rstrdup((_str))
116 #define _free(_ptr) rfree((_ptr))
118 /* Retrofit glibc __progname */
119 #if defined __GLIBC__ && __GLIBC__ >= 2
120 #if __GLIBC_MINOR__ >= 1
121 #define __progname __assert_program_name
123 #define setprogname(pn)
125 #define __progname program_name
126 #define setprogname(pn) \
127 { if ((__progname = strrchr(pn, '/')) != NULL) __progname++; \
128 else __progname = pn; \
131 extern const char *__progname;
133 /* Take care of NLS matters. */
136 # include <libintl.h>
137 # define _(Text) dgettext (PACKAGE, Text)
139 # define _(Text) Text
142 #define N_(Text) Text
144 /* ============== from misc/miscfn.h */
146 #if !defined(USE_GNU_GLOB)
155 #include "misc/glob.h"
156 #include "misc/fnmatch.h"
159 #endif /* H_SYSTEM */