UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
history.h
1 /* history.h */
2 /* $Id: history.h,v 1.8 2003/02/14 16:20:09 vlad Exp $ */
3 #ifndef __history_h
4 #define __history_h
5 
6 #include <mix/Types.h>
7 #include <ldb/dbtc.h>
8 
9 
10 /***********************************************************************
11  *
12  * Processing history API
13  *
14  ***********************************************************************/
15 
16 /* Possible historical events that relate to data/jobs life inside the
17  project during the data processing. */
18 typedef enum
19 {
20  heNone = 0,
21  heMemo,
22  heStartJob,
23  heFinishJob,
24  heCreateData,
25  heModifyData,
26  heReadData,
27  heDeleteData,
28  heBackupData,
29  heRestoreData,
30  heImportData,
31  heExportData,
32  __heNumber
34 } HistoricalEvent;
35 
36 
40 typedef Int4 TimeStampId;
41 
42 
46 typedef struct{
47  dbNameStruct name;
48  TimeStampId iDeathDate;
49  char sDate[MOMENT_LEN+1];
50 } phDataObject;
51 
56 typedef struct{
57  int count;
58  phDataObject* phdoList;
59  HistoricalEvent*pheList;
60  HistoricalEvent pheEqual;
61 } phDataEvents;
62 
66 typedef struct{
67  char sAppName[WE_NAME_LEN+1];
68  char sDate[MOMENT_LEN+1];
69  char sUser[WE_NAME_LEN+1];
70  int JobNumber;
71 } phJobObject;
72 
76 typedef struct{
77  int count;
78  phJobObject* phjoList;
79  HistoricalEvent*pheList;
80  HistoricalEvent pheEqual;
81 } phJobEvents;
82 
83 
85 typedef struct{
86  char sDate[MOMENT_LEN+1];
88 
89 
93 #define PH_EVENT_LEN 255
94 
95 
96 #ifdef __cplusplus
97 extern "C" {
98 #endif /* __cplusplus */
99 
100 
101 /***********************************************************************
102  * Logging historical events.
103  ***********************************************************************/
104 
106 void phAddRecord (const char* project,
107  HistoricalEvent event,
108  const dbNameStruct* dataref);
109 
111 void phAddMemo (const char* project,
112  const char szMemo[PH_EVENT_LEN+1]);
113 
114 
115 /***********************************************************************
116  * Toolkit for querying processing history.
117  ***********************************************************************/
118 
121 Logic phGatherHistory (dbHandle dbh);
122 
123 
128 ErrCode phQueryEventsByData(const char* project, phDataObject phdo,
129  phJobEvents* pOE);
130 ErrCode phQueryEventsByProg(const char* project, phJobObject phjo,
131  phDataEvents* pOE);
132 ErrCode phQueryEventsByDate(const char* project,
134  phJobEvents* pJE,phDataEvents* pDE);
135 
139 ErrCode phExtractDataEvent(HistoricalEvent event,
140  const phDataEvents* poeIn,phDataEvents*poeOut);
141 ErrCode phExtractJobEvent(HistoricalEvent event,
142  const phJobEvents* poeIn,phJobEvents*poeOut);
143 
147 ErrCode phAppendJobEvents(phJobEvents* poeWhere,phJobEvents*poeWhat);
148 ErrCode phAppendDataEvents(phDataEvents* poeWhere,phDataEvents*poeWhat);
149 
150 ErrCode phCopyDataObject(phDataObject* pTo,phDataObject* pFrom);
151 ErrCode phCopyJobObject(phJobObject* pTo,phJobObject* pFrom);
152 
155 phJobEvents* newphJobEvents();
156 
159 phDataEvents* newphDataEvents();
160 
161 /***********************************************************************
162  * Service and miscellaneous.
163  ***********************************************************************/
164 
166 const char* phEventToString (HistoricalEvent he);
167 
169 HistoricalEvent phStringToEvent (const char* str);
170 
171 
172 /***********************************************************************
173  * Common variables and constants.
174  ***********************************************************************/
175 
176 #ifndef __ProcHistVars
177 
178 extern dbNameStruct dbnsHistory;
179 
180 #endif /* __ProcHistVars */
181 
182 
183 #ifdef __cplusplus
184 };
185 #endif /* __cplusplus */
186 
187 #endif /* history.h */
Definition: history.h:56
Definition: dbnamedefs.h:67
Definition: history.h:46
Definition: history.h:85
Definition: history.h:66
Definition: history.h:76