Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
2be87d71
Commit
2be87d71
authored
Oct 23, 2015
by
Thomas Jahns
🤸
Browse files
Privatize resource list status.
* No component external to namespace needs to know.
parent
b076010b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/namespace.c
View file @
2be87d71
...
...
@@ -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
();
}
...
...
src/namespace.h
View file @
2be87d71
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment