Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / lib / DtHelp / il / ilefs.h
1 /* $XConsortium: ilefs.h /main/3 1995/10/23 15:47:11 rswiston $ */
2 /**---------------------------------------------------------------------
3 ***     
4 ***    file:           ilefs.h
5 ***
6 ***    description:    Public include file for Image Library (IL) EFS support.
7 ***
8 ***     
9 ***    (c)Copyright 1992 Hewlett-Packard Co.
10 ***    
11 ***                             RESTRICTED RIGHTS LEGEND
12 ***    Use, duplication, or disclosure by the U.S. Government is subject to
13 ***    restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
14 ***    Technical Data and Computer Software clause in DFARS 252.227-7013.
15 ***                             Hewlett-Packard Company
16 ***                             3000 Hanover Street
17 ***                             Palo Alto, CA 94304 U.S.A.
18 ***    Rights for non-DOD U.S. Government Departments and Agencies are as set
19 ***    forth in FAR 52.227-19(c)(1,2).
20 ***
21 ***-------------------------------------------------------------------*/
22
23
24
25 #ifndef ILEFS_H
26 #define ILEFS_H 
27
28 #ifndef IL_H
29 #include "il.h"
30 #endif
31
32 #ifndef NeedFunctionPrototypes
33 #if defined(FUNCPROTO) || defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
34 #define NeedFunctionPrototypes 1
35 #else
36 #define NeedFunctionPrototypes 0
37 #endif /* __STDC__ */
38 #endif /* NeedFunctionPrototypes */
39
40 #ifndef NeedWidePrototypes
41 #if defined(NARROWPROTO)
42 #define NeedWidePrototypes 0
43 #else
44 #define NeedWidePrototypes 1
45 #endif
46 #endif
47
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51
52
53     /* openMode to ilEFSOpen() */
54 #define IL_EFS_READ                 0
55 #define IL_EFS_READ_SEQUENTIAL      1
56 #define IL_EFS_WRITE                2
57
58     /* readMode to ilEFSReadImage() */
59 #define IL_EFS_READ_MAIN            0
60 #define IL_EFS_READ_MASK            1
61
62     /* masks for bits in ilEFSFileInfo/ilEFSFileTypeInfo.attributes */
63 #define IL_EFS_MULTI_PAGE_READS     (1<<0)
64 #define IL_EFS_MULTI_PAGE_WRITES    (1<<1)
65 #define IL_EFS_MASK_READS           (1<<2)
66 #define IL_EFS_MASK_WRITES          (1<<3)
67 #define IL_EFS_SCALEABLE_READS      (1<<4)
68
69     /* masks for bits in ilEFSPageInfo.attributes */
70 #define IL_EFS_EOF                  (1<<0)
71 #define IL_EFS_MASKED               (1<<1)
72 #define IL_EFS_SCALEABLE            (1<<2)
73
74     /* masks for bits in searchOptions to ilEFSOpen() */
75 #define IL_EFS_BY_TYPE_NAME         (1<<0)
76 #define IL_EFS_BY_EXTENSION         (1<<1)
77 #define IL_EFS_BY_CHECKING          (1<<2)
78 #define IL_EFS_READ_SEARCH          (IL_EFS_BY_EXTENSION | IL_EFS_BY_CHECKING)
79
80     /* String lengths; all values include trailing null. */
81 #define IL_EFS_MAX_NAME_CHARS       12
82 #define IL_EFS_MAX_DISPLAY_NAME_CHARS 24
83 #define IL_EFS_MAX_EXTENSION_CHARS  8
84
85 #define IL_EFS_MAX_EXTENSIONS       8
86
87 #define IL_EFS_TYPE_RESERVED_SIZE   10
88
89
90 typedef ilObject ilEFSFile;
91 typedef ilObject ilEFSFileType;
92
93 typedef struct {
94     ilEFSFileType       fileType;
95     unsigned short      openMode;
96     unsigned short      howFound;
97     unsigned long       attributes;
98     long                nPages;
99     ilShortBool         inUse;
100     short               reserved [21];
101     } ilEFSFileInfo;
102
103 typedef struct {
104     unsigned long       attributes;
105     long                page;
106     long                width, height;
107     long                xRes, yRes;
108     ilImageDes          des;
109     ilImageFormat       format;
110     } ilEFSPageInfo;
111
112 typedef struct {
113     char                name [IL_EFS_MAX_NAME_CHARS];
114     char                displayName [IL_EFS_MAX_DISPLAY_NAME_CHARS];
115     unsigned short      checkOrder;
116     short               nExtensions;
117     char                extensions [IL_EFS_MAX_EXTENSIONS] 
118                                    [IL_EFS_MAX_EXTENSION_CHARS];
119     unsigned long       openModes;
120     unsigned long       attributes;
121     ilBool            (*Escape)();
122     ilPtr             (*Open)();
123     ilBool            (*Seek)();
124     ilBool            (*GetPageInfo)();
125     ilBool            (*ReadImage)();
126     ilBool            (*WriteImage)();
127     ilBool            (*Close)();
128     ilBool            (*Destroy)();
129     long                reserved [IL_EFS_TYPE_RESERVED_SIZE];
130     } ilEFSFileTypeInfo;
131
132
133 extern ilEFSFile ilEFSOpen (
134 #if NeedFunctionPrototypes
135     ilContext           context,
136     char               *fileName,
137     unsigned int        openMode,
138     unsigned long       searchOptions,
139     char               *typeName,
140     void               *pOptions
141 #endif
142     );
143
144 extern ilBool ilEFSGetFileInfo (
145 #if NeedFunctionPrototypes
146     ilEFSFile          file,
147     ilEFSFileInfo     *pInfo                   /* RETURNED */
148 #endif
149     );
150
151 extern ilBool ilEFSSeek (
152 #if NeedFunctionPrototypes
153     ilEFSFile           file,
154     long                page,
155     void               *pOptions
156 #endif
157     );
158
159 extern ilBool ilEFSGetPageInfo (
160 #if NeedFunctionPrototypes
161     ilEFSFile          file,
162     ilEFSPageInfo     *pInfo                   /* RETURNED */
163 #endif
164     );
165
166 extern ilBool ilEFSReadImage (
167 #if NeedFunctionPrototypes
168     ilPipe              pipe,
169     ilEFSFile           file,
170     unsigned int        readMode,
171     long                width,
172     long                height,
173     void               *pOptions
174 #endif
175     );
176
177 extern ilBool ilEFSWriteImage (
178 #if NeedFunctionPrototypes
179     ilPipe              pipe,
180     ilEFSFile           file,
181     long                xRes,
182     long                yRes,
183     ilClientImage       maskImage,
184     void               *pOptions
185 #endif
186     );
187
188 extern ilBool ilEFSListFileTypes (
189 #if NeedFunctionPrototypes
190     ilContext           context,
191     int                *pNFileTypes,            /* RETURNED */
192     ilEFSFileType     **pFileTypes              /* RETURNED */
193 #endif
194     );
195
196 extern ilBool ilEFSGetFileTypeInfo (
197 #if NeedFunctionPrototypes
198     ilEFSFileType       fileType,
199     ilEFSFileTypeInfo  *pInfo                   /* RETURNED */
200 #endif
201     );
202
203 extern ilEFSFileType ilEFSAddFileType (
204 #if NeedFunctionPrototypes
205     ilContext           context,
206     ilEFSFileTypeInfo  *pInfo,
207     void               *pOptions
208 #endif
209     );
210
211 #ifdef __cplusplus
212 }                                /* for C++ V2.0 */
213 #endif
214
215 #endif
216