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 ***********************************************************************/
29 * magic interface definitions
33 #if !defined(__PROTO__)
34 #include <prototyped.h>
36 #if !defined(__LINKAGE__)
37 #define __LINKAGE__ /* 2004-08-11 transition */
45 #define MAGIC_VERSION 19961031L
48 #define MAGIC_FILE "lib/file/magic"
52 #define MAGIC_DIR "lib/file"
55 #define MAGIC_FILE_ENV "MAGICFILE"
57 #define MAGIC_MIME (1<<0) /* magictype returns MIME type */
58 #define MAGIC_VERBOSE (1<<1) /* verbose magic file errors */
60 #define MAGIC_USER (1L<<16) /* first user flag bit */
65 typedef struct Magicdisc_s
67 unsigned long version
; /* interface version */
68 unsigned long flags
; /* MAGIC_* flags */
69 Error_f errorf
; /* error function */
72 typedef struct Magic_s
74 const char* id
; /* library id string */
76 #ifdef _MAGIC_PRIVATE_
82 #if _BLD_ast && defined(__EXPORT__)
84 #define __MANGLE__ __LINKAGE__ __EXPORT__
87 extern __MANGLE__ Magic_t
* magicopen
__PROTO__((Magicdisc_t
*));
88 extern __MANGLE__
int magicload
__PROTO__((Magic_t
*, const char*, unsigned long));
89 extern __MANGLE__
int magiclist
__PROTO__((Magic_t
*, Sfio_t
*));
90 extern __MANGLE__
char* magictype
__PROTO__((Magic_t
*, Sfio_t
*, const char*, struct stat
*));
91 extern __MANGLE__
int magicclose
__PROTO__((Magic_t
*));
94 #define __MANGLE__ __LINKAGE__