12 #ifdef HAVE_SYS_PARAM_H
13 #include <sys/param.h>
16 /* <unistd.h> should be included before any preprocessor test
20 #if !defined(__GLIBC__)
22 #include <crt_externs.h>
23 #define environ (*_NSGetEnviron())
25 extern char ** environ;
26 #endif /* __APPLE__ */
30 #if !defined(HAVE_STPCPY)
31 char * stpcpy(char * dest, const char * src);
34 #if !defined(HAVE_STPNCPY)
35 char * stpncpy(char * dest, const char * src, size_t n);
38 #if HAVE___SECURE_GETENV
39 #define getenv(_s) __secure_getenv(_s)
50 # define NLENGTH(direct) (strlen((direct)->d_name))
51 #else /* not HAVE_DIRENT_H */
52 # define dirent direct
53 # define NLENGTH(direct) ((direct)->d_namlen)
54 # ifdef HAVE_SYS_NDIR_H
55 # include <sys/ndir.h>
56 # endif /* HAVE_SYS_NDIR_H */
57 # ifdef HAVE_SYS_DIR_H
59 # endif /* HAVE_SYS_DIR_H */
62 # endif /* HAVE_NDIR_H */
63 #endif /* HAVE_DIRENT_H */
70 #ifdef _POSIX_PATH_MAX
71 #define PATH_MAX _POSIX_PATH_MAX
72 #elif defined MAXPATHLEN
73 #define PATH_MAX MAXPATHLEN
80 #include <selinux/selinux.h>
81 #include <selinux/label.h>
83 typedef char * security_context_t;
87 #define setfilecon(_fn, _c) (-1)
88 #define lsetfilecon(_fn, _c) (-1)
90 #define is_selinux_enabled() (0)
92 #define matchpathcon_init(_fn) (-1)
93 #define matchpathcon_fini() (0)
94 #define matchpathcon(_fn, _fm, _c) (-1)
96 #define selabel_lookup_raw(_hnd, _scon, _key,_type) (-1)
98 #define selinux_file_context_path() (0)
100 #define rpm_execcon(_v, _fn, _av, _envp) (0)
103 #include "rpmio/rpmutil.h"
104 /* compatibility macros to avoid a mass-renaming all over the codebase */
105 #define xmalloc(_size) rmalloc((_size))
106 #define xcalloc(_nmemb, _size) rcalloc((_nmemb), (_size))
107 #define xrealloc(_ptr, _size) rrealloc((_ptr), (_size))
108 #define xstrdup(_str) rstrdup((_str))
109 #define _free(_ptr) rfree((_ptr))
111 /* Retrofit glibc __progname */
112 #if defined __GLIBC__ && __GLIBC__ >= 2
113 #if __GLIBC_MINOR__ >= 1
114 #define __progname __assert_program_name
116 #define setprogname(pn)
118 #define __progname program_name
119 #define setprogname(pn) \
120 { if ((__progname = strrchr(pn, '/')) != NULL) __progname++; \
121 else __progname = pn; \
124 extern const char *__progname;
126 /* Take care of NLS matters. */
129 # include <libintl.h>
130 # define _(Text) dgettext (PACKAGE, Text)
132 # define _(Text) Text
135 #define N_(Text) Text
137 /* ============== from misc/miscfn.h */
139 #if !defined(USE_GNU_GLOB)
148 #include "misc/glob.h"
149 #include "misc/fnmatch.h"
154 #endif /* H_SYSTEM */