source: trunk/Cosy/incl/dbtm.h@ 18892

Last change on this file since 18892 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 2.8 KB
Line 
1/*-----------------------------------------------------------------------------
2dbtm.h -- DBT Master Interface
3
4Copyright (c) 1994 JANZ Computer AG
5All Rights Reserved
6
7Created 95/02/23 by Soenke Hansen
8Version 1.7 of 96/05/21
9
10Prototype declarations of functions defined in dbtm.c.
11
12-----------------------------------------------------------------------------*/
13
14#ifndef dbtm_DEFINED
15#define dbtm_DEFINED
16
17#ifdef __cplusplus
18extern "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 */
29struct 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 */
41struct 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 */
48struct 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 */
57extern int CobDBEnabled;
58
59/*--------- COB Database Functions ------------------------------------------*/
60
61/* Create COB Database Service (initialization of DB) */
62extern void CreateCobDB(void);
63
64/* Set state of COB database to ENABLED */
65extern void EnableDist(void);
66
67/* Set state of COB database to DISABLED */
68extern void DisableDist(void);
69
70/* Create COB Definition Service */
71extern 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 */
78extern 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 */
84extern int CreatePreDef(
85 WORD_t, /* COB ID */
86 BYTE_t * /* COB name */
87);
88
89/* Delete Pre-Definition Service */
90extern void DeletePreDef(
91 BYTE_t * /* COB name */
92);
93
94
95/* Get next COB Definition in database. */
96extern struct cobdef *GetNextCobDef(int);
97
98/* Get next User Definition in database. */
99extern struct usrdef *GetNextUsrDef(int);
100
101/* Get next COB Definition in database. */
102extern struct predef *GetNextPreDef(int);
103
104
105/*--------- Creation, Initialization, Destruction ---------------------------*/
106
107/* Create and initialize the DBT Master */
108extern void InitDbtM(
109 WORD_t /* timeout interval */
110);
111
112void 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. */
118extern void DeleteDbtM(void);
119
120
121#ifdef __cplusplus
122}
123#endif
124
125#endif /* !dbtm_DEFINED */
Note: See TracBrowser for help on using the repository browser.