~zorba-coders/zorba/bugs-1022495-and-1022494

« back to all changes in this revision

Viewing changes to src/util/uuid/uuid.h

  • Committer: chillery+launchpad at lambda
  • Date: 2012-09-12 00:14:08 UTC
  • mfrom: (10923.1.111 zorba)
  • Revision ID: chillery+launchpad@lambda.nu-20120912001408-r0hxvjukenfzpjrk
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2006-2008 The FLWOR Foundation.
3
 
 * 
4
 
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 
 * you may not use this file except in compliance with the License.
6
 
 * You may obtain a copy of the License at
7
 
 * 
8
 
 * http://www.apache.org/licenses/LICENSE-2.0
9
 
 * 
10
 
 * Unless required by applicable law or agreed to in writing, software
11
 
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 
 * See the License for the specific language governing permissions and
14
 
 * limitations under the License.
15
 
 */
16
 
 
17
 
#ifndef ZORBA_UTIL_UUID_H
18
 
#define ZORBA_UTIL_UUID_H
19
 
 
20
 
#undef uuid_t
21
 
 
22
 
namespace zorba {
23
 
 
24
 
typedef struct {
25
 
  xs_unsignedInt    time_low;
26
 
  xs_unsignedShort  time_mid;
27
 
  xs_unsignedShort  time_hi_and_version;
28
 
  xs_unsignedByte   clock_seq_hi_and_reserved;
29
 
  xs_unsignedByte   clock_seq_low;
30
 
  xs_byte           node[6];
31
 
} uuid_t;
32
 
 
33
 
/* uuid_create -- generate a UUID */
34
 
int uuid_create(uuid_t * uuid);
35
 
 
36
 
/* uuidToString -- transform a UUID to a string */
37
 
zstring uuidToString(const uuid_t& uuid);
38
 
 
39
 
/* uuidToURI -- transform a UUID to a URI-formatted string */
40
 
zstring uuidToURI(const uuid_t& uuid);
41
 
 
42
 
} // namespace zorba
43
 
#endif /* ZORBA_UTIL_UUID_H */
44
 
/* vim:set et sw=2 ts=2: */