add a rudimentary makefile for our build system. minor patches to correctly build...
[AROS.git] / tools / flexcat / src / flexcat.h
bloba54db5fa843679943452daca9263e6fb7064aba4
1 /*
2 * $Id$
4 * Copyright (C) 1993-1999 by Jochen Wiedmann and Marcin Orlowski
5 * Copyright (C) 2002-2010 by the FlexCat Open Source Team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef FLEXCAT_H
24 #define FLEXCAT_H
26 /* Amiga enviroment? */
27 #ifdef AMIGA
28 #include "FlexCat_cat.h"
29 #else
30 #include "FlexCat_cat_other.h"
31 #endif
33 #include <stdlib.h>
34 #include <stdio.h>
35 #include <string.h>
36 #include <ctype.h>
37 #include <time.h>
38 #ifdef AMIGA
39 #include <dos/dos.h>
40 #endif
42 #include "version.h"
44 #define VERS "FlexCat " EXE_REV_STRING
45 #define VSTRING VERS " [" SYSTEMSHORT "/" CPU "] (" EXE_DATE ") " EXE_COPYRIGHT
46 #define VERSTAG "\0$VER: " VSTRING
48 #if defined(AMIGA)
49 #include <exec/types.h>
50 #if defined(_DCC) || defined(__SASC) || defined(__GNUC__)
51 #include <proto/exec.h>
52 #include <proto/dos.h>
53 #include <proto/intuition.h>
54 #include <proto/utility.h>
55 #else
56 #include <clib/exec_protos.h>
57 #include <clib/dos_protos.h>
58 #include <clib/utility_protos.h>
59 #endif
61 #ifdef tolower
62 #undef tolower
63 #endif
64 #define tolower ToLower
65 #endif
67 #if defined(__MORPHOS__) || defined(__AROS__) || defined(WIN32) || defined(unix)
68 #include <stdarg.h>
69 int asprintf(char **ptr, const char * format, ...);
70 int vasprintf(char **ptr, const char * format, va_list ap);
71 #endif
73 #if defined(WIN32)
74 // VisualStudio has strdup() declared as being deprecated
75 #undef strdup
76 #define strdup(s) _strdup(s)
77 #endif
79 #ifndef FALSE
80 #define FALSE 0
81 #endif
82 #ifndef TRUE
83 #define TRUE 1
84 #endif
87 #ifndef MAXPATHLEN
88 #define MAXPATHLEN 512
89 #endif
90 #ifndef PATH_MAX
91 #define PATH_MAX 512
92 #endif
94 #define FLEXCAT_SDDIR "FLEXCAT_SDDIR"
96 #if defined(AMIGA)
97 #if defined(__amigaos4__)
98 #include <dos/obsolete.h>
99 #endif
100 #define FILE_MASK FIBF_EXECUTE
101 #define DEFAULT_FLEXCAT_SDDIR "PROGDIR:lib"
102 #else
103 #ifdef __MINGW32__
104 #define DEFAULT_FLEXCAT_SDDIR "C:\\MinGW\\lib\\flexcat"
105 #else
106 #define DEFAULT_FLEXCAT_SDDIR "/usr/lib/flexcat"
107 #endif
108 #endif
111 // we have to care about own basic datatype
112 // definitions as flexcat may also be compiled
113 // on 64bit environments (e.g. linux)
115 // in fact, these definitions are borrowed from
116 // the OS4 SDK and we bring them onto all the
117 // other OSs as well....
118 #if !defined(__amigaos4__)
119 typedef unsigned char uint8;
120 typedef signed char int8;
122 typedef unsigned short uint16;
123 typedef signed short int16;
125 typedef unsigned long uint32;
126 typedef signed long int32;
128 #if !defined(__SASC) && ((__GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) || defined(__VBCC__))
129 typedef unsigned long long uint64;
130 typedef signed long long int64;
131 #else
132 typedef struct { unsigned long hi,lo; } uint64; /* Not exactly scalar data
133 * types, but the right size.
135 typedef struct { long hi,lo; } int64;
136 #endif
138 #ifndef AMIGA
139 typedef uint8 UBYTE;
140 typedef int8 BYTE;
141 typedef uint8 BYTEBITS;
142 typedef uint16 UWORD;
143 typedef int16 WORD;
144 typedef uint16 WORDBITS;
145 typedef uint32 ULONG;
146 typedef int32 LONG;
147 typedef uint32 LONGBITS;
148 typedef uint16 RPTR;
149 #endif
151 #endif /* !__amigaos4__ */
153 #ifndef MAKE_ID
154 #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
155 #endif
157 #define MAX_NEW_STR_LEN 25
158 #define BUFSIZE 4096
160 struct CDLine
162 struct CDLine *Next;
163 char *Line;
166 struct CatString
168 struct CatString *Next;
169 char *CD_Str;
170 char *CT_Str;
171 char *ID_Str;
172 int MinLen, MaxLen, ID, Nr, LenBytes;
173 int NotInCT; /* If a string is not present, we write NEW
174 while updating the CT file for easier work. */
175 int POformat; /* Is this string a po-format string */
179 struct CatalogChunk
181 struct CatalogChunk *Next; /* struct CatalogChunk *Next */
182 ULONG ID;
183 char *ChunkStr;
186 int32 getft ( char *filename );
188 #endif /* FLEXCAT_H */