File: ftypes.h

package info (click to toggle)
xmhtml 1.1.7-7
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,104 kB
  • ctags: 8,347
  • sloc: ansic: 68,063; makefile: 496; sh: 161; perl: 36
file content (129 lines) | stat: -rw-r--r-- 4,068 bytes parent folder | download | duplicates (10)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*****
* ftypes.h : list of file associates. Used by example_2 when displaying
*			directory contents.
*
* This file Version	$Revision: 1.1 $
*
* Creation date:		Wed Sep  9 03:46:55 CEST 1998
* Last modification: 	$Date$
* By:					$Author$
* Current State:		$State$
*
* Author:				XmHTML Developers Account
*
* Copyright (C) 1994-1998 by Ripley Software Development 
* All Rights Reserved
*
* This file is part of no particular project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU  General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
*  General Public License for more details.
*
* You should have received a copy of the GNU  General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*****/
/*****
* $Source$
*****/
/*****
* ChangeLog 
* $Log$
*
*****/ 

#ifndef _ftypes_h_
#define _ftypes_h_

/*****
* The first three of these file types are viewable directly with XmHTML.
* The DIR and OPENDIR types are read and , processed and displayed via
* XmHTML.
* All other types require an external viewer.
*****/
#define FILE_TXT		0		/* plain text document, XmHTML		*/
#define FILE_HTML		1		/* HTML document, XmHTML			*/
#define FILE_IMG		2		/* image, XmHTML					*/
#define FILE_DIR		3		/* a directory, XmHTML				*/
#define FILE_OPENDIR	4		/* the current directory, XmHTML	*/
#define FILE_BIN		5		/* a binary file					*/
#define FILE_UNKNOWN	6		/* all other types					*/

typedef struct{
	String ext;			/* list of extensions, separated by a | */
	int type;			/* type of file	*/
	String icon;		/* name of icon to use */
	String descrip;		/* accompying description */
#if 0
	String mime_type;	/* mime type for this entry */
#endif
}fileType;

/*****
* Note on extensions: case is ignored when determining the type of a file!
*****/

static fileType FileTypes[] = {
	/* file types known to example_2 */
	{ ".c", FILE_TXT, "text.document", "C program text" },
	{ ".cc|.c++", FILE_TXT, "text.document", "C++ program text" },
	{ ".h", FILE_TXT, "text.document", "C/C++ header file" },

	/* archive types */
	{ ".tar.gz|.tgz", FILE_BIN, "archive", "Gzipped tar archive" },
	{ ".tar.z|.tz", FILE_BIN, "archive", "Compressed tar archive" },
	{ ".tar", FILE_BIN, "archive", "Tar archive" },

	{ ".rpm.gz", FILE_BIN, "archive",
		"Gzipped Redhat Package Manager archive" },
	{ ".rpm.z", FILE_BIN, "archive",
		 "Compressed Redhat Package Manager archive" },
	{ ".rpm", FILE_BIN, "archive",
		 "Redhat Package Manager archive" },

	{ ".deb.gz", FILE_BIN, "archive",
		"Gzipped Debian archive" },
	{ ".deb.z", FILE_BIN, "archive",
		 "Compressed Debian archive" },
	{ ".deb", FILE_BIN, "archive",
		 "Debian archive" },

	/* compressed files */
	{ ".gz|.gzip", FILE_BIN, "compressed.document", "Gzipped file" },
	{ ".z", FILE_BIN, "compressed.document", "Compressed file" },

	{ ".o", FILE_BIN, "binary.document", "Compiled object module" },

	/* image types */
	{ ".gif", FILE_IMG, "image", "GIF image" },
	{ ".jpg|.jpeg", FILE_IMG, "image", "JPEG image" },
	{ ".png", FILE_IMG, "image", "PNG image" },
	{ ".xpm", FILE_IMG, "image", "X11 Pixmap image" },
	{ ".xbm", FILE_IMG, "image", "X11 Bitmap image" },

	/* document types */
	{ ".html|.htm", FILE_HTML, "html", "HTML document" },
	{ ".txt|.text", FILE_TXT, "text.document", "Plain text document"},
	{ ".doc", FILE_TXT, "document", "Other document"},

	/* directory types */
	{ "..", FILE_DIR, "previous", "Parent directory" },
	{ NULL, FILE_DIR, "folder", "Directory" },
	{ NULL, FILE_OPENDIR, "folder.open", "Current directory" },

	/* for all other documents */
	{ NULL, FILE_UNKNOWN, "unknown.document", "" },
};


/* Don't add anything after this endif! */
#endif /* _ftypes_h_ */