.ad 8
.bm 8
.fm 4
.bt $Copyright by   Software AG, 1997$$Page %$
.tm 12
.hm 6
.hs 3
.tt 1 $SQL$Project Distributed Database System$VSP009C$
.tt 2 $$$
.tt 3 $$                        $1997-01-08$
***********************************************************
.nf


    ========== licence begin LGPL
    Copyright (C) 2002 SAP AG

    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
    ========== licence end

.fo
.nf
.sp
Module  : Common declarations for control server
=========
.sp
Purpose :
 
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  :
.sp
.cp 3
Created :
.sp
.cp 3
Version : 1997-01-08
.sp
.cp 3
Release :  6.2 	 Date : 1997-01-08
.sp
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Specification:
 
.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Description:
 
.CM *-END-* description ---------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.nf
.oc _/1
Structure:
 
.CM *-END-* structure -----------------------------------
.sp 2
**********************************************************
.sp
.cp 10
.nf
.oc _/1
.CM -lll-
Code    :
/*PRETTY*/
 
typedef int tsp9_bool;
#if !defined (UNDEF)
#define UNDEF (-1)
#endif
 
#if defined (SCO)
/* compc defines _SVID -> ANSI functions take char* as arg */
typedef char* tsp9_cstr;
#else
typedef const char* tsp9_cstr;
#endif
 
/**\
--------------------------------------- MF__ MOD__ (remote control)
\**/
 
#if !defined (SP1CE_OK)
#define  SP1CE_OK		 0
#define  SP1CE_NOTOK		 1
#define  SP1CE_TASKLIMIT  	 2
#define  SP1CE_TIMEOUT  	 3
#define  SP1CE_CRASH  		 4
#define  SP1CE_START_REQUIRED  	 5
#define  SP1CE_SHUTDOWN  	 6
#define  SP1CE_SEND_LINE_DOWN  	 7
#define  SP1CE_RECEIVE_LINE_DOWN 8
#define  SP1CE_PACKET_LIMIT  	 9
#define  SP1CE_RELEASED        	10
#define  SP1CE_WOULDBLOCK      	11
typedef unsigned char tsp1_comm_error;
#endif
 
/* SQL_CONTROL belongs into vsp00c after SQL_UTILITY */
#define SQL_CONTROL	4
 
#define csp9_ctrl_packet_size	16384
 
/**\
--------------------------------------- MF__ MOD__ (control interface)
\**/
 
#define csp9_ctrlcmd_ok      0
#define csp9_ctrlcmd_err     1
#define csp9_ctrl_release    2
 
void ctrlservopen (
    void** vcontrolData,
    tsp9_cstr dbname,
    tsp9_cstr dbroot);
 
void ctrlservclose (
    void* vcontrolData);
 
int ctrlservcommand (
    void* vcontrolData,
    char* requestData,
    int requestLen,
    char* replyData,
    int* replyLen,
    int replyLenmax);
 
extern void sqlxservinit (
    void** rteData,
    int argc,
    char* argv [],
    char* dbname,
    char* dbroot,
    tsp1_comm_error* commErr);
 
extern void sqlxservrecv (
    void *voidRTE,
    char** recvPacket,
    int*   recvLen,
    char** sendPacket,
    int*   maxSendLen,
    tsp1_comm_error* commErr);
 
extern void sqlxservsend (
    void *voidRTE,
    int sendLen,
    tsp1_comm_error* commErr);
 
extern void sqlxservexit (
    void *voidRTE);
 
/**\
--------------------------------------- MF__ MOD__ (control implementation)
\**/
 
typedef enum {
    csp9_fast_pgm, csp9_quick_pgm, csp9_slow_pgm, csp9_any_pgm
} tsp9_pgm_kind;
 
typedef tsp_int4 tsp9_server_options;
 
#define csp9_no_options         0
#define csp9_start_automatic    1
 
#define csp9_xrte_ok		0
#define csp9_xrte_notok		1
#define csp9_xrte_atend		2
 
typedef struct tsp9_rte_xerror {
    int         xe_result;
    int	        xe_native_error;
    char        xe_text[200];
} tsp9_rte_xerror;
 
typedef enum {
    csp9_read_first, csp9_read_next, csp9_read_again
} tsp9_rte_readdirection;
 
extern void sqlxinit (
    tsp9_cstr dbname,
    tsp9_cstr dbroot);
 
extern void sqlxfinish (void);
 
#define csp9_kernel     FALSE
#define csp9_gateway    TRUE
 
extern void sqlxstart (
    tsp9_cstr dbname,
    tsp9_pgm_kind pgmKind,
    tsp9_cstr dbroot,
    BOOLEAN is_gateway,
    int argc,
    char* argv[],
    tsp9_rte_xerror* xerror);
 
extern void sqlxstop (
    tsp9_cstr dbname,
    tsp9_cstr dbroot,
    BOOLEAN dumpflag,
    tsp9_rte_xerror* xerror);
 
extern void sqlxclear (
    tsp9_cstr dbname,
    tsp9_cstr dbroot,
    tsp9_rte_xerror* xerror);
 
extern void sqlxkernelcntl (
    tsp9_cstr cmdstring,
    tsp9_rte_xerror* xerror);
 
extern void sqlxknlopenmonitor (
    tsp9_cstr topic,
    int flags,
    void** monitorHandle,
    tsp9_cstr* description,
    tsp9_rte_xerror* xerror);
 
extern void sqlxknlmonitor (
    void* monitorHandle,
    tsp9_rte_readdirection direction,
    char* description,
    int maxDescLen,
    tsp9_rte_xerror* xerror);
 
extern void sqlxknlclosemonitor (
    void* monitorHandle);
 
#define csp9_version_digits     4
#define csp9_invalid_version  (-1)
 
typedef struct tsp9_release_version {
    signed char  no[csp9_version_digits];
} tsp9_release_version;
 
#define csp9_state_unknown	0
#define csp9_state_off		1
#define csp9_state_running	2
#define csp9_state_ruin		3
 
typedef struct tsp9_rte_dbinfo {
    VF_FILENAMEC        dbname;
    VF_FILENAMEC        dbroot;
    tsp9_release_version version;
    tsp9_pgm_kind       pgmKind;
    tsp9_server_options options;
    int                 state;
} tsp9_rte_dbinfo;
 
typedef struct tsp9_rte_installationinfo {
    VF_FILENAMEC        dbroot;
    tsp9_release_version version;
} tsp9_rte_installationinfo;
 
extern void sqlxregisterdb (
    tsp9_cstr           dbname,
    tsp9_cstr           dbroot,
    tsp9_pgm_kind       pgmKind,
    tsp9_server_options options,
    tsp9_rte_xerror*    xerror);
 
extern void sqlxunregisterdb (
    tsp9_cstr           dbname,
    tsp9_pgm_kind       pgmKind,
    tsp9_rte_xerror*    xerror);
 
extern void sqlxopen_db_enum (
    void**              handle,
    BOOLEAN             fullinfo,
    tsp9_rte_xerror*    xerror);
 
extern void sqlxnext_db (
    void*               handle,
    tsp9_rte_dbinfo*    dbinfo,
    tsp9_rte_xerror*    xerror);
 
extern void sqlxclose_db_enum (
    void*               handle);
 
extern void sqlxregisterinst (
    tsp9_cstr           dbroot,
    tsp9_release_version* version,
    tsp9_rte_xerror*    xerror);
 
extern void sqlxunregisterinst (
    tsp9_cstr           dbroot,
    tsp9_rte_xerror*    xerror);
 
extern void sqlxopen_installation_enum (
    void**              handle,
    tsp9_rte_xerror*    xerror);
 
extern void sqlxnext_installation (
    void*               handle,
    tsp9_rte_installationinfo* releaseinfo,
    tsp9_rte_xerror*    xerror);
 
extern void sqlxclose_installation_enum (
    void*               handle);
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
*-PRETTY-*  statements    :        235
*-PRETTY-*  lines of code :        235        PRETTY  3.09 
*-PRETTY-*  lines in file :        321         1992-11-23 
.PA 
