~ubuntu-branches/ubuntu/hardy/texmacs/hardy

« back to all changes in this revision

Viewing changes to TeXmacs/include/TeXmacs.h

  • Committer: Bazaar Package Importer
  • Author(s): Ralf Treinen
  • Date: 2004-04-19 20:34:00 UTC
  • Revision ID: james.westby@ubuntu.com-20040419203400-g4e34ih0315wcn8v
Tags: upstream-1.0.3-R2
ImportĀ upstreamĀ versionĀ 1.0.3-R2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/******************************************************************************
 
3
* MODULE     : TeXmacs.h
 
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
******************************************************************************/
 
33
 
 
34
#ifndef __TEXMACS_H
 
35
#define __TEXMACS_H
 
36
 
 
37
#if defined (__cplusplus)
 
38
extern "C" {
 
39
#endif
 
40
 
 
41
/******************************************************************************
 
42
* Any communication protocol contains at least the following
 
43
******************************************************************************/
 
44
 
 
45
typedef struct TeXmacs_exports {
 
46
  char* version_protocol;
 
47
  char* version_TeXmacs;
 
48
} TeXmacs_exports;
 
49
 
 
50
typedef struct package_exports {
 
51
  char* version_protocol;
 
52
  char* version_package;
 
53
} package_exports;
 
54
 
 
55
/******************************************************************************
 
56
* The first TeXmacs <-> package communication protocol from September 1999
 
57
******************************************************************************/
 
58
 
 
59
typedef struct TeXmacs_exports_1 {
 
60
  char* version_protocol; /* "TeXmacs communication protocol 1" */
 
61
  char* version_TeXmacs;
 
62
} TeXmacs_exports_1;
 
63
 
 
64
typedef struct package_exports_1 {
 
65
  char* version_protocol; /* "TeXmacs communication protocol 1" */
 
66
  char* version_package;
 
67
 
 
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 */
 
76
 
 
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 */
 
84
} package_exports_1;
 
85
 
 
86
#if defined (__cplusplus)
 
87
}
 
88
#endif
 
89
 
 
90
#endif /* __TEXMACS_H */