Annotation of OpenXM_contrib/pari/src/language/TeXmacs.h, Revision 1.1
1.1 ! maekawa 1: /******************************************************************************
! 2: * MODULE : TeXmacs.h
! 3: * DESCRIPTION: Include file for communication of extern packages with TeXmacs
! 4: * COPYRIGHT : (C) 1999 Joris van der Hoeven
! 5: *******************************************************************************
! 6: * This software falls under the GNU general public licence and comes WITHOUT
! 7: * ANY WARRENTY WHATSOEVER. See the file $TEXMACS_PATH/LICENCE for more details.
! 8: * If you don't have this file, write to the Free Software Foundation, Inc.,
! 9: * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
! 10: *******************************************************************************
! 11: * The TeXmacs communication protocol works as follows:
! 12: * - First of all, the protocol is dynamic. All protocols define
! 13: * the abstract structures 'TeXmacs_exports' and 'package_exports'.
! 14: * These structures contain the version of the protocol used
! 15: * and the versions of TeXmacs and the package
! 16: * - Version n of the concrete protocol implements two structures
! 17: * 'TeXmacs_exports_n' and 'package_exports_n'.
! 18: * The first structure contains all routines and data of TeXmacs,
! 19: * which may be necessary for the package.
! 20: * The structure 'package_exports' contains all routines and data
! 21: * of the package, which should be visible for TeXmacs
! 22: * - Now the package has to be a dynamically linkable library,
! 23: * which implements a function
! 24: * package_exports* get_my_package (int version);
! 25: * In order to link your package to TeXmacs, you will now have to
! 26: * call the TeXmacs function
! 27: * void package_declare (string name, string lib, string f, string init);
! 28: * Here 'name' is the name of your package under TeXmacs,
! 29: * 'lib' the name of the library, 'f' the function 'get_my_package' and
! 30: * 'init' an initialization string.
! 31: ******************************************************************************/
! 32:
! 33: #ifndef __TEXMACS_H
! 34: #define __TEXMACS_H
! 35:
! 36: #if defined (__cplusplus)
! 37: extern "C" {
! 38: #endif
! 39:
! 40: /******************************************************************************
! 41: * Any communication protocol contains at least the following
! 42: ******************************************************************************/
! 43:
! 44: typedef struct TeXmacs_exports {
! 45: char* version_protocol;
! 46: char* version_TeXmacs;
! 47: } TeXmacs_exports;
! 48:
! 49: typedef struct package_exports {
! 50: char* version_protocol;
! 51: char* version_package;
! 52: } package_exports;
! 53:
! 54: /******************************************************************************
! 55: * The first TeXmacs <-> package communication protocol from September 1999
! 56: ******************************************************************************/
! 57:
! 58: typedef struct TeXmacs_exports_1 {
! 59: char* version_protocol; /* "TeXmacs communication protocol 1" */
! 60: char* version_TeXmacs;
! 61: } TeXmacs_exports_1;
! 62:
! 63: typedef struct package_exports_1 {
! 64: char* version_protocol; /* "TeXmacs communication protocol 1" */
! 65: char* version_package;
! 66:
! 67: char* (*install) (TeXmacs_exports_1* TeXmacs,
! 68: char* options, char** failure_flag);
! 69: /* installation routine for extern package
! 70: TeXmacs: pointer to routines exported by TeXmacs
! 71: options: a string with installation option (freed by TeXmacs)
! 72: *failure_flag: contains 1 on exit, if installation failed
! 73: returns: a status message when installation succeeded
! 74: : an error message when installation failed */
! 75:
! 76: char* (*evaluate) (char* what, char* session, char** failure_flag);
! 77: /* interactive evaluation routine for shells
! 78: what: string to be evaluated (freed by TeXmacs)
! 79: session: name of your session ("default" by default, freed by TeXmacs)
! 80: *failure_flag: contains 1 on exit, if evaluation failed
! 81: returned string: result of the evaluation or error message
! 82: (freed by TeXmacs) */
! 83:
! 84: char* (*execute) (char* what, char* session, char** failure_flag);
! 85: /* alternative routine for executing strings,
! 86: used for controlling the interaction between TeXmacs and the package
! 87: what: string to be executed (freed by TeXmacs)
! 88: session: name of your session ("default" by default, freed by TeXmacs)
! 89: *failure_flag: contains 1 on exit, if execution failed
! 90: returned string: result of the execution or error message
! 91: (freed by TeXmacs) */
! 92: } package_exports_1;
! 93:
! 94: #if defined (__cplusplus)
! 95: }
! 96: #endif
! 97:
! 98: #endif __TEXMACS_H
! 99:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>