1 | /*-----------------------------------------------------------------------------
|
---|
2 | dbtm.h -- DBT Master Interface
|
---|
3 |
|
---|
4 | Copyright (c) 1994 JANZ Computer AG
|
---|
5 | All Rights Reserved
|
---|
6 |
|
---|
7 | Created 95/02/23 by Soenke Hansen
|
---|
8 | Version 1.7 of 96/05/21
|
---|
9 |
|
---|
10 | Prototype declarations of functions defined in dbtm.c.
|
---|
11 |
|
---|
12 | -----------------------------------------------------------------------------*/
|
---|
13 |
|
---|
14 | #ifndef dbtm_DEFINED
|
---|
15 | #define dbtm_DEFINED
|
---|
16 |
|
---|
17 | #ifdef __cplusplus
|
---|
18 | extern "C" {
|
---|
19 | #endif
|
---|
20 |
|
---|
21 | #include "defs.h"
|
---|
22 | #include "msg.h"
|
---|
23 | #include "cal.h"
|
---|
24 |
|
---|
25 |
|
---|
26 | /*--------- Data structures of COB database ---------------------------------*/
|
---|
27 |
|
---|
28 | /* User Definition */
|
---|
29 | struct usrdef {
|
---|
30 | WORD_t id; /* COB-ID */
|
---|
31 | BYTE_t nid; /* node Id */
|
---|
32 | BYTE_t len; /* COB length */
|
---|
33 | BYTE_t type; /* COB type */
|
---|
34 | BYTE_t cclass; /* COB class */
|
---|
35 | WORD_t inht; /* actual inhibit time */
|
---|
36 | BYTE_t cobnm[COB_NAME_LEN]; /* COB name */
|
---|
37 | struct usrdef *next; /* next in same COB definition */
|
---|
38 | };
|
---|
39 |
|
---|
40 | /* Pre-Definition */
|
---|
41 | struct predef {
|
---|
42 | WORD_t id; /* COB-ID */
|
---|
43 | BYTE_t cobnm[COB_NAME_LEN]; /* COB name */
|
---|
44 | struct predef *next; /* next in same COB definition */
|
---|
45 | };
|
---|
46 |
|
---|
47 | /* COB Definition */
|
---|
48 | struct cobdef {
|
---|
49 | WORD_t id; /* COB-ID */
|
---|
50 | WORD_t inht; /* inhibit time */
|
---|
51 | struct usrdef *usr; /* list of user definitions */
|
---|
52 | struct predef *pre; /* list of pre-definitions */
|
---|
53 | };
|
---|
54 |
|
---|
55 |
|
---|
56 | /* State of COB database */
|
---|
57 | extern int CobDBEnabled;
|
---|
58 |
|
---|
59 | /*--------- COB Database Functions ------------------------------------------*/
|
---|
60 |
|
---|
61 | /* Create COB Database Service (initialization of DB) */
|
---|
62 | extern void CreateCobDB(void);
|
---|
63 |
|
---|
64 | /* Set state of COB database to ENABLED */
|
---|
65 | extern void EnableDist(void);
|
---|
66 |
|
---|
67 | /* Set state of COB database to DISABLED */
|
---|
68 | extern void DisableDist(void);
|
---|
69 |
|
---|
70 | /* Create COB Definition Service */
|
---|
71 | extern int CreateCobDef(
|
---|
72 | WORD_t, /* lower bound of COB-ID range */
|
---|
73 | WORD_t, /* upper bound of COB-ID range */
|
---|
74 | WORD_t /* minimum inhibit time */
|
---|
75 | );
|
---|
76 |
|
---|
77 | /* Delete COB Definition Service */
|
---|
78 | extern void DeleteCobDef(
|
---|
79 | WORD_t, /* lower bound of COB-ID range */
|
---|
80 | WORD_t /* upper bound of COB-ID range */
|
---|
81 | );
|
---|
82 |
|
---|
83 | /* Create Pre-Definition Service */
|
---|
84 | extern int CreatePreDef(
|
---|
85 | WORD_t, /* COB ID */
|
---|
86 | BYTE_t * /* COB name */
|
---|
87 | );
|
---|
88 |
|
---|
89 | /* Delete Pre-Definition Service */
|
---|
90 | extern void DeletePreDef(
|
---|
91 | BYTE_t * /* COB name */
|
---|
92 | );
|
---|
93 |
|
---|
94 |
|
---|
95 | /* Get next COB Definition in database. */
|
---|
96 | extern struct cobdef *GetNextCobDef(int);
|
---|
97 |
|
---|
98 | /* Get next User Definition in database. */
|
---|
99 | extern struct usrdef *GetNextUsrDef(int);
|
---|
100 |
|
---|
101 | /* Get next COB Definition in database. */
|
---|
102 | extern struct predef *GetNextPreDef(int);
|
---|
103 |
|
---|
104 |
|
---|
105 | /*--------- Creation, Initialization, Destruction ---------------------------*/
|
---|
106 |
|
---|
107 | /* Create and initialize the DBT Master */
|
---|
108 | extern void InitDbtM(
|
---|
109 | WORD_t /* timeout interval */
|
---|
110 | );
|
---|
111 |
|
---|
112 | void ConfigDbtM(
|
---|
113 | WORD_t timeout, /* timeout interval */
|
---|
114 | WORD_t flags /* various config. flags */
|
---|
115 | );
|
---|
116 |
|
---|
117 | /* Remove the DBT Master. Free the resources it holds. */
|
---|
118 | extern void DeleteDbtM(void);
|
---|
119 |
|
---|
120 |
|
---|
121 | #ifdef __cplusplus
|
---|
122 | }
|
---|
123 | #endif
|
---|
124 |
|
---|
125 | #endif /* !dbtm_DEFINED */
|
---|