]> git.draconx.ca Git - upkg.git/blob - src/serializable.c
Initial UObject implementation plus a dumb music extractor.
[upkg.git] / src / serializable.c
1 #include <glib-object.h>
2 #include "serializable.h"
3 #include "upkg.h"
4
5 GType upkg_serializable_get_type(void)
6 {
7         static GType type = 0;
8         if (type == 0) {
9                 static const GTypeInfo info = {
10                         sizeof (UPkgSerializable),
11                         NULL,
12                         NULL,
13                 };
14
15                 type = g_type_register_static(G_TYPE_INTERFACE,
16                         "UPkgSerializable", &info, 0);
17         }
18         return type;
19 }
20
21 int upkg_deserialize(GObject *obj, struct upkg_file *f)
22 {
23         g_return_val_if_fail(UPKG_IS_SERIALIZABLE(obj), -1);
24         return UPKG_SERIALIZABLE_GET_INTERFACE(obj)->deserialize(obj, f);
25 }