forked from UnitexGramLab/unitex-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAbstractFst2PlugCallback.h
92 lines (62 loc) · 2.9 KB
/
AbstractFst2PlugCallback.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
* Unitex
*
* Copyright (C) 2001-2017 Université Paris-Est Marne-la-Vallée <unitex@univ-mlv.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
*/
/*
* File created and contributed by Gilles Vollant (Ergonotics SAS)
* as part of an UNITEX optimization and reliability effort
*
* additional information: http://www.ergonotics.com/unitex-contribution/
* contact : unitex-contribution@ergonotics.com
*
*/
#ifndef _ABSTRACT_FST2_CALLBACK_INCLUDED
#define _ABSTRACT_FST2_CALLBACK_INCLUDED 1
#include "AbstractCallbackFuncModifier.h"
#define IS_FST2_FUNC_ARRAY_EXTENSIBLE 1
#ifdef __cplusplus
extern "C" {
using namespace unitex;
#endif
typedef int (ABSTRACT_CALLBACK_UNITEX *t_fnc_is_filename_Fst2Space_object)(const char*name,void* privateSpacePtr);
typedef int (ABSTRACT_CALLBACK_UNITEX* t_fnc_Init_Fst2Space)(void* privateSpacePtr);
typedef void (ABSTRACT_CALLBACK_UNITEX* t_fnc_Uninit_Fst2Space)(void* privateSpacePtr);
/* Unlike the load callback for dictionnary, p_fst2_free_info can be NULL
this mean the caller (Locate) will modify the Fst2* object, and then call free_Fst2
To reuse an Fst2 object, the solution is to call new_Fst2_clone
*/
typedef Fst2* (ABSTRACT_CALLBACK_UNITEX* t_fnc_load_abstract_fst2)(const VersatileEncodingConfig* vec,const char* name,int read_names,struct FST2_free_info* p_fst2_free_info,void* privateSpacePtr);
typedef void (ABSTRACT_CALLBACK_UNITEX* t_fnc_free_abstract_fst2)(Fst2* fst2,struct FST2_free_info* p_inf_free_info,void* privateSpacePtr);
typedef struct
{
size_t size_func_array;
t_fnc_is_filename_Fst2Space_object fnc_is_filename_object;
t_fnc_Init_Fst2Space fnc_Init_Fst2Space;
t_fnc_Uninit_Fst2Space fnc_Uninit_Fst2Space;
t_fnc_load_abstract_fst2 fnc_load_abstract_fst2;
t_fnc_free_abstract_fst2 fnc_free_abstract_fst2;
} t_persistent_fst2_func_array;
UNITEX_FUNC int UNITEX_CALL AddAbstractFst2Space(const t_persistent_fst2_func_array* func_array,void* privateSpacePtr);
UNITEX_FUNC int UNITEX_CALL RemoveAbstractFst2Space(const t_persistent_fst2_func_array* func_array,void* privateSpacePtr);
/* just return the number of AbstractFst2Space Installed */
UNITEX_FUNC int UNITEX_CALL GetNbAbstractFst2SpaceInstalled();
#ifdef __cplusplus
}
#endif
#endif