]> git.r.bdr.sh - rbdr/mobius/blob - hotline/file_types.go
Implement some special case file descriptions
[rbdr/mobius] / hotline / file_types.go
1 package hotline
2
3 type fileType struct {
4 TypeCode string // 4 byte type code used in file transfers
5 CreatorCode string // 4 byte creator code used in file transfers
6 }
7
8 var defaultFileType = fileType{
9 TypeCode: "TEXT",
10 CreatorCode: "TTXT",
11 }
12
13 var fileTypes = map[string]fileType{
14 "sit": {
15 TypeCode: "SIT!",
16 CreatorCode: "SIT!",
17 },
18 "pdf": {
19 TypeCode: "PDF ",
20 CreatorCode: "CARO",
21 },
22 "gif": {
23 TypeCode: "GIFf",
24 CreatorCode: "ogle",
25 },
26 "txt": {
27 TypeCode: "TEXT",
28 CreatorCode: "ttxt",
29 },
30 "zip": {
31 TypeCode: "ZIP ",
32 CreatorCode: "SITx",
33 },
34 "tgz": {
35 TypeCode: "Gzip",
36 CreatorCode: "SITx",
37 },
38 "hqx": {
39 TypeCode: "TEXT",
40 CreatorCode: "SITx",
41 },
42 "jpg": {
43 TypeCode: "JPEG",
44 CreatorCode: "ogle",
45 },
46 "img": {
47 TypeCode: "rohd",
48 CreatorCode: "ddsk",
49 },
50 "sea": {
51 TypeCode: "APPL",
52 CreatorCode: "aust",
53 },
54 "mov": {
55 TypeCode: "MooV",
56 CreatorCode: "TVOD",
57 },
58 "incomplete": { // Partial file upload
59 TypeCode: "HTft",
60 CreatorCode: "HTLC",
61 },
62 }
63
64 // A small number of type codes are displayed in the GetInfo window with a friendly name instead of the 4 letter code
65 var friendlyCreatorNames = map[string]string{
66 "fldr": "Folder",
67 "flda": "Folder Alias",
68 "HTft": "Incomplete File",
69 "SIT!": "StuffIt Archive",
70 "TEXT": "Text File",
71 }