This file is indexed.

/usr/include/libwmf/types.h is in libwmf-dev 0.2.8.4-10ubuntu1.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
/* libwmf (<libwmf/types.h>): library for wmf conversion
   Copyright (C) 2000 - various; see CREDITS, ChangeLog, and sources

   The libwmf Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   The libwmf Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with the libwmf Library; see the file COPYING.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */


#ifndef LIBWMF_TYPES_H
#define LIBWMF_TYPES_H

#include <stdio.h>
#include <sys/types.h>

#include <ft2build.h>
#include FT_FREETYPE_H

#include <libwmf/fund.h>

#ifdef __cplusplus
extern "C" {
#endif

/* API Enumeration defs
 */

/**
 * \b wmf_bool_t is the (enumeration) type used for boolean
 */
typedef enum _wmf_bool_t
{	wmf_false = 0,	/**< False */
	wmf_true	/**< True */
} wmf_bool_t;

/**
 * \b wmf_error_t is the (enumeration) type used for the library error state.
 */
typedef enum _wmf_error_t
{	wmf_E_None = 0,		/**< No error. */
	wmf_E_InsMem,		/**< An attempt to allocate memory has failed. */
	wmf_E_BadFile,		/**< Attempt to open an unreadable file, or to read from an unopened file. */
	wmf_E_BadFormat,	/**< The metafile, if indeed it is a metafile, has been corrupted. */
	wmf_E_EOF,		/**< An unexpected end-of-file has been reached. */
	wmf_E_DeviceError,	/**< Device-layer error. */
	wmf_E_Glitch,		/**< Programmer's error. Sorry. */
	wmf_E_Assert,		/**< Internally forced error. */
	wmf_E_UserExit		/**< The status function has returned non-zero; exit is premature. */
} wmf_error_t;

/**
 * \b wmf_page_t is the (enumeration) type used to indicate page size.
 */
typedef enum _wmf_page_t
{	wmf_P_A5,	/**< A5 (420 x 595) */
	wmf_P_A4,	/**< A4 (595 x 842) */
	wmf_P_A3,	/**< A3 (842 x 1191) */
	wmf_P_A2,	/**< A2 (1191 x 1684) */
	wmf_P_A1,	/**< A1 (1684 x 2384) */
	wmf_P_A0,	/**< A0 (2384 x 3370) */
	wmf_P_B5,	/**< B5 (516 x 729) */
	wmf_P_Letter,	/**< Letter (612 x 792) */
	wmf_P_Legal,	/**< Legal (612 x 1008) */
	wmf_P_Ledger,	/**< Ledger (1224 x 792) */
	wmf_P_Tabloid	/**< Tabloid (792 x 1224) */
} wmf_page_t;

/**
 * \b wmf_image_t is the (enumeration) type used to indicate image type.
 */
typedef enum _wmf_image_t
{	wmf_I_gd
} wmf_image_t;

/**
 * User redefinable function for input-stream access:
 * 
 * wmfRead: returns unsigned char cast to int, or EOF
 * 
 * See \b wmf_bbuf_input().
 */
typedef int  (*wmfRead) (void*);

/**
 * User redefinable function for input-stream access:
 * 
 * wmfSeek: returns (-1) on error, else 0
 * 
 * See \b wmf_bbuf_input().
 */
typedef int  (*wmfSeek) (void*,long);

/**
 * User redefinable function for input-stream access:
 * 
 * wmfTell: returns (-1) on error, else pos
 * 
 * See \b wmf_bbuf_input().
 */
typedef long (*wmfTell) (void*);

/**
 * User redefinable function for character-based output-stream:
 * 
 * wmfSPutS: returns EOF on error, else 0
 * 
 * See \b wmfStream.
 */
typedef int (*wmfSPutS) (char*,void*);

/**
 * User redefinable function for character-based output-stream:
 * 
 * wmfReset: resets stream to start; returns non-zero on failure
 * 
 * See \b wmfStream.
 */
typedef int (*wmfReset) (void*);

/**
 * User definable function indicating progress.
 * 
 * @param context  handle for user data
 * @param fraction fraction of metafile parsed so far
 * 
 * @return Should return non-zero only if premature exit is required for whatever reason.
 * 
 * See \b wmf_status_function().
 */
typedef int (*wmfStatus) (void* context,float fraction);

/* API types
 */

typedef struct _wmfD_Coord             wmfD_Coord;
typedef struct _wmfD_Rect              wmfD_Rect;

typedef struct _wmfMapping             wmfMapping;
typedef struct _wmfFontMap             wmfFontMap;

typedef struct _wmfHead                wmfHead; /* Bit nonsensical having these three at all ?? */
typedef struct _wmfMetaHeader          wmfMetaHeader,*wmfFile;
typedef struct _wmfPlaceableMetaHeader wmfPlaceableMetaHeader;

typedef struct _wmfAPI_Options         wmfAPI_Options;
typedef struct _wmfAPI                 wmfAPI;

typedef struct _wmfStream              wmfStream;

typedef struct _wmfImage               wmfImage;

typedef struct _wmfAttributes          wmfAttributes;
typedef struct _wmfAttributeStore      wmfAttributeStore;

/* API Structure defs
 */

/**
 * Device coordinate.
 */
struct _wmfD_Coord
{	float x;
	float y;
};

/**
 * Device rectangle.
 */
struct _wmfD_Rect
{	/**
	 * Device coordinate of top left corner (TL.x < BR.x, TL.y < BR.y).
	 */
	wmfD_Coord TL;

	/**
	 * Device coordinate of bottom right corner.
	 */
	wmfD_Coord BR;
};

struct _wmfMapping
{	char* name;
	char* mapping;

	/* I had been hoping to keep FT out of this file, but
	 * it seems easier just to use the FT encoding defs
	 * rather than create some kind of wrapper...
	 */
	FT_Encoding encoding;
};

struct _wmfFontMap
{	char* name;       /* wmf font name */

	char* normal;     /* postscript font names */
	char* italic;
	char* bold;
	char* bolditalic;
};

/**
 * Structure containing list of XML attributes
 */
struct _wmfAttributes
{	char * name;

	char ** atts;

	unsigned long count;
	unsigned long max;

	unsigned char * buffer;

	unsigned long length;
	unsigned long offset;
};

/**
 * Structure containing list of lists of XML attributes
 */
struct _wmfAttributeStore
{	wmfAttributes * attrlist;

	unsigned long count;
	unsigned long max;
};

/**
 * @internal
 */
struct _wmfPlaceableMetaHeader
{	U32 Key;      /* Magic number (always 9AC6CDD7h) */
	U16 Handle;   /* Metafile HANDLE number (always 0) */
	S16 Left;     /* Left coordinate in metafile units */
	S16 Top;      /* Top coordinate in metafile units */
	S16 Right;    /* Right coordinate in metafile units */
	S16 Bottom;   /* Bottom coordinate in metafile units */
	U16 Inch;     /* Number of metafile units per inch */
	U32 Reserved; /* Reserved (always 0) */
	U16 Checksum; /* Checksum value for previous 10 U16s */
};

/**
 * @internal
 */
struct _wmfHead
{	U16 FileType;      /* Type of metafile (0=memory, 1=disk) */
	U16 HeaderSize;    /* Size of header in U16S (always 9) */
	U16 Version;       /* Version of Microsoft Windows used */
	U32 FileSize;      /* Total size of the metafile in U16s */
	U16 NumOfObjects;  /* Number of objects in the file */
	U32 MaxRecordSize; /* The size of largest record in U16s */
	U16 NumOfParams;   /* Not Used (always 0) */
};

/**
 * @internal
 */
struct _wmfMetaHeader
{	wmfHead*                wmfheader;
	wmfPlaceableMetaHeader* pmh;

	FILE* filein;

	long pos;

	int placeable;
};

struct _wmfAPI_Options
{	void* context;

	void* (*malloc)  (void* context,size_t size);
	void* (*realloc) (void* context,void* mem,size_t size);
	void  (*free)    (void* context,void* mem);

	int    argc;
	char** argv;

	char** fontdirs; /* NULL-terminated list of directories to search for font files */

	struct
	{	wmfFontMap* wmf; /* {0,*}-terminated list: wmf-font-name -> ps-font-name */
		wmfMapping* sub; /* {0,*}-terminated list: wmf-font-name substring equiv */
		wmfMapping* ps;  /* {0,*}-terminated list: ps-font-name -> pfb-file-name */
	} font;

	char* sys_fontmap_file;
	char* xtra_fontmap_file;
	char* gs_fontmap_file;

	char* write_file;

	void (*function) (wmfAPI*);

	char*  module;
	char** dirs;

	FILE* debug_out;
	FILE* error_out;
};

/**
 * @internal
 */
struct _wmfAPI
{	wmf_error_t err; /* current state of API; wmf_E_None, hopefully... */

	wmfHead                Head;  /* structures containing meta file general properties... */
	wmfPlaceableMetaHeader PlaceableMetaHeader;
	wmfMetaHeader          MetaHeader;
	wmfFile                File;

	FILE* debug_out; /* Output streams for debugger & error reports... */
	FILE* error_out;

	wmfAttributeStore store;

	void* write_data; /* Output stream data for --wmf-write=<file> */

	void* user_data; /* These are hooks for data to hang on to... */

	void* device_data;
	void* player_data;
	void* buffer_data;
	void* memory_data;

	void* function_reference;

	void* font_data;

	char** fonts; /* NULL-terminated list of fonts loaded during wmf_scan () */

	void* color_data;

	struct /* Input stream functions... */
	{	wmfRead read;
		wmfSeek seek;
		wmfTell tell;
	} bbuf;

	struct
	{	void* context;

		wmfStatus function; /* return non-zero if premature exit desired */
	} status;

	struct
	{	unsigned long length;

		char* buffer;
	} string_buffer; /* this is a general purpose char buffer */

	unsigned long flags; /* General flags... */
};

/**
 * WMF_ERROR_STATE(wmfAPI* API) -> (wmf_error_t) library error state
 */
#define WMF_ERROR_STATE(Z) (((wmfAPI*)(Z))->err)

/**
 * Structure describing user-definable character-based output stream.
 * 
 * \b wmf_stream_create() and \b wmf_ztream_create() both return pointers to \b wmfStream objects, but
 * an application can create its own implementation if preferred.
 * 
 * @verbatim
typedef int (*wmfSPutS) (char* str,void* context);
typedef int (*wmfReset) (void* context);
@endverbatim
 * 
 * \b wmfSPutS: writes string \p str; returns EOF on error, else 0.
 * 
 * \b wmfReset: resets stream to start; returns non-zero on failure.
 * 
 * \p context is a handle for user data
 */
struct _wmfStream
{	void* context;

	wmfSPutS sputs;
	wmfReset reset;
};

/**
 * @internal
 * Macro-wrapper for input stream function:
 * (int)  WMF_READ((wmfAPI*) API)                 - returns unsigned char cast to int, or EOF
 */
#define WMF_READ(Z)   ((Z)->bbuf.read ((Z)->buffer_data))

/**
 * @internal
 * Macro-wrapper for input stream function:
 * (int)  WMF_SEEK((wmfAPI*) API,(long) position) - returns (-1) on error, else 0
 */
#define WMF_SEEK(Z,P) ((Z)->bbuf.seek ((Z)->buffer_data,P))

/**
 * @internal
 * Macro-wrapper for input stream function:
 * (long) WMF_TELL((wmfAPI*) API)                 - returns (-1) on error, else current position
 */
#define WMF_TELL(Z)   ((Z)->bbuf.tell ((Z)->buffer_data))

#ifdef __cplusplus
}
#endif

/**
 * Structure referencing an image
 */
struct _wmfImage
{	wmf_image_t type;

	U16 width;
	U16 height;

	void* data;
};

#endif /* ! LIBWMF_TYPES_H */