1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 /* e-uid.c - Unique ID generator.
4 * Copyright (C) 2002 Ximian, Inc.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of version 2 of the GNU Lesser General Public
8 * License as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
20 * Author: Dan Winship <danw@ximian.com>
34 * Generate a new unique string for use e.g. in account lists.
36 * Return value: The newly generated UID. The caller should free the string
37 * when it's done with it.
43 static char *hostname;
46 hostname = (char *) g_get_host_name ();
49 return g_strdup_printf ("%lu.%lu.%d@%s",
50 (unsigned long) time (NULL),
51 (unsigned long) getpid (),