1 /*
2  *	epos/src/epos.h
3  *	(c) Jirka Hanika, geo@cuni.cz
4  *	(c) Petr Horak, horak@ure.cas.cz
5 
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10 
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15 
16  *
17  *	The GNU General Public License can be found in file doc/COPYING.
18  *
19  *	This is the main header file for the server side (service, daemon,
20  *	or monolith incarnation of Epos).  It includes other header
21  *	files generally considered to defined the internal interfaces
22  *	of Epos, inlined templates etc.
23  *
24  */
25 
26 #include "common.h"
27 
28 #ifndef FORGET_PORTAUDIO
29 	#define WANT_PORTAUDIO_PABLIO
30 #endif
31 
32 #ifdef WANT_DMALLOC
33 	#include <dmalloc.h>
34 #endif			      // new and delete are overloaded in interf.cc !
35 
36 #ifndef  IGNORE_REGEX_RULES_OR_THE_FASTMATCH_OPTIMIZATION
37 	#define WANT_REGEX    // About always, we want to use the regex code
38 #endif
39 
40 #ifdef WANT_REGEX
41    extern "C" {
42 	#ifdef HAVE_RX_H
43 		#include <rx.h>
44 	#else
45 	    #ifdef HAVE_REGEX_H
46 		#include <sys/types.h>
47 		#include <regex.h>
48 	    #else
49 		#include "rx.h"
50 	    #endif
51 	#endif
52    }
53 #else
54 	typedef void regex_t;
55 #endif
56 
57 #ifndef HAVE_STRCASECMP
58 #ifdef  HAVE_STRICMP
59 	#define strcasecmp stricmp	// if only stricmp is defined
60 	#define strncasecmp strnicmp
61 #endif
62 #endif
63 
64 #ifdef HAVE_GETCWD
65 #else
66 	#ifdef HAVE_DIRECT_H
67 		#include <direct.h>
68 		#define getcwd _getcwd
69 	#else
70 		#error No getcwd and no replacement for getcwd
71 	#endif
72 #endif
73 
74 
75 enum SUBST_METHOD {M_EXACT=0, M_SUBSTR=4, M_PROPER=7, M_LEFT=8, M_RIGHT=16, M_ONCE=32, M_NEGATED=64};
76 enum REPARENT {M_DELETE, M_RIGHTWARDS, M_LEFTWARDS};
77 enum FIT_IDX {Q_FREQ, Q_INTENS, Q_TIME};
78 enum OUT_ML { ML_NONE, ML_ANSI, ML_RTF};
79 #define OUT_MLstr "none:ansi:rtf:"
80 #define FITstr	"f:i:t:"
81 #define BOOLstr "false:true:off:on:no:yes:disabled:enabled:-:+:n:y:0:1:non::"
82 #define LIST_DELIM	 ':'
83 
84 typedef char UNIT;
85 #define UNIT_MAX 12
86 #define U_ILL		127
87 #define U_DEFAULT	126
88 #define U_INHERIT	125
89 #define U_VOID		120
90 
91 extern int unused_variable;
92 #define unuse(x) (unused_variable = (long int)(x));
93 
94 extern const bool is_monolith;
95 
96 struct file;
97 struct epos_option;
98 class  unit;
99 
100 class stream;
101 
102 typedef char wchar;
103 
104 #define MAX_PATHNAME       256	  // only load_language uses this
105 
106 #ifdef HAVE_UNISTD_H
107 	#define SLASH              '/'
108 	#define NULL_FILE	   "/dev/null"
109 	#define MODE_MASK	   (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
110 	#define O_BINARY	   0
111 #else
112 	#define SLASH              '\\'
113 	#define NULL_FILE	   "NUL"
114 	#define MODE_MASK	   (S_IREAD | S_IWRITE)
115 #endif
116 
117 #if defined(HAVE_WINSOCK_H) || defined(HAVE_WINSOCK2_H)
118 	#define HAVE_WINSOCK
119 	#define socky unsigned
120 #else
121 	#define socky signed
122 #endif
123 
124 
125 #include "hash.h"
126 #include "text.h"
127 #include "voice.h"
128 #include "function.h"
129 #include "options.h"
130 #include "interf.h"
131 #include "parser.h"
132 #include "unit.h"
133 #include "rule.h"              //See rules.h for additional #defines and enums
134 #include "waveform.h"
135 #include "synth.h"
136 #include "encoding.h"
137 
138 
139 
140 
141