/*
 *  main.h - global armDeu defines
 *
 *  Written by:
 *   Andreas Dehmel
 *
 *  This file is part of armDeu, the portable WAD utility (the name derives
 *  from its initial port to the ARM-based RISC OS). armDeu is released under
 *  the GNU Public License (GPL) in the hope that it proves useful. Please
 *  note there is NO WARRANTY. For more information read the file License
 *  included in this release.
 */

#ifndef _MAIN_H_

#include <stdio.h>



#define OUTPUT_WAD_DATA		0
#define OUTPUT_RAW_DATA		1


/* Pattern matching */
char *NormalizePattern(const char *pattern, int **ranges);
int MatchPattern(const char *s, const char *p, const int *ranges);

#ifdef __riscos
extern int strncasecmp(const char *str1, const char *str2, unsigned int size);
#endif

extern void *safe_malloc(unsigned int size);



#ifdef __BIG_ENDIAN__
unsigned short	SwapSHORT(unsigned short x);
unsigned long	SwapLONG(unsigned long x);
#define SHORT(x)	SwapSHORT(x);
#define LONG(x)		SwapLONG(x);
#else
#define SHORT(x)	(x)
#define LONG(x)		(x)
#endif

/* in WAD.c, the size of the buffer used when building a new WAD */
extern long buffersize;
/* Eliminate duplicate lumps? */
extern int eliminate;
/* Compress output? (0 ==> no compress) */
extern int compressOut;
/* Verbose output (output lump names during patching?) */
extern int verbose;
/* Pattern */
extern char *lumpPattern;
/* Output mode (WAD/binary) */
extern int outputMode;
/* Ignore first n bytes of each lump */
extern int ignoreFirstBytes;
/* Expand multiple lumps */
extern int expandMultipleLumps;
/* maximum number of lines to output in list mode before waiting for a key */
extern int maxOutputLines;

#endif
