8354 sync regcomp(3C) with upstream (fix make catalog)
[unleashed/tickless.git] / usr / src / lib / libast / i386 / include / ast / magic.h
blob8683016e80e9ec8710649f7b193b2a5b7090aabb
2 /* : : generated by proto : : */
3 /***********************************************************************
4 * *
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 *
10 * *
11 * A copy of the License is available at *
12 * http://www.opensource.org/licenses/cpl1.0.txt *
13 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
14 * *
15 * Information and Software Systems Research *
16 * AT&T Research *
17 * Florham Park NJ *
18 * *
19 * Glenn Fowler <gsf@research.att.com> *
20 * David Korn <dgk@research.att.com> *
21 * Phong Vo <kpv@research.att.com> *
22 * *
23 ***********************************************************************/
26 * Glenn Fowler
27 * AT&T Research
29 * magic interface definitions
32 #ifndef _MAGIC_H
33 #if !defined(__PROTO__)
34 #include <prototyped.h>
35 #endif
36 #if !defined(__LINKAGE__)
37 #define __LINKAGE__ /* 2004-08-11 transition */
38 #endif
40 #define _MAGIC_H
42 #include <sfio.h>
43 #include <ls.h>
45 #define MAGIC_VERSION 19961031L
47 #ifndef MAGIC_FILE
48 #define MAGIC_FILE "lib/file/magic"
49 #endif
51 #ifndef MAGIC_DIR
52 #define MAGIC_DIR "lib/file"
53 #endif
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 */
62 struct Magic_s;
63 struct Magicdisc_s;
65 typedef struct Magicdisc_s
67 unsigned long version; /* interface version */
68 unsigned long flags; /* MAGIC_* flags */
69 Error_f errorf; /* error function */
70 } Magicdisc_t;
72 typedef struct Magic_s
74 const char* id; /* library id string */
76 #ifdef _MAGIC_PRIVATE_
77 _MAGIC_PRIVATE_
78 #endif
80 } Magic_t;
82 #if _BLD_ast && defined(__EXPORT__)
83 #undef __MANGLE__
84 #define __MANGLE__ __LINKAGE__ __EXPORT__
85 #endif
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*));
93 #undef __MANGLE__
94 #define __MANGLE__ __LINKAGE__
96 #endif