|
|
@ -1,4 +1,4 @@ |
|
|
|
#!/bin/bash |
|
|
|
#!/bin/sh |
|
|
|
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
|
# |
|
|
@ -21,21 +21,17 @@ cat < |
|
|
|
/* |
|
|
|
* !!! THIS FILE IS AUTO-GENERATED BY $0 !!! |
|
|
|
*/ |
|
|
|
|
|
|
|
EOT |
|
|
|
|
|
|
|
add_wrapper() |
|
|
|
{ |
|
|
|
add_wrapper() { |
|
|
|
local template= |
|
|
|
line="$( echo "$*" | sed 's/ *, */,/g' )" |
|
|
|
old_ifs="$IFS" ; IFS="," ; set $line ; IFS="$old_ifs" |
|
|
|
local ret_type="$1" function="$2" |
|
|
|
local p1= p2= |
|
|
|
|
|
|
|
ret_type=$1 ; shift ; function=$1 ; shift |
|
|
|
p1="" ; p2="" ; for x ; do p1="$p1$x, " ; done |
|
|
|
for x ; do x="${x%%\[\]}" ; p2="$p2${x##* }, " ; done |
|
|
|
p1="${p1%, }" ; p2="${p2%, }" |
|
|
|
p1="$3" |
|
|
|
p2=$(echo "$3" | tr ' \n' '\n,' | grep , | tr '\n' ' ' | sed -e 's/[\[\]]//g' -e 's/, $//') |
|
|
|
|
|
|
|
case ${function} in |
|
|
|
case "${function}" in |
|
|
|
open*) |
|
|
|
# remove varg from $p2 |
|
|
|
p2=${p2%, ...} |
|
|
@ -55,24 +51,24 @@ add_wrapper() |
|
|
|
"$template" | sed -e 'N;/^\/\*\n \*\/$/d;' |
|
|
|
} |
|
|
|
|
|
|
|
add_wrapper 'int, open, const char* f, int a, ...' |
|
|
|
add_wrapper 'int, open64, const char* f, int a, ...' |
|
|
|
add_wrapper int open 'const char* f, int a, ...' |
|
|
|
add_wrapper int open64 'const char* f, int a, ...' |
|
|
|
|
|
|
|
add_wrapper 'FILE*, fopen, const char* f, const char* g' |
|
|
|
add_wrapper 'FILE*, fopen64, const char* f, const char* g' |
|
|
|
add_wrapper 'FILE*' fopen 'const char* f, const char* g' |
|
|
|
add_wrapper 'FILE*' fopen64 'const char* f, const char* g' |
|
|
|
|
|
|
|
add_wrapper 'int, creat, const char* f, mode_t m' |
|
|
|
add_wrapper 'int, creat64, const char* f, mode_t m' |
|
|
|
add_wrapper int creat 'const char* f, mode_t m' |
|
|
|
add_wrapper int creat64 'const char* f, mode_t m' |
|
|
|
|
|
|
|
add_wrapper 'int, mkdir, const char* f, mode_t m' |
|
|
|
add_wrapper 'int, mknod, const char* f, mode_t m, dev_t d' |
|
|
|
add_wrapper int mkdir 'const char* f, mode_t m' |
|
|
|
add_wrapper int mknod 'const char* f, mode_t m, dev_t d' |
|
|
|
|
|
|
|
add_wrapper 'int, link, const char* s, const char* f' |
|
|
|
add_wrapper 'int, symlink, const char* s, const char* f' |
|
|
|
add_wrapper 'int, rename, const char* s, const char* f' |
|
|
|
add_wrapper int link 'const char* s, const char* f' |
|
|
|
add_wrapper int symlink 'const char* s, const char* f' |
|
|
|
add_wrapper int rename 'const char* s, const char* f' |
|
|
|
|
|
|
|
add_wrapper 'int, utime, const char* f, const struct utimbuf* t' |
|
|
|
add_wrapper 'int, utimes, const char* f, struct timeval* t' |
|
|
|
add_wrapper int utime 'const char* f, const struct utimbuf* t' |
|
|
|
add_wrapper int utimes 'const char* f, struct timeval* t' |
|
|
|
|
|
|
|
add_wrapper 'int, execv, const char* f, char* const a[]' |
|
|
|
add_wrapper 'int, execve, const char* f, char* const a[], char* const e[]' |
|
|
|
add_wrapper int execv 'const char* f, char* const a[]' |
|
|
|
add_wrapper int execve 'const char* f, char* const a[], char* const e[]' |