X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lib%2Fuuid%2Fuuid_time.c;h=4c3536b479485cae5da81b01a5a0915d972fa5b7;hb=d1154eb460efe588eaed3d439c1caaca149fa362;hp=fc1d26658bf3a011abe2f31e1115a353f11c0f8b;hpb=6ec9ef1881e636540cfe28e6f32c93e1781ad173;p=tools%2Fe2fsprogs.git diff --git a/lib/uuid/uuid_time.c b/lib/uuid/uuid_time.c index fc1d266..4c3536b 100644 --- a/lib/uuid/uuid_time.c +++ b/lib/uuid/uuid_time.c @@ -2,7 +2,7 @@ * uuid_time.c --- Interpret the time field from a uuid. This program * violates the UUID abstraction barrier by reaching into the guts * of a UUID and interpreting it. - * + * * Copyright (C) 1998, 1999 Theodore Ts'o. * * %Begin-Header% @@ -18,7 +18,7 @@ * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. - * + * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF @@ -34,6 +34,8 @@ * %End-Header% */ +#include "config.h" + #ifdef _WIN32 #define _WIN32_WINNT 0x0500 #include @@ -61,7 +63,7 @@ time_t uuid_time(const uuid_t uu, struct timeval *ret_tv) uint64_t clock_reg; uuid_unpack(uu, &uuid); - + high = uuid.time_mid | ((uuid.time_hi_and_version & 0xFFF) << 16); clock_reg = uuid.time_low | ((uint64_t) high << 32); @@ -79,7 +81,7 @@ int uuid_type(const uuid_t uu) { struct uuid uuid; - uuid_unpack(uu, &uuid); + uuid_unpack(uu, &uuid); return ((uuid.time_hi_and_version >> 12) & 0xF); } @@ -88,7 +90,7 @@ int uuid_variant(const uuid_t uu) struct uuid uuid; int var; - uuid_unpack(uu, &uuid); + uuid_unpack(uu, &uuid); var = uuid.clock_seq; if ((var & 0x8000) == 0) @@ -115,7 +117,7 @@ static const char *variant_string(int variant) } } - + int main(int argc, char **argv) { @@ -165,7 +167,7 @@ main(int argc, char **argv) } printf("UUID time is: (%ld, %ld): %s\n", tv.tv_sec, tv.tv_usec, ctime(&time_reg)); - + return 0; } #endif