Annotation of freem/src/freem.h, revision 1.1
1.1 ! snw 1: /*
! 2: * *
! 3: * * *
! 4: * * *
! 5: * ***************
! 6: * * * * *
! 7: * * MUMPS *
! 8: * * * * *
! 9: * ***************
! 10: * * *
! 11: * * *
! 12: * *
! 13: *
! 14: * freem.h
! 15: * libfreem data structures and prototypes
! 16: *
! 17: * NOTE: Caller must pre-allocate memory for *all* APIs!
! 18: *
! 19: *
! 20: * Author: Serena Willis <jpw@coherent-logic.com>
! 21: * Copyright (C) 1998 MUG Deutschland
! 22: * Copyright (C) 2020 Coherent Logic Development LLC
! 23: *
! 24: *
! 25: * This file is part of FreeM.
! 26: *
! 27: * FreeM is free software: you can redistribute it and/or modify
! 28: * it under the terms of the GNU Affero Public License as published by
! 29: * the Free Software Foundation, either version 3 of the License, or
! 30: * (at your option) any later version.
! 31: *
! 32: * FreeM is distributed in the hope that it will be useful,
! 33: * but WITHOUT ANY WARRANTY; without even the implied warranty of
! 34: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 35: * GNU Affero Public License for more details.
! 36: *
! 37: * You should have received a copy of the GNU Affero Public License
! 38: * along with FreeM. If not, see <https://www.gnu.org/licenses/>.
! 39: *
! 40: **/
! 41:
! 42: #ifndef _LIBFREEM_H
! 43: # define _LIBFREEM_H
! 44:
! 45: #include "merr.h"
! 46: #include <sys/types.h>
! 47:
! 48: #if !defined(STRLEN)
! 49: # define STRLEN 65535
! 50: #endif
! 51:
! 52: #define MREF_RT_LOCAL 0
! 53: #define MREF_RT_GLOBAL 1
! 54: #define MREF_RT_SSVN 2
! 55: #define MREF_RT_SSV MREF_RT_SSVN
! 56:
! 57: #define MREF_ST_NEW 0
! 58: #define MREF_ST_INIT 1
! 59: #define MREF_ST_ERR 10
! 60:
! 61: #define MLIB_ERRLEN 180
! 62:
! 63: typedef struct freem_ref_t {
! 64:
! 65: /*
! 66: * The 'reftype' field can be one of:
! 67: *
! 68: * MREF_RT_LOCAL
! 69: * MREF_RT_GLOBAL
! 70: * MREF_RT_SSVN
! 71: */
! 72: short reftype;
! 73:
! 74: /*
! 75: * The 'name' field is the name of the local variable,
! 76: * global variable, or SSV.
! 77: */
! 78: char name[256];
! 79:
! 80: /*
! 81: * Returned data goes in a string, so it is important to make sure
! 82: * that your application accounts for canonical numbers as needed.
! 83: */
! 84: char value[STRLEN];
! 85:
! 86: short status;
! 87:
! 88: unsigned int subscript_count;
! 89: char subscripts[255][256];
! 90:
! 91: } freem_ref_t;
! 92:
! 93: typedef struct freem_ent_t {
! 94:
! 95: /* name of function or procedure entry point */
! 96: char name[256];
! 97:
! 98: /* return value */
! 99: char value[STRLEN];
! 100:
! 101: /* value of ierr on return */
! 102: short status;
! 103:
! 104: /* argument count and array */
! 105: unsigned int argument_count;
! 106: char arguments[255][256];
! 107:
! 108: } freem_ent_t;
! 109:
! 110: #ifndef TRUE
! 111: # define TRUE 1
! 112: #endif
! 113:
! 114: #ifndef FALSE
! 115: # define FALSE 0
! 116: #endif
! 117:
! 118: #ifdef __cplusplus
! 119: extern "C" {
! 120: #endif
! 121:
! 122: extern pid_t freem_init(char *environment_name, char *namespace_name);
! 123: extern short freem_version(char *result);
! 124: extern short freem_set(freem_ref_t *ref);
! 125: extern short freem_get(freem_ref_t *ref);
! 126: extern short freem_kill(freem_ref_t *ref);
! 127: extern short freem_data(freem_ref_t *ref);
! 128: extern short freem_order(freem_ref_t *ref);
! 129: extern short freem_query(freem_ref_t *ref);
! 130: extern short freem_lock(freem_ref_t *ref, long lck_timeout);
! 131: extern short freem_unlock(freem_ref_t *ref, long lck_timeout);
! 132: extern short freem_tstart(char *tp_id, short serial, short restartable, char **sym_save);
! 133: extern short freem_trestart(void);
! 134: extern short freem_trollback(int tp_levels);
! 135: extern short freem_tcommit(void);
! 136: extern int freem_tlevel(void);
! 137: extern short freem_function(freem_ent_t *ent);
! 138: extern short freem_procedure(freem_ent_t *ent);
! 139: extern short freem_errmsg(int code, char *msg);
! 140:
! 141: #ifdef __cplusplus
! 142: }
! 143: #endif
! 144:
! 145: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>