mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 00:32:11 +01:00
base: add WUFFS_BASE__MIME_TYPE__ETC
This commit is contained in:
1 parent
b2e6da3024
commit
89b7cc7a36
5 files changed
+58
No files matched your search
@@ -47,6 +47,8 @@
|
||||
# directory of the github.com/google/wuffs repository. That same directory also
|
||||
# holds a base38-and-fourcc.md file that elaborates on base38 encoding.
|
||||
|
||||
0x09CC62_556F2000 2757997502603264 appl/brot/.. application/brotli
|
||||
0x09CC62_607F1000 2757997688197120 appl/defl/.. application/deflate
|
||||
0x09CC62_6933B000 2757997834252288 appl/epub/.. application/epub+zip
|
||||
0x09CC62_784EA000 2757998087675904 appl/gzip/.. application/gzip
|
||||
0x09CC62_880DB9BE 2757998351858110 appl/java/ar application/java-archive
|
||||
@@ -130,6 +132,7 @@
|
||||
0x09CC62_E70E1800 2757999945717760 appl/xhtm/.. application/xhtml+xml
|
||||
0x09CC62_E73A1800 2757999948601344 appl/xiso/.. application/x-iso9660-image
|
||||
0x09CC62_E7AC4000 2757999956082688 appl/xlat/.. application/x-latex
|
||||
0x09CC62_E7C9B800 2757999958013952 appl/xlzm/.. application/x-lzma
|
||||
0x09CC62_E7E58000 2757999959834624 appl/xml./.. application/xml
|
||||
0x09CC62_E7E5F000 2757999959863296 appl/xmld/.. application/xml-dtd
|
||||
0x09CC62_E7EDD1BC 2757999960379836 appl/xms./ap application/x-ms-application
|
||||
@@ -144,6 +147,8 @@
|
||||
0x09CC62_E91A22EA 2757999980061418 appl/xtex/in application/x-texinfo
|
||||
0x09CC62_E9E68000 2757999993454592 appl/xxz./.. application/x-xz
|
||||
0x09CC62_F49B4000 2758000173072384 appl/zip./.. application/zip
|
||||
0x09CC62_F51AB000 2758000181424128 appl/zlib/.. application/zlib
|
||||
0x09CC62_F663B000 2758000202985472 appl/zstd/.. application/zstd
|
||||
0x09CC62_FAA35800 2758000274266112 appl/~exa/.. application/pua.example
|
||||
0x09CC62_FE887DA3 2758000339615139 appl/~~~~/~~ application/*
|
||||
|
||||
|
||||
@@ -682,6 +682,13 @@ typedef struct wuffs_base__transform__output__struct {
|
||||
|
||||
// --------
|
||||
|
||||
// Various MIME types in 4/4/2 base-38 encoding, per
|
||||
// doc/note/enumerated-media-types.txt
|
||||
|
||||
// ¡ INSERT MimeTypes.
|
||||
|
||||
// --------
|
||||
|
||||
// Quirks.
|
||||
|
||||
// ¡ INSERT Quirks.
|
||||
|
||||
@@ -316,6 +316,32 @@ func insertBaseAllPublicH(buf *buffer) error {
|
||||
}
|
||||
return nil
|
||||
},
|
||||
"// ¡ INSERT MimeTypes.\n": func(b *buffer) error {
|
||||
for i, z := range builtin.MimeTypes {
|
||||
if i != 0 {
|
||||
b.writeb('\n')
|
||||
}
|
||||
strBuf := make([]byte, len(z.Name))
|
||||
for i := range strBuf {
|
||||
c := z.Name[i]
|
||||
if ('a' <= c) && (c <= 'z') {
|
||||
strBuf[i] = c &^ 0x20
|
||||
} else if (('A' <= c) && (c <= 'Z')) || (('0' <= c) && (c <= '9')) {
|
||||
strBuf[i] = c
|
||||
} else {
|
||||
strBuf[i] = '_'
|
||||
}
|
||||
}
|
||||
b.printf("// base38(%q) = 0x%X_%08X\n#define WUFFS_BASE__MIME_TYPE__%s %d\n",
|
||||
z.Base38String,
|
||||
z.Base38Number>>32,
|
||||
z.Base38Number&0xFFFFFFFF,
|
||||
string(strBuf),
|
||||
z.Base38Number,
|
||||
)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
"// ¡ INSERT Quirks.\n": func(b *buffer) error {
|
||||
first := true
|
||||
for _, z := range builtin.Consts {
|
||||
|
||||
@@ -94,6 +94,15 @@ var FourCCs = [...][2]string{
|
||||
{"ZSTD", "Zstandard"},
|
||||
}
|
||||
|
||||
var MimeTypes = [...]struct {
|
||||
Base38Number uint64
|
||||
Base38String string
|
||||
Name string
|
||||
}{
|
||||
{0x09CC62_607F1000, "appl/defl/..", "application/deflate"},
|
||||
{0x09CC62_A9E37800, "appl/octe/..", "application/octet-stream"},
|
||||
}
|
||||
|
||||
var Consts = [...]struct {
|
||||
Type t.ID
|
||||
Value string
|
||||
|
||||
@@ -964,6 +964,17 @@ typedef struct wuffs_base__transform__output__struct {
|
||||
|
||||
// --------
|
||||
|
||||
// Various MIME types in 4/4/2 base-38 encoding, per
|
||||
// doc/note/enumerated-media-types.txt
|
||||
|
||||
// base38("appl/defl/..") = 0x9CC62_607F1000
|
||||
#define WUFFS_BASE__MIME_TYPE__APPLICATION_DEFLATE 2757997688197120
|
||||
|
||||
// base38("appl/octe/..") = 0x9CC62_A9E37800
|
||||
#define WUFFS_BASE__MIME_TYPE__APPLICATION_OCTET_STREAM 2757998919514112
|
||||
|
||||
// --------
|
||||
|
||||
// Quirks.
|
||||
|
||||
#define WUFFS_BASE__QUIRK_IGNORE_CHECKSUM 1
|
||||
|
||||
Reference in new issue
Block a user