MIME(3)
okay bestie, this is MIME(3) from the Library Functions Manual β the mime / mailcap interface page. β¨ Itβs giving βsmall header, big Unix energy,β so letβs get into it.
πΈ NAME πΈ
mimeβ mime/mailcap interface
β¨ SYNOPSIS β¨
#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 are your little backstage pass to the MIME type database. π mimeopen returns a mime session handle, and that handle gets passed to all of the other routines. The flags argument is currently unused β iconic βwe left a seat openβ behaviour, no cap.
mimeclose closes the mime session. bye bestie π
mimeload loads the mime file named by path into the mime session. The flags argument may be one of these:
MIME_LISTβ thepathargument is a:separated list of pathnames, each of which is loaded. Non-existent files are ignoredMIME_LISTset. π«ΆMIME_REPLACEβ replace existing entries by new entries with the same type. Otherwise original entries take precedence. periodt.
More than one mime file can be loaded into a session, and the files are searched in load order. If path is 0, then the default mime file is loaded. π
mimelist lists the mime file contents on the sfio(3) stream sp. This is used for debugging mime entries. π΅οΈββοΈ
mimetype returns the type string for path. mimetype always returns a non-null string. If errors are encountered on path, then the return value will be error. π
also in the synopsis aremimeviewandmimesetβ this page doesnβt give them prose descriptions here, so Iβm not inventing any. we respect the source. π
π SEE ALSO π
file(1)mime(4)
thatβs the whole page, bestie β footer check: MIME(3) from the Library Functions Manual, and thereβs no separate source/version/date line on this page to report. bye πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms