Commit 2be87d71 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Privatize resource list status.

* No component external to namespace needs to know.
parent b076010b
......@@ -62,6 +62,11 @@ static const union namespaceSwitchValue
defaultSwitches_[NUM_NAMESPACE_SWITCH] = defaultSwitches;
#endif
enum namespaceStatus {
NAMESPACE_STATUS_INUSE,
NAMESPACE_STATUS_UNUSED,
};
static struct Namespace
{
enum namespaceStatus resStage;
......@@ -264,20 +269,6 @@ int namespaceAdaptKey2 ( int originResH )
return namespaceIdxEncode2 ( nsp, tin.idx );
}
void namespaceDefResStatus (enum namespaceStatus argResStatus )
{
int nsp = namespaceGetActive ();
namespaces[nsp].resStage = argResStatus;
}
enum namespaceStatus namespaceInqResStatus ( void )
{
int nsp = namespaceGetActive ();
return namespaces[nsp].resStage;
}
void namespaceSwitchSet(enum namespaceSwitch sw, union namespaceSwitchValue value)
{
xassert(sw > NSSWITCH_NO_SUCH_SWITCH && sw < NUM_NAMESPACE_SWITCH);
......@@ -303,10 +294,10 @@ void cdiReset(void)
{
Free(namespaces);
namespaces = &initialNamespace;
namespaces[0].resStage = NAMESPACE_STATUS_UNUSED;
}
namespacesSize = 1;
nNamespaces = 1;
activeNamespace = 0;
nNamespaces = 0;
NAMESPACE_UNLOCK();
}
......
......@@ -6,11 +6,6 @@
#endif
enum namespaceStatus {
NAMESPACE_STATUS_INUSE,
NAMESPACE_STATUS_UNUSED,
};
typedef struct {
int idx;
int nsp;
......@@ -66,8 +61,6 @@ int namespaceIdxEncode2 ( int, int );
namespaceTuple_t namespaceResHDecode ( int );
int namespaceAdaptKey ( int originResH, int originNamespace);
int namespaceAdaptKey2 ( int );
void namespaceDefResStatus ( enum namespaceStatus );
enum namespaceStatus namespaceInqResStatus ( void );
void namespaceSwitchSet(enum namespaceSwitch sw,
union namespaceSwitchValue value);
union namespaceSwitchValue namespaceSwitchGet(enum namespaceSwitch sw);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment