Skip to content

Commit 87a5c0e

Browse files
committed
until lsw_main.c
1 parent f0bae82 commit 87a5c0e

21 files changed

Lines changed: 39 additions & 1632 deletions

include/mmalloc.h

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,9 @@
6969
extern "C" {
7070
#endif
7171

72-
#if defined __unix__ || defined VXWORKS || defined _SPARC_SOLARIS_ || defined __EMSCRIPTEN__ || defined (__APPLE__)
7372
//#define HANDLE int
7473
#define HGLOBAL DT_HANDLE
7574
#define GMEM_MOVEABLE 0x0002
76-
#endif
7775

7876
/**********************************************************************/
7977
/* The follwing macro definitions can be used to make code portable */
@@ -87,62 +85,10 @@ extern "C" {
8785
/* */
8886
/* The SERVER_BUFFER macros are for allocating buffers. */
8987
/**********************************************************************/
90-
91-
#ifdef USE_MME_SERVER /* Digital UNIX or OpenVMS */
92-
#define ALLOCATE_SERVER_MEM( SizeInBytes ) mallocLock( SizeInBytes )
93-
#define FREE_SERVER_MEM( SizeInBytes ) freeLock( SizeInBytes )
94-
95-
#define ALLOCATE_SERVER_BUFFER( SizeInBytes ) mmeAllocBuffer( SizeInBytes )
96-
#define FREE_SERVER_BUFFER( SizeInBytes ) mmeFreeBuffer( SizeInBytes )
97-
98-
#else /* Windows NT or Windows 95 */
99-
100-
#define ALLOCATE_SERVER_MEM( SizeInBytes ) malloc( SizeInBytes )
101-
#define FREE_SERVER_MEM( SizeInBytes ) free( SizeInBytes )
102-
103-
#if defined UNDER_CE || defined __unix__ || defined VXWORKS || defined _SPARC_SOLARIS_ || defined (__APPLE__)
10488

10589
#define ALLOCATE_SERVER_BUFFER( SizeInBytes ) malloc( SizeInBytes )
10690
#define FREE_SERVER_BUFFER( SizeInBytes ) free( SizeInBytes )
10791

108-
#else
109-
110-
#define ALLOCATE_SERVER_BUFFER( SizeInBytes ) mallocLock( SizeInBytes )
111-
#define FREE_SERVER_BUFFER( SizeInBytes ) freeLock( SizeInBytes )
112-
113-
#endif // UNDER_CE
114-
115-
#endif
116-
117-
#if defined UNDER_CE || defined __unix__ || defined VXWORKS || defined _SPARC_SOLARIS_ || defined (__APPLE__)
118-
119-
#define ALLOCATE_LOCKED_MEMORY( SizeInBytes ) malloc( SizeInBytes )
120-
#define FREE_LOCKED_MEMORY( SizeInBytes ) free( SizeInBytes )
121-
122-
#else
123-
124-
/**********************************************************************/
125-
/* General multimedia memory allocation. mallocLock() and FreeLock() */
126-
/* are defined differently for Windows NT and UNIX (or VMS). */
127-
/**********************************************************************/
128-
129-
#define ALLOCATE_LOCKED_MEMORY( SizeInBytes ) mallocLock( SizeInBytes )
130-
#define FREE_LOCKED_MEMORY( SizeInBytes ) freeLock( SizeInBytes )
131-
132-
/**********************************************************************/
133-
/* Function prototypes. */
134-
/**********************************************************************/
135-
136-
#if !defined __unix__ && !defined VXWORKS && !defined _SPARC_SOLARIS_ || defined (__APPLE__)
137-
void * mallocLock( unsigned int uiSize );
138-
#ifndef MSDOS
139-
void * reallocLock( void * pMem, size_t size );
140-
#endif
141-
unsigned int freeLock( void * pMemory );
142-
#endif
143-
144-
#endif
145-
14692
#ifdef __cplusplus
14793
} /* End extern "C" */
14894
#endif

include/par_pars1.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -144,25 +144,9 @@
144144
*/
145145
#ifndef PARSER_STANDALONE_DEBUG_OLD
146146

147-
#ifdef WIN32_OLD
148-
#include <windows.h>
149-
#include "tts.h"
150-
#endif
151-
152147
/* GL 04/21/1997 add this for OSF build */
153-
#ifdef __osf__
154-
#include "tts.h"
155-
#endif
156-
#if defined __unix__ || defined VXWORKS || defined _SPARC_SOLARIS_ || defined __EMSCRIPTEN__ || defined (__APPLE__)
157148
#include <stdlib.h>
158149
#include "tts.h"
159-
#endif
160-
#if defined ARM7 || defined __EMSCRIPTEN__
161-
#include <stdlib.h>
162-
#include <string.h>
163-
#include <ctype.h>
164-
#include "tts.h"
165-
#endif
166150

167151
void cm_util_flush_init(LPTTS_HANDLE_T); // NAL warning removal
168152

include/tts.h

Lines changed: 1 addition & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -72,42 +72,18 @@
7272
#ifndef _TTS_H_
7373
#define _TTS_H_
7474

75-
#ifdef WIN32_OLD
76-
#include <windows.h>
77-
#include <mmreg.h>
78-
#include <stdio.h>
79-
// cjl 19nov97 add ifdef for sapi only.
80-
#ifdef OLEDECTALK
81-
// cjl 19nov97 change speech.h to local
82-
#include "speech.h"
83-
#endif //OLEDECTALK
84-
#endif
85-
8675
#include "port.h"
8776

88-
#if defined __unix__ || defined VXWORKS || defined _SPARC_SOLARIS_ || defined __EMSCRIPTEN__ || defined (__APPLE__)
89-
#define HWND unsigned long
77+
#define HWND size_t
9078
#include "dtmmedefs.h"
91-
#endif
92-
93-
#ifndef ARM7
94-
//#include "opthread.h" /*Platform-independent Threads implementation header file*/
95-
//#include "playaud.h"
96-
#endif
9779

9880
/* GL 04/21/1997 add this as the latest OSF code */
99-
#if defined __osf__ || defined __unix__ || defined VXWORKS || defined _SPARC_SOLARIS_ || defined __EMSCRIPTEN__ || defined (__APPLE__)
10081
//typedef HPLAY_AUDIO_T LPAUDIO_HANDLE_T;
101-
#endif
10282

10383
#ifdef OLEDECTALK //MVP: For OLE-DECTalk
10484
#include "audioapi.h"
10585
#endif
10686

107-
#ifdef SAPI5DECTALK
108-
#include "sapiiont.h"
109-
#endif
110-
11187
#include "kernel.h" /* Added for PKSD_T declaration MI :MVP */
11288

11389
#ifndef ACI_LICENSE //tek 01may97
@@ -118,13 +94,6 @@
11894

11995
/* DECtalk Version Numbers moved to coop.h: 11/22/96 CJL */
12096
#include "coop.h"
121-
#if !defined __unix__ && !defined VXWORKS && !defined _SPARC_SOLARIS_ && !defined __EMSCRIPTEN__ && !defined (__APPLE__)
122-
/* externs for global variables :MVP */
123-
extern volatile int gnInstanceCounter;
124-
#ifndef ARM7
125-
extern TLOCK tl_gnInstanceCounter; // tek 27may98
126-
#endif
127-
#endif
12897

12998
extern int *gpufdic_index;
13099
extern unsigned char *gpufdic_data;
@@ -145,14 +114,12 @@ extern DT_HANDLE gufordicFileHandle;
145114
extern LPVOID gufordicMapStartAddr;
146115

147116
/* GL 04/21/1997 add this as the latest OSF code */
148-
#if defined __unix__ || defined VXWORKS || defined _SPARC_SOLARIS_ || defined __osf__ || defined __EMSCRIPTEN__ || defined (__APPLE__)
149117
/**********************************************************************/
150118
/* Sybmol definitiopns for return status from CheckLicenses */
151119
/**********************************************************************/
152120
#define LIC_NO_PAK 1
153121
#define LIC_NO_MORE_UNITS 2
154122
#define LIC_UNKNOWN_ERR 3
155-
#endif
156123

157124
/**********************************************************************/
158125
/* Symbol definitions for the Text-To-Speech output state. */
@@ -174,7 +141,6 @@ extern LPVOID gufordicMapStartAddr;
174141
/* There is an additiona undocumented 32 bit word that had to be */
175142
/* added to make the files formats match the examples. */
176143
/**********************************************************************/
177-
#ifndef ARM7
178144

179145
typedef struct WAVE_FILE_HDR_TAG
180146
{
@@ -210,9 +176,7 @@ typedef struct AU_FILE_HDR_TAG
210176
typedef AU_FILE_HDR_T * LPAU_FILE_HDR_T;
211177

212178
#define AU_HEADER_OFFSET 32
213-
#endif
214179
/* GL 04/21/1997 add this as the latest OSF code */
215-
#if defined (__osf__) || defined (__unix__) || defined VXWORKS || defined _SPARC_SOLARIS_ || defined __EMSCRIPTEN__ || defined (NOWIN) || defined (__APPLE__)
216180
/**********************************************************************/
217181
/* Text Message Linked List structure for digital unix. */
218182
/**********************************************************************/
@@ -226,52 +190,20 @@ struct TEXT_MSG_TAG
226190

227191
typedef struct TEXT_MSG_TAG TEXT_MSG_T;
228192
typedef TEXT_MSG_T * LPTEXT_MSG_T;
229-
#endif /* __osf__ || __unix__ */
230193

231194
/**********************************************************************/
232195
/* This structure is the text to speech handle. */
233196
/**********************************************************************/
234197

235-
#ifdef ARM7
236-
typedef unsigned int UINT;
237-
typedef unsigned char BOOL;
238-
typedef unsigned short WORD;
239-
typedef long LONG;
240-
#endif
241-
242198
struct TTS_HANDLE_TAG
243199
{
244-
#ifndef ARM7
245200
HWND hWnd;
246201
HWND hTextToSpeechWnd;
247-
#endif
248202
PKSD_T pKernelShareData; /* Added for Multiple instance speech objects: MVP*/
249203
PVOID pCMDThreadData ; /* Instance specific CMD thread data */
250204
PVOID pLTSThreadData ; /* Instance specific LTS thread data */
251205
PVOID pVTMThreadData ; /* Instance specific VTM thread data */
252206
PVOID pPHThreadData ; /* Instance specific PH thread data */
253-
#ifdef WIN32_OLD
254-
DT_HANDLE hMallocSuccessEvent; /* Event handle to report successful memory allocations */
255-
DT_HANDLE hThread_TXT;
256-
DT_HANDLE hThread_CMD;
257-
DT_HANDLE hThread_SYNC;
258-
DT_HANDLE hSyncEvent;
259-
DT_HANDLE hNotEmptyingVtmPipeEvent;
260-
#endif // WIN32_OLD
261-
262-
/* GL 04/21/1997 add this as the latest OSF code */
263-
#if defined (__osf__) || defined (__unix__) || defined VXWORKS || defined _SPARC_SOLARIS_ || defined __EMSCRIPTEN__ || defined (__APPLE__)
264-
//HEVENT_T hMallocSuccessEvent; /* Event handle to report successful memory allocations */
265-
//HTHREAD_T hThread_TXT;
266-
//HTHREAD_T hThread_CMD;
267-
//HTHREAD_T hThread_SYNC;
268-
//HEVENT_T hSyncEvent;
269-
//HEVENT_T hNotEmptyingVtmPipeEvent;
270-
//HEVENT_T hTextInQueueEvent;
271-
//UINT uiTextThreadExit;
272-
//UINT uiThreadError;
273-
/* MGS 09/15/1997 removed bInReset from osf/linux only */
274-
#endif
275207

276208
#ifdef DEMO_NOISE
277209
int char_count;
@@ -301,74 +233,19 @@ struct TTS_HANDLE_TAG
301233
BOOL bMemoryReset;
302234
BOOL bSendingBuffer;
303235

304-
#ifndef ARM7
305236
LPWAVE_FILE_HDR_T pWaveFileHdr;
306237
LPAU_FILE_HDR_T pAuFileHdr;
307-
#ifdef UNDER_CE // must be a handle for Windows CE
308-
DT_HANDLE pWaveFile;
309-
DT_HANDLE pLogFile;
310-
#else
311238
FILE * pWaveFile;
312239
FILE * pLogFile;
313-
#endif
314-
#endif // ARM7
315240

316241
void * pTTS_Buffer;
317242

318243
// epsonapi callback
319244
short *(*EmbCallbackRoutine)(short *, long, int); // audio, length, phoneme
320245

321-
#ifdef ARM7
322-
#ifndef EPSON_ARM7
323-
//short *(*EmbCallbackRoutine)(short *,S32);
324-
#endif
325-
short *output_buffer;
326-
#ifdef EPSON_ARM7
327-
int TTP_return_code;
328-
S16 TTP_phoneme_buf_len;
329-
S16 *TTP_phoneme_buf;
330-
S16 PTS_phoneme_buf_len;
331-
S16 *PTS_phoneme_buf;
332-
int PTS_return_code;
333-
int TTP_return;
334-
int PTS_return;
335-
int PTS_location;
336-
int PTS_input_pos;
337-
int PTS_special_change;
338-
void (*main_lts_loop)(void *,unsigned short *);
339-
#endif
340-
#else
341246
void (*DtCallbackRoutine)(LONG,LONG,DWORD,UINT); //New Audio Integration :After testing remove these comments
342-
#endif
343247

344248
DWORD dwTTSInstanceParameter; //New Audio Integration
345-
#ifdef WIN32_OLD
346-
HMUTEX_T hmxCallback; //New Audio Integration
347-
LPCRITICAL_SECTION pcsMemoryBuffer;
348-
LPCRITICAL_SECTION pcsQueuedSampleCount;
349-
LPCRITICAL_SECTION pcsLastQueuedTextMsgNumber;
350-
LPCRITICAL_SECTION pcsFlushMsgNumber;
351-
LPCRITICAL_SECTION pcsQueuedCharacterCount;
352-
LPCRITICAL_SECTION pcsLogFile;
353-
LPCRITICAL_SECTION pcsBufferPipe;
354-
// LPAUDIO_HANDLE_T pAudioHandle;
355-
BOOL IsSpeaking;
356-
ULONG LastError;
357-
#endif
358-
/* GL 04/21/1997 add this as the latest OSF code */
359-
#if defined (__osf__) || defined (__unix__) || defined VXWORKS || defined _SPARC_SOLARIS_ || defined __EMSCRIPTEN__ || defined (__APPLE__)
360-
//HMUTEX_T pcsCallback; /*New Audio Integration*/
361-
//HMUTEX_T pcsMemoryBuffer;
362-
//HMUTEX_T pcsQueuedSampleCount;
363-
//HMUTEX_T pcsLastQueuedTextMsgNumber;
364-
//HMUTEX_T pcsFlushMsgNumber;
365-
//HMUTEX_T pcsQueuedCharacterCount;
366-
//HMUTEX_T pcsLogFile;
367-
//HMUTEX_T pcsTextMsgList;
368-
//HMUTEX_T pcsBufferPipe;
369-
//LPTEXT_MSG_T pTextMsgList; /* A linked list of text messages */
370-
//unsigned int LastError;
371-
#endif
372249

373250
#ifdef NOWIN
374251
//HEVENT_T hTextInQueueEvent;
@@ -378,10 +255,6 @@ struct TTS_HANDLE_TAG
378255
//LPTEXT_MSG_T pTextMsgList; /* A linked list of text messages */
379256
#endif
380257

381-
#ifndef ARM7
382-
//LPAUDIO_HANDLE_T pAudioHandle;
383-
#endif
384-
385258
#ifndef ACI_LICENSE
386259
#ifdef DTALK_50
387260
LPCPTHREAD CPanelThread;
@@ -411,19 +284,14 @@ struct TTS_HANDLE_TAG
411284
//int bisau;
412285
#endif
413286

414-
#ifdef WIN32_OLD
415-
TCHAR dictionary_file_name[500];
416-
#else
417287
char dictionary_file_name[500];
418-
#endif
419288
int last_syl;
420289
};
421290

422291
/**********************************************************************/
423292
/* Define the audio sample type */
424293
/**********************************************************************/
425294

426-
#ifndef ARM7
427295
typedef short SAMPLE_T;
428296

429297
typedef SAMPLE_T * LPSAMPLE_T;
@@ -480,7 +348,6 @@ typedef struct NOTIFY_LIST
480348

481349
//#endif //WIN32_OLD
482350
// end of sapi fixes
483-
#endif // ARM7
484351
/**********************************************************************/
485352
/* Define the API interface. */
486353
/**********************************************************************/
@@ -541,23 +408,15 @@ typedef struct SPDEFS_TAG {
541408
/* (Functions WriteAudioToFile() and QueueInMemory() are included */
542409
/* directly in the Vocal Tract Model task in file vtmiont.c. */
543410
/**********************************************************************/
544-
#ifndef ARM7
545-
546411
void TextToSpeechErrorHandler( LPTTS_HANDLE_T,
547412
UINT,
548413
MMRESULT );
549414

550415
/* MVP : This fucntion is become now obsolete
551416
LPTTS_HANDLE_T TextToSpeechGetHandle(void);
552417
*/
553-
#ifdef WIN32_OLD
554-
void Report_TTS_Status( LPTTS_HANDLE_T ttsHandle, UINT uiMsg, long lParam1, long lParam2);
555-
#endif
556418

557-
/* GL 04/21/1997 add this as the latest OSF code */
558-
#if defined __unix__ || defined VXWORKS || defined _SPARC_SOLARIS_ || defined __osf__ || defined __EMSCRIPTEN__ || defined (__APPLE__)
559419
void Report_TTS_Status( LPTTS_HANDLE_T phTTS, UINT uiMsg, long lParam1, long lParam2);
560-
#endif
561420

562421
void QueueToMemory( LPTTS_HANDLE_T, LPSAMPLE_T, DWORD );
563422

@@ -571,6 +430,4 @@ void EmptyVtmPipe(PKSD_T);
571430
void WINprintf(char *fmt, ...);
572431
#endif
573432

574-
#endif // ARM7
575-
576433
#endif // _TTS_H_

premake5.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ project("libdtc")
6666
"SINGLE_THREADED"
6767
})
6868
filter("system:windows")
69-
files("mman-win32/*.c")
70-
defines("__unix__")
69+
files("src/mman-win32/*.c")
7170
filter({})
7271

7372
project("say")

0 commit comments

Comments
 (0)