# include <dirent.h>
#endif
+#if defined(HAVE_DLFCN_H)
+# include <dlfcn.h>
+#endif
+
#if defined(HAVE_FCNTL_H)
# include <fcntl.h>
#endif
-#if defined(WITH_JRE_LAYOUT)
+#if defined(ENABLE_JRE_LAYOUT)
# if defined(HAVE_LIBGEN_H)
# include <libgen.h>
# endif
#endif
}
+inline static int system_atoi(const char *nptr)
+{
+#if defined(HAVE_ATOI)
+ return atoi(nptr);
+#else
+# error atoi not available
+#endif
+}
+
inline static void *system_calloc(size_t nmemb, size_t size)
{
#if defined(HAVE_CALLOC)
#endif
}
-#if defined(WITH_JRE_LAYOUT)
+#if defined(ENABLE_JRE_LAYOUT)
inline static char *system_dirname(char *path)
{
#if defined(HAVE_DIRNAME)
}
#endif
+inline static int system_dlclose(void* handle)
+{
+#if defined(HAVE_DLCLOSE)
+ return dlclose(handle);
+#else
+# error dlclose not available
+#endif
+}
+
+inline static char* system_dlerror(void)
+{
+#if defined(HAVE_DLERROR)
+ return dlerror();
+#else
+# error dlerror not available
+#endif
+}
+
+inline static void* system_dlopen(const char* filename, int flag)
+{
+#if defined(HAVE_DLOPEN)
+ return dlopen(filename, flag);
+#else
+# error dlopen not available
+#endif
+}
+
+inline static void* system_dlsym(void* handle, const char* symbol)
+{
+#if defined(HAVE_DLSYM)
+ return dlsym(handle, symbol);
+#else
+# error dlsym not available
+#endif
+}
+
inline static FILE *system_fopen(const char *path, const char *mode)
{
#if defined(HAVE_FOPEN)
#endif
}
+inline static int system_fseek(FILE *stream, off_t offset, int whence)
+{
+#if defined(HAVE_FSEEK)
+ return fseek(stream, offset, whence);
+#else
+# error fseek not available
+#endif
+}
+
inline static void system_free(void *ptr)
{
#if defined(HAVE_FREE)
#endif
}
+#if defined(__LINUX__)
inline static int system_scandir(const char *dir, struct dirent ***namelist, int(*filter)(const struct dirent *), int(*compar)(const void *, const void *))
+#elif defined(__IRIX__)
+inline static int system_scandir(const char *dir, struct dirent ***namelist, int(*filter)(dirent_t *), int(*compar)(dirent_t **, dirent_t **))
+#else
+inline static int system_scandir(const char *dir, struct dirent ***namelist, int(*filter)(struct dirent *), int(*compar)(const void *, const void *))
+#endif
{
#if defined(HAVE_SCANDIR)
return scandir(dir, namelist, filter, compar);
#endif
}
+inline static char *system_strcat(char *dest, const char *src)
+{
+#if defined(HAVE_STRCAT)
+ return strcat(dest, src);
+#else
+# error strcat not available
+#endif
+}
+
+inline static char *system_strcpy(char *dest, const char *src)
+{
+#if defined(HAVE_STRCPY)
+ return strcpy(dest, src);
+#else
+# error strcpy not available
+#endif
+}
+
inline static char *system_strdup(const char *s)
{
#if defined(HAVE_STRDUP)