aboutsummaryrefslogtreecommitdiff
path: root/libexe/mkSDKincludes.csh
blob: c6dc096b0d043522c5a7582eed7547475e9521e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/csh

# Shave and a Haircut
# (c) 2019 Epic Games
# US Patent 6720962

echo "mkSDKincludes:status: creating sample include files"
cp shaveSDK.h shaveSDKTYPES.h shaveSDKFUNCS.h shaveSDKCALLBACKS.h shaveEngine.h sample/include

#
# Use the ALTERNATE_DEFS section of shaveSDKALTNAMES.h to create a file of
# sed commands to convert SDK func names to SDK2 names
#
sed -e '1,/^#ifdef ALTERNATE_DEFS/d' -e '/#endif/,$d' -e 's/[ 	][ 	]*/ /g' -e 's/^ //' < shaveSDKALTNAMES.h \
	| grep '^#define' \
	| sed -e 's/^#define \([^ ]*\) \([^ ]*\) *$/s\/\1[ 	]*(\/\2(\//' \
	> tempEdits

#
# Create the shaveSDKFUNCS2.h file using those edits
#
sed -f tempEdits < shaveSDKFUNCS.h >sample/include/shaveSDKFUNCS2.h

#
# Create the shaveSDKCALLBACKS2.h file using those edits
#
sed -f tempEdits < shaveSDKCALLBACKS.h >sample/include/shaveSDKCALLBACKS2.h

rm -f tempEdits