2
/******************************************************************************
4
* DESCRIPTION: Include file for communication of extern packages with TeXmacs
5
* COPYRIGHT : (C) 1999 Joris van der Hoeven
6
*******************************************************************************
7
* This software falls under the GNU general public license and comes WITHOUT
8
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
9
* If you don't have this file, write to the Free Software Foundation, Inc.,
10
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
11
*******************************************************************************
12
* The TeXmacs communication protocol works as follows:
13
* - First of all, the protocol is dynamic. All protocols define
14
* the abstract structures 'TeXmacs_exports' and 'package_exports'.
15
* These structures contain the version of the protocol used
16
* and the versions of TeXmacs and the package
17
* - Version n of the concrete protocol implements two structures
18
* 'TeXmacs_exports_n' and 'package_exports_n'.
19
* The first structure contains all routines and data of TeXmacs,
20
* which may be necessary for the package.
21
* The structure 'package_exports' contains all routines and data
22
* of the package, which should be visible for TeXmacs
23
* - Now the package has to be a dynamically linkable library,
24
* which implements a function
25
* package_exports* get_my_package (int version);
26
* In order to link your package to TeXmacs, you will now have to
27
* call the TeXmacs function
28
* void package_declare (string name, string lib, string f, string init);
29
* Here 'name' is the name of your package under TeXmacs,
30
* 'lib' the name of the library, 'f' the function 'get_my_package' and
31
* 'init' an initialization string.
32
******************************************************************************/
37
#if defined (__cplusplus)
41
/******************************************************************************
42
* Any communication protocol contains at least the following
43
******************************************************************************/
45
typedef struct TeXmacs_exports {
46
char* version_protocol;
47
char* version_TeXmacs;
50
typedef struct package_exports {
51
char* version_protocol;
52
char* version_package;
55
/******************************************************************************
56
* The first TeXmacs <-> package communication protocol from September 1999
57
******************************************************************************/
59
typedef struct TeXmacs_exports_1 {
60
char* version_protocol; /* "TeXmacs communication protocol 1" */
61
char* version_TeXmacs;
64
typedef struct package_exports_1 {
65
char* version_protocol; /* "TeXmacs communication protocol 1" */
66
char* version_package;
68
char* (*install) (TeXmacs_exports_1* TeXmacs,
69
char* options, char** errors);
70
/* Installation routine for extern package.
71
TeXmacs: pointer to routines exported by TeXmacs
72
options: a string with installation option (freed by TeXmacs)
73
*errors: contains error and warning messages (freed by TeXmacs)
74
returned string: status of installation (freed by TeXmacs)
75
: NULL indicates a pure error */
77
char* (*evaluate) (char* what, char* session, char** errors);
78
/* Interactive evaluation routine for shells.
79
what: string to be evaluated (freed by TeXmacs)
80
session: name of your session ("default" by default, freed by TeXmacs)
81
*errors: contains error and warning messages (freed by TeXmacs)
82
returned string: result of the evaluation (freed by TeXmacs)
83
: NULL indicates a pure error */
86
#if defined (__cplusplus)
90
#endif /* __TEXMACS_H */