#include <limits.h>
#include <gio/gio.h>
+#include "src/interfaces/hostnamed/hostnamed-gen.c"
GDBusNodeInfo *spect_data;
+/* handled by codegen
static gchar *hostname;
static gchar *pretty_hostname;
static gchar *static_hostname;
static gchar *kernel_version;
static gchar *os_prettyname;
static gchar *os_cpe; //common platform enumeration string
+*/
+/* handled by codegen
static void handle_method_call(GDBusConnection *conn,
const gchar *sender,
const gchar *obj_path,
}
}
+*/
+/* handled by codegen
static GVariant * handle_get_property(GDBusConnection *conn,
const gchar *sender,
const gchar *obj_path,
return NULL; //TODO error
}
+*/
+/* handled by codegen
static gboolean handle_set_property(GDBusConnection *conn,
const gchar *sender,
const gchar *obj_path,
obj_path,
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
- NULL, /* incorrect */
+ NULL, //incorrect
NULL);
return TRUE;
}
+*/
-/* "hot" functions initially passed to gdbus */
+/* handled by codegen
static const GDBusInterfaceVTable interface_vtable =
{
handle_method_call,
handle_set_property
};
-/* end method/property functions, begin bus name handlers
- * TODO: these should be intertwined as to handle edge cases
- * for when the system cannot immediately grab the name, as
- * well as cases where the system unintendedly loses the name
- */
+*/
+
static void on_bus_acquired(GDBusConnection *conn,
const gchar *name,
gpointer user_data) {
//TODO: malloc and return reference as if a main() closed
return err;
}
-
-static gboolean init_props() {
+/* handled by codegen
+gboolean init_props() {
if(init_hostname()
&& init_static_hostname()
}
//POSIX, for future ports try_hostname should be checked for null-termination
-static gboolean init_hostname() {
+gboolean init_hostname() {
- gchar try_hostname[MAX_HOSTNAME];
+ gchar try_hostname[HOST_NAME_MAX];
- if(!get_hostname(try_hostname, MAX_HOSTNAME)) {
+ if(!gethostname(try_hostname, HOST_NAME_MAX)) {
hostname = try_hostname;
return TRUE;
}
return FALSE;
}
+*/
-static gboolean init_pretty_hostname() {
+/* handled by codegen
+gboolean init_static_hostname() {
+ //TODO
+ return TRUE;
+}
-
+gboolean init_pretty_hostname() {
+ //TODO
+ return TRUE;
+}
+
+gboolean init_icon_name() {
+ //TODO
+ return TRUE;
+}
+gboolean init_chassis() {
+ //TODO
+ return TRUE;
+}
+
+gboolean init_kernel_name() {
+ //TODO
+ return TRUE;
+}
+
+gboolean init_kernel_version() {
+ //TODO
+ return TRUE;
+}
+
+gboolean init_os_name() {
+ //TODO
+ return TRUE;
+}
+
+gboolean init_os_cpe() {
+ //TODO
+ return TRUE;
}
//TODO figure out DMI variables on obsd