"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/libglusterfs/src/glusterfs/compat-uuid.h" (16 Sep 2020, 1298 Bytes) of package /linux/misc/glusterfs-8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "compat-uuid.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (c) 2015 Red Hat, Inc. <http://www.redhat.com>
    3  * This file is part of GlusterFS.
    4  *
    5  * This file is licensed to you under your choice of the GNU Lesser
    6  * General Public License, version 3 or any later version (LGPLv3 or
    7  * later), or the GNU General Public License, version 2 (GPLv2), in all
    8  * cases as published by the Free Software Foundation.
    9  */
   10 
   11 #ifndef _GF_UUID_H
   12 #define _GF_UUID_H
   13 
   14 #include <uuid/uuid.h>
   15 
   16 static inline void
   17 gf_uuid_clear(uuid_t uuid)
   18 {
   19     uuid_clear(uuid);
   20 }
   21 
   22 static inline int
   23 gf_uuid_compare(uuid_t u1, uuid_t u2)
   24 {
   25     return uuid_compare(u1, u2);
   26 }
   27 
   28 static inline void
   29 gf_uuid_copy(uuid_t dst, const uuid_t src)
   30 {
   31     uuid_copy(dst, src);
   32 }
   33 
   34 static inline void
   35 gf_uuid_generate(uuid_t uuid)
   36 {
   37     uuid_generate(uuid);
   38 }
   39 
   40 static inline int
   41 gf_uuid_is_null(uuid_t uuid)
   42 {
   43     return uuid_is_null(uuid);
   44 }
   45 
   46 static inline int
   47 gf_uuid_parse(const char *in, uuid_t uuid)
   48 {
   49     return uuid_parse(in, uuid);
   50 }
   51 
   52 static inline void
   53 gf_uuid_unparse(const uuid_t uuid, char *out)
   54 {
   55     uuid_unparse(uuid, out);
   56 }
   57 
   58 /* TODO: add more uuid APIs, use constructs like this:
   59 #if defined(__NetBSD__) * NetBSD libc *
   60 
   61 #include <string.h>
   62 
   63 static inline void
   64 gf_uuid_clear (uuid_t uuid)
   65 {
   66         memset (uuid, 0, sizeof (uuid_t));
   67 }
   68 #endif
   69 */
   70 
   71 #endif /* _GF_UUID_H */