Welcome to mirror list, hosted at ThFree Co, Russian Federation.

convert_source.sh « ietf « doc - gitlab.com/quite/celt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 707e2c83a7b007e50d65dc8f896b2acd73f66d09 (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh

mkdir -p source

for i in `ls ../../libcelt | grep '\.[ch]$'`
do

#echo "<section anchor=\"$i\" title=\"$i\">" > source/$i
#echo '<t>' >> source/$i
#echo '<figure><artwork><![CDATA[' >> source/$i

echo '#include "substitutions.h"' > tata.c
echo 'SOURCE_CODE_BEGIN' >> tata.c

if echo $i | grep '\.h' > /dev/null; then
	cat ../../libcelt/$i | sed -e 's/=\*/= \*/' -e 's/=-/= -/' -e 's/\t/    /g' -e 's/^#/\/\/PREPROCESS_REMOVE#/' >> tata.c
else
	cat ../../libcelt/$i | sed -e 's/=\*/= \*/' -e 's/=-/= -/' -e 's/\t/    /g' -e 's/^#include/\/\/PREPROCESS_REMOVE#include/' | sed 's/^#define/\/\/PREPROCESS_REMOVE#define/'>> tata.c
fi

#cat ../../libcelt/$i | sed 's/^#/\/\/PREPROCESS_REMOVE#/' >> tata.c
#cat ../../libcelt/$i | sed 's/^#include/\/\/PREPROCESS_REMOVE#include/' | sed 's/^#define/\/\/PREPROCESS_REMOVE#define/'>> tata.c
gcc -DHAVE_CONFIG_H -C -E -nostdinc tata.c | grep -v '^#' | sed 's/\/\/PREPROCESS_REMOVE//' | perl -ne 'if ($begin) {print $_} if (/SOURCE_CODE_BEGIN/) {$begin=1}' > tata2.c

#cat ../../libcelt/$i >> tata.c
#gcc -C -E -nostdinc tata.c -fdirectives-only | perl -ne 'if ($begin) {print $_} if (/SOURCE_CODE_BEGIN/) {$begin=1}' > tata2.c

indent -nsc -ncdb -original -sob -i2 -bl -bli0 --no-tabs -l69 --format-all-comments tata2.c -o tata.c
cat tata.c | grep -v 'include.*float_cast' | ./wrap_lines > source/$i
#cat tata.c  > source/$i



#indent --no-tabs -l72 --format-all-comments ../../libcelt/$i -o tata.c
#cat tata.c >> source/$i


#echo ']]></artwork></figure>' >> source/$i
#echo '</t>' >> source/$i
#echo '</section>' >> source/$i

done

cp arch.h source/arch.h
cp celt_types.h source/celt_types.h
cp config.h source/config.h
cp Makefile.ietf source/Makefile

rm source/mfrng*.c
rm source/dump_modes*
rm source/header*
rm source/fixed*