alsa.audio: move handling of XRUN when writting to the slave task
[AROS.git] / tools / flexcat / src / flexcat.h
blobe6a7567961d016d99690b0bd3f4d9b0d7ccdad4d
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 #include <stdint.h>
120 typedef uint8_t uint8;
121 typedef int8_t int8;
123 typedef uint16_t uint16;
124 typedef int16_t int16;
126 typedef uint32_t uint32;
127 typedef int32_t int32;
129 #if !defined(__SASC) && ((__GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) || defined(__VBCC__))
130 typedef uint64_t uint64;
131 typedef int64_t int64;
132 #else
133 typedef struct { unsigned long hi,lo; } uint64; /* Not exactly scalar data
134 * types, but the right size.
136 typedef struct { long hi,lo; } int64;
137 #endif
139 #ifndef AMIGA
140 typedef uint8 UBYTE;
141 typedef int8 BYTE;
142 typedef uint8 BYTEBITS;
143 typedef uint16 UWORD;
144 typedef int16 WORD;
145 typedef uint16 WORDBITS;
146 typedef uint32 ULONG;
147 typedef int32 LONG;
148 typedef uint32 LONGBITS;
149 typedef uint16 RPTR;
150 #endif
152 #endif /* !__amigaos4__ */
154 #ifndef MAKE_ID
155 #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
156 #endif
158 #define MAX_NEW_STR_LEN 25
159 #define BUFSIZE 4096
161 struct CDLine
163 struct CDLine *Next;
164 char *Line;
167 struct CatString
169 struct CatString *Next;
170 char *CD_Str;
171 char *CT_Str;
172 char *ID_Str;
173 int MinLen, MaxLen, ID, Nr, LenBytes;
174 int NotInCT; /* If a string is not present, we write NEW
175 while updating the CT file for easier work. */
176 int POformat; /* Is this string a po-format string */
180 struct CatalogChunk
182 struct CatalogChunk *Next; /* struct CatalogChunk *Next */
183 ULONG ID;
184 char *ChunkStr;
187 int32 getft ( char *filename );
189 #endif /* FLEXCAT_H */