Skip to content

Commit c9b9640

Browse files
committed
Minimal exports needed for Windows DLL build
1 parent 3562090 commit c9b9640

10 files changed

+55
-1
lines changed

src/bin_mdef.h

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ extern "C" {
5353
#endif
5454

5555
#include <pocketsphinx.h>
56+
#include <pocketsphinx/export.h>
5657

5758
#include "util/mmio.h"
5859
#include "mdef.h"
@@ -166,21 +167,25 @@ struct bin_mdef_s {
166167
/**
167168
* Read a binary mdef from a file.
168169
*/
170+
POCKETSPHINX_EXPORT
169171
bin_mdef_t *bin_mdef_read(ps_config_t *config, const char *filename);
170172

171173
/**
172174
* Read a text mdef from a file (creating an in-memory binary mdef).
173175
*/
176+
POCKETSPHINX_EXPORT
174177
bin_mdef_t *bin_mdef_read_text(ps_config_t *config, const char *filename);
175178

176179
/**
177180
* Write a binary mdef to a file.
178181
*/
182+
POCKETSPHINX_EXPORT
179183
int bin_mdef_write(bin_mdef_t *m, const char *filename);
180184

181185
/**
182186
* Write a binary mdef to a text file.
183187
*/
188+
POCKETSPHINX_EXPORT
184189
int bin_mdef_write_text(bin_mdef_t *m, const char *filename);
185190

186191
/**

src/dict.h

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ dict_t *dict_init(ps_config_t *config, /**< Configuration (-dict, -fdict, -dictc
112112
int dict_write(dict_t *dict, char const *filename, char const *format);
113113

114114
/** Return word id for given word string if present. Otherwise return BAD_S3WID */
115+
POCKETSPHINX_EXPORT
115116
s3wid_t dict_wordid(dict_t *d, const char *word);
116117

117118
/**
@@ -125,6 +126,7 @@ int dict_filler_word(dict_t *d, /**< The dictionary structure */
125126
/**
126127
* Test if w is a "real" word, i.e. neither a filler word nor START/FINISH.
127128
*/
129+
POCKETSPHINX_EXPORT
128130
int dict_real_word(dict_t *d, /**< The dictionary structure */
129131
s3wid_t w /**< The word ID */
130132
);

src/fe/yin.h

+7
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ extern "C" {
5050
#endif
5151

5252
#include <pocketsphinx/prim_type.h>
53+
#include <pocketsphinx/export.h>
5354

5455
/**
5556
* Frame-based moving-window pitch estimator.
@@ -59,22 +60,26 @@ typedef struct yin_s yin_t;
5960
/**
6061
* Initialize moving-window pitch estimation.
6162
*/
63+
POCKETSPHINX_EXPORT
6264
yin_t *yin_init(int frame_size, float search_threshold,
6365
float search_range, int smooth_window);
6466

6567
/**
6668
* Free a moving-window pitch estimator.
6769
*/
70+
POCKETSPHINX_EXPORT
6871
void yin_free(yin_t *pe);
6972

7073
/**
7174
* Start processing an utterance.
7275
*/
76+
POCKETSPHINX_EXPORT
7377
void yin_start(yin_t *pe);
7478

7579
/**
7680
* Mark the end of an utterance.
7781
*/
82+
POCKETSPHINX_EXPORT
7883
void yin_end(yin_t *pe);
7984

8085
/**
@@ -84,6 +89,7 @@ void yin_end(yin_t *pe);
8489
* @param frame Frame of <code>frame_size</code> (see
8590
* yin_init()) samples of audio data.
8691
*/
92+
POCKETSPHINX_EXPORT
8793
void yin_write(yin_t *pe, int16 const *frame);
8894

8995
/**
@@ -99,6 +105,7 @@ void yin_write(yin_t *pe, int16 const *frame);
99105
* @return Non-zero if enough data was avaliable to return a pitch
100106
* estimate, zero otherwise.
101107
*/
108+
POCKETSPHINX_EXPORT
102109
int yin_read(yin_t *pe, uint16 *out_period, uint16 *out_bestdiff);
103110

104111
#ifdef __cplusplus

src/lm/fsg_model.h

+10
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
#include <string.h>
5353

5454
#include <pocketsphinx.h>
55+
#include <pocketsphinx/export.h>
56+
5557
#include "util/glist.h"
5658
#include "util/bitvec.h"
5759
#include "util/hash_table.h"
@@ -190,6 +192,7 @@ fsg_model_t *fsg_model_init(char const *name, logmath_t *lmath,
190192
* Return value: a new fsg_model_t structure if the file is successfully
191193
* read, NULL otherwise.
192194
*/
195+
POCKETSPHINX_EXPORT
193196
fsg_model_t *fsg_model_readfile(const char *file, logmath_t *lmath, float32 lw);
194197

195198
/**
@@ -255,6 +258,7 @@ int32 fsg_model_tag_trans_add(fsg_model_t * fsg, int32 from, int32 to,
255258
* @param nulls List of null transitions, or NULL to find them automatically.
256259
* @return Updated list of null transitions.
257260
*/
261+
POCKETSPHINX_EXPORT
258262
glist_t fsg_model_null_trans_closure(fsg_model_t * fsg, glist_t nulls);
259263

260264
/**
@@ -304,31 +308,37 @@ int fsg_model_add_alt(fsg_model_t * fsg, char const *baseword,
304308
/**
305309
* Write FSG to a file.
306310
*/
311+
POCKETSPHINX_EXPORT
307312
void fsg_model_write(fsg_model_t *fsg, FILE *fp);
308313

309314
/**
310315
* Write FSG to a file.
311316
*/
317+
POCKETSPHINX_EXPORT
312318
void fsg_model_writefile(fsg_model_t *fsg, char const *file);
313319

314320
/**
315321
* Write FSG to a file in AT&T FSM format.
316322
*/
323+
POCKETSPHINX_EXPORT
317324
void fsg_model_write_fsm(fsg_model_t *fsg, FILE *fp);
318325

319326
/**
320327
* Write FSG to a file in AT&T FSM format.
321328
*/
329+
POCKETSPHINX_EXPORT
322330
void fsg_model_writefile_fsm(fsg_model_t *fsg, char const *file);
323331

324332
/**
325333
* Write FSG symbol table to a file (for AT&T FSM)
326334
*/
335+
POCKETSPHINX_EXPORT
327336
void fsg_model_write_symtab(fsg_model_t *fsg, FILE *file);
328337

329338
/**
330339
* Write FSG symbol table to a file (for AT&T FSM)
331340
*/
341+
POCKETSPHINX_EXPORT
332342
void fsg_model_writefile_symtab(fsg_model_t *fsg, char const *file);
333343

334344
#ifdef __cplusplus

src/lm/jsgf.h

+6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
/* Not much here anymore! */
5050
#include <pocketsphinx/model.h>
51+
#include <pocketsphinx/export.h>
5152

5253
#ifdef __cplusplus
5354
extern "C" {
@@ -65,6 +66,11 @@ extern "C" {
6566
*/
6667
jsgf_t *jsgf_grammar_new(jsgf_t *parent);
6768

69+
POCKETSPHINX_EXPORT
70+
fsg_model_t *jsgf_build_fsg_raw(jsgf_t * grammar, jsgf_rule_t * rule,
71+
logmath_t * lmath, float32 lw);
72+
73+
6874
#ifdef __cplusplus
6975
}
7076
#endif

src/util/ckd_alloc.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@
9090
#include <setjmp.h>
9191

9292
#include <pocketsphinx/prim_type.h>
93+
#include <pocketsphinx/export.h>
94+
9395

9496
/** \file ckd_alloc.h
9597
*\brief Sphinx's memory allocation/deallocation routines.
@@ -136,27 +138,31 @@ void ckd_fail(char *format, ...);
136138
* message if any error occurs, with any other behaviour determined by
137139
* ckd_set_jump(), above.
138140
*/
139-
141+
POCKETSPHINX_EXPORT
140142
void *__ckd_calloc__(size_t n_elem, size_t elem_size,
141143
const char *caller_file, int caller_line);
142144

145+
POCKETSPHINX_EXPORT
143146
void *__ckd_malloc__(size_t size,
144147
const char *caller_file, int caller_line);
145148

149+
POCKETSPHINX_EXPORT
146150
void *__ckd_realloc__(void *ptr, size_t new_size,
147151
const char *caller_file, int caller_line);
148152

149153
/**
150154
* Like strdup, except that if an error occurs it prints a diagnostic message and
151155
* exits. If origin in NULL the function also returns NULL.
152156
*/
157+
POCKETSPHINX_EXPORT
153158
char *__ckd_salloc__(const char *origstr,
154159
const char *caller_file, int caller_line);
155160

156161
/**
157162
* Allocate a 2-D array and return ptr to it (ie, ptr to vector of ptrs).
158163
* The data area is allocated in one block so it can also be treated as a 1-D array.
159164
*/
165+
POCKETSPHINX_EXPORT
160166
void *__ckd_calloc_2d__(size_t d1, size_t d2, /* In: #elements in the 2 dimensions */
161167
size_t elemsize, /* In: Size (#bytes) of each element */
162168
const char *caller_file, int caller_line); /* In */
@@ -205,11 +211,13 @@ void *__ckd_alloc_2d_ptr(size_t d1,
205211
/**
206212
* Test and free a 1-D array
207213
*/
214+
POCKETSPHINX_EXPORT
208215
void ckd_free(void *ptr);
209216

210217
/**
211218
* Free a 2-D array (ptr) previously allocated by ckd_calloc_2d
212219
*/
220+
POCKETSPHINX_EXPORT
213221
void ckd_free_2d(void *ptr);
214222

215223
/**

src/util/cmd_ln.h

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#include <stdarg.h>
6363

6464
#include <pocketsphinx.h>
65+
#include <pocketsphinx/export.h>
6566

6667
#include "util/hash_table.h"
6768

@@ -193,6 +194,7 @@ int cmd_ln_free_r(cmd_ln_t *cmdln);
193194
* @return A cmd_ln_t containing the results of command line parsing,
194195
* or NULL on failure.
195196
**/
197+
POCKETSPHINX_EXPORT
196198
cmd_ln_t *cmd_ln_parse_r(cmd_ln_t *inout_cmdln, /**< In/Out: Previous command-line to update,
197199
or NULL to create a new one. */
198200
arg_t const *defn, /**< In: Array of argument name definitions */
@@ -211,6 +213,7 @@ cmd_ln_t *cmd_ln_parse_r(cmd_ln_t *inout_cmdln, /**< In/Out: Previous command-li
211213
*
212214
* @return A cmd_ln_t containing the results of command line parsing, or NULL on failure.
213215
*/
216+
POCKETSPHINX_EXPORT
214217
cmd_ln_t *cmd_ln_parse_file_r(cmd_ln_t *inout_cmdln, /**< In/Out: Previous command-line to update,
215218
or NULL to create a new one. */
216219
arg_t const *defn, /**< In: Array of argument name definitions*/
@@ -256,6 +259,7 @@ void cmd_ln_set_str_extra_r(cmd_ln_t *cmdln, char const *name, char const *str);
256259
* @param cmdln command-line object
257260
* @param defn array of argument name definitions.
258261
*/
262+
POCKETSPHINX_EXPORT
259263
void cmd_ln_log_help_r (cmd_ln_t *cmdln, const arg_t *defn);
260264

261265
/**

src/util/filename.h

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#define _LIBUTIL_FILENAME_H_
6363

6464
#include <pocketsphinx/prim_type.h>
65+
#include <pocketsphinx/export.h>
6566

6667
/**\file filename.h
6768
*\brief File names related operation
@@ -83,6 +84,7 @@ const char *path2basename(const char *path);
8384
* Strip off filename from the given path and copy the directory name into dir
8485
* Caller must have allocated dir (hint: it's always shorter than path).
8586
*/
87+
POCKETSPHINX_EXPORT
8688
void path2dirname(const char *path, char *dir);
8789

8890

src/util/pio.h

+5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
#endif
8989

9090
#include <pocketsphinx/prim_type.h>
91+
#include <pocketsphinx/export.h>
9192

9293
/** \file pio.h
9394
* \brief file IO related operations.
@@ -161,6 +162,7 @@ int32 fread_retry(void *pointer, int32 size, int32 num_items, FILE *stream);
161162
* @param out_len Output: if not NULL, length of the string read.
162163
* @return allocated string containing the line, or NULL on error or EOF.
163164
*/
165+
POCKETSPHINX_EXPORT
164166
char *fread_line(FILE *stream, size_t *out_len);
165167

166168
/**
@@ -178,6 +180,7 @@ typedef struct lineiter_t {
178180
/**
179181
* Start reading lines from a file.
180182
*/
183+
POCKETSPHINX_EXPORT
181184
lineiter_t *lineiter_start(FILE *fh);
182185

183186
/**
@@ -188,6 +191,7 @@ lineiter_t *lineiter_start_clean(FILE *fh);
188191
/**
189192
* Move to the next line in the file.
190193
*/
194+
POCKETSPHINX_EXPORT
191195
lineiter_t *lineiter_next(lineiter_t *li);
192196

193197
/**
@@ -277,6 +281,7 @@ int32 stat_mtime (const char *file);
277281
*
278282
* @return 0 on success, <0 on failure.
279283
*/
284+
POCKETSPHINX_EXPORT
280285
int build_directory(const char *path);
281286

282287
#ifdef __cplusplus

src/util/strfuncs.h

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include <stdarg.h>
4646

4747
#include <pocketsphinx/prim_type.h>
48+
#include <pocketsphinx/export.h>
4849

4950
#ifdef __cplusplus
5051
extern "C" {
@@ -58,6 +59,7 @@ extern "C" {
5859
* Concatenate a NULL-terminated argument list of strings, returning a
5960
* newly allocated string.
6061
**/
62+
POCKETSPHINX_EXPORT
6163
char *string_join(const char *base, ...);
6264

6365
/**
@@ -75,6 +77,7 @@ enum string_edge_e {
7577
* @param string string to trim, contents will be modified.
7678
* @param which one of STRING_START, STRING_END, or STRING_BOTH.
7779
*/
80+
POCKETSPHINX_EXPORT
7881
char *string_trim(char *string, enum string_edge_e which);
7982

8083
/**
@@ -84,6 +87,7 @@ char *string_trim(char *string, enum string_edge_e which);
8487
* locale in a threaded program is extremely uncool, therefore we need
8588
* this since we pass floats as strings in 1000 different places.
8689
*/
90+
POCKETSPHINX_EXPORT
8791
double atof_c(char const *str);
8892

8993
/* FIXME: Both of these string splitting functions basically suck. I
@@ -96,6 +100,7 @@ double atof_c(char const *str);
96100
* every word in the line.
97101
* Return value: No. of words found; -1 if no. of words in line exceeds n_wptr.
98102
*/
103+
POCKETSPHINX_EXPORT
99104
int32 str2words (char *line, /**< In/Out: line to be parsed. This
100105
string will be modified! (NUL
101106
characters inserted at word

0 commit comments

Comments
 (0)