Check-in [4e6097bf48]
Overview
Comment:Updated to emit correct code for an empty mime types file
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4e6097bf48b0a08db9c8289dcacae933a1791ca6
User & Date: rkeene on 2014-02-08 03:15:26
Other Links: manifest | tags
Context
2014-02-08
03:16
Moved cleanup of mime types file to distclean check-in: c928347a46 user: rkeene tags: trunk
03:15
Updated to emit correct code for an empty mime types file check-in: 4e6097bf48 user: rkeene tags: trunk
03:14
Updated to make mime types file configurable check-in: ad6e43c2bd user: rkeene tags: trunk
Changes

Modified generate-mime-types from [ce8a54e188] to [64211e4a81].

77
78
79
80
81
82
83

84
85
86
87
88
89
90
91
92
93
94
95

96
97
	set hash_id [filed_hash $extension $modulus]

	lappend hashinfo($hash_id) $extension

}

# Emit a C fragment to take a pointer (p) to an extension determine the mime type

puts "\tswitch (filed_hash((const unsigned char *) p, $modulus)) \{"
foreach hash [lsort -integer -increasing [array names hashinfo]] {
	puts "\t\tcase $hash:"
	foreach extension $hashinfo($hash) {
		puts "\t\t\tif (strcmp(p, \"$extension\") == 0) \{"
		puts "\t\t\t\treturn(\"$extensioninfo($extension)\");"
		puts "\t\t\t\}"
	}
	puts "\t\t\treturn(FILED_DEFAULT_TYPE);"
}
puts "\t\}"


# Declare victory
exit 0







>
|
|
|
|
|
|
|
|
|
|
|
|
>


77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
	set hash_id [filed_hash $extension $modulus]

	lappend hashinfo($hash_id) $extension

}

# Emit a C fragment to take a pointer (p) to an extension determine the mime type
if {[llength [array names hashinfo]] > 0} {
	puts "\tswitch (filed_hash((const unsigned char *) p, $modulus)) \{"
	foreach hash [lsort -integer -increasing [array names hashinfo]] {
		puts "\t\tcase $hash:"
		foreach extension $hashinfo($hash) {
			puts "\t\t\tif (strcmp(p, \"$extension\") == 0) \{"
			puts "\t\t\t\treturn(\"$extensioninfo($extension)\");"
			puts "\t\t\t\}"
		}
		puts "\t\t\treturn(FILED_DEFAULT_TYPE);"
	}
	puts "\t\}"
}

# Declare victory
exit 0