Revert "Rename uuid.h wrapper to lttng-ust-uuid.h"
[lttng-ust.git] / liblttng-ust / uuid.h
1 #ifndef _LTTNG_UST_UUID_H
2 #define _LTTNG_UST_UUID_H
3
4 /*
5 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 *
7 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
8 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
9 *
10 * Permission is hereby granted to use or copy this program
11 * for any purpose, provided the above notices are retained on all copies.
12 * Permission to modify the code and to distribute modified code is granted,
13 * provided the above notices are retained, and a notice that the code was
14 * modified is included with the above copyright notice.
15 */
16
17 #include <config.h>
18 #include <lttng/ust-events.h> /* For LTTNG_UST_UUID_LEN */
19 /*
20 * Includes final \0.
21 */
22 #define LTTNG_UST_UUID_STR_LEN 37
23
24 #include <uuid/uuid.h>
25
26 #ifdef LTTNG_UST_HAVE_LIBUUID
27 static inline
28 int lttng_ust_uuid_generate(unsigned char *uuid_out)
29 {
30 uuid_generate(uuid_out);
31 return 0;
32 }
33
34 #elif defined(LTTNG_UST_HAVE_LIBC_UUID)
35 #include <uuid.h>
36 #include <stdint.h>
37
38 static inline
39 int lttng_ust_uuid_generate(unsigned char *uuid_out)
40 {
41 uint32_t status;
42
43 uuid_create(uuid_out, &status);
44 if (status == uuid_s_ok)
45 return 0;
46 else
47 return -1;
48 }
49
50 #else
51 #error "LTTng-UST needs to have a UUID generator configured."
52 #endif
53
54 #endif /* _LTTNG_UST_UUID_H */
This page took 0.035634 seconds and 5 git commands to generate.