-
Notifications
You must be signed in to change notification settings - Fork 0
/
Registry.h
executable file
·84 lines (67 loc) · 2.65 KB
/
Registry.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* Copyright (c) 2008 Texas Instruments. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License
* v. 1.0 which accompanies this distribution. The Eclipse Public License is
* available at http://www.eclipse.org/legal/epl-v10.html and the Eclipse
* Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Texas Instruments - initial implementation
* */
#ifndef REGISTRY__include
#define REGISTRY__include
/*
* ======== INCLUDES ========
*/
#define REGISTRY__MODE
#include <sstd.h>
#include <Types.h>
#include <Log.h>
#include <Config.h>
//#if mode == 1
#ifndef Module__MID
#define Module__MID ((Registry_findByName("main"))->id)
#endif
#undef Module__DGSINCL
#define Module__DGSINCL \
Registry_getDGSINCLMask((Registry_findById(Module__MID))->modName)
#undef Module__DGSENAB
#define Module__DGSENAB \
Registry_getDGSENABMask((Registry_findById(Module__MID))->modName)
#undef Module__DGSMASK
#define Module__DGSMASK \
Registry_getDGSMask((Registry_findById(Module__MID))->modName)
//#endif
typedef Types_RegDesc Registry_Desc;
typedef struct {
Registry_Desc* listHead;
Types_ModuleId curId;
}Registry_State;
typedef enum {
Registry_SUCCESS,
Registry_ALLOC_FAILED,
Registry_ALREADY_ADDED,
Registry_ALL_IDS_USED
}Registry_Result;
Types_DiagsMask Registry_getDGSINCLMask(String name);
Types_DiagsMask Registry_getDGSENABMask(String name);
Types_DiagsMask Registry_getDGSMask(String name);
Registry_Result Registry_addModule(Registry_Desc *desc, String modName,
Types_DiagsMask RuntimeOn,
Types_DiagsMask AlwaysOff,
Types_DiagsMask AlwaysOn,
Types_DiagsMask RuntimeOff);
Registry_Desc *Registry_findByName(String name);
Registry_Desc *Registry_findByNameInList(String name, Registry_Desc *listHead);
Registry_Desc *Registry_findByNamePattern(String namePat, Int len,
Registry_Desc *prev);
Bool Registry_matchPattern(String pattern, Int len, String modName);
Registry_Desc *Registry_findById(Types_ModuleId mid);
Bool Registry_getMask(String name, Types_DiagsMask *mask);
Bool Registry_isMember(Types_ModuleId mid);
Registry_Desc *Registry_getNextModule(Registry_Desc *desc);
String Registry_getModuleName(Registry_Desc *desc);
Types_ModuleId Registry_getModuleId(Registry_Desc *desc);
#endif