|
Packit |
992a25 |
.fp 5 CW
|
|
Packit |
992a25 |
.de Af
|
|
Packit |
992a25 |
.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
|
|
Packit |
992a25 |
.if !?\\$4?? .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
|
|
Packit |
992a25 |
..
|
|
Packit |
992a25 |
.de aF
|
|
Packit |
992a25 |
.ie ?\\$3?? .ft \\$1
|
|
Packit |
992a25 |
.el \{\
|
|
Packit |
992a25 |
.ds ;G \&
|
|
Packit |
992a25 |
.nr ;G \\n(.f
|
|
Packit |
992a25 |
.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
|
|
Packit |
992a25 |
\\*(;G
|
|
Packit |
992a25 |
.ft \\n(;G \}
|
|
Packit |
992a25 |
..
|
|
Packit |
992a25 |
.de L
|
|
Packit |
992a25 |
.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
|
|
Packit |
992a25 |
..
|
|
Packit |
992a25 |
.de LR
|
|
Packit |
992a25 |
.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
|
|
Packit |
992a25 |
..
|
|
Packit |
992a25 |
.de RL
|
|
Packit |
992a25 |
.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
|
|
Packit |
992a25 |
..
|
|
Packit |
992a25 |
.de EX \" start example
|
|
Packit |
992a25 |
.ta 1i 2i 3i 4i 5i 6i
|
|
Packit |
992a25 |
.PP
|
|
Packit |
992a25 |
.RS
|
|
Packit |
992a25 |
.PD 0
|
|
Packit |
992a25 |
.ft 5
|
|
Packit |
992a25 |
.nf
|
|
Packit |
992a25 |
..
|
|
Packit |
992a25 |
.de EE \" end example
|
|
Packit |
992a25 |
.fi
|
|
Packit |
992a25 |
.ft
|
|
Packit |
992a25 |
.PD
|
|
Packit |
992a25 |
.RE
|
|
Packit |
992a25 |
.PP
|
|
Packit |
992a25 |
..
|
|
Packit |
992a25 |
.TH MIME 3
|
|
Packit |
992a25 |
.SH NAME
|
|
Packit |
992a25 |
mime \- mime/mailcap interface
|
|
Packit |
992a25 |
.SH SYNOPSIS
|
|
Packit |
992a25 |
.EX
|
|
Packit |
992a25 |
#include <mime.h>
|
|
Packit |
992a25 |
|
|
Packit |
992a25 |
Mime_t
|
|
Packit |
992a25 |
{
|
|
Packit |
992a25 |
unsigned long flags;
|
|
Packit |
992a25 |
};
|
|
Packit |
992a25 |
|
|
Packit |
992a25 |
Mime_t* mimeopen(unsigned long \fIflags\fP);
|
|
Packit |
992a25 |
void mimeclose(Mime_t* \fImime\fP);
|
|
Packit |
992a25 |
|
|
Packit |
992a25 |
int mimeload(Mime_t* \fImime\fP, const char* \fIpath\fP, unsigned long \fIflags\fP);
|
|
Packit |
992a25 |
int mimelist(Mime_t* \fImime\fP, Sfio_t* \fIsp\fP, const char* \fIpattern\fP);
|
|
Packit |
992a25 |
|
|
Packit |
992a25 |
char* mimeview(Mime_t* \fImime\fP, const char* \fIview\fP, const char* \fIname\fP, const char* \fItype\fP, const char* \fIopts\fP);
|
|
Packit |
992a25 |
int mimeset(Mime_t* \fImime\fP, char* \fIline\fP, unsigned long \fIflags\fP);
|
|
Packit |
992a25 |
.EE
|
|
Packit |
992a25 |
.SH DESCRIPTION
|
|
Packit |
992a25 |
These routines provide an interface to the MIME type database.
|
|
Packit |
992a25 |
.L mimeopen
|
|
Packit |
992a25 |
returns a mime session handle that is passed to all of the other routines.
|
|
Packit |
992a25 |
The
|
|
Packit |
992a25 |
.I flags
|
|
Packit |
992a25 |
argument is currently unused.
|
|
Packit |
992a25 |
.PP
|
|
Packit |
992a25 |
.L mimeclose
|
|
Packit |
992a25 |
closes the mime session.
|
|
Packit |
992a25 |
.PP
|
|
Packit |
992a25 |
.L mimeload
|
|
Packit |
992a25 |
loads the mime file named by
|
|
Packit |
992a25 |
.I path
|
|
Packit |
992a25 |
into the mime session.
|
|
Packit |
992a25 |
.I flags
|
|
Packit |
992a25 |
may be one of:
|
|
Packit |
992a25 |
.TP
|
|
Packit |
992a25 |
.L MIME_LIST
|
|
Packit |
992a25 |
The
|
|
Packit |
992a25 |
.I path
|
|
Packit |
992a25 |
argument is a
|
|
Packit |
992a25 |
.B :
|
|
Packit |
992a25 |
separated list of pathnames, each of which is loaded.
|
|
Packit |
992a25 |
Non-existent files are ignored
|
|
Packit |
992a25 |
.L MIME_LIST
|
|
Packit |
992a25 |
set.
|
|
Packit |
992a25 |
.TP
|
|
Packit |
992a25 |
.L MIME_REPLACE
|
|
Packit |
992a25 |
Replace existing entries by new entries with the same type.
|
|
Packit |
992a25 |
Otherwise original entries take precedence.
|
|
Packit |
992a25 |
.PP
|
|
Packit |
992a25 |
More than one mime file can be loaded into a session;
|
|
Packit |
992a25 |
the files are searched in load order.
|
|
Packit |
992a25 |
If
|
|
Packit |
992a25 |
.I path
|
|
Packit |
992a25 |
is
|
|
Packit |
992a25 |
.L 0
|
|
Packit |
992a25 |
then the default mime file is loaded.
|
|
Packit |
992a25 |
.PP
|
|
Packit |
992a25 |
.L mimelist
|
|
Packit |
992a25 |
lists the mime file contents on the
|
|
Packit |
992a25 |
.IR sfio (3)
|
|
Packit |
992a25 |
stream
|
|
Packit |
992a25 |
.IR sp .
|
|
Packit |
992a25 |
This is used for debugging mime entries.
|
|
Packit |
992a25 |
.PP
|
|
Packit |
992a25 |
.L mimetype
|
|
Packit |
992a25 |
returns the type string for
|
|
Packit |
992a25 |
.IR path .
|
|
Packit |
992a25 |
.L mimetype
|
|
Packit |
992a25 |
always returns a non-null string.
|
|
Packit |
992a25 |
If errors are encounterd on
|
|
Packit |
992a25 |
.I path
|
|
Packit |
992a25 |
then the return value will be
|
|
Packit |
992a25 |
.LR "error" .
|
|
Packit |
992a25 |
.SH "SEE ALSO"
|
|
Packit |
992a25 |
file(1), mime(4)
|