xapian-check-patch: Catch no space between << and "
[xapian.git] / xapian-core / common / win32_uuid.h
blob4b2db1d8d817941af414a5e163708a6ff27ab4fc
1 /* @file win32_uuid.h
2 * @brief Provide UUID functions compatible with libuuid from util-linux-ng.
3 */
4 /* Copyright 2008 Lemur Consulting Ltd
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef XAPIAN_INCLUDED_WIN32_UUID_H
22 #define XAPIAN_INCLUDED_WIN32_UUID_H
24 #if !defined USE_WIN32_UUID_API
25 # error Including win32_uuid.h but USE_WIN32_UUID_API not defined
26 #endif
28 #if !defined __CYGWIN__ && !defined __WIN32__
29 # error Including win32_uuid.h, but neither __CYGWIN__ nor __WIN32__ defined!
30 #endif
32 #include "safewindows.h"
33 #include <rpc.h>
35 // Unfortunately Windows defines uuid_t as GUID, so we redefine it to match the
36 // Unix definition.
37 #undef uuid_t
38 typedef unsigned char uuid_t[16];
40 void uuid_generate(uuid_t uu);
42 int uuid_parse(const char * in, uuid_t uu);
44 void uuid_unparse_lower(const uuid_t uu, char * out);
46 void uuid_clear(uuid_t uu);
48 int uuid_is_null(const uuid_t uu);
50 #endif /* XAPIAN_INCLUDED_WIN32_UUID_H */