dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libast / common / include / magic.h
blob4ea4393840a74182238c4d7eaf0edd7d1880253a
1 /***********************************************************************
2 * *
3 * This software is part of the ast package *
4 * Copyright (c) 1985-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
8 * *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
12 * *
13 * Information and Software Systems Research *
14 * AT&T Research *
15 * Florham Park NJ *
16 * *
17 * Glenn Fowler <gsf@research.att.com> *
18 * David Korn <dgk@research.att.com> *
19 * Phong Vo <kpv@research.att.com> *
20 * *
21 ***********************************************************************/
22 #pragma prototyped
24 * Glenn Fowler
25 * AT&T Research
27 * magic interface definitions
30 #ifndef _MAGIC_H
31 #define _MAGIC_H
33 #include <sfio.h>
34 #include <ls.h>
36 #define MAGIC_VERSION 19961031L
38 #ifndef MAGIC_FILE
39 #define MAGIC_FILE "lib/file/magic"
40 #endif
42 #ifndef MAGIC_DIR
43 #define MAGIC_DIR "lib/file"
44 #endif
46 #define MAGIC_FILE_ENV "MAGICFILE"
48 #define MAGIC_MIME (1<<0) /* magictype returns MIME type */
49 #define MAGIC_VERBOSE (1<<1) /* verbose magic file errors */
51 #define MAGIC_USER (1L<<16) /* first user flag bit */
53 struct Magic_s;
54 struct Magicdisc_s;
56 typedef struct Magicdisc_s
58 unsigned long version; /* interface version */
59 unsigned long flags; /* MAGIC_* flags */
60 Error_f errorf; /* error function */
61 } Magicdisc_t;
63 typedef struct Magic_s
65 const char* id; /* library id string */
67 #ifdef _MAGIC_PRIVATE_
68 _MAGIC_PRIVATE_
69 #endif
71 } Magic_t;
73 #if _BLD_ast && defined(__EXPORT__)
74 #define extern __EXPORT__
75 #endif
77 extern Magic_t* magicopen(Magicdisc_t*);
78 extern int magicload(Magic_t*, const char*, unsigned long);
79 extern int magiclist(Magic_t*, Sfio_t*);
80 extern char* magictype(Magic_t*, Sfio_t*, const char*, struct stat*);
81 extern int magicclose(Magic_t*);
83 #undef extern
85 #endif