mime-type-include.sh 868 Bytes
Newer Older
1 2
#!/bin/sh

3
. `dirname $0`/mime-functions.sh
4

5 6 7 8
echo_mime () {
	echo "\"$i\","
}

9
if [ x"$1" = "x--nautilus" ] ; then
10 11 12 13 14
	get_audio_mimetypes $2;

	echo "/* generated with mime-types-include.sh in the totem module, don't edit or "
	echo "   commit in the nautilus module without filing a bug against totem */"

15
	echo "static const char *audio_mime_types[] = {"
16 17 18 19 20 21 22 23 24
	for i in $MIMETYPES ; do
		echo_mime;
	done

	echo "};"

	exit 0
fi

25
MIMETYPES=`grep -v ^# $1 | grep -v x-content/`
26

27
echo "/* generated with mime-types-include.sh, don't edit */"
28
echo "const char *mime_types[] = {"
29 30 31 32 33 34 35

for i in $MIMETYPES ; do
	echo_mime;
done

echo "};"

36 37
get_audio_mimetypes $1;

38
echo "const char *audio_mime_types[] = {"
39 40 41 42 43 44 45 46
for i in $MIMETYPES ; do
	echo_mime;
done

echo "};"

get_video_mimetypes $1;

47
echo "const char *video_mime_types[] = {"
48 49 50 51 52 53
for i in $MIMETYPES ; do
	echo_mime;
done

echo "};"