Browse Source

Use C linkage for all libespeak internal headers.

The libespeak files are supposed to be C code, so use C linkage
for all the functions defined in that code when they are being
referenced in the C++ code (i.e. espeakedit).
master
Reece H. Dunn 9 years ago
parent
commit
1e01ce9202
14 changed files with 110 additions and 6 deletions
  1. 2
    2
      src/compiledata.cpp
  2. 8
    0
      src/debug.h
  3. 9
    0
      src/espeak_command.h
  4. 9
    0
      src/event.h
  5. 9
    0
      src/fifo.h
  6. 7
    1
      src/klatt.h
  7. 2
    2
      src/options.cpp
  8. 9
    0
      src/phoneme.h
  9. 9
    0
      src/sintab.h
  10. 10
    1
      src/speech.h
  11. 9
    0
      src/synthesize.h
  12. 9
    0
      src/translate.h
  13. 9
    0
      src/voice.h
  14. 9
    0
      src/wave.h

+ 2
- 2
src/compiledata.cpp View File

@@ -45,8 +45,8 @@

extern void FindPhonemesUsed(void);
extern void DisplayErrorFile(const char *fname);
extern int utf8_in(int *c, const char *buf);
extern int utf8_out(unsigned int c, char *buf);
extern "C" int utf8_in(int *c, const char *buf);
extern "C" int utf8_out(unsigned int c, char *buf);
extern void DrawEnvelopes();
extern void ReadPhondataManifest();
char path_source[sizeof(path_home)+20];

+ 8
- 0
src/debug.h View File

@@ -1,6 +1,11 @@
#ifndef DEBUG_H
#define DEBUG_H

#ifdef __cplusplus
extern "C"
{
#endif

//#define DEBUG_ENABLED

#ifdef DEBUG_ENABLED
@@ -22,5 +27,8 @@ extern void debug_time(const char* text);
#define ENTER(text)
#endif

#ifdef __cplusplus
}
#endif

#endif

+ 9
- 0
src/espeak_command.h View File

@@ -6,6 +6,11 @@
#endif
#include "speak_lib.h"

#ifdef __cplusplus
extern "C"
{
#endif

enum t_espeak_type
{
ET_TEXT,
@@ -141,5 +146,9 @@ void SetParameter(int parameter, int value, int relative);

int sync_espeak_terminated_msg(unsigned int unique_identifier, void* user_data);

#ifdef __cplusplus
}
#endif

//>
#endif

+ 9
- 0
src/event.h View File

@@ -23,6 +23,11 @@ Note: the timeout is checked against the real progress of the audio stream, whic

#include "speak_lib.h"

#ifdef __cplusplus
extern "C"
{
#endif

// Initialize the event component.
// First function to be called.
// the callback will be called when the event actually occurs.
@@ -48,4 +53,8 @@ espeak_ERROR event_declare (espeak_EVENT* event);
// Last function to be called.
void event_terminate();

#ifdef __cplusplus
}
#endif

#endif

+ 9
- 0
src/fifo.h View File

@@ -7,6 +7,11 @@
#include "espeak_command.h"
#include "speak_lib.h"

#ifdef __cplusplus
extern "C"
{
#endif

// Initialize the fifo component.
// First function to be called.
void fifo_init();
@@ -55,4 +60,8 @@ void fifo_terminate();
// Returns 1 if yes, or 0 otherwise.
int fifo_is_command_enabled();

#ifdef __cplusplus
}
#endif

#endif

+ 7
- 1
src/klatt.h View File

@@ -1,4 +1,7 @@

#ifdef __cplusplus
extern "C"
{
#endif

#define CASCADE_PARALLEL 1 /* Type of synthesis model */
#define ALL_PARALLEL 2
@@ -152,3 +155,6 @@ typedef struct {
} klatt_peaks_t;


#ifdef __cplusplus
}
#endif

+ 2
- 2
src/options.cpp View File

@@ -1,7 +1,7 @@
/***************************************************************************
* Copyright (C) 2005 to 2013 by Jonathan Duddington *
* email: [email protected] *
* Copyright (C) 2013 by Reece H. Dunn *
* Copyright (C) 2013-2015 by Reece H. Dunn *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -33,7 +33,7 @@

#include "options.h"

extern void WavegenInit(int samplerate, int wavemult_fact);
extern "C" void WavegenInit(int samplerate, int wavemult_fact);
extern void strncpy0(char *to,const char *from, int size);
extern int GetNumeric(wxTextCtrl *t);
extern void SetNumeric(wxTextCtrl *t, int value);

+ 9
- 0
src/phoneme.h View File

@@ -1,6 +1,7 @@
/***************************************************************************
* Copyright (C) 2005 to 2010 by Jonathan Duddington *
* email: [email protected] *
* Copyright (C) 2015 by Reece H. Dunn *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -17,6 +18,10 @@
* <http://www.gnu.org/licenses/>. *
***************************************************************************/

#ifdef __cplusplus
extern "C"
{
#endif


// phoneme types
@@ -169,3 +174,7 @@ extern const char *WordToString(unsigned int word);

extern PHONEME_TAB_LIST phoneme_tab_list[N_PHONEME_TABS];
extern int phoneme_tab_number;

#ifdef __cplusplus
}
#endif

+ 9
- 0
src/sintab.h View File

@@ -1,3 +1,8 @@
#ifdef __cplusplus
extern "C"
{
#endif

short int sin_tab[2048] = {
0, -25, -50, -75, -100, -125, -150, -175,
-201, -226, -251, -276, -301, -326, -351, -376,
@@ -256,3 +261,7 @@ short int sin_tab[2048] = {
401, 376, 351, 326, 301, 276, 251, 226,
201, 175, 150, 125, 100, 75, 50, 25,
};

#ifdef __cplusplus
}
#endif

+ 10
- 1
src/speech.h View File

@@ -1,7 +1,7 @@
/***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: [email protected] *
* Copyright (C) 2013 Reece H. Dunn *
* Copyright (C) 2013-2015 Reece H. Dunn *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -23,6 +23,11 @@

#include <sys/types.h>

#ifdef __cplusplus
extern "C"
{
#endif

#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
#define ARCH_BIG
#endif
@@ -78,4 +83,8 @@ int GetFileLength(const char *filename);
char *Alloc(int size);
void Free(void *ptr);

#ifdef __cplusplus
}
#endif

#endif // SPEECH_H

+ 9
- 0
src/synthesize.h View File

@@ -1,6 +1,7 @@
/***************************************************************************
* Copyright (C) 2005 to 2014 by Jonathan Duddington *
* email: [email protected] *
* Copyright (C) 2015 by Reece H. Dunn *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -17,6 +18,11 @@
* <http://www.gnu.org/licenses/>. *
***************************************************************************/

#ifdef __cplusplus
extern "C"
{
#endif

#define espeakINITIALIZE_PHONEME_IPA 0x0002 // move this to speak_lib.h, after eSpeak version 1.46.02


@@ -587,3 +593,6 @@ void KlattInit();
void KlattReset(int control);
int Wavegen_Klatt2(int length, int modulation, int resume, frame_t *fr1, frame_t *fr2);

#ifdef __cplusplus
}
#endif

+ 9
- 0
src/translate.h View File

@@ -1,6 +1,7 @@
/***************************************************************************
* Copyright (C) 2005 to 2014 by Jonathan Duddington *
* email: [email protected] *
* Copyright (C) 2015 by Reece H. Dunn *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -17,6 +18,10 @@
* <http://www.gnu.org/licenses/>. *
***************************************************************************/

#ifdef __cplusplus
extern "C"
{
#endif

#define L(c1,c2) (c1<<8)+c2 // combine two characters into an integer for translator name

@@ -796,3 +801,7 @@ char *WritePhMnemonic(char *phon_out, PHONEME_TAB *ph, PHONEME_LIST *plist, int
extern FILE *f_trans; // for logging
extern FILE *f_logespeak;
extern int logging_type; // from config file

#ifdef __cplusplus
}
#endif

+ 9
- 0
src/voice.h View File

@@ -1,6 +1,7 @@
/***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: [email protected] *
* Copyright (C) 2015 by Reece H. Dunn *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -17,6 +18,11 @@
* <http://www.gnu.org/licenses/>. *
***************************************************************************/

#ifdef __cplusplus
extern "C"
{
#endif



typedef struct {
@@ -85,3 +91,6 @@ void WavegenSetVoice(voice_t *v);
void ReadTonePoints(char *string, int *tone_pts);
void VoiceReset(int control);

#ifdef __cplusplus
}
#endif

+ 9
- 0
src/wave.h View File

@@ -5,6 +5,11 @@
#include "stdint.h"
#endif

#ifdef __cplusplus
extern "C"
{
#endif

extern int option_device_number;

extern int wave_init(int samplerate);
@@ -40,4 +45,8 @@ extern void add_time_in_ms(struct timespec *ts, int time_in_ms);
// for tests
extern void *wave_test_get_write_buffer();

#ifdef __cplusplus
}
#endif

#endif

Loading…
Cancel
Save