added a script to build the table from setmime; fix (c)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10581 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
function dump_mime () {
|
||||
while [ ! -z "$1" ]; do
|
||||
case "$1" in
|
||||
-set)
|
||||
shift;
|
||||
mime="$1"
|
||||
;;
|
||||
-extension)
|
||||
shift
|
||||
extension="$1"
|
||||
echo " { \"$extension\", \"$mime\" },"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
# header
|
||||
echo "struct ext_mime mimes[] = {"
|
||||
|
||||
setmime -dump | grep extension | sed 's/^[^ ]*setmime /dump_mime /' | while read L; do
|
||||
eval $L
|
||||
done
|
||||
|
||||
#footer
|
||||
echo ""
|
||||
echo " { 0, 0 }"
|
||||
echo "};"
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
/
|
||||
/ Description: Kernel module implementing kernel-space mime_table API
|
||||
/
|
||||
/ Copyright 1999, Be Incorporated, All Rights Reserved.
|
||||
/ This file may be used under the terms of the Be Sample Code License.
|
||||
/ Copyright 2004, François Revol.
|
||||
/
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user