2 /* : : generated by proto : : */
3 /***********************************************************************
5 * This software is part of the ast package *
6 * Copyright (c) 1985-2010 AT&T Intellectual Property *
7 * and is licensed under the *
8 * Common Public License, Version 1.0 *
9 * by AT&T Intellectual Property *
11 * A copy of the License is available at *
12 * http://www.opensource.org/licenses/cpl1.0.txt *
13 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
15 * Information and Software Systems Research *
19 * Glenn Fowler <gsf@research.att.com> *
20 * David Korn <dgk@research.att.com> *
21 * Phong Vo <kpv@research.att.com> *
23 ***********************************************************************/
27 * mime/mailcap interface
31 #if !defined(__PROTO__)
32 #include <prototyped.h>
34 #if !defined(__LINKAGE__)
35 #define __LINKAGE__ /* 2004-08-11 transition */
43 #define MIME_VERSION 19970717L
46 #define MIME_FILES "~/.mailcap:/usr/local/etc/mailcap:/usr/etc/mailcap:/etc/mailcap:/etc/mail/mailcap:/usr/public/lib/mailcap"
49 #define MIME_FILES_ENV "MAILCAP"
51 #define MIME_LIST (1<<0) /* mimeload arg is : list */
52 #define MIME_NOMAGIC (1<<1) /* no magic for mimetype() */
53 #define MIME_PIPE (1<<2) /* mimeview() io is piped */
54 #define MIME_REPLACE (1<<3) /* replace existing definition */
56 #define MIME_USER (1L<<16) /* first user flag bit */
59 typedef struct Mime_s Mime_t
;
62 typedef struct Mimedisc_s Mimedisc_t
;
64 typedef int (*Mimevalue_f
) __PROTO__((Mime_t
*, __V_
*, char*, size_t, Mimedisc_t
*));
68 unsigned long version
; /* interface version */
69 unsigned long flags
; /* MIME_* flags */
70 Error_f errorf
; /* error function */
71 Mimevalue_f valuef
; /* value extraction function */
76 const char* id
; /* library id string */
84 #if _BLD_ast && defined(__EXPORT__)
86 #define __MANGLE__ __LINKAGE__ __EXPORT__
89 extern __MANGLE__ Mime_t
* mimeopen
__PROTO__((Mimedisc_t
*));
90 extern __MANGLE__
int mimeload
__PROTO__((Mime_t
*, const char*, unsigned long));
91 extern __MANGLE__
int mimelist
__PROTO__((Mime_t
*, Sfio_t
*, const char*));
92 extern __MANGLE__
int mimeclose
__PROTO__((Mime_t
*));
93 extern __MANGLE__
int mimeset
__PROTO__((Mime_t
*, char*, unsigned long));
94 extern __MANGLE__
char* mimetype
__PROTO__((Mime_t
*, Sfio_t
*, const char*, struct stat
*));
95 extern __MANGLE__
char* mimeview
__PROTO__((Mime_t
*, const char*, const char*, const char*, const char*));
96 extern __MANGLE__
int mimehead
__PROTO__((Mime_t
*, __V_
*, size_t, size_t, char*));
97 extern __MANGLE__
int mimecmp
__PROTO__((const char*, const char*, char**));
100 #define __MANGLE__ __LINKAGE__