dbus-misc.c

00001 /* -*- mode: C; c-file-style: "gnu" -*- */
00002 /* dbus-misc.c  A few assorted public functions that don't fit elsewhere
00003  *
00004  * Copyright (C) 2006 Red Hat, Inc.
00005  *
00006  * Licensed under the Academic Free License version 2.1
00007  * 
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  * 
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  */
00023 
00024 #include <config.h>
00025 #include "dbus-misc.h"
00026 #include "dbus-internals.h"
00027 #include "dbus-string.h"
00028 
00072 char*
00073 dbus_get_local_machine_id (void)
00074 {
00075   DBusString uuid;
00076   char *s;
00077 
00078   s = NULL;
00079   if (!_dbus_string_init (&uuid))
00080     return NULL;
00081 
00082   if (!_dbus_get_local_machine_uuid_encoded (&uuid) ||
00083       !_dbus_string_steal_data (&uuid, &s))
00084     {
00085       _dbus_string_free (&uuid);
00086       return NULL;
00087     }
00088   else
00089     {
00090       _dbus_string_free (&uuid);
00091       return s;
00092     }
00093 
00094 }
00095  /* End of public API */
00097 
00098 #ifdef DBUS_BUILD_TESTS
00099 
00100 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00101 
00102 #include "dbus-test.h"
00103 #include <stdlib.h>
00104 
00105 
00106 dbus_bool_t
00107 _dbus_misc_test (void)
00108 {
00109   
00110   return TRUE;
00111 }
00112 
00113 #endif /* !DOXYGEN_SHOULD_SKIP_THIS */
00114 
00115 #endif

Generated on Tue Apr 15 15:54:00 2008 for D-Bus by  doxygen 1.5.1