grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / libs / uuid / uuid_namespace.c
blob93996c17346fe41e7918b81bec7e3f793dca6dee
1 /*
2 Copyright © 2007-2008, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 1
8 #include <aros/symbolsets.h>
9 #include <aros/debug.h>
10 #include <aros/libcall.h>
11 #include <proto/exec.h>
13 #include "uuid_private.h"
14 #include LC_LIBDEFS_FILE
16 /* Name string is a fully-qualified domain name */
17 static uuid_t NameSpace_DNS = { /* 6ba7b810-9dad-11d1-80b4-00c04fd430c8 */
18 0x6ba7b810,
19 0x9dad,
20 0x11d1,
21 0x80, 0xb4, {0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8}
24 /* Name string is a URL */
25 static uuid_t NameSpace_URL = { /* 6ba7b811-9dad-11d1-80b4-00c04fd430c8 */
26 0x6ba7b811,
27 0x9dad,
28 0x11d1,
29 0x80, 0xb4, {0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8}
32 /* Name string is an ISO OID */
33 static uuid_t NameSpace_OID = { /* 6ba7b812-9dad-11d1-80b4-00c04fd430c8 */
34 0x6ba7b812,
35 0x9dad,
36 0x11d1,
37 0x80, 0xb4, {0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8}
40 /* Name string is an X.500 DN (in DER or a text output format) */
41 static uuid_t NameSpace_X500 = { /* 6ba7b814-9dad-11d1-80b4-00c04fd430c8 */
42 0x6ba7b814,
43 0x9dad,
44 0x11d1,
45 0x80, 0xb4, {0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8}
48 static uuid_t _null = {0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0}};
50 AROS_LH2(void, UUID_GetNameSpace,
51 AROS_LHA(uint32_t, NameSpace, D0),
52 AROS_LHA(uuid_t *, uuid, A0),
53 struct uuid_base *, UUIDBase, 6, UUID)
55 AROS_LIBFUNC_INIT
57 ASSERT(uuid);
59 switch(NameSpace)
61 case UUID_NAMESPACE_DNS:
62 *uuid = NameSpace_DNS;
63 break;
65 case UUID_NAMESPACE_URL:
66 *uuid = NameSpace_URL;
67 break;
69 case UUID_NAMESPACE_OID:
70 *uuid = NameSpace_OID;
71 break;
73 case UUID_NAMESPACE_X500:
74 *uuid = NameSpace_X500;
75 break;
77 default:
78 *uuid = _null;
79 break;
82 AROS_LIBFUNC_EXIT