summaryrefslogtreecommitdiff
path: root/data/mime-type-include.sh
blob: 06dc562fcdccd1af7f633025b13e75d703642932 (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
54
55
56
#!/bin/sh

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

echo_mime () {
	echo "\"$i\","
}

if [ x"$1" = "x--nautilus" ] ; then
	get_video_mimetypes $2;

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

	echo "G_GNUC_UNUSED static const char *video_mime_types[] = {"
	for i in $MIMETYPES ; do
		echo_mime;
	done

	echo "NULL"
	echo "};"

	exit 0
fi

MIMETYPES=`grep -v '^#' $1 | grep -v x-content/ | grep -v x-scheme-handler/`

echo "/* generated with mime-types-include.sh, don't edit */"
echo "G_GNUC_UNUSED static const gchar *mime_types[] = {"

for i in $MIMETYPES ; do
	echo_mime;
done

echo "NULL"
echo "};"

get_audio_mimetypes $1;

echo "G_GNUC_UNUSED static const gchar *audio_mime_types[] = {"
for i in $MIMETYPES ; do
	echo_mime;
done

echo "NULL"
echo "};"

get_video_mimetypes $1;

echo "G_GNUC_UNUSED static const gchar *video_mime_types[] = {"
for i in $MIMETYPES ; do
	echo_mime;
done

echo "NULL"
echo "};"