Commit 47021054 authored by Nils Goroll's avatar Nils Goroll

make more intelligent use of the tables files.

have checked the cpp output, all it does is shuffle around the definitions:

for f in src/*.i ; do egrep ^extern /tmp/liblongpath/$f | sort >/tmp/liblongpath/$f.s && egrep ^extern $f | sort >$f.s && diff -ub /tmp/liblongpath/$f.s $f.s|less ; done
parent b69beab7
......@@ -226,14 +226,29 @@ extern "C" {
#endif /* _LP64 && _LARGEFILE64_SOURCE */
#if defined(__STDC__)
#define FUNCTION(type, name, bits, ...) extern type name ## l ## bits (__VA_ARGS__);
#include "longpath_tbl_functions.h"
#undef FUNCTION
# define FUNCTION(type, name, ...) extern type name ## l (__VA_ARGS__);
# if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
!defined(__PRAGMA_REDEFINE_EXTNAME))
# define FUNCTION64(type, name, ...) extern type name ## l64 (__VA_ARGS__);
# else
# define FUNCTION64(type, name, ...)
# endif /* _LARGEFILE... */
# include "longpath_tbl_functions.h"
# include "longpath_tbl_functions64.h"
# undef FUNCTION
# undef FUNCTION64
#else /* defined(__STDC__) */
#define FUNCTION(type, name, bits, ...) extern type name ## l ## bits ();
#include "longpath_tbl_functions.h"
#undef FUNCTION
# define FUNCTION(type, name, ...) extern type name ## l ();
# if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
!defined(__PRAGMA_REDEFINE_EXTNAME))
# define FUNCTION64(type, name, ...) extern type name ## l64 ();
# else
# define FUNCTION64(type, name, ...)
# endif /* _LARGEFILE... */
# include "longpath_tbl_functions.h"
# include "longpath_tbl_functions64.h"
# undef FUNCTION
# undef FUNCTION64
#endif /* defined(__STDC__) */
#endif /* _LONGPATH_H */
FUNCTION(int, open, /*32*/, const char *, int, ...)
FUNCTION(int, creat, /*32*/, const char *, mode_t)
FUNCTION(int, stat, /*32*/, const char *, struct stat *)
FUNCTION(int, link, /*32*/, const char *, const char *)
FUNCTION(int, unlink, /*32*/, const char *)
FUNCTION(int, chown, /*32*/, const char *, uid_t, gid_t)
FUNCTION(int, chmod, /*32*/, const char *, mode_t)
FUNCTION(int, mknod, /*32*/, const char *, mode_t, dev_t)
FUNCTION(int, mkfifo, /*32*/, const char *, mode_t)
FUNCTION(int, rmdir, /*32*/, const char *)
FUNCTION(int, mkdir, /*32*/, const char *, mode_t)
FUNCTION(int, rename, /*32*/, const char *, const char *)
FUNCTION(int, utimes, /*32*/, const char *, const struct timeval *)
FUNCTION(int, lutimes, /*32*/, const char *, const struct timeval *)
FUNCTION(int, utime, /*32*/, const char *, const struct utimbuf *)
FUNCTION(int, link, const char *, const char *)
FUNCTION(int, unlink, const char *)
FUNCTION(int, chown, const char *, uid_t, gid_t)
FUNCTION(int, chmod, const char *, mode_t)
FUNCTION(int, mknod, const char *, mode_t, dev_t)
FUNCTION(int, mkfifo, const char *, mode_t)
FUNCTION(int, rmdir, const char *)
FUNCTION(int, mkdir, const char *, mode_t)
FUNCTION(int, rename, const char *, const char *)
FUNCTION(int, utimes, const char *, const struct timeval *)
FUNCTION(int, lutimes, const char *, const struct timeval *)
FUNCTION(int, utime, const char *, const struct utimbuf *)
/* at funcs */
#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
defined(_ATFILE_SOURCE)
FUNCTION(int, openat, /*32*/, int, const char *, int, ...)
#ifdef HAVE_ATTROPEN
FUNCTION(int, attropen, /*32*/, const char *, const char *, int, ...)
#endif
FUNCTION(int, fstatat, /*32*/, int, const char *, struct stat *, int)
#if defined(HAVE_LINKAT)
FUNCTION(int, linkat, /*32*/, int, const char *, int, const char *, int)
FUNCTION(int, linkat, int, const char *, int, const char *, int)
#endif
FUNCTION(int, unlinkat, /*32*/, int, const char *, int)
FUNCTION(int, unlinkat, int, const char *, int)
#if defined(HAVE_SYMLINKAT)
FUNCTION(int, symlinkat, /*32*/, const char *, int, const char *)
FUNCTION(int, symlinkat, const char *, int, const char *)
#endif
#if defined(HAVE_READLINKAT)
FUNCTION(int, readlinkat, /*32*/, int, const char *, char *, size_t)
FUNCTION(int, readlinkat, int, const char *, char *, size_t)
#endif
FUNCTION(int, fchownat, /*32*/, int, const char *, uid_t, gid_t, int)
FUNCTION(int, fchownat, int, const char *, uid_t, gid_t, int)
#if defined(HAVE_MKNODAT)
FUNCTION(int, mknodat, /*32*/, int, const char *, mode_t, dev_t)
FUNCTION(int, mknodat, int, const char *, mode_t, dev_t)
#endif
#if defined(HAVE_MKFIFOAT)
FUNCTION(int, mkfifoat, /*32*/, int, const char *, mode_t)
FUNCTION(int, mkfifoat, int, const char *, mode_t)
#endif
FUNCTION(int, rmdirat, /*32*/, int, const char *)
FUNCTION(int, rmdirat, int, const char *)
#if defined(HAVE_MKDIRAT)
FUNCTION(int, mkdirat, /*32*/, int, const char *, mode_t)
FUNCTION(int, mkdirat, int, const char *, mode_t)
#endif
FUNCTION(int, renameat, /*32*/, int, const char *, int, const char *)
FUNCTION(int, renameat, int, const char *, int, const char *)
#endif
/* times at */
#if defined(__EXTENSIONS__) || \
(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
/* || defined(_XPG7) */
FUNCTION(int, futimesat, /*32*/, int, const char *, const struct timeval *)
FUNCTION(int, utimensat, /*32*/, int, const char *, const struct timespec *, int)
FUNCTION(int, futimesat, int, const char *, const struct timeval *)
FUNCTION(int, utimensat, int, const char *, const struct timespec *, int)
#endif
/* lstat */
#if !defined(__XOPEN_OR_POSIX) || defined(_XPG_2) || defined(__EXTENSIONS__)
FUNCTION(int, lstat, /*32*/, const char *, struct stat *)
FUNCTION(int, symlink, /*32*/, const char *, const char *)
FUNCTION(int, readlink, /*32*/, const char *, char *, size_t)
FUNCTION(int, lchown, /*32*/, const char *, uid_t, gid_t)
FUNCTION(int, symlink, const char *, const char *)
FUNCTION(int, readlink, const char *, char *, size_t)
FUNCTION(int, lchown, const char *, uid_t, gid_t)
#endif
/* mkstemp */
FUNCTION(char *, mktemp, /*32*/, char *)
FUNCTION(char *, mkdtemp, /*32*/, char *)
FUNCTION(int, mkstemp, /*32*/, char *)
FUNCTION(int, mkstemps, /*32*/, char *, int)
FUNCTION(char *, mktemp, char *)
FUNCTION(char *, mkdtemp, char *)
/* mkstemp GNU */
#if defined(_GNU_SOURCE)
FUNCTION(int, mkostemp, /*32*/, char *, int)
FUNCTION(int, mkostemps, /*32*/, char *, int, int)
#endif
FUNCTION(DIR *, opendir, /*32*/, const char *)
FUNCTION(DIR *, opendir, const char *)
/* linux */
#ifdef HAVE_FGETXATTR
FUNCTION(ssize_t, getxattr, /*32*/, const char *, const char *, void *, size_t)
FUNCTION(ssize_t, lgetxattr, /*32*/, const char *, const char *, void *, size_t)
FUNCTION(int, setxattr, /*32*/, const char *, const char *, const void *, size_t, int)
FUNCTION(int, lsetxattr, /*32*/, const char *, const char *, const void *, size_t, int)
#endif
/* 64 */
#if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
!defined(__PRAGMA_REDEFINE_EXTNAME))
FUNCTION(int, open, 64, const char *, int, ...)
FUNCTION(int, creat, 64, const char *, mode_t)
FUNCTION(int, stat, 64, const char *, struct stat64 *)
/* 64 at funcs */
#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
defined(_ATFILE_SOURCE)
FUNCTION(int, openat, 64, int, const char *, int, ...)
#ifdef HAVE_ATTROPEN
FUNCTION(int, attropen, 64, const char *, const char *, int, ...)
#endif
FUNCTION(int, fstatat, 64, int, const char *, struct stat64 *, int)
#endif
/* 64 lstat */
#if !defined(__XOPEN_OR_POSIX) || defined(_XPG_2) || defined(__EXTENSIONS__)
FUNCTION(int, lstat, 64, const char *, struct stat64 *)
#endif
/* 64 mkstemp*/
FUNCTION(int, mkstemp, 64, char *)
FUNCTION(int, mkstemps, 64, char *, int)
/* 64 mkstemp GNU*/
#if defined(_GNU_SOURCE)
FUNCTION(int, mkostemp, 64, char *, int)
FUNCTION(int, mkostemps, 64, char *, int, int)
FUNCTION(ssize_t, getxattr, const char *, const char *, void *, size_t)
FUNCTION(ssize_t, lgetxattr, const char *, const char *, void *, size_t)
FUNCTION(int, setxattr, const char *, const char *, const void *, size_t, int)
FUNCTION(int, lsetxattr, const char *, const char *, const void *, size_t, int)
#endif
#endif /* 64 */
/*
* table file with functions for which a *64 variant can or cannot exist,
* depending upon the compilation environment (see lf64 etc)
*
* using seperate FUNCTION and FUNCTION64 macros because the 64 variants can
* have a different signature (read: stat64)
*/
FUNCTION(int, open, const char *, int, ...)
FUNCTION(int, creat, const char *, mode_t)
FUNCTION(int, stat, const char *, struct stat *)
FUNCTION64(int, open, const char *, int, ...)
FUNCTION64(int, creat, const char *, mode_t)
FUNCTION64(int, stat, const char *, struct stat64 *)
/* 64 at funcs */
#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
defined(_ATFILE_SOURCE)
FUNCTION(int, openat, int, const char *, int, ...)
FUNCTION64(int, openat, int, const char *, int, ...)
# ifdef HAVE_ATTROPEN
FUNCTION(int, attropen, const char *, const char *, int, ...)
FUNCTION64(int, attropen, const char *, const char *, int, ...)
# endif
FUNCTION(int, fstatat, int, const char *, struct stat *, int)
FUNCTION64(int, fstatat, int, const char *, struct stat64 *, int)
#endif /* __EXTENSIONS ... */
/* 64 lstat */
#if !defined(__XOPEN_OR_POSIX) || defined(_XPG_2) || defined(__EXTENSIONS__)
FUNCTION64(int, lstat, const char *, struct stat64 *)
FUNCTION(int, lstat, const char *, struct stat *)
#endif /* __XOPEN... */
/* 64 mkstemp*/
FUNCTION(int, mkstemp, char *)
FUNCTION(int, mkstemps, char *, int)
FUNCTION64(int, mkstemp, char *)
FUNCTION64(int, mkstemps, char *, int)
/* 64 mkstemp GNU*/
#if defined(_GNU_SOURCE)
FUNCTION64(int, mkostemp, char *, int)
FUNCTION64(int, mkostemps, char *, int, int)
FUNCTION(int, mkostemp, char *, int)
FUNCTION(int, mkostemps, char *, int, int)
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment