add support for vars from uname(3)
[systembsd.git] / src / interfaces / hostnamed / hostnamed.h
index 6bc1478a41e74d33eaa9174240fb1662dea5fa3b..6c5f2073ff26bf5726be4eb862c5b2dc7ef3dbf9 100644 (file)
@@ -1,78 +1,27 @@
-#include <gio/gio.h>
+/*
+ * Copyright (c) 2014 Ian Sutton <ian@kremlin.cc>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
 
-static const gchar SYSTEMD_HOSTNAMED_XML[] = 
-       "<!DOCTYPE node PUBLIC '-//freedesktop//DTD D-BUS Object Introspection 1.0//EN'"
-       "'http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd'>"
-       "<node>"
-       " <interface name='org.freedesktop.DBus.Peer'>"
-       "  <method name='Ping'/>"
-       "  <method name='GetMachineId'>"
-       "   <arg type='s' name='machine_uuid' direction='out'/>"
-       "  </method>"
-       " </interface>"
-       " <interface name='org.freedesktop.DBus.Introspectable'>"
-       "  <method name='Introspect'>"
-       "   <arg name='data' type='s' direction='out'/>"
-       "  </method>"
-       " </interface>"
-       " <interface name='org.freedesktop.DBus.Properties'>"
-       "  <method name='Get'>"
-       "   <arg name='interface' direction='in' type='s'/>"
-       "   <arg name='property' direction='in' type='s'/>"
-       "   <arg name='value' direction='out' type='v'/>"
-       "  </method>"
-       "  <method name='GetAll'>"
-       "   <arg name='interface' direction='in' type='s'/>"
-       "   <arg name='properties' direction='out' type='a{sv}'/>"
-       "  </method>"
-       "  <method name='Set'>"
-       "   <arg name='interface' direction='in' type='s'/>"
-       "   <arg name='property' direction='in' type='s'/>"
-       "   <arg name='value' direction='in' type='v'/>"
-       "  </method>"
-       "  <signal name='PropertiesChanged'>"
-       "   <arg type='s' name='interface'/>"
-       "   <arg type='a{sv}' name='changed_properties'/>"
-       "   <arg type='as' name='invalidated_properties'/>"
-       "  </signal>"
-       " </interface>"
-       " <interface name='org.freedesktop.hostname1'>"
-       "  <property name='Hostname' type='s' access='read'>"
-       "   <annotation name='org.freedesktop.DBus.Property.EmitsChangedSignal' value='false'/>"
-       "  </property>"
-       "  <property name='StaticHostname' type='s' access='read'>"
-       "  </property>"
-       "  <property name='PrettyHostname' type='s' access='read'>"
-       "  </property>"
-       "  <property name='IconName' type='s' access='read'>"
-       "  </property>"
-       "  <property name='Chassis' type='s' access='read'>"
-       "  </property>"
-       "  <property name='OperatingSystemPrettyName' type='s' access='read'>"
-       "   <annotation name='org.freedesktop.DBus.Property.EmitsChangedSignal' value='const'/>"
-       "  </property>"
-       "  <property name='OperatingSystemCPEName' type='s' access='read'>"
-       "   <annotation name='org.freedesktop.DBus.Property.EmitsChangedSignal' value='const'/>"
-       "  </property>"
-       "  <method name='SetHostname'>"
-       "   <arg type='s' direction='in'/>"
-       "   <arg type='b' direction='in'/>"
-       "  </method>"
-       "  <method name='SetStaticHostname'>"
-       "   <arg type='s' direction='in'/>"
-       "   <arg type='b' direction='in'/>"
-       "  </method>"
-       "  <method name='SetPrettyHostname'>"
-       "   <arg type='s' direction='in'/>"
-       "   <arg type='b' direction='in'/>"
-       "  </method>"
-       "  <method name='SetIconName'>"
-       "   <arg type='s' direction='in'/>"
-       "   <arg type='b' direction='in'/>"
-       "  </method>"
-       "  <method name='SetChassis'>"
-       "   <arg type='s' direction='in'/>"
-       "   <arg type='b' direction='in'/>"
-       "  </method>"
-       " </interface>"
-       "</node>";
+void hostnamed_mem_clean();
+
+const gchar *our_get_pretty_hostname();
+
+int up_apm_get_fd();
+
+gboolean determine_chassis_and_icon();
+gboolean up_native_get_sensordev(const char * id, struct sensordev * snsrdev);
+gboolean up_native_is_laptop();
+gboolean is_server(gchar *arch);
+gboolean set_uname_properties();