From b88b59741fd9d2bc4097b803db4447e15d004d79 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Wed, 29 Mar 2000 00:47:30 +0000 Subject: create id's for entries using the following format: ("pas-id-%08lX%08X", * addressbook/backend/pas/pas-backend-file.c (pas_backend_file_create_unique_id): create id's for entries using the following format: ("pas-id-%08lX%08X", time(NULL), c++). svn path=/trunk/; revision=2235 --- addressbook/backend/pas/pas-backend-file.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'addressbook/backend/pas') diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c index 94c87f655b..e117fe8b05 100644 --- a/addressbook/backend/pas/pas-backend-file.c +++ b/addressbook/backend/pas/pas-backend-file.c @@ -9,6 +9,7 @@ #include "config.h" #include #include +#include #ifdef HAVE_DB_185_H #include #else @@ -92,7 +93,11 @@ string_to_dbt(const char *str, DBT *dbt) static char * pas_backend_file_create_unique_id (char *vcard) { - return g_strdup ("foo"); /* XXX create unique id here */ + /* use a 32 counter and the 32 bit timestamp to make an id. + it's doubtful 2^32 id's will be created in a second, so we + should be okay. */ + static guint c = 0; + return g_strdup_printf ("pas-id-%08lX%08X", time(NULL), c++); } static void -- cgit v1.2.3