diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
commit | 8362bf63dea22bbf6736609b0f49c152f975eb63 (patch) | |
tree | 0eea3928e39e50fae91d4e68b21b1e6cbae25604 /kexi/3rdparty/uuid | |
download | koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip |
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/3rdparty/uuid')
28 files changed, 2029 insertions, 0 deletions
diff --git a/kexi/3rdparty/uuid/ChangeLog b/kexi/3rdparty/uuid/ChangeLog new file mode 100644 index 00000000..db8b00cd --- /dev/null +++ b/kexi/3rdparty/uuid/ChangeLog @@ -0,0 +1,435 @@ +2003-07-25 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs 1.34 + +2003-04-21 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs 1.33 + +2003-04-21 Theodore Ts'o <[email protected]> + + * Makefile.in: Use DYLD_LIBRAY_PATH so that "make check" works on + Darwin systems when building with shared libraries. + +2003-04-12 Theodore Ts'o <[email protected]> + + * gen_uuid.c: Add #ifdef checks around #include <sys/ioctl.h> and + <sys/socket.h>. + +2003-04-03 Theodore Ts'o <[email protected]> + + * gen_uuid.c (get_random_bytes): Always xor in a stream of bytes + from the system PRNG (i.e., random/srandom, seeded from + the time, pid, and uid) in case /dev/random isn't doing + the right thing on a particular system. It doesn't hurt, + and it can help, in the case of a buggy /dev/random. + +2003-03-14 Theodore Ts'o <[email protected]> + + * Makefile.in: Add support for Apple Darwin + +2003-03-06 Theodore Tso <[email protected]> + + * uuid_types.h.in: Don't redefine types if other e2fsprogs + *_types.h files have been included already. + + * Makefile.in (tst_uuid): Link against the static library instead + of all of the object files, so that we automatically pick + up -lsocket under Solaris. + +2003-03-02 Theodore Ts'o <[email protected]> + + * Makefile.in, uuidP.h, uuid_types.h.in: Use uuid_types.h instead + of ext2_types.h + +2002-11-09 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs 1.32 + +2002-11-08 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs 1.31 + +2002-10-31 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs 1.30 + +2002-10-31 Theodore Ts'o <[email protected]> + + * gen_uuid.c (get_random_bytes): Don't spin forever if read() + returns EINTR or EAGAIN, so that when /dev/random is + opened O_NONBLOCK, we don't end up spinning forever. + +2001-09-24 Theodore Tso <[email protected]> + + * Release of E2fsprogs 1.29 + +2001-08-31 Theodore Tso <[email protected]> + + * Release of E2fsprogs 1.28 + +2002-07-15 Theodore Ts'o <[email protected]> + + * parse.c (uuid_parse): Fix uuid parsing bug which didn't complain + for certain types of invalid input text. (Addresses + Debian bug #152891). + + * tst_uuid.c: Add test cases for invalid text strings passed to + uuid_parse. + +2002-03-08 Theodore Tso <[email protected]> + + * Release of E2fsprogs 1.27 + +2002-02-24 Theodore Tso <[email protected]> + + * Makefile.in (install): Install hard links to man pages for + uuid_generate_random and uuid_generate_time. Remove + any compressed man pages before installing the man pages. + +2002-02-03 Theodore Tso <[email protected]> + + * Release of E2fsprogs 1.26 + +2001-09-20 Theodore Tso <[email protected]> + + * Release of E2fsprogs 1.25 + +2001-09-10 Theodore Tso <[email protected]> + + * compare.c (uuid_compare), copy.c (uuid_copy), + isnull.c (uuid_is_null), pack.c (uuid_pack), + parse.c (uuid_parse), unpack.c (uuid_unpack), + unparse.c (uuid_unparse), uuid.h, uuidP.h, + uuid_time.c (uuid_time, uuid_type, uuid_variant): + Use const for pointer variables that we don't modify. Add + the appropriate ifdef's in uuid.h to make it be C++ friendly. + +2001-09-02 Theodore Tso <[email protected]> + + * Release of E2fsprogs 1.24a + +2001-08-30 Theodore Tso <[email protected]> + + * Release of E2fsprogs 1.24 + +2001-08-15 Theodore Tso <[email protected]> + + * Release of E2fsprogs 1.23 + +2001-06-23 Theodore Tso <[email protected]> + + * Release of E2fsprogs 1.22 + +2001-06-21 Theodore Tso <[email protected]> + + * uuid.h: Add protection against multiple inclusion + +2001-06-15 Theodore Tso <[email protected]> + + * Release of E2fsprogs 1.21 + +2001-06-01 Theodore Tso <[email protected]> + + * Makefile.in, uuidP.h: Move include/asm/types.h.in to + lib/ext2fs/ext2_types.h.in. + +2001-06-01 Theodore Tso <[email protected]> + + * unpack.c, unparse.c, uuid_time.c: Update files to be under the + LGPL (that somehow were missed when libuuid was converted + to use the LGPL). Whoops. + +2001-05-25 Theodore Tso <[email protected]> + + * Release of E2fsprogs 1.20 + +2001-05-14 Theodore Tso <[email protected]> + + * tst_uuid.c, uuid_time.c: Remove unneeded #include of ext2_fs.h + +2001-05-12 Theodore Tso <[email protected]> + + * libuuid.3.in, uuid_clear.3.in, uuid_compare.3.in, uuid_copy.3.in, + uuid_generate.3.in, uuid_is_null.3.in, uuid_parse.3.in, + uuid_time.3.in, uuid_unparse.3.in: Update URL location of + e2fsprogs package. + +2001-05-01 Theodore Tso <[email protected]> + + * parse.c, compare.c: Include string.h to fix gcc -Wall + complaints. + + * gen_uuid.c: Define _SVID_SOURCE to avoid gcc -Wall errors + because some required structures wouldn't be otherwise + defined. Fix a minor gcc -Wall nit in the declaration of + get_random_fd(). + +2001-01-12 Theodore Ts'o <[email protected]> + + * uuid_time.c (main), tst_uuid.c (main): Fix gcc -Wall complaints. + + * uuid.h, copy.c (uuid_copy): Change arguments to make it + clear which argument is the source and which is the + destination. + + * gen_uuid.c (get_random_fd): Use gettimeofday to seed the PRNG, + so we can take advantage of tv_usec to do (slightly) + better at seeding it. + +2000-07-13 <[email protected]> + + * Release of E2fsprogs 1.19 + +2000-07-07 Theodore Ts'o <[email protected]> + + * Makefile.in (uuid_time): Fix compilation rule so that + uuid_time.o doesn't get bashed in order to build the + command-line version of uuid_time. + +2000-07-04 Theodore Ts'o <[email protected]> + + * Makefile.in: Remove explicit link of -lc in the shared library. + (It shouldn't be necessary, and is harmful in some cases). + +2000-06-12 Theodore Ts'o <[email protected]> + + * gen_uuid.c (get_random_bytes): Use O_NONBLOCK when trying to + open /dev/random. Break out the /dev/random + initialization code into a get_random_fd() function, and + use that function in uuid_generate() to determine whether + to use uuid_generate_random() or uuid_generate_time(). + +2000-05-25 <[email protected]> + + * Makefile: Add hack dependency rule so that parallel makes work + correctly. + +2000-04-07 Theodore Ts'o <[email protected]> + + * clear.c, compare.c, copy.c, gen_uuid.c, isnull.c, pack.c, + parse.c, uuid.h, uuidP.h: Changed copyright to be the + LGPL. + +Thu Apr 6 17:38:58 2000 Theodore Y. Ts'o <[email protected]> + + * Makefile.in (uuid_time): Compile uuid_time in two steps (first + create .o, then link it against the libraries) to work + around bug in a.out linker. + + * dll/jump.funcs, dll/jump.import, dll/jump.params: Update a.out + shared library control files to reflect new added files. + +2000-04-03 Theodore Ts'o <[email protected]> + + * gen_uuid.c (get_clock): Fix bug where the last timeval wasn't + getting set, causing potentially duplicate UUID's to be + generated. + +2000-03-12 Theodore Ts'o <[email protected]> + + * gen_uuid.c (get_random_bytes): Make more paranoid about + misbehaving /dev/urandom. If we get a return of zero + without an error more than 8 times in a row, we break out + and return an error. Also, if /dev/urandom doesn't exist, + try /dev/random. + +2000-01-18 Theodore Ts'o <[email protected]> + + * Makefile.in: Since LIBUUID can sometimes include + "-lsocket" we need a separate DEPLIBUUID that can be used + in Makefile's dependency rules. + +1999-11-19 <[email protected]> + + * Makefile.in (distclean): Remove TAGS and Makefile.in.old from + the source directory. + +1999-11-10 <[email protected]> + + * Release of E2fsprogs 1.18 + +1999-10-26 <[email protected]> + + * Release of E2fsprogs 1.17 + +1999-10-26 <[email protected]> + + * uuid_time.c (variant_string): Declare to be static to avoid gcc + warnings. + + * uuid.h: Add function prototypes for uuid_generate_random() and + uuid_generate_time(). + +1999-10-25 <[email protected]> + + * gen_uuid_nt.c (uuid_generate): W2K strikes again! An + incompatible interface change means we need to detect + whether the code is running on an NT4 or NT5 system. + +1999-10-22 <[email protected]> + + * Release of E2fsprogs 1.16 + +1999-10-21 <[email protected]> + + * uuid_generate.8.in: Update man page to use a more standard + format (bold option flags and italicized variables), as + suggested by Andreas Dilger ([email protected]) + +1999-09-24 <[email protected]> + + * gen_uuid_nt.c: New file which creates a UUID under Windows NT. + +1999-07-18 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs 1.15 + +1999-05-17 <[email protected]> + + * gen_uuid.c (get_random_bytes): Use a while loop when reading + from /dev/urandom so that if we get interrupted while + reading the right thing happens. + (uuid_generate_random): Add new function which uses the + new UUID format which uses 122 random bits to form the + 128-bit UUID. + (uuid_generate): Rename the old uuid_generate to be + uuid_generate_time, and create a new uuid_generate + function which calls either uuid_generate_random or + uuid_genereate_time depending on whether /dev/urandom is + present. + + * uuid_generate.3.in: Update to reflect changesin uuid_generate + and its two new variants. + + * tst_uuid.c: Updated to test new uuid_generate functions, and to + reflect new semantics of uuid_compare. Added tests to + make sure the UUID type and variant created by UUID + generate is correct. + + * uuid_time.c (uuid_variant, uuid_type): Added new functions to + return the UUID variant and type information. The + debugging program now prints the UUID variant and type, + and warns if the unparsed time information is likely to be + incorrect. + + * uuid_parse.3.in, libuuid.3.in: Miscellaneous text cleanups. + +1999-05-03 <[email protected]> + + * compare.c (uuid_compare): Change sense of uuid_compare so that + its return values match that of memcpy and the + uuid_compare() found in Paul Leach's internet-draft. + +1999-03-11 Andreas Dilger <[email protected]> + + * Created man pages for libuuid functions. + +1999-01-09 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs 1.14 + +1998-12-15 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs 1.13 + +1998-12-04 Theodore Ts'o <[email protected]> + + * Makefile.in: Update version numbers of the UUID shared library, + since we've added a new function (uuid_time()). + + * uuid_time.c: New file which returns the time field of a UUID. + (Good for debugging purposes) + +1998-07-09 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs 1.12 + +1998-06-25 Theodore Ts'o <[email protected]> + + * tst_uuid.c (main): Fixed bogus declaration of the main's argv + parameter. + +1998-04-26 Theodore Ts'o <[email protected]> + + * uuidP.h: Use asm/types.h instead of linux/types.h to avoid a + problem caused by glibc hack to prevent linux/types.h from + being included. + +1998-03-30 Theodore Ts'o <[email protected]> + + * Makefile.in: Change to use new installation directory variables + convention. Fix uninstall rules to take $(DESTDIR) into + account. + +Sun Mar 8 22:17:59 1998 Theodore Ts'o <[email protected]> + + * gen_uuid.c (get_node_id): Use char * instead of caddr_t, which + doesn't always exist for glibc. + +Tue Oct 14 21:48:16 1997 Theodore Ts'o <[email protected]> + + * gen_uuid.c: Use clock_reg instead of clock, since clock + conflicts with a header file declaration. + +Tue Jun 17 01:33:20 1997 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs 1.11 + +Thu Apr 24 12:16:42 1997 Theodre Ts'o <[email protected]> + + * Release of E2fsprogs version 1.10 + +Thu Apr 17 12:23:38 1997 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs version 1.09 + +Fri Apr 11 18:56:26 1997 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs version 1.08 + +Wed Mar 12 13:32:05 1997 Theodore Y. Ts'o <[email protected]> + + * Release of E2fsprogs version 1.07 + +Sun Mar 2 16:45:36 1997 Theodore Ts'o <[email protected]> + + * Makefile.in (ELF_VERSION): Change version to be 1.1 + +Thu Feb 6 23:08:07 1997 Theodore Ts'o <[email protected]> + + * gen_uuid.c (uuid_generate): Set Multicast bit when picking a + random node_id, to prevent conflicts with IEEE 802 + addresses obtained from network cards. + +Wed Jan 1 23:51:09 1997 Theodore Ts'o <[email protected]> + + * unpack.c, pack.c: Include string.h, since we use memcpy(). + +Tue Dec 3 13:05:11 1996 Theodore Ts'o <[email protected]> + + * parse.c: Add #include of ctype.h and stdlib.h, to pull in the + required prototypes. + +Fri Oct 11 17:15:10 1996 Theodore Ts'o <[email protected]> + + * Makefile.in (DLL_ADDRESS): Updated DLL address for libuuid. + +Tue Oct 8 02:02:03 1996 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs version 1.06 + +Thu Sep 12 15:23:07 1996 Theodore Ts'o <[email protected]> + + * Release of E2fsprogs version 1.05 + +Tue Aug 27 16:50:43 1996 Miles Bader <[email protected]> + + * uuid/gen_uuid.c [HAVE_NET_IF_H] <net/if.h>: Include guarded. + [HAVE_NETINET_IN_H] <netinet/in.h>: Include guarded. + (get_node_id): Surround bulk of function with #ifdef HAVE_NET_IF_H. + +Tue Aug 27 16:50:16 1996 Theodore Ts'o <[email protected]> + + * gen_uuid.c (get_node_id): Add a specific ifdef for the HURD, + since it is broken w.r.t getting hardware addresses. diff --git a/kexi/3rdparty/uuid/Makefile.am b/kexi/3rdparty/uuid/Makefile.am new file mode 100644 index 00000000..d5664967 --- /dev/null +++ b/kexi/3rdparty/uuid/Makefile.am @@ -0,0 +1,14 @@ +include $(top_srcdir)/kexi/Makefile.global + +noinst_LTLIBRARIES = libkexiuuid.la + +INCLUDES = $(all_includes) + +SUBDIRS = . + + +libkexiuuid_la_SOURCES = gen_uuid.c parse.c unparse.c compare.c isnull.c pack.c unpack.c copy.c +libkexiuuid_la_LDFLAGS = -no-undefined $(VER_INFO) +libkexiuuid_la_LIBADD = + + diff --git a/kexi/3rdparty/uuid/clear.c b/kexi/3rdparty/uuid/clear.c new file mode 100644 index 00000000..9cfe59aa --- /dev/null +++ b/kexi/3rdparty/uuid/clear.c @@ -0,0 +1,20 @@ +/* + * clear.c -- Clear a UUID + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU + * Library General Public License. + * %End-Header% + */ + +#include "string.h" + +#include "uuidP.h" + +void uuid_clear(uuid_t uu) +{ + memset(uu, 0, 16); +} + diff --git a/kexi/3rdparty/uuid/compare.c b/kexi/3rdparty/uuid/compare.c new file mode 100644 index 00000000..0f9737c5 --- /dev/null +++ b/kexi/3rdparty/uuid/compare.c @@ -0,0 +1,32 @@ +/* + * compare.c --- compare whether or not two UUID's are the same + * + * Returns 0 if the two UUID's are different, and 1 if they are the same. + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU + * Library General Public License. + * %End-Header% + */ + +#include "uuidP.h" +#include <string.h> + +#define UUCMP(u1,u2) if (u1 != u2) return((u1 < u2) ? -1 : 1); + +int uuid_compare(const uuid_t uu1, const uuid_t uu2) +{ + struct uuid uuid1, uuid2; + + uuid_unpack(uu1, &uuid1); + uuid_unpack(uu2, &uuid2); + + UUCMP(uuid1.time_low, uuid2.time_low); + UUCMP(uuid1.time_mid, uuid2.time_mid); + UUCMP(uuid1.time_hi_and_version, uuid2.time_hi_and_version); + UUCMP(uuid1.clock_seq, uuid2.clock_seq); + return memcmp(uuid1.node, uuid2.node, 6); +} + diff --git a/kexi/3rdparty/uuid/configure.in b/kexi/3rdparty/uuid/configure.in new file mode 100644 index 00000000..bf9509fe --- /dev/null +++ b/kexi/3rdparty/uuid/configure.in @@ -0,0 +1,10 @@ +dnl +dnl Not used now, for the future when uuid is separated out into its +dnl own package. +dnl +AC_INIT(gen_uuid.c) +AC_PREREQ(2.12) + +AC_CHECK_HEADERS(stdlib.h unistd.h sys/sockio.h net/if.h netinet/in.h) +AC_CHECK_FUNCS(srandom) +AC_OUTPUT(Makefile) diff --git a/kexi/3rdparty/uuid/copy.c b/kexi/3rdparty/uuid/copy.c new file mode 100644 index 00000000..b9a34dac --- /dev/null +++ b/kexi/3rdparty/uuid/copy.c @@ -0,0 +1,22 @@ +/* + * copy.c --- copy UUIDs + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU + * Library General Public License. + * %End-Header% + */ + +#include "uuidP.h" + +void uuid_copy(uuid_t dst, const uuid_t src) +{ + unsigned char *cp1; + const unsigned char *cp2; + int i; + + for (i=0, cp1 = dst, cp2 = src; i < 16; i++) + *cp1++ = *cp2++; +} diff --git a/kexi/3rdparty/uuid/gen_uuid.c b/kexi/3rdparty/uuid/gen_uuid.c new file mode 100644 index 00000000..2441931c --- /dev/null +++ b/kexi/3rdparty/uuid/gen_uuid.c @@ -0,0 +1,280 @@ +/* + * gen_uuid.c --- generate a DCE-compatible uuid + * + * Copyright (C) 1996, 1997, 1998, 1999 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU + * Library General Public License. + * %End-Header% + */ + +/* + * Force inclusion of SVID stuff since we need it if we're compiling in + * gcc-wall wall mode + */ +#define _SVID_SOURCE + +/*jowenn: #ifdef HAVE_UNISTD_H*/ +#include <unistd.h> +/*jowenn: #endif*/ +/*jowenn: #ifdef HAVE_STDLIB_H*/ +#include <stdlib.h> +/*jowenn: #endif*/ +#include <string.h> +#include <fcntl.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/time.h> +#include <sys/stat.h> +#include <sys/file.h> +#ifdef HAVE_SYS_IOCTL_H +#include <sys/ioctl.h> +#endif +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif +#ifdef HAVE_SYS_SOCKIO_H +#include <sys/sockio.h> +#endif +#ifdef HAVE_NET_IF_H +#include <net/if.h> +#endif +#ifdef HAVE_NETINET_IN_H +#include <netinet/in.h> +#endif + +#include "uuidP.h" + +#ifdef HAVE_SRANDOM +#define srand(x) srandom(x) +#define rand() random() +#endif + +static int get_random_fd(void) +{ + struct timeval tv; + static int fd = -2; + int i; + + if (fd == -2) { + gettimeofday(&tv, 0); + fd = open("/dev/urandom", O_RDONLY); + if (fd == -1) + fd = open("/dev/random", O_RDONLY | O_NONBLOCK); + srand((getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec); + } + /* Crank the random number generator a few times */ + gettimeofday(&tv, 0); + for (i = (tv.tv_sec ^ tv.tv_usec) & 0x1F; i > 0; i--) + rand(); + return fd; +} + + +/* + * Generate a series of random bytes. Use /dev/urandom if possible, + * and if not, use srandom/random. + */ +static void get_random_bytes(void *buf, int nbytes) +{ + int i, n = nbytes, fd = get_random_fd(); + int lose_counter = 0; + unsigned char *cp = (unsigned char *) buf; + + if (fd >= 0) { + while (n > 0) { + i = read(fd, cp, n); + if (i <= 0) { + if (lose_counter++ > 16) + break; + continue; + } + n -= i; + cp += i; + lose_counter = 0; + } + } + + /* + * We do this all the time, but this is the only source of + * randomness if /dev/random/urandom is out to lunch. + */ + for (cp = buf, i = 0; i < nbytes; i++) + *cp++ ^= (rand() >> 7) & 0xFF; + return; +} + +/* + * Get the ethernet hardware address, if we can find it... + */ +static int get_node_id(unsigned char *node_id) +{ +#ifdef HAVE_NET_IF_H + int sd; + struct ifreq ifr, *ifrp; + struct ifconf ifc; + char buf[1024]; + int n, i; + unsigned char *a; + +/* + * BSD 4.4 defines the size of an ifreq to be + * max(sizeof(ifreq), sizeof(ifreq.ifr_name)+ifreq.ifr_addr.sa_len + * However, under earlier systems, sa_len isn't present, so the size is + * just sizeof(struct ifreq) + */ +#ifdef HAVE_SA_LEN +#ifndef max +#define max(a,b) ((a) > (b) ? (a) : (b)) +#endif +#define ifreq_size(i) max(sizeof(struct ifreq),\ + sizeof((i).ifr_name)+(i).ifr_addr.sa_len) +#else +#define ifreq_size(i) sizeof(struct ifreq) +#endif /* HAVE_SA_LEN*/ + + sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); + if (sd < 0) { + return -1; + } + memset(buf, 0, sizeof(buf)); + ifc.ifc_len = sizeof(buf); + ifc.ifc_buf = buf; + if (ioctl (sd, SIOCGIFCONF, (char *)&ifc) < 0) { + close(sd); + return -1; + } + n = ifc.ifc_len; + for (i = 0; i < n; i+= ifreq_size(*ifr) ) { + ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i); + strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ); +#ifdef SIOCGIFHWADDR + if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0) + continue; + a = (unsigned char *) &ifr.ifr_hwaddr.sa_data; +#else +#ifdef SIOCGENADDR + if (ioctl(sd, SIOCGENADDR, &ifr) < 0) + continue; + a = (unsigned char *) ifr.ifr_enaddr; +#else + /* + * XXX we don't have a way of getting the hardware + * address + */ + close(sd); + return 0; +#endif /* SIOCGENADDR */ +#endif /* SIOCGIFHWADDR */ + if (!a[0] && !a[1] && !a[2] && !a[3] && !a[4] && !a[5]) + continue; + if (node_id) { + memcpy(node_id, a, 6); + close(sd); + return 1; + } + } + close(sd); +#endif + return 0; +} + +/* Assume that the gettimeofday() has microsecond granularity */ +#define MAX_ADJUSTMENT 10 + +static int get_clock(__u32 *clock_high, __u32 *clock_low, __u16 *ret_clock_seq) +{ + static int adjustment = 0; + static struct timeval last = {0, 0}; + static __u16 clock_seq; + struct timeval tv; + unsigned longlong clock_reg; + +try_again: + gettimeofday(&tv, 0); + if ((last.tv_sec == 0) && (last.tv_usec == 0)) { + get_random_bytes(&clock_seq, sizeof(clock_seq)); + clock_seq &= 0x1FFF; + last = tv; + last.tv_sec--; + } + if ((tv.tv_sec < last.tv_sec) || + ((tv.tv_sec == last.tv_sec) && + (tv.tv_usec < last.tv_usec))) { + clock_seq = (clock_seq+1) & 0x1FFF; + adjustment = 0; + last = tv; + } else if ((tv.tv_sec == last.tv_sec) && + (tv.tv_usec == last.tv_usec)) { + if (adjustment >= MAX_ADJUSTMENT) + goto try_again; + adjustment++; + } else { + adjustment = 0; + last = tv; + } + + clock_reg = tv.tv_usec*10 + adjustment; + clock_reg += ((unsigned longlong) tv.tv_sec)*10000000; + clock_reg += (((unsigned longlong) 0x01B21DD2) << 32) + 0x13814000; + + *clock_high = clock_reg >> 32; + *clock_low = clock_reg; + *ret_clock_seq = clock_seq; + return 0; +} + +void uuid_generate_time(uuid_t out) +{ + static unsigned char node_id[6]; + static int has_init = 0; + struct uuid uu; + __u32 clock_mid; + + if (!has_init) { + if (get_node_id(node_id) <= 0) { + get_random_bytes(node_id, 6); + /* + * Set multicast bit, to prevent conflicts + * with IEEE 802 addresses obtained from + * network cards + */ + node_id[0] |= 0x80; + } + has_init = 1; + } + get_clock(&clock_mid, &uu.time_low, &uu.clock_seq); + uu.clock_seq |= 0x8000; + uu.time_mid = (__u16) clock_mid; + uu.time_hi_and_version = (clock_mid >> 16) | 0x1000; + memcpy(uu.node, node_id, 6); + uuid_pack(&uu, out); +} + +void uuid_generate_random(uuid_t out) +{ + uuid_t buf; + struct uuid uu; + + get_random_bytes(buf, sizeof(buf)); + uuid_unpack(buf, &uu); + + uu.clock_seq = (uu.clock_seq & 0x3FFF) | 0x8000; + uu.time_hi_and_version = (uu.time_hi_and_version & 0x0FFF) | 0x4000; + uuid_pack(&uu, out); +} + +/* + * This is the generic front-end to uuid_generate_random and + * uuid_generate_time. It uses uuid_generate_random only if + * /dev/urandom is available, since otherwise we won't have + * high-quality randomness. + */ +void uuid_generate(uuid_t out) +{ + if (get_random_fd() >= 0) + uuid_generate_random(out); + else + uuid_generate_time(out); +} diff --git a/kexi/3rdparty/uuid/gen_uuid_nt.c b/kexi/3rdparty/uuid/gen_uuid_nt.c new file mode 100644 index 00000000..aa44bfd3 --- /dev/null +++ b/kexi/3rdparty/uuid/gen_uuid_nt.c @@ -0,0 +1,92 @@ +/* + * gen_uuid_nt.c -- Use NT api to generate uuid + * + * Written by Andrey Shedel ([email protected]) + */ + + +#include "uuidP.h" + +#pragma warning(push,4) + +#pragma comment(lib, "ntdll.lib") + +// +// Here is a nice example why it's not a good idea +// to use native API in ordinary applications. +// Number of parameters in function below was changed from 3 to 4 +// for NT5. +// +// +// NTSYSAPI +// NTSTATUS +// NTAPI +// NtAllocateUuids( +// OUT PULONG p1, +// OUT PULONG p2, +// OUT PULONG p3, +// OUT PUCHAR Seed // 6 bytes +// ); +// +// + +unsigned long +__stdcall +NtAllocateUuids( + void* p1, // 8 bytes + void* p2, // 4 bytes + void* p3 // 4 bytes + ); + +typedef +unsigned long +(__stdcall* +NtAllocateUuids_2000)( + void* p1, // 8 bytes + void* p2, // 4 bytes + void* p3, // 4 bytes + void* seed // 6 bytes + ); + + + +// +// Nice, but instead of including ntddk.h ot winnt.h +// I should define it here because they MISSED __stdcall in those headers. +// + +__declspec(dllimport) +struct _TEB* +__stdcall +NtCurrentTeb(void); + + +// +// The only way to get version information from the system is to examine +// one stored in PEB. But it's pretty dangerouse because this value could +// be altered in image header. +// + +static +int +Nt5(void) +{ + //return NtCuttentTeb()->Peb->OSMajorVersion >= 5; + return (int)*(int*)((char*)(int)(*(int*)((char*)NtCurrentTeb() + 0x30)) + 0xA4) >= 5; +} + + + + +void uuid_generate(uuid_t out) +{ + if(Nt5()) + { + unsigned char seed[6]; + ((NtAllocateUuids_2000)NtAllocateUuids)(out, ((char*)out)+8, ((char*)out)+12, &seed[0] ); + } + else + { + NtAllocateUuids(out, ((char*)out)+8, ((char*)out)+12); + } +} diff --git a/kexi/3rdparty/uuid/isnull.c b/kexi/3rdparty/uuid/isnull.c new file mode 100644 index 00000000..8aba238a --- /dev/null +++ b/kexi/3rdparty/uuid/isnull.c @@ -0,0 +1,25 @@ +/* + * isnull.c --- Check whether or not the UUID is null + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU + * Library General Public License. + * %End-Header% + */ + +#include "uuidP.h" + +/* Returns 1 if the uuid is the NULL uuid */ +int uuid_is_null(const uuid_t uu) +{ + const unsigned char *cp; + int i; + + for (i=0, cp = uu; i < 16; i++) + if (*cp++) + return 0; + return 1; +} + diff --git a/kexi/3rdparty/uuid/libuuid.3.in b/kexi/3rdparty/uuid/libuuid.3.in new file mode 100644 index 00000000..ec5e7cd6 --- /dev/null +++ b/kexi/3rdparty/uuid/libuuid.3.in @@ -0,0 +1,70 @@ +.\" Copyright 1999 Andreas Dilger ([email protected]) +.\" +.\" This man page was created for libuuid.so.1.1 from e2fsprogs-1.14. +.\" +.\" This file may be copied under the terms of the GNU Public License. +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH LIBUUID 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" +.SH NAME +libuuid \- DCE compatible Universally Unique Identifier library +.SH SYNOPSIS +.B #include <uuid/uuid.h> +.sp +.B cc +.I file.c +.B \-luuid +.SH DESCRIPTION +The +.B libuuid +library is used to generate unique identifiers for objects that may be +accessible beyond the local system. The Linux implementation was created +to uniquely identify ext2 filesystems created by a machine. This library +generates UUIDs compatible with those created by the Open Software +Foundation (OSF) Distributed Computing Environment (DCE) utility +.BR uuidgen . +.sp +The UUIDs generated by this library can be reasonably expected to be +unique within a system, and unique across all systems. They could +be used, for instance, to generate unique HTTP cookies across multiple +web servers without communication between the servers, and without fear +of a name clash. +.SH "CONFORMING TO" +OSF DCE 1.1 +.SH AUTHOR +.B libuuid +was written by Theodore Y. Ts'o for the ext2 filesystem utilties. +.SH AVAILABILITY +.B libuuid +is part of the e2fsprogs package and is available from +.UR http://e2fsprogs.sourceforge.net/ +http://e2fsprogs.sourceforge.net/ +.UE +.SH COPYING +.B libuuid +is available under the terms of the GNU Library General Public License (LGPL), +version 2 (or at your discretion any later version). A copy of the LGPL +should be included with this library in the file COPYING. If not, write to +.RS +Free Software Foundation, Inc. +.br +59 Temple Place +.br +Suite 330 +.br +Boston, MA 02110-1301 USA +.RE +.PP +or visit +.UR http://www.gnu.org/licenses/licenses.html#LGPL +http://www.gnu.org/licenses/licenses.html#LGPL +.UE +.SH "SEE ALSO" +.BR uuid_clear (3), +.BR uuid_compare (3), +.BR uuid_copy (3), +.BR uuid_generate (3), +.BR uuid_is_null (3), +.BR uuid_parse (3), +.BR uuid_time (3), +.BR uuid_unparse (3) diff --git a/kexi/3rdparty/uuid/pack.c b/kexi/3rdparty/uuid/pack.c new file mode 100644 index 00000000..1303ef52 --- /dev/null +++ b/kexi/3rdparty/uuid/pack.c @@ -0,0 +1,46 @@ +/* + * Internal routine for packing UUID's + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU + * Library General Public License. + * %End-Header% + */ + +#include <string.h> +#include "uuidP.h" + +void uuid_pack(const struct uuid *uu, uuid_t ptr) +{ + __u32 tmp; + unsigned char *out = ptr; + + tmp = uu->time_low; + out[3] = (unsigned char) tmp; + tmp >>= 8; + out[2] = (unsigned char) tmp; + tmp >>= 8; + out[1] = (unsigned char) tmp; + tmp >>= 8; + out[0] = (unsigned char) tmp; + + tmp = uu->time_mid; + out[5] = (unsigned char) tmp; + tmp >>= 8; + out[4] = (unsigned char) tmp; + + tmp = uu->time_hi_and_version; + out[7] = (unsigned char) tmp; + tmp >>= 8; + out[6] = (unsigned char) tmp; + + tmp = uu->clock_seq; + out[9] = (unsigned char) tmp; + tmp >>= 8; + out[8] = (unsigned char) tmp; + + memcpy(out+10, uu->node, 6); +} + diff --git a/kexi/3rdparty/uuid/parse.c b/kexi/3rdparty/uuid/parse.c new file mode 100644 index 00000000..f97f13ea --- /dev/null +++ b/kexi/3rdparty/uuid/parse.c @@ -0,0 +1,56 @@ +/* + * parse.c --- UUID parsing + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU + * Library General Public License. + * %End-Header% + */ + +#include <stdlib.h> +#include <stdio.h> +#include <ctype.h> +#include <string.h> + +#include "uuidP.h" + +int uuid_parse(const char *in, uuid_t uu) +{ + struct uuid uuid; + int i; + const char *cp; + char buf[3]; + + if (strlen(in) != 36) + return -1; + for (i=0, cp = in; i <= 36; i++,cp++) { + if ((i == 8) || (i == 13) || (i == 18) || + (i == 23)) { + if (*cp == '-') + continue; + else + return -1; + } + if (i== 36) + if (*cp == 0) + continue; + if (!isxdigit(*cp)) + return -1; + } + uuid.time_low = strtoul(in, NULL, 16); + uuid.time_mid = strtoul(in+9, NULL, 16); + uuid.time_hi_and_version = strtoul(in+14, NULL, 16); + uuid.clock_seq = strtoul(in+19, NULL, 16); + cp = in+24; + buf[2] = 0; + for (i=0; i < 6; i++) { + buf[0] = *cp++; + buf[1] = *cp++; + uuid.node[i] = strtoul(buf, NULL, 16); + } + + uuid_pack(&uuid, uu); + return 0; +} diff --git a/kexi/3rdparty/uuid/tst_uuid.c b/kexi/3rdparty/uuid/tst_uuid.c new file mode 100644 index 00000000..f1f56f16 --- /dev/null +++ b/kexi/3rdparty/uuid/tst_uuid.c @@ -0,0 +1,147 @@ +/* + * tst_uuid.c --- test program from the UUID library + * + * Copyright (C) 1996, 1997, 1998 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU Public + * License. + * %End-Header% + */ + +#include <stdio.h> + +#include "uuid.h" + +static int test_uuid(const char * uuid, int isValid) +{ + static const char * validStr[2] = {"invalid", "valid"}; + uuid_t uuidBits; + int parsedOk; + + parsedOk = uuid_parse(uuid, uuidBits) == 0; + + printf("%s is %s", uuid, validStr[isValid]); + if (parsedOk != isValid) { + printf(" but uuid_parse says %s\n", validStr[parsedOk]); + return 1; + } + printf(", OK\n"); + return 0; +} + +int +main(int argc, char **argv) +{ + uuid_t buf, tst; + char str[100]; + struct timeval tv; + time_t time_reg; + unsigned char *cp; + int i; + int failed = 0; + int type, variant; + + uuid_generate(buf); + uuid_unparse(buf, str); + printf("UUID generate = %s\n", str); + printf("UUID: "); + for (i=0, cp = (unsigned char *) &buf; i < 16; i++) { + printf("%02x", *cp++); + } + printf("\n"); + type = uuid_type(buf); variant = uuid_variant(buf); + printf("UUID type = %d, UUID variant = %d\n", type, variant); + if (variant != UUID_VARIANT_DCE) { + printf("Incorrect UUID Variant; was expecting DCE!\n"); + failed++; + } + printf("\n"); + + uuid_generate_random(buf); + uuid_unparse(buf, str); + printf("UUID random string = %s\n", str); + printf("UUID: "); + for (i=0, cp = (unsigned char *) &buf; i < 16; i++) { + printf("%02x", *cp++); + } + printf("\n"); + type = uuid_type(buf); variant = uuid_variant(buf); + printf("UUID type = %d, UUID variant = %d\n", type, variant); + if (variant != UUID_VARIANT_DCE) { + printf("Incorrect UUID Variant; was expecting DCE!\n"); + failed++; + } + if (type != 4) { + printf("Incorrect UUID type; was expecting " + "4 (random type)!\n"); + failed++; + } + printf("\n"); + + uuid_generate_time(buf); + uuid_unparse(buf, str); + printf("UUID string = %s\n", str); + printf("UUID time: "); + for (i=0, cp = (unsigned char *) &buf; i < 16; i++) { + printf("%02x", *cp++); + } + printf("\n"); + type = uuid_type(buf); variant = uuid_variant(buf); + printf("UUID type = %d, UUID variant = %d\n", type, variant); + if (variant != UUID_VARIANT_DCE) { + printf("Incorrect UUID Variant; was expecting DCE!\n"); + failed++; + } + if (type != 1) { + printf("Incorrect UUID type; was expecting " + "1 (time-based type)!\\n"); + failed++; + } + tv.tv_sec = 0; + tv.tv_usec = 0; + time_reg = uuid_time(buf, &tv); + printf("UUID time is: (%ld, %ld): %s\n", tv.tv_sec, tv.tv_usec, + ctime(&time_reg)); + uuid_parse(str, tst); + if (!uuid_compare(buf, tst)) + printf("UUID parse and compare succeeded.\n"); + else { + printf("UUID parse and compare failed!\n"); + failed++; + } + uuid_clear(tst); + if (uuid_is_null(tst)) + printf("UUID clear and is null succeeded.\n"); + else { + printf("UUID clear and is null failed!\n"); + failed++; + } + uuid_copy(buf, tst); + if (!uuid_compare(buf, tst)) + printf("UUID copy and compare succeeded.\n"); + else { + printf("UUID copy and compare failed!\n"); + failed++; + } + failed += test_uuid("84949cc5-4701-4a84-895b-354c584a981b", 1); + failed += test_uuid("84949CC5-4701-4A84-895B-354C584A981B", 1); + failed += test_uuid("84949cc5-4701-4a84-895b-354c584a981bc", 0); + failed += test_uuid("84949cc5-4701-4a84-895b-354c584a981", 0); + failed += test_uuid("84949cc5x4701-4a84-895b-354c584a981b", 0); + failed += test_uuid("84949cc504701-4a84-895b-354c584a981b", 0); + failed += test_uuid("84949cc5-470104a84-895b-354c584a981b", 0); + failed += test_uuid("84949cc5-4701-4a840895b-354c584a981b", 0); + failed += test_uuid("84949cc5-4701-4a84-895b0354c584a981b", 0); + failed += test_uuid("g4949cc5-4701-4a84-895b-354c584a981b", 0); + failed += test_uuid("84949cc5-4701-4a84-895b-354c584a981g", 0); + + if (failed) { + printf("%d failures.\n", failed); + exit(1); + } + return 0; +} + + + diff --git a/kexi/3rdparty/uuid/unpack.c b/kexi/3rdparty/uuid/unpack.c new file mode 100644 index 00000000..02005dde --- /dev/null +++ b/kexi/3rdparty/uuid/unpack.c @@ -0,0 +1,40 @@ +/* + * Internal routine for unpacking UUID + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU + * Library General Public License. + * %End-Header% + */ + +#include <string.h> +#include "uuidP.h" + +void uuid_unpack(const uuid_t in, struct uuid *uu) +{ + const __u8 *ptr = in; + __u32 tmp; + + tmp = *ptr++; + tmp = (tmp << 8) | *ptr++; + tmp = (tmp << 8) | *ptr++; + tmp = (tmp << 8) | *ptr++; + uu->time_low = tmp; + + tmp = *ptr++; + tmp = (tmp << 8) | *ptr++; + uu->time_mid = tmp; + + tmp = *ptr++; + tmp = (tmp << 8) | *ptr++; + uu->time_hi_and_version = tmp; + + tmp = *ptr++; + tmp = (tmp << 8) | *ptr++; + uu->clock_seq = tmp; + + memcpy(uu->node, ptr, 6); +} + diff --git a/kexi/3rdparty/uuid/unparse.c b/kexi/3rdparty/uuid/unparse.c new file mode 100644 index 00000000..db3ef048 --- /dev/null +++ b/kexi/3rdparty/uuid/unparse.c @@ -0,0 +1,28 @@ +/* + * unparse.c -- convert a UUID to string + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU + * Library General Public License. + * %End-Header% + */ + +#include <stdio.h> + +#include "uuidP.h" + +void uuid_unparse(const uuid_t uu, char *out) +{ + struct uuid uuid; + + uuid_unpack(uu, &uuid); + sprintf(out, + "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + uuid.time_low, uuid.time_mid, uuid.time_hi_and_version, + uuid.clock_seq >> 8, uuid.clock_seq & 0xFF, + uuid.node[0], uuid.node[1], uuid.node[2], + uuid.node[3], uuid.node[4], uuid.node[5]); +} + diff --git a/kexi/3rdparty/uuid/uuid.h b/kexi/3rdparty/uuid/uuid.h new file mode 100644 index 00000000..17a33a8a --- /dev/null +++ b/kexi/3rdparty/uuid/uuid.h @@ -0,0 +1,68 @@ +/* + * Public include file for the UUID library + * + * Copyright (C) 1996, 1997, 1998 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU + * Library General Public License. + * %End-Header% + */ + +#ifndef _UUID_UUID_H +#define _UUID_UUID_H + +/*(js)*/ +#ifndef KEXIUUID_EXPORT +# define KEXIUUID_EXPORT +#endif + +#include <sys/types.h> +#include <sys/time.h> +#include <time.h> + +typedef unsigned char uuid_t[16]; + +/* UUID Variant definitions */ +#define UUID_VARIANT_NCS 0 +#define UUID_VARIANT_DCE 1 +#define UUID_VARIANT_MICROSOFT 2 +#define UUID_VARIANT_OTHER 3 + +#ifdef __cplusplus +extern "C" { +#endif + +/* clear.c */ +void KEXIUUID_EXPORT uuid_clear(uuid_t uu); + +/* compare.c */ +int KEXIUUID_EXPORT uuid_compare(const uuid_t uu1, const uuid_t uu2); + +/* copy.c */ +void KEXIUUID_EXPORT uuid_copy(uuid_t dst, const uuid_t src); + +/* gen_uuid.c */ +void KEXIUUID_EXPORT uuid_generate(uuid_t out); +void KEXIUUID_EXPORT uuid_generate_random(uuid_t out); +void KEXIUUID_EXPORT uuid_generate_time(uuid_t out); + +/* isnull.c */ +int KEXIUUID_EXPORT uuid_is_null(const uuid_t uu); + +/* parse.c */ +int KEXIUUID_EXPORT uuid_parse(const char *in, uuid_t uu); + +/* unparse.c */ +void KEXIUUID_EXPORT uuid_unparse(const uuid_t uu, char *out); + +/* uuid_time.c */ +time_t KEXIUUID_EXPORT uuid_time(const uuid_t uu, struct timeval *ret_tv); +int KEXIUUID_EXPORT uuid_type(const uuid_t uu); +int KEXIUUID_EXPORT uuid_variant(const uuid_t uu); + +#ifdef __cplusplus +} +#endif + +#endif /* _UUID_UUID_H */ diff --git a/kexi/3rdparty/uuid/uuid.pro b/kexi/3rdparty/uuid/uuid.pro new file mode 100644 index 00000000..e4dbc8fe --- /dev/null +++ b/kexi/3rdparty/uuid/uuid.pro @@ -0,0 +1,24 @@ + +TEMPLATE = lib + +win32:DEFINES += MAKE_KEXIUUID_LIB + +include( $(KEXI)/common.pro ) + +TARGET = kexiuuid$$KDELIBDEBUG + + +SOURCES = \ +clear.c \ +compare.c \ +copy.c \ +gen_uuid.c \ +isnull.c \ +pack.c \ +parse.c \ +unpack.c \ +unparse.c \ +uuid_time.c + +#tst_uuid.c \ +#gen_uuid_nt.c \ diff --git a/kexi/3rdparty/uuid/uuidP.h b/kexi/3rdparty/uuid/uuidP.h new file mode 100644 index 00000000..2595277f --- /dev/null +++ b/kexi/3rdparty/uuid/uuidP.h @@ -0,0 +1,58 @@ +/* + * uuid.h -- private header file for uuids + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU + * Library General Public License. + * %End-Header% + */ + +#include <sys/types.h> +/*jowenn: #include <uuid/uuid_types.h>*/ + +/*js*/ +#ifdef _WIN32 +/*.. */ +# define longlong __int64 +#else /* non-win32 systems */ +# define longlong long long +#endif + +#ifdef __linux__ +# include <linux/types.h> +#endif + +#ifdef __FreeBSD__ +typedef u_int32_t __u32; +typedef u_int16_t __u16; +typedef u_int8_t __u8; +#endif + +#include "uuid.h" + +/* + * Offset between 15-Oct-1582 and 1-Jan-70 + */ +#define TIME_OFFSET_HIGH 0x01B21DD2 +#define TIME_OFFSET_LOW 0x13814000 + +struct uuid { + __u32 time_low; + __u16 time_mid; + __u16 time_hi_and_version; + __u16 clock_seq; + __u8 node[6]; +}; + + +/* + * prototypes + */ +void uuid_pack(const struct uuid *uu, uuid_t ptr); +void uuid_unpack(const uuid_t in, struct uuid *uu); + + + + diff --git a/kexi/3rdparty/uuid/uuid_clear.3.in b/kexi/3rdparty/uuid/uuid_clear.3.in new file mode 100644 index 00000000..6f32b128 --- /dev/null +++ b/kexi/3rdparty/uuid/uuid_clear.3.in @@ -0,0 +1,35 @@ +.\" Copyright 1999 Andreas Dilger ([email protected]) +.\" +.\" This man page was created for libuuid.so.1.1 from e2fsprogs-1.14. +.\" +.\" This file may be copied under the terms of the GNU Public License. +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_CLEAR 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" +.SH NAME +uuid_clear \- reset value of UUID variable to the NULL value +.SH SYNOPSIS +.nf +.B #include <uuid/uuid.h> +.sp +.BI "void uuid_clear(uuid_t " uu ); +.fi +.SH DESCRIPTION +The +.B uuid_clear +function sets the value of the supplied uuid variable +.I uu +to the NULL value. +.SH AUTHOR +.B uuid_clear +was written by Theodore Y. Ts'o for the ext2 filesystem utilties. +.SH AVAILABILITY +.B uuid_clear +is part of libuuid from the e2fsprogs package and is available from +http://e2fsprogs.sourceforge.net. +.SH "SEE ALSO" +.BR libuuid (3), +.BR uuid_compare (3), +.BR uuid_copy (3), +.BR uuid_generate (3), +.BR uuid_is_null (3) diff --git a/kexi/3rdparty/uuid/uuid_compare.3.in b/kexi/3rdparty/uuid/uuid_compare.3.in new file mode 100644 index 00000000..a5759eb0 --- /dev/null +++ b/kexi/3rdparty/uuid/uuid_compare.3.in @@ -0,0 +1,41 @@ +.\" Copyright 1999 Andreas Dilger ([email protected]) +.\" +.\" This man page was created for libuuid.so.1.1 from e2fsprogs-1.14. +.\" +.\" This file may be copied under the terms of the GNU Public License. +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_COMPARE 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" +.SH NAME +uuid_compare \- compare whether two UUIDs are the same +.SH SYNOPSIS +.nf +.B #include <uuid/uuid.h> +.sp +.BI "int uuid_compare(uuid_t " uu1 ", uuid_t " uu2) +.fi +.SH DESCRIPTION +The +.B uuid_compare +function compares the two supplied uuid variables +.IR uu1 " and " uu2 +to each other. +.SH RETURN VALUE +Returns an integer less than, equal to, or greater than zero if +.I uu1 +is found, respectively, to be lexigraphically less than, equal, or +greater than +.IR uu2 . +.SH AUTHOR +.B uuid_compare +was written by Theodore Y. Ts'o for the ext2 filesystem utilties. +.SH AVAILABILITY +.B uuid_compare +is part of libuuid from the e2fsprogs package and is available from +http://e2fsprogs.sourceforge.net. +.SH "SEE ALSO" +.BR libuuid (3), +.BR uuid_clear (3), +.BR uuid_copy (3), +.BR uuid_generate (3), +.BR uuid_is_null (3) diff --git a/kexi/3rdparty/uuid/uuid_copy.3.in b/kexi/3rdparty/uuid/uuid_copy.3.in new file mode 100644 index 00000000..52fd1667 --- /dev/null +++ b/kexi/3rdparty/uuid/uuid_copy.3.in @@ -0,0 +1,37 @@ +.\" Copyright 1999 Andreas Dilger ([email protected]) +.\" +.\" This man page was created for libuuid.so.1.1 from e2fsprogs-1.14. +.\" +.\" This file may be copied under the terms of the GNU Public License. +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_COPY 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" +.SH NAME +uuid_copy \- copy a UUID value +.SH SYNOPSIS +.nf +.B #include <uuid/uuid.h> +.sp +.BI "void uuid_copy(uuid_t " dst ", uuid_t " src); +.fi +.SH DESCRIPTION +The +.B uuid_copy +function copies the UUID variable +.IR src " to " dst . +.SH RETURN VALUE +The copied UUID is returned in the location pointed to by +.IR dst . +.SH AUTHOR +.B uuid_copy +was written by Theodore Y. Ts'o for the ext2 filesystem utilties. +.SH AVAILABILITY +.B uuid_copy +is part of libuuid from the e2fsprogs package and is available from +http://e2fsprogs.sourceforge.net. +.SH "SEE ALSO" +.BR libuuid (3), +.BR uuid_clear (3), +.BR uuid_compare (3), +.BR uuid_generate (3), +.BR uuid_is_null (3) diff --git a/kexi/3rdparty/uuid/uuid_generate.3.in b/kexi/3rdparty/uuid/uuid_generate.3.in new file mode 100644 index 00000000..ed15dd60 --- /dev/null +++ b/kexi/3rdparty/uuid/uuid_generate.3.in @@ -0,0 +1,81 @@ +.\" Copyright 1999 Andreas Dilger ([email protected]) +.\" +.\" This man page was created for libuuid.so.1.1 from e2fsprogs-1.14. +.\" +.\" This file may be copied under the terms of the GNU Public License. +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_GENERATE 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" +.SH NAME +uuid_generate, uuid_generate_random, uuid_generate_time \- create a new unique UUID value +.SH SYNOPSIS +.nf +.B #include <uuid/uuid.h> +.sp +.BI "void uuid_generate(uuid_t " out ); +.BI "void uuid_generate_random(uuid_t " out ); +.BI "void uuid_generate_time(uuid_t " out ); +.fi +.SH DESCRIPTION +The +.B uuid_generate +function creates a new universally unique identifier (UUID). The uuid will +be generated based on high-quality randomness from +.IR /dev/urandom , +if available. If it is not available, then +.B uuid_generate +will use an alternative algorithm which uses the current time, the +local ethernet MAC address (if available), and random data generated +using a pseudo-random generator. +.sp +The +.B uuid_generate_random +function forces the use of the all-random UUID format, even if +a high-quality random number generator (i.e., +.IR /dev/urandom ) +is not available, in which case a pseudo-random +generator will be subsituted. Note that the use of a pseudo-random +generator may compromise the uniqueness of UUID's +generated in this fashion. +.sp +The +.B uuid_generate_time +function forces the use of the alternative algorithm which uses the +current time and the local ethernet MAC address (if available). +This algorithm used to be the default one used to generate UUID, but +because of the use of the ethernet MAC address, it can leak +information about when and where the UUID was generated. This can cause +privacy problems in some applications, so the +.B uuid_generate +function only uses this algorithm if a high-quality source of +randomness is not available. +.sp +The UUID is 16 bytes (128 bits) long, which gives approximately 3.4x10^38 +unique values (there are approximately 10^80 elemntary particles in +the universe according to Carl Sagan's +.IR Cosmos ). +The new UUID can reasonably be considered unique among all UUIDs created +on the local system, and among UUIDs created on other systems in the past +and in the future. +.SH RETURN VALUE +The newly created UUID is returned in the memory location pointed to by +.IR out . +.SH "CONFORMING TO" +OSF DCE 1.1 +.SH AUTHOR +.B uuid_generate +was written by Theodore Y. Ts'o for the ext2 filesystem utilties. +.SH AVAILABILITY +.B uuid_generate +is part of libuuid from the e2fsprogs package and is available from +http://e2fsprogs.sourceforge.net. +.SH "SEE ALSO" +.BR libuuid (3), +.BR uuid_clear (3), +.BR uuid_compare (3), +.BR uuid_copy (3), +.BR uuidgen (1), +.BR uuid_is_null (3), +.BR uuid_parse (3), +.BR uuid_time (3), +.BR uuid_unparse (3) diff --git a/kexi/3rdparty/uuid/uuid_is_null.3.in b/kexi/3rdparty/uuid/uuid_is_null.3.in new file mode 100644 index 00000000..94ad0afe --- /dev/null +++ b/kexi/3rdparty/uuid/uuid_is_null.3.in @@ -0,0 +1,37 @@ +.\" Copyright 1999 Andreas Dilger ([email protected]) +.\" +.\" This man page was created for libuuid.so.1.1 from e2fsprogs-1.14. +.\" +.\" This file may be copied under the terms of the GNU Public License. +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_IS_NULL 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" +.SH NAME +uuid_is_null \- compare the value of the UUID to the NULL value +.SH SYNOPSIS +.nf +.B #include <uuid/uuid.h> +.sp +.BI "int uuid_is_null(uuid_t " uu ); +.fi +.SH DESCRIPTION +The +.B uuid_is_null +function compares the value of the supplied UUID variable +.I uu +to the NULL value. If the value is equal to the NULL UUID, 1 is returned, +otherwise 0 is returned. +.SH AUTHOR +.B uuid_is_null +was written by Theodore Y. Ts'o for the ext2 filesystem utilties. +.SH AVAILABILITY +.B uuid_is_null +is part of libuuid from the e2fsprogs package and is available from +http://e2fsprogs.sourceforge.net. +.SH "SEE ALSO" +.BR libuuid (3), +.BR uuid_clear (3), +.BR uuid_compare (3), +.BR uuid_copy (3), +.BR uuid_generate (3), +.BR uuid_time (3) diff --git a/kexi/3rdparty/uuid/uuid_parse.3.in b/kexi/3rdparty/uuid/uuid_parse.3.in new file mode 100644 index 00000000..d0b646d2 --- /dev/null +++ b/kexi/3rdparty/uuid/uuid_parse.3.in @@ -0,0 +1,50 @@ +.\" Copyright 1999 Andreas Dilger ([email protected]) +.\" +.\" This man page was created for libuuid.so.1.1 from e2fsprogs-1.14. +.\" +.\" This file may be copied under the terms of the GNU Public License. +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_PARSE 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" +.SH NAME +uuid_parse \- convert an input UUID string into the libuuid internal format +.SH SYNOPSIS +.nf +.B #include <uuid/uuid.h> +.sp +.BI "int uuid_parse( char *" in ", uuid_t " uu ); +.fi +.SH DESCRIPTION +The +.B uuid_parse +function converts the UUID string given by +.I in +into the internal +.B uuid_t +format. The input UUID is a string of the form +1b4e28ba\-2fa1\-11d2\-883f\-b9a761bde3fb (in +.BR printf (3) +format "%08x\-%04x\-%04x\-%04x\-%012x", 36 bytes plus the trailing '\\0'). +.SH RETURN VALUE +Upon successfully parsing the input string, 0 is returned, and the UUID is +stored in the location pointed to by +.IR uu , +otherwise \-1 is returned. +.SH "CONFORMING TO" +OSF DCE 1.1 +.SH AUTHOR +.B uuid_parse +was written by Theodore Y. Ts'o for the ext2 filesystem utilties. +.SH AVAILABILITY +.B uuid_parse +is part of libuuid from the e2fsprogs package and is available from +http://e2fsprogs.sourceforge.net. +.SH "SEE ALSO" +.BR libuuid (3), +.BR uuid_clear (3), +.BR uuid_compare (3), +.BR uuid_copy (3), +.BR uuid_generate (3), +.BR uuid_is_null (3), +.BR uuid_time (3), +.BR uuid_unparse (3) diff --git a/kexi/3rdparty/uuid/uuid_time.3.in b/kexi/3rdparty/uuid/uuid_time.3.in new file mode 100644 index 00000000..b85aa233 --- /dev/null +++ b/kexi/3rdparty/uuid/uuid_time.3.in @@ -0,0 +1,52 @@ +.\" Copyright 1999 Andreas Dilger ([email protected]) +.\" +.\" This man page was created for libuuid.so.1.1 from e2fsprogs-1.14. +.\" +.\" This file may be copied under the terms of the GNU Public License. +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_TIME 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" +.SH NAME +uuid_time \- extract the time at which the UUID was created +.SH SYNOPSIS +.nf +.B #include <uuid/uuid.h> +.sp +.BI "time_t uuid_time(uuid_t " uu ", struct timeval *" ret_tv ) +.fi +.SH DESCRIPTION +The +.B uuid_time +function extracts the time at which the supplied UUID +.I uu +was created. Note that the UUID creation time is encoded within the UUID, +and this function can only reasonably expect to extract the creation time +for UUIDs created with the +.BR uuid_generate (3) +function. It may or may not work with UUIDs created by OSF DCE +.BR uuidgen . +.SH "RETURN VALUES" +The time at which the UUID was created, in seconds since January 1, 1970 GMT +(the epoch), is returned (see +.BR time "(2))." +The time at which the UUID was created, in seconds and microseconds since +the epoch, is also stored in the location pointed to by +.I ret_tv +(see +.BR gettimeofday "(2))." +.SH AUTHOR +.B uuid_time +was written by Theodore Y. Ts'o for the ext2 filesystem utilties. +.SH AVAILABILITY +.B uuid_time +is part of libuuid from the e2fsprogs package and is available from +http://e2fsprogs.sourceforge.net. +.SH "SEE ALSO" +.BR libuuid (3), +.BR uuid_clear (3), +.BR uuid_compare (3), +.BR uuid_copy (3), +.BR uuid_generate (3), +.BR uuid_is_null (3), +.BR uuid_parse (3), +.BR uuid_unparse (3) diff --git a/kexi/3rdparty/uuid/uuid_time.c b/kexi/3rdparty/uuid/uuid_time.c new file mode 100644 index 00000000..c19af48c --- /dev/null +++ b/kexi/3rdparty/uuid/uuid_time.c @@ -0,0 +1,138 @@ +/* + * 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% + * This file may be redistributed under the terms of the GNU + * Library General Public License. + * %End-Header% + */ + +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/time.h> +#include <time.h> + +#include "uuidP.h" + +time_t uuid_time(const uuid_t uu, struct timeval *ret_tv) +{ + struct uuid uuid; + __u32 high; + struct timeval tv; + unsigned longlong clock_reg; + + uuid_unpack(uu, &uuid); + + high = uuid.time_mid | ((uuid.time_hi_and_version & 0xFFF) << 16); + clock_reg = uuid.time_low | ((unsigned longlong) high << 32); + + clock_reg -= (((unsigned longlong) 0x01B21DD2) << 32) + 0x13814000; + tv.tv_sec = clock_reg / 10000000; + tv.tv_usec = (clock_reg % 10000000) / 10; + + if (ret_tv) + *ret_tv = tv; + + return tv.tv_sec; +} + +int uuid_type(const uuid_t uu) +{ + struct uuid uuid; + + uuid_unpack(uu, &uuid); + return ((uuid.time_hi_and_version >> 12) & 0xF); +} + +int uuid_variant(const uuid_t uu) +{ + struct uuid uuid; + int var; + + uuid_unpack(uu, &uuid); + var = uuid.clock_seq; + + if ((var & 0x8000) == 0) + return UUID_VARIANT_NCS; + if ((var & 0x4000) == 0) + return UUID_VARIANT_DCE; + if ((var & 0x2000) == 0) + return UUID_VARIANT_MICROSOFT; + return UUID_VARIANT_OTHER; +} + +#ifdef DEBUG +static const char *variant_string(int variant) +{ + switch (variant) { + case UUID_VARIANT_NCS: + return "NCS"; + case UUID_VARIANT_DCE: + return "DCE"; + case UUID_VARIANT_MICROSOFT: + return "Microsoft"; + default: + return "Other"; + } +} + + +int +main(int argc, char **argv) +{ + uuid_t buf; + time_t time_reg; + struct timeval tv; + int type, variant; + + if (argc != 2) { + fprintf(stderr, "Usage: %s uuid\n", argv[0]); + exit(1); + } + if (uuid_parse(argv[1], buf)) { + fprintf(stderr, "Invalid UUID: %s\n", argv[1]); + exit(1); + } + variant = uuid_variant(buf); + type = uuid_type(buf); + time_reg = uuid_time(buf, &tv); + + printf("UUID variant is %d (%s)\n", variant, variant_string(variant)); + if (variant != UUID_VARIANT_DCE) { + printf("Warning: This program only knows how to interpret " + "DCE UUIDs.\n\tThe rest of the output is likely " + "to be incorrect!!\n"); + } + printf("UUID type is %d", type); + switch (type) { + case 1: + printf(" (time based)\n"); + break; + case 2: + printf(" (DCE)\n"); + break; + case 3: + printf(" (name-based)\n"); + break; + case 4: + printf(" (random)\n"); + break; + default: + printf("\n"); + } + if (type != 1) { + printf("Warning: not a time-based UUID, so UUID time " + "decoding will likely not work!\n"); + } + printf("UUID time is: (%ld, %ld): %s\n", tv.tv_sec, tv.tv_usec, + ctime(&time_reg)); + + return 0; +} +#endif diff --git a/kexi/3rdparty/uuid/uuid_types.h.in b/kexi/3rdparty/uuid/uuid_types.h.in new file mode 100644 index 00000000..ba67feaf --- /dev/null +++ b/kexi/3rdparty/uuid/uuid_types.h.in @@ -0,0 +1,51 @@ +/* + * If linux/types.h is already been included, assume it has defined + * everything we need. (cross fingers) Other header files may have + * also defined the types that we need. + */ +#if (!defined(_LINUX_TYPES_H) && !defined(_BLKID_TYPES_H) && \ + !defined(_UUID_TYPES) && !defined(_EXT2_TYPES_H)) +#define _UUID_TYPES_H + +typedef unsigned char __u8; +typedef signed char __s8; + +#if (@SIZEOF_INT@ == 8) +typedef int __s64; +typedef unsigned int __u64; +#elif (@SIZEOF_LONG@ == 8) +typedef long __s64; +typedef unsigned long __u64; +#elif (@SIZEOF_LONG_LONG@ == 8) +#if defined(__GNUC__) +typedef __signed__ long long __s64; +#else +typedef signed long long __s64; +#endif +typedef unsigned long long __u64; +#endif + +#if (@SIZEOF_INT@ == 2) +typedef int __s16; +typedef unsigned int __u16; +#elif (@SIZEOF_SHORT@ == 2) +typedef short __s16; +typedef unsigned short __u16; +#else + ?==error: undefined 16 bit type +#endif + +#if (@SIZEOF_INT@ == 4) +typedef int __s32; +typedef unsigned int __u32; +#elif (@SIZEOF_LONG@ == 4) +typedef long __s32; +typedef unsigned long __u32; +#elif (@SIZEOF_SHORT@ == 4) +typedef short __s32; +typedef unsigned short __u32; +#else + ?== error: undefined 32 bit type +#endif + +#endif /* _*_TYPES_H */ diff --git a/kexi/3rdparty/uuid/uuid_unparse.3.in b/kexi/3rdparty/uuid/uuid_unparse.3.in new file mode 100644 index 00000000..7099ed22 --- /dev/null +++ b/kexi/3rdparty/uuid/uuid_unparse.3.in @@ -0,0 +1,40 @@ +.\" Copyright 1999 Andreas Dilger ([email protected]) +.\" +.\" This man page was created for libuuid.so.1.1 from e2fsprogs-1.14. +.\" +.\" This file may be copied under the terms of the GNU Public License. +.\" +.\" Created Wed Mar 10 17:42:12 1999, Andreas Dilger +.TH UUID_UNPARSE 3 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" +.SH NAME +uuid_unparse \- output UUID variable in string format +.SH SYNOPSIS +.nf +.B #include <uuid/uuid.h> +.sp +.BI "void uuid_unparse(uuid_t " uu ", char *" out ); +.fi +.SH DESCRIPTION +The +.B uuid_unparse +function converts the supplied UUID +.I uu +from the internal binary format into a 36\-byte string (plus tailing '\\0') +of the form 1b4e28ba\-2fa1\-11d2\-883f\-b9a76 and stores this value in the +character string pointed to by +.IR out . +.SH "CONFORMING TO" +OSF DCE 1.1 +.SH AUTHOR +.B uuid_unparse +was written by Theodore Y. Ts'o for the ext2 filesystem utilties. +.SH AVAILABILITY +.B uuid_unparse +is part of libuuid from the e2fsprogs package and is available from +http://e2fsprogs.sourceforge.net. +.SH "SEE ALSO" +.BR libuuid (3), +.BR uuid_clear (3), +.BR uuid_generate (3), +.BR uuid_parse (3), +.BR uuid_time (3) |