namespace.c 487 Bytes
Newer Older
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
#include <stdlib.h>
#include "cdi.h"

enum { MAX_NAMESPACES = 16 };

static int nNamespaces = 1;
static int activeNamespace;


void namespaceSetNumber ( int nspn )
{
  if ( nspn > MAX_NAMESPACES || nspn <= 1 )
    abort ();

  nNamespaces = nspn;
}

int namespaceGetNumber ()
{
  return nNamespaces;
}


void namespaceSetActive ( int nId )
{
  if ( nId >= nNamespaces || nId < 0 )
    abort ();

  activeNamespace = nId;
}

int namespaceGetActive ()
{
  return activeNamespace;
}