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   _dbus_string_init (&uuid);
00080   if (!_dbus_get_local_machine_uuid_encoded (&uuid) ||
00081       !_dbus_string_steal_data (&uuid, &s))
00082     {
00083       _dbus_string_free (&uuid);
00084       return FALSE;
00085     }
00086   else
00087     {
00088       _dbus_string_free (&uuid);
00089       return s;
00090     }
00091 
00092 }
00093  /* End of public API */
00095 
00096 #ifdef DBUS_BUILD_TESTS
00097 
00098 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00099 
00100 #include "dbus-test.h"
00101 #include <stdlib.h>
00102 
00103 
00104 dbus_bool_t
00105 _dbus_misc_test (void)
00106 {
00107   
00108   return TRUE;
00109 }
00110 
00111 #endif /* !DOXYGEN_SHOULD_SKIP_THIS */
00112 
00113 #endif

Generated on Fri Sep 21 18:12:12 2007 for D-Bus by  doxygen 1.5.1