|
|
@ -0,0 +1,87 @@ |
|
|
|
#!/bin/sh |
|
|
|
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
|
# |
|
|
|
# Filename: src/tools-source/fl_wrapper/fl_wrapper.h.sh |
|
|
|
# Copyright (C) 2010 The OpenSDE Project |
|
|
|
# Copyright (C) 2004 - 2006 The T2 SDE Project |
|
|
|
# Copyright (C) 1998 - 2003 Clifford Wolf |
|
|
|
# |
|
|
|
# More information can be found in the files COPYING and README. |
|
|
|
# |
|
|
|
# This program is free software; you can redistribute it and/or modify |
|
|
|
# it under the terms of the GNU General Public License as published by |
|
|
|
# the Free Software Foundation; version 2 of the License. A copy of the |
|
|
|
# GNU General Public License can be found in the file COPYING. |
|
|
|
# --- SDE-COPYRIGHT-NOTE-END --- |
|
|
|
# |
|
|
|
# This shell-script genereates the fl_wrapper.h header file. |
|
|
|
|
|
|
|
cat <<EOT |
|
|
|
/* |
|
|
|
* !!! THIS FILE IS AUTO-GENERATED BY $0 !!! |
|
|
|
*/ |
|
|
|
|
|
|
|
EOT |
|
|
|
|
|
|
|
DEF="_GNU_SOURCE _REENTRANT _LARGEFILE_SOURCE _LARGEFILE64_SOURCE" |
|
|
|
UNDEF= |
|
|
|
|
|
|
|
ESCAPE= |
|
|
|
UNESCAPE= |
|
|
|
|
|
|
|
add_wrapper() { |
|
|
|
ESCAPE="$ESCAPE $2" |
|
|
|
UNESCAPE="$2 $UNESCAPE" |
|
|
|
} |
|
|
|
|
|
|
|
eval "$(grep '^add_wrapper ' fl_wrapper_generated.c.sh)" |
|
|
|
|
|
|
|
# defines |
|
|
|
for x in $DEF; do |
|
|
|
echo "#define $x" |
|
|
|
done |
|
|
|
|
|
|
|
# blank line |
|
|
|
echo |
|
|
|
|
|
|
|
# and rename the functions we override |
|
|
|
for x in $ESCAPE; do |
|
|
|
echo "#define $x xxx_$x" |
|
|
|
done |
|
|
|
|
|
|
|
cat <<EOT |
|
|
|
|
|
|
|
#include <dlfcn.h> |
|
|
|
#include <errno.h> |
|
|
|
#include <fcntl.h> |
|
|
|
#include <stdio.h> |
|
|
|
#include <stdlib.h> |
|
|
|
#include <string.h> |
|
|
|
#include <sys/file.h> |
|
|
|
#include <sys/stat.h> |
|
|
|
#include <sys/types.h> |
|
|
|
#include <unistd.h> |
|
|
|
#include <utime.h> |
|
|
|
#include <stdarg.h> |
|
|
|
#include <limits.h> |
|
|
|
/* somehow it can happen that PATH_MAX does not get defined...? -- jsaw */ |
|
|
|
#ifndef PATH_MAX |
|
|
|
#include <linux/limits.h> |
|
|
|
#endif |
|
|
|
#ifndef PATH_MAX |
|
|
|
#warning "PATH_MAX was not defined - BUG in your system headers?" |
|
|
|
#define PATH_MAX 4095 |
|
|
|
#endif |
|
|
|
#include <libgen.h> |
|
|
|
|
|
|
|
EOT |
|
|
|
|
|
|
|
# and undefine the stuff we defined above |
|
|
|
for x in $UNESCAPE '|' $UNDEF; do |
|
|
|
if [ "$x" = "|" ]; then |
|
|
|
echo # blank line |
|
|
|
else |
|
|
|
echo "#undef $x" |
|
|
|
fi |
|
|
|
done |