Skip to content
This repository has been archived by the owner on Sep 30, 2018. It is now read-only.

Commit

Permalink
Renamed uuid_t to ossp_uuid_t since it conflicted with a type provide…
Browse files Browse the repository at this point in the history
…d by OS X.

Xss is added to the list of libs needed for X11.


git-svn-id: file:///home/svn/MyPasswordSafe/tags/macport@205 9e3857e0-fc33-0410-b652-94ab0348a082
  • Loading branch information
nolan committed Jun 28, 2007
1 parent 3e6fa9c commit d337443
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 66 deletions.
2 changes: 1 addition & 1 deletion MyPasswordSafe.pro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CONFIG += idle
IDLE_CPP = src/tools/idle
INCLUDEPATH += $$IDLE_CPP
unix {
LIBS += -lXss
QMAKE_X11_LIBS += -lXss
}
include($$IDLE_CPP/idle.pri)

Expand Down
2 changes: 0 additions & 2 deletions src/crypto/sha1.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#include <stdint.h>
#include <string>

#include "endian.h"

using std::string;

typedef uint8_t byte;
Expand Down
2 changes: 1 addition & 1 deletion src/uuid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class UUID
*/
static Exception errorToException(uuid_rc_t error);

uuid_t *m_uuid;
ossp_uuid_t *m_uuid;
};

#endif // UUID_HPP
2 changes: 1 addition & 1 deletion uuid-1.0.0/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ CC = gcc
CPPFLAGS =
CFLAGS = -DHAVE_CONFIG_H -O2 -pipe
LDFLAGS =
LIBS = -lnsl
LIBS =
RM = rm -f
CP = cp
RMDIR = rmdir
Expand Down
2 changes: 1 addition & 1 deletion uuid-1.0.0/uuid-config
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ uuid_datadir="${prefix}/share"
uuid_acdir="${prefix}/share/aclocal"
uuid_cflags="-O2 -pipe"
uuid_ldflags=""
uuid_libs="-lnsl "
uuid_libs=""
uuid_version="1.0.0 (16-Feb-2004)"

help=no
Expand Down
42 changes: 21 additions & 21 deletions uuid-1.0.0/uuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ struct uuid_st {
};

/* create UUID object */
uuid_rc_t uuid_create(uuid_t **uuid)
uuid_rc_t uuid_create(ossp_uuid_t **uuid)
{
/* argument sanity check */
if (uuid == NULL)
return UUID_RC_ARG;

/* allocate UUID object */
if ((*uuid = (uuid_t *)malloc(sizeof(uuid_t))) == NULL)
if ((*uuid = (ossp_uuid_t *)malloc(sizeof(ossp_uuid_t))) == NULL)
return UUID_RC_MEM;

/* set UUID object initially to "Nil UUID" */
Expand All @@ -123,7 +123,7 @@ uuid_rc_t uuid_create(uuid_t **uuid)
}

/* destroy UUID object */
uuid_rc_t uuid_destroy(uuid_t *uuid)
uuid_rc_t uuid_destroy(ossp_uuid_t *uuid)
{
/* argument sanity check */
if (uuid == NULL)
Expand All @@ -140,7 +140,7 @@ uuid_rc_t uuid_destroy(uuid_t *uuid)
}

/* check whether UUID object represents "Nil UUID" */
uuid_rc_t uuid_isnil(uuid_t *uuid, int *result)
uuid_rc_t uuid_isnil(ossp_uuid_t *uuid, int *result)
{
const unsigned char *ucp;
int i;
Expand All @@ -162,7 +162,7 @@ uuid_rc_t uuid_isnil(uuid_t *uuid, int *result)
}

/* compare UUID objects */
uuid_rc_t uuid_compare(uuid_t *uuid1, uuid_t *uuid2, int *result)
uuid_rc_t uuid_compare(ossp_uuid_t *uuid1, ossp_uuid_t *uuid2, int *result)
{
int r;

Expand Down Expand Up @@ -214,7 +214,7 @@ uuid_rc_t uuid_compare(uuid_t *uuid1, uuid_t *uuid2, int *result)

/* INTERNAL: unpack UUID binary presentation into UUID object
(allows in-place operation for internal efficiency!) */
static uuid_rc_t uuid_import_bin(uuid_t *uuid, const void *data_ptr, size_t data_len)
static uuid_rc_t uuid_import_bin(ossp_uuid_t *uuid, const void *data_ptr, size_t data_len)
{
const uuid_uint8_t *in;
uuid_uint32_t tmp32;
Expand Down Expand Up @@ -260,7 +260,7 @@ static uuid_rc_t uuid_import_bin(uuid_t *uuid, const void *data_ptr, size_t data

/* INTERNAL: pack UUID object into binary representation
(allows in-place operation for internal efficiency!) */
static uuid_rc_t uuid_export_bin(uuid_t *uuid, void **data_ptr, size_t *data_len)
static uuid_rc_t uuid_export_bin(ossp_uuid_t *uuid, void **data_ptr, size_t *data_len)
{
uuid_uint8_t *out;
uuid_uint32_t tmp32;
Expand All @@ -273,7 +273,7 @@ static uuid_rc_t uuid_export_bin(uuid_t *uuid, void **data_ptr, size_t *data_len

/* optionally allocate octet data buffer */
if (*data_ptr == NULL) {
if ((*data_ptr = malloc(sizeof(uuid_t))) == NULL)
if ((*data_ptr = malloc(sizeof(ossp_uuid_t))) == NULL)
return UUID_RC_MEM;
if (data_len != NULL)
*data_len = UUID_LEN_BIN;
Expand Down Expand Up @@ -349,7 +349,7 @@ static int uuid_isstr(const char *str, size_t str_len)
}

/* INTERNAL: import UUID object from string representation */
static uuid_rc_t uuid_import_str(uuid_t *uuid, const void *data_ptr, size_t data_len)
static uuid_rc_t uuid_import_str(ossp_uuid_t *uuid, const void *data_ptr, size_t data_len)
{
uuid_uint16_t tmp16;
const char *cp;
Expand Down Expand Up @@ -389,7 +389,7 @@ static uuid_rc_t uuid_import_str(uuid_t *uuid, const void *data_ptr, size_t data
}

/* INTERNAL: export UUID object to string representation */
static uuid_rc_t uuid_export_str(uuid_t *uuid, void **data_ptr, size_t *data_len)
static uuid_rc_t uuid_export_str(ossp_uuid_t *uuid, void **data_ptr, size_t *data_len)
{
/* sanity check argument(s) */
if (uuid == NULL || data_ptr == NULL)
Expand Down Expand Up @@ -448,7 +448,7 @@ static struct {
};

/* INTERNAL: dump UUID object as descriptive text */
static uuid_rc_t uuid_export_txt(uuid_t *uuid, void **data_ptr, size_t *data_len)
static uuid_rc_t uuid_export_txt(ossp_uuid_t *uuid, void **data_ptr, size_t *data_len)
{
uuid_rc_t rc;
char **out;
Expand Down Expand Up @@ -618,7 +618,7 @@ static uuid_rc_t uuid_export_txt(uuid_t *uuid, void **data_ptr, size_t *data_len
}

/* UUID importing */
uuid_rc_t uuid_import(uuid_t *uuid, uuid_fmt_t fmt, const void *data_ptr, size_t data_len)
uuid_rc_t uuid_import(ossp_uuid_t *uuid, uuid_fmt_t fmt, const void *data_ptr, size_t data_len)
{
uuid_rc_t rc;

Expand All @@ -638,7 +638,7 @@ uuid_rc_t uuid_import(uuid_t *uuid, uuid_fmt_t fmt, const void *data_ptr, size_t
}

/* UUID exporting */
uuid_rc_t uuid_export(uuid_t *uuid, uuid_fmt_t fmt, void **data_ptr, size_t *data_len)
uuid_rc_t uuid_export(ossp_uuid_t *uuid, uuid_fmt_t fmt, void **data_ptr, size_t *data_len)
{
uuid_rc_t rc;

Expand All @@ -658,7 +658,7 @@ uuid_rc_t uuid_export(uuid_t *uuid, uuid_fmt_t fmt, void **data_ptr, size_t *dat
}

/* INTERNAL: brand UUID with version and variant */
static void uuid_brand(uuid_t *uuid, int version)
static void uuid_brand(ossp_uuid_t *uuid, int version)
{
/* set version (as given) */
uuid->obj.time_hi_and_version &= BM_MASK(11,0);
Expand All @@ -671,7 +671,7 @@ static void uuid_brand(uuid_t *uuid, int version)
}

/* INTERNAL: generate UUID version 1: time, clock and node based */
static uuid_rc_t uuid_make_v1(uuid_t *uuid, unsigned int mode, va_list ap)
static uuid_rc_t uuid_make_v1(ossp_uuid_t *uuid, unsigned int mode, va_list ap)
{
struct timeval time_now;
#ifdef HAVE_NANOSLEEP
Expand Down Expand Up @@ -824,7 +824,7 @@ static struct {
};

/* load UUID object with pre-defined value */
uuid_rc_t uuid_load(uuid_t *uuid, const char *name)
uuid_rc_t uuid_load(ossp_uuid_t *uuid, const char *name)
{
uuid_uint8_t *uuid_octets;
uuid_rc_t rc;
Expand Down Expand Up @@ -853,16 +853,16 @@ uuid_rc_t uuid_load(uuid_t *uuid, const char *name)
}

/* INTERNAL: generate UUID version 3: name based */
static uuid_rc_t uuid_make_v3(uuid_t *uuid, unsigned int mode, va_list ap)
static uuid_rc_t uuid_make_v3(ossp_uuid_t *uuid, unsigned int mode, va_list ap)
{
char *str;
uuid_t *uuid_ns;
ossp_uuid_t *uuid_ns;
uuid_uint8_t uuid_buf[UUID_LEN_BIN];
void *uuid_ptr;
size_t uuid_len;

/* determine namespace UUID and name string arguments */
if ((uuid_ns = (uuid_t *)va_arg(ap, void *)) == NULL)
if ((uuid_ns = (ossp_uuid_t *)va_arg(ap, void *)) == NULL)
return UUID_RC_ARG;
if ((str = (char *)va_arg(ap, char *)) == NULL)
return UUID_RC_ARG;
Expand Down Expand Up @@ -898,7 +898,7 @@ static uuid_rc_t uuid_make_v3(uuid_t *uuid, unsigned int mode, va_list ap)
}

/* INTERNAL: generate UUID version 4: random number based */
static uuid_rc_t uuid_make_v4(uuid_t *uuid, unsigned int mode, va_list ap)
static uuid_rc_t uuid_make_v4(ossp_uuid_t *uuid, unsigned int mode, va_list ap)
{
/* fill UUID with random data */
prng_data(uuid->prng, (void *)&(uuid->obj), sizeof(uuid->obj));
Expand All @@ -910,7 +910,7 @@ static uuid_rc_t uuid_make_v4(uuid_t *uuid, unsigned int mode, va_list ap)
}

/* generate UUID */
uuid_rc_t uuid_make(uuid_t *uuid, unsigned int mode, ...)
uuid_rc_t uuid_make(ossp_uuid_t *uuid, unsigned int mode, ...)
{
va_list ap;
uuid_rc_t rc;
Expand Down
18 changes: 9 additions & 9 deletions uuid-1.0.0/uuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,23 @@ typedef enum {

/* UUID abstract data type */
struct uuid_st;
typedef struct uuid_st uuid_t;
typedef struct uuid_st ossp_uuid_t;

/* UUID object handling */
extern uuid_rc_t uuid_create (uuid_t **_uuid);
extern uuid_rc_t uuid_destroy (uuid_t *_uuid);
extern uuid_rc_t uuid_create (ossp_uuid_t **_uuid);
extern uuid_rc_t uuid_destroy (ossp_uuid_t *_uuid);

/* UUID generation */
extern uuid_rc_t uuid_load (uuid_t *_uuid, const char *_name);
extern uuid_rc_t uuid_make (uuid_t *_uuid, unsigned int _mode, ...);
extern uuid_rc_t uuid_load (ossp_uuid_t *_uuid, const char *_name);
extern uuid_rc_t uuid_make (ossp_uuid_t *_uuid, unsigned int _mode, ...);

/* UUID comparison */
extern uuid_rc_t uuid_isnil (uuid_t *_uuid, int *_result);
extern uuid_rc_t uuid_compare (uuid_t *_uuid, uuid_t *_uuid2, int *_result);
extern uuid_rc_t uuid_isnil (ossp_uuid_t *_uuid, int *_result);
extern uuid_rc_t uuid_compare (ossp_uuid_t *_uuid, ossp_uuid_t *_uuid2, int *_result);

/* UUID import/export */
extern uuid_rc_t uuid_import (uuid_t *_uuid, uuid_fmt_t _fmt, const void *_data_ptr, size_t _data_len);
extern uuid_rc_t uuid_export (uuid_t *_uuid, uuid_fmt_t _fmt, void **_data_ptr, size_t *_data_len);
extern uuid_rc_t uuid_import (ossp_uuid_t *_uuid, uuid_fmt_t _fmt, const void *_data_ptr, size_t _data_len);
extern uuid_rc_t uuid_export (ossp_uuid_t *_uuid, uuid_fmt_t _fmt, void **_data_ptr, size_t *_data_len);

/* library utilities */
extern char *uuid_error (uuid_rc_t _rc);
Expand Down
18 changes: 9 additions & 9 deletions uuid-1.0.0/uuid.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,23 @@ typedef enum {

/* UUID abstract data type */
struct uuid_st;
typedef struct uuid_st uuid_t;
typedef struct uuid_st ossp_uuid_t;

/* UUID object handling */
extern uuid_rc_t uuid_create (uuid_t **_uuid);
extern uuid_rc_t uuid_destroy (uuid_t *_uuid);
extern uuid_rc_t uuid_create (ossp_uuid_t **_uuid);
extern uuid_rc_t uuid_destroy (ossp_uuid_t *_uuid);

/* UUID generation */
extern uuid_rc_t uuid_load (uuid_t *_uuid, const char *_name);
extern uuid_rc_t uuid_make (uuid_t *_uuid, unsigned int _mode, ...);
extern uuid_rc_t uuid_load (ossp_uuid_t *_uuid, const char *_name);
extern uuid_rc_t uuid_make (ossp_uuid_t *_uuid, unsigned int _mode, ...);

/* UUID comparison */
extern uuid_rc_t uuid_isnil (uuid_t *_uuid, int *_result);
extern uuid_rc_t uuid_compare (uuid_t *_uuid, uuid_t *_uuid2, int *_result);
extern uuid_rc_t uuid_isnil (ossp_uuid_t *_uuid, int *_result);
extern uuid_rc_t uuid_compare (ossp_uuid_t *_uuid, ossp_uuid_t *_uuid2, int *_result);

/* UUID import/export */
extern uuid_rc_t uuid_import (uuid_t *_uuid, uuid_fmt_t _fmt, const void *_data_ptr, size_t _data_len);
extern uuid_rc_t uuid_export (uuid_t *_uuid, uuid_fmt_t _fmt, void **_data_ptr, size_t *_data_len);
extern uuid_rc_t uuid_import (ossp_uuid_t *_uuid, uuid_fmt_t _fmt, const void *_data_ptr, size_t _data_len);
extern uuid_rc_t uuid_export (ossp_uuid_t *_uuid, uuid_fmt_t _fmt, void **_data_ptr, size_t *_data_len);

/* library utilities */
extern char *uuid_error (uuid_rc_t _rc);
Expand Down
4 changes: 2 additions & 2 deletions uuid-1.0.0/uuid_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ int main(int argc, char *argv[])
{
char uuid_buf_bin[UUID_LEN_BIN];
char uuid_buf_str[UUID_LEN_STR+1];
uuid_t *uuid;
uuid_t *uuid_ns;
ossp_uuid_t *uuid;
ossp_uuid_t *uuid_ns;
uuid_rc_t rc;
FILE *fp;
char *p;
Expand Down
14 changes: 7 additions & 7 deletions uuid-1.0.0/uuid_dce.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
*/

/* include DCE 1.1 API */
#define uuid_t uuid_dce_t
#define ossp_uuid_t uuid_dce_t
#include "uuid_dce.h"
#undef uuid_t
#undef ossp_uuid_t
#undef uuid_create
#undef uuid_create_nil
#undef uuid_is_nil
Expand All @@ -46,7 +46,7 @@
/* create a UUID (v1 only) */
void uuid_dce_create(uuid_dce_t *uuid_dce, int *status)
{
uuid_t *uuid;
ossp_uuid_t *uuid;
size_t len;
void *vp;

Expand Down Expand Up @@ -135,8 +135,8 @@ int uuid_dce_is_nil(uuid_dce_t *uuid_dce, int *status)
/* compare two UUIDs */
int uuid_dce_compare(uuid_dce_t *uuid_dce1, uuid_dce_t *uuid_dce2, int *status)
{
uuid_t *uuid1 = NULL;
uuid_t *uuid2 = NULL;
ossp_uuid_t *uuid1 = NULL;
ossp_uuid_t *uuid2 = NULL;
int result = 0;

/* initialize status */
Expand Down Expand Up @@ -190,7 +190,7 @@ int uuid_dce_equal(uuid_dce_t *uuid_dce1, uuid_dce_t *uuid_dce2, int *status)
/* import UUID from string representation */
void uuid_dce_from_string(const char *str, uuid_dce_t *uuid_dce, int *status)
{
uuid_t *uuid = NULL;
ossp_uuid_t *uuid = NULL;
size_t len;
void *vp;

Expand Down Expand Up @@ -226,7 +226,7 @@ void uuid_dce_from_string(const char *str, uuid_dce_t *uuid_dce, int *status)
/* export UUID to string representation */
void uuid_dce_to_string(uuid_dce_t *uuid_dce, char **str, int *status)
{
uuid_t *uuid = NULL;
ossp_uuid_t *uuid = NULL;
size_t len;
void *vp;

Expand Down
Loading

0 comments on commit d337443

Please sign in to comment.