xref: /titanic_41/usr/src/lib/libast/common/man/mime.3 (revision 4445fffbbb1ea25fd0e9ea68b9380dd7a6709025)
.fp 5 CW .. .nr ;G \\n(.f .Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" \\*(;G .. .aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" .. .aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" .. .aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" ..

0

..

..

MIME 3
NAME
mime - mime/mailcap interface
SYNOPSIS
.EX #include <mime.h> Mime_t { unsigned long flags; }; Mime_t* mimeopen(unsigned long flags); void mimeclose(Mime_t* mime); int mimeload(Mime_t* mime, const char* path, unsigned long flags); int mimelist(Mime_t* mime, Sfio_t* sp, const char* pattern); char* mimeview(Mime_t* mime, const char* view, const char* name, const char* type, const char* opts); int mimeset(Mime_t* mime, char* line, unsigned long flags);
DESCRIPTION
These routines provide an interface to the MIME type database. .L mimeopen returns a mime session handle that is passed to all of the other routines. The flags argument is currently unused.

.L mimeclose closes the mime session.

.L mimeload loads the mime file named by path into the mime session. flags may be one of:

.L MIME_LIST The path argument is a : separated list of pathnames, each of which is loaded. Non-existent files are ignored .L MIME_LIST set.

.L MIME_REPLACE Replace existing entries by new entries with the same type. Otherwise original entries take precedence.

More than one mime file can be loaded into a session; the files are searched in load order. If path is .L 0 then the default mime file is loaded.

.L mimelist lists the mime file contents on the sfio (3) stream sp . This is used for debugging mime entries.

.L mimetype returns the type string for path . .L mimetype always returns a non-null string. If errors are encounterd on path then the return value will be .LR "error" .

"SEE ALSO"
file(1), mime(4)