]> git.draconx.ca Git - upkg.git/commitdiff
uobject: Namespace changes.
authorNick Bowler <nbowler@draconx.ca>
Fri, 7 Aug 2009 05:22:09 +0000 (01:22 -0400)
committerNick Bowler <nbowler@draconx.ca>
Fri, 7 Aug 2009 05:22:09 +0000 (01:22 -0400)
Change uobject to u_object, and export all symbols starting with u_.
The library is starting to include package stuff which will use the
u_pkg prefix.

13 files changed:
src/Makefile.am
src/engine/music.c
src/engine/texture.c
src/exportable.c
src/loadable.c
src/module.c
src/uobject.c
src/uobject/exportable.h
src/uobject/loadable.h
src/uobject/module.h
src/uobject/package.h
src/uobject/uobject.h
src/upkg.c

index a6e337249567da7ace8825722f6f6aafb2523034..95764dfa5a24fe518c8482d527a030b9c635aaec 100644 (file)
@@ -10,7 +10,7 @@ libuobject_la_SOURCES  = uobject.c module.c avl.c package.c \
        loadable.c exportable.c
 libuobject_la_CPPFLAGS = $(GLIB_CFLAGS) $(LTDLINCL)
 libuobject_la_LIBADD   = $(LIBLTDL) $(GLIB_LIBS)
        loadable.c exportable.c
 libuobject_la_CPPFLAGS = $(GLIB_CFLAGS) $(LTDLINCL)
 libuobject_la_LIBADD   = $(LIBLTDL) $(GLIB_LIBS)
-libuobject_la_LDFLAGS  = -export-symbols-regex '^uobject_'
+libuobject_la_LDFLAGS  = -export-symbols-regex '^u_'
 
 libupkg_la_SOURCES = libupkg.c pack.c
 
 
 libupkg_la_SOURCES = libupkg.c pack.c
 
index 434d881fda70d1fe51f1efd2bd3989f05a4eadb6..565a6a0528b975c2441c3363785a18ff0d566dc9 100644 (file)
@@ -40,9 +40,9 @@ struct music_priv {
 static void exportable_init(UObjectExportable *);
 static void loadable_init(UObjectLoadable *);
 
 static void exportable_init(UObjectExportable *);
 static void loadable_init(UObjectLoadable *);
 
-G_DEFINE_DYNAMIC_TYPE_EXTENDED(EngineMusic, engine_music, UOBJECT_TYPE, 0,
-       G_IMPLEMENT_INTERFACE(UOBJECT_TYPE_EXPORTABLE, exportable_init)
-       G_IMPLEMENT_INTERFACE(UOBJECT_TYPE_LOADABLE, loadable_init)
+G_DEFINE_DYNAMIC_TYPE_EXTENDED(EngineMusic, engine_music, U_OBJECT_TYPE, 0,
+       G_IMPLEMENT_INTERFACE(U_OBJECT_TYPE_EXPORTABLE, exportable_init)
+       G_IMPLEMENT_INTERFACE(U_OBJECT_TYPE_LOADABLE, loadable_init)
 );
 
 static int load(GObject *o)
 );
 
 static int load(GObject *o)
@@ -129,7 +129,7 @@ static int deserialize(UObject *o, struct upkg_file *f)
        unsigned char buf[32];
        long size;
 
        unsigned char buf[32];
        long size;
 
-       UOBJECT_CLASS(engine_music_parent_class)->deserialize(o, f);
+       U_OBJECT_CLASS(engine_music_parent_class)->deserialize(o, f);
 
        buflen = upkg_export_read(f, buf, sizeof buf);
 
 
        buflen = upkg_export_read(f, buf, sizeof buf);
 
@@ -183,7 +183,7 @@ static void engine_music_finalize(GObject *o)
 
 static void engine_music_class_init(EngineMusicClass *class)
 {
 
 static void engine_music_class_init(EngineMusicClass *class)
 {
-       UObjectClass *uo = UOBJECT_CLASS(class);
+       UObjectClass *uo = U_OBJECT_CLASS(class);
        GObjectClass *go = G_OBJECT_CLASS(class);
        g_type_class_add_private(class, sizeof (struct music_priv));
 
        GObjectClass *go = G_OBJECT_CLASS(class);
        g_type_class_add_private(class, sizeof (struct music_priv));
 
index 209409b2f9ecbe09513cde05c7b0a7b795e153f9..9cd6571bbae872ed89bfe333f9ca7fd4229831de 100644 (file)
@@ -49,14 +49,14 @@ void exportable_init(UObjectExportable *e)
 {
 }
 
 {
 }
 
-G_DEFINE_DYNAMIC_TYPE(EngineTexture, engine_texture, UOBJECT_TYPE);
+G_DEFINE_DYNAMIC_TYPE(EngineTexture, engine_texture, U_OBJECT_TYPE);
 
 static int deserialize(UObject *o, struct upkg_file *f)
 {
        struct texture_priv *priv = TEXTURE_GET_PRIV(o);
        EngineTexture *t = ENGINE_TEXTURE(o);
 
 
 static int deserialize(UObject *o, struct upkg_file *f)
 {
        struct texture_priv *priv = TEXTURE_GET_PRIV(o);
        EngineTexture *t = ENGINE_TEXTURE(o);
 
-       UOBJECT_CLASS(engine_texture_parent_class)->deserialize(o, f);
+       U_OBJECT_CLASS(engine_texture_parent_class)->deserialize(o, f);
 
        printf("Texture size: %ux%u\n", t->usize, t->vsize);
 
 
        printf("Texture size: %ux%u\n", t->usize, t->vsize);
 
@@ -109,7 +109,7 @@ static void engine_texture_init(EngineTexture *t)
 
 static void engine_texture_class_init(EngineTextureClass *class)
 {
 
 static void engine_texture_class_init(EngineTextureClass *class)
 {
-       UObjectClass *uo = UOBJECT_CLASS(class);
+       UObjectClass *uo = U_OBJECT_CLASS(class);
        GObjectClass *go = G_OBJECT_CLASS(class);
 
        g_type_class_add_private(class, sizeof (struct texture_priv));
        GObjectClass *go = G_OBJECT_CLASS(class);
 
        g_type_class_add_private(class, sizeof (struct texture_priv));
index 5553014b3d86cc1222c6c064439edba41028bdeb..8bda8506324711dfc949eca218a5cc059a8d3ab1 100644 (file)
@@ -21,7 +21,7 @@
 #include <glib-object.h>
 #include <uobject/exportable.h>
 
 #include <glib-object.h>
 #include <uobject/exportable.h>
 
-GType uobject_exportable_get_type(void)
+GType u_object_exportable_get_type(void)
 {
        static GType type = 0;
        if (type == 0) {
 {
        static GType type = 0;
        if (type == 0) {
@@ -37,14 +37,14 @@ GType uobject_exportable_get_type(void)
        return type;
 }
 
        return type;
 }
 
-int uobject_export(GObject *obj, FILE *f)
+int u_object_export(GObject *obj, FILE *f)
 {
 {
-       g_return_val_if_fail(UOBJECT_IS_EXPORTABLE(obj), -1);
-       return UOBJECT_EXPORTABLE_GET_INTERFACE(obj)->export(obj, f);
+       g_return_val_if_fail(U_OBJECT_IS_EXPORTABLE(obj), -1);
+       return U_OBJECT_EXPORTABLE_GET_INTERFACE(obj)->export(obj, f);
 }
 
 }
 
-int uobject_export_name(GObject *obj, char *buf, size_t n)
+int u_object_export_name(GObject *obj, char *buf, size_t n)
 {
 {
-       g_return_val_if_fail(UOBJECT_IS_EXPORTABLE(obj), -1);
-       return UOBJECT_EXPORTABLE_GET_INTERFACE(obj)->export_name(obj, buf, n);
+       g_return_val_if_fail(U_OBJECT_IS_EXPORTABLE(obj), -1);
+       return U_OBJECT_EXPORTABLE_GET_INTERFACE(obj)->export_name(obj, buf, n);
 }
 }
index a7c18201ba0d297fdaf2fd71013bf2a54591ad29..c4970ec65178219570e1c620ae24e8a3244ef18a 100644 (file)
@@ -21,7 +21,7 @@
 #include <glib-object.h>
 #include <uobject/loadable.h>
 
 #include <glib-object.h>
 #include <uobject/loadable.h>
 
-GType uobject_loadable_get_type(void)
+GType u_object_loadable_get_type(void)
 {
        static GType type = 0;
        if (type == 0) {
 {
        static GType type = 0;
        if (type == 0) {
@@ -37,14 +37,14 @@ GType uobject_loadable_get_type(void)
        return type;
 }
 
        return type;
 }
 
-int uobject_load(GObject *obj)
+int u_object_load(GObject *obj)
 {
 {
-       g_return_val_if_fail(UOBJECT_IS_LOADABLE(obj), -1);
-       return UOBJECT_LOADABLE_GET_INTERFACE(obj)->load(obj);
+       g_return_val_if_fail(U_OBJECT_IS_LOADABLE(obj), -1);
+       return U_OBJECT_LOADABLE_GET_INTERFACE(obj)->load(obj);
 }
 
 }
 
-void uobject_unload(GObject *obj)
+void u_object_unload(GObject *obj)
 {
 {
-       g_return_if_fail(UOBJECT_IS_LOADABLE(obj));
-       UOBJECT_LOADABLE_GET_INTERFACE(obj)->unload(obj);
+       g_return_if_fail(U_OBJECT_IS_LOADABLE(obj));
+       U_OBJECT_LOADABLE_GET_INTERFACE(obj)->unload(obj);
 }
 }
index ffc06e292ad300aaeb0a841d8428ccd8eee7c761..2eeffc07e30857944e5efe81d08ebbe6b947d10f 100644 (file)
@@ -50,7 +50,7 @@ static int modcmp(const void *a, const void *b, void *_data)
        return strcmp(ma->name, mb->name);
 }
 
        return strcmp(ma->name, mb->name);
 }
 
-int uobject_module_init(void)
+int u_object_module_init(void)
 {
        if (!initialized) {
                package_tree = avl_create(modcmp, NULL, NULL);
 {
        if (!initialized) {
                package_tree = avl_create(modcmp, NULL, NULL);
@@ -66,7 +66,7 @@ int uobject_module_init(void)
        return 0;
 }
 
        return 0;
 }
 
-int uobject_module_exit(void)
+int u_object_module_exit(void)
 {
        if (--initialized)
                return 0;
 {
        if (--initialized)
                return 0;
@@ -76,7 +76,7 @@ int uobject_module_exit(void)
        return 0;
 }
 
        return 0;
 }
 
-GType uobject_module_get_class(const char *package, const char *class)
+GType u_object_module_get_class(const char *package, const char *class)
 {
        char buf[strlen(package) + strlen(class) + 1];
        GTypeModule search = { .name = str_cpy_lower(buf, package) };
 {
        char buf[strlen(package) + strlen(class) + 1];
        GTypeModule search = { .name = str_cpy_lower(buf, package) };
index e271a678bb83f2f3b44ab568f4d6a041805f50d2..ec04e3036f029a485a3bb5d97e5e06e6094860ec 100644 (file)
@@ -27,8 +27,8 @@
 #include "upkg.h"
 #include "pack.h"
 
 #include "upkg.h"
 #include "pack.h"
 
-#define UOBJECT_GET_PRIV(o) \
-       G_TYPE_INSTANCE_GET_PRIVATE(o, UOBJECT_TYPE, struct uobject_priv)
+#define U_OBJECT_GET_PRIV(o) \
+       G_TYPE_INSTANCE_GET_PRIVATE(o, U_OBJECT_TYPE, struct u_object_priv)
 
 enum {
        PROPERTY_BYTE = 1,
 
 enum {
        PROPERTY_BYTE = 1,
@@ -48,12 +48,7 @@ enum {
        PROPERTY_FIXEDARRAY,
 };
 
        PROPERTY_FIXEDARRAY,
 };
 
-struct uobject_property {
-       const char *name;
-       GValue val;
-};
-
-struct uobject_priv {
+struct u_object_priv {
        struct upkg_file *f;
        size_t base, len;
 
        struct upkg_file *f;
        size_t base, len;
 
@@ -61,7 +56,7 @@ struct uobject_priv {
        unsigned long nbuf;
 };
 
        unsigned long nbuf;
 };
 
-G_DEFINE_TYPE(UObject, uobject, G_TYPE_OBJECT);
+G_DEFINE_TYPE(UObject, u_object, G_TYPE_OBJECT);
 
 static unsigned long
 get_real_size(unsigned long *real, unsigned size, unsigned char *buf, size_t n)
 
 static unsigned long
 get_real_size(unsigned long *real, unsigned size, unsigned char *buf, size_t n)
@@ -95,7 +90,7 @@ get_real_size(unsigned long *real, unsigned size, unsigned char *buf, size_t n)
 static unsigned long
 decode_property(UObject *o, const char *name, struct upkg_file *f, unsigned long len)
 {
 static unsigned long
 decode_property(UObject *o, const char *name, struct upkg_file *f, unsigned long len)
 {
-       struct uobject_priv *priv = UOBJECT_GET_PRIV(o);
+       struct u_object_priv *priv = U_OBJECT_GET_PRIV(o);
        unsigned long real_size, rc;
        int type, size, top;
        GValue val = {0};
        unsigned long real_size, rc;
        int type, size, top;
        GValue val = {0};
@@ -149,7 +144,7 @@ decode_property(UObject *o, const char *name, struct upkg_file *f, unsigned long
 /* Deserialize properties from an Unreal package. */
 static int deserialize(UObject *o, struct upkg_file *f)
 {
 /* Deserialize properties from an Unreal package. */
 static int deserialize(UObject *o, struct upkg_file *f)
 {
-       struct uobject_priv *priv = UOBJECT_GET_PRIV(o);
+       struct u_object_priv *priv = U_OBJECT_GET_PRIV(o);
        unsigned long rc, tot_len = 0;
 
        while (1) {
        unsigned long rc, tot_len = 0;
 
        while (1) {
@@ -181,7 +176,7 @@ static int deserialize(UObject *o, struct upkg_file *f)
                        break;
                }
 
                        break;
                }
 
-               rc = decode_property(UOBJECT(o), name, f, len);
+               rc = decode_property(U_OBJECT(o), name, f, len);
                if (rc == 0)
                        return -1;
                len = rc;
                if (rc == 0)
                        return -1;
                len = rc;
@@ -196,10 +191,10 @@ static int deserialize(UObject *o, struct upkg_file *f)
        return 0;
 }
 
        return 0;
 }
 
-int uobject_deserialize(GObject *obj, struct upkg *pkg, unsigned long idx)
+int u_object_deserialize(GObject *obj, struct upkg *pkg, unsigned long idx)
 {
 {
-       g_return_val_if_fail(IS_UOBJECT(obj), -1);
-       UObject *uo = UOBJECT(obj);
+       g_return_val_if_fail(IS_U_OBJECT(obj), -1);
+       UObject *uo = U_OBJECT(obj);
        struct upkg_file *f;
        int rc;
 
        struct upkg_file *f;
        int rc;
 
@@ -209,7 +204,7 @@ int uobject_deserialize(GObject *obj, struct upkg *pkg, unsigned long idx)
                return -1;
        }
 
                return -1;
        }
 
-       rc = UOBJECT_GET_CLASS(obj)->deserialize(uo, f);
+       rc = U_OBJECT_GET_CLASS(obj)->deserialize(uo, f);
        if (rc != 0) {
                upkg_export_close(f);
        } else {
        if (rc != 0) {
                upkg_export_close(f);
        } else {
@@ -221,29 +216,29 @@ int uobject_deserialize(GObject *obj, struct upkg *pkg, unsigned long idx)
        return rc;
 }
 
        return rc;
 }
 
-static void uobject_init(UObject *o)
+static void u_object_init(UObject *o)
 {
        o->pkg      = NULL;
        o->pkg_file = NULL;
        o->pkg_idx  = 0;
 }
 
 {
        o->pkg      = NULL;
        o->pkg_file = NULL;
        o->pkg_idx  = 0;
 }
 
-static void uobject_finalize(GObject *o)
+static void u_object_finalize(GObject *o)
 {
 {
-       UObject *uo = UOBJECT(o);
+       UObject *uo = U_OBJECT(o);
 
        if (uo->pkg_file) {
                upkg_export_close(uo->pkg_file);
        }
 
 
        if (uo->pkg_file) {
                upkg_export_close(uo->pkg_file);
        }
 
-       G_OBJECT_CLASS(uobject_parent_class)->finalize(o);
+       G_OBJECT_CLASS(u_object_parent_class)->finalize(o);
 }
 
 }
 
-static void uobject_class_init(UObjectClass *class)
+static void u_object_class_init(UObjectClass *class)
 {
 {
-       g_type_class_add_private(class, sizeof (struct uobject_priv));
+       g_type_class_add_private(class, sizeof (struct u_object_priv));
        GObjectClass *go = G_OBJECT_CLASS(class);
 
        class->deserialize = deserialize;
        GObjectClass *go = G_OBJECT_CLASS(class);
 
        class->deserialize = deserialize;
-       go->finalize       = uobject_finalize;
+       go->finalize       = u_object_finalize;
 }
 }
index 6aa58b37a4b222ad71478c2355a1b71b384ab16d..e241f1ec63c2b43c44f60c34bd3ca46a580ed2ce 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#ifndef UOBJECT_EXPORTABLE_H_
-#define UOBJECT_EXPORTABLE_H_
+#ifndef U_OBJECT_EXPORTABLE_H_
+#define U_OBJECT_EXPORTABLE_H_
 
 #include <stdio.h>
 #include <glib-object.h>
 
 
 #include <stdio.h>
 #include <glib-object.h>
 
-#define UOBJECT_TYPE_EXPORTABLE (uobject_exportable_get_type())
-#define UOBJECT_EXPORTABLE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, \
-       UOBJECT_TYPE_EXPORTABLE, UObjectExportable)
-#define UOBJECT_IS_EXPORTABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, \
-       UOBJECT_TYPE_EXPORTABLE)
-#define UOBJECT_EXPORTABLE_GET_INTERFACE(inst) G_TYPE_INSTANCE_GET_INTERFACE \
-       (inst, UOBJECT_TYPE_EXPORTABLE, UObjectExportable)
+#define U_OBJECT_TYPE_EXPORTABLE (u_object_exportable_get_type())
+#define U_OBJECT_EXPORTABLE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, \
+       U_OBJECT_TYPE_EXPORTABLE, UObjectExportable)
+#define U_OBJECT_IS_EXPORTABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, \
+       U_OBJECT_TYPE_EXPORTABLE)
+#define U_OBJECT_EXPORTABLE_GET_INTERFACE(inst) G_TYPE_INSTANCE_GET_INTERFACE \
+       (inst, U_OBJECT_TYPE_EXPORTABLE, UObjectExportable)
 
 typedef struct UObjectExportable UObjectExportable;
 
 
 typedef struct UObjectExportable UObjectExportable;
 
@@ -44,13 +44,13 @@ struct UObjectExportable {
        int (*export_name)(GObject *obj, char *buf, size_t n);
 };
 
        int (*export_name)(GObject *obj, char *buf, size_t n);
 };
 
-GType uobject_exportable_get_type(void);
+GType u_object_exportable_get_type(void);
 
 /*
  * Export the object by writing it to the given FILE handle, which must have
  * been opened for writing in binary mode.
  */
 
 /*
  * Export the object by writing it to the given FILE handle, which must have
  * been opened for writing in binary mode.
  */
-int uobject_export(GObject *obj, FILE *f);
+int u_object_export(GObject *obj, FILE *f);
 
 /*
  * Get the suggested output filename.  Not more than n-1 characters of the
 
 /*
  * Get the suggested output filename.  Not more than n-1 characters of the
@@ -59,6 +59,6 @@ int uobject_export(GObject *obj, FILE *f);
  * not bounded.  It is valid to call this function with a NULL buffer and a 0
  * size in order to determine how large the buffer needs to be.
  */
  * not bounded.  It is valid to call this function with a NULL buffer and a 0
  * size in order to determine how large the buffer needs to be.
  */
-int uobject_export_name(GObject *obj, char *buf, size_t n);
+int u_object_export_name(GObject *obj, char *buf, size_t n);
 
 #endif
 
 #endif
index ff5fd6342da46fda7656516df3833253d39797b4..8d458841adf860636ca07b3472b9992654187447 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#ifndef UOBJECT_LOADABLE_H_
-#define UOBJECT_LOADABLE_H_
+#ifndef U_OBJECT_LOADABLE_H_
+#define U_OBJECT_LOADABLE_H_
 
 #include <stdio.h>
 #include <glib-object.h>
 
 
 #include <stdio.h>
 #include <glib-object.h>
 
-#define UOBJECT_TYPE_LOADABLE (uobject_loadable_get_type())
-#define UOBJECT_LOADABLE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, \
-       UOBJECT_TYPE_LOADABLE, UObjectLoadable)
-#define UOBJECT_IS_LOADABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, \
-       UOBJECT_TYPE_LOADABLE)
-#define UOBJECT_LOADABLE_GET_INTERFACE(inst) G_TYPE_INSTANCE_GET_INTERFACE \
-       (inst, UOBJECT_TYPE_LOADABLE, UObjectLoadable)
+#define U_OBJECT_TYPE_LOADABLE (u_object_loadable_get_type())
+#define U_OBJECT_LOADABLE(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, \
+       U_OBJECT_TYPE_LOADABLE, UObjectLoadable)
+#define U_OBJECT_IS_LOADABLE(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, \
+       U_OBJECT_TYPE_LOADABLE)
+#define U_OBJECT_LOADABLE_GET_INTERFACE(inst) G_TYPE_INSTANCE_GET_INTERFACE \
+       (inst, U_OBJECT_TYPE_LOADABLE, UObjectLoadable)
 
 typedef struct UObjectLoadable UObjectLoadable;
 
 
 typedef struct UObjectLoadable UObjectLoadable;
 
@@ -46,9 +46,9 @@ struct UObjectLoadable {
        void (*unload)(GObject *obj);
 };
 
        void (*unload)(GObject *obj);
 };
 
-GType uobject_loadable_get_type(void);
+GType u_object_loadable_get_type(void);
 
 
-int uobject_load(GObject *obj);
-void uobject_unload(GObject *obj);
+int u_object_load(GObject *obj);
+void u_object_unload(GObject *obj);
 
 #endif
 
 #endif
index 2f5a211b867dc49a9e037dc5bf82f7db703543b8..97d9e2b57879d3acb11c93f10b2a4209ae78a2db 100644 (file)
@@ -17,8 +17,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#ifndef UOBJECT_MODULE_H_
-#define UOBJECT_MODULE_H_
+#ifndef U_OBJECT_MODULE_H_
+#define U_OBJECT_MODULE_H_
 
 #include <glib-object.h>
 
 
 #include <glib-object.h>
 
  * Initialize the UObject module system.  Returns 0 on success, -1 otherwise.
  * The module system can be safely initialized multiple times.
  */
  * Initialize the UObject module system.  Returns 0 on success, -1 otherwise.
  * The module system can be safely initialized multiple times.
  */
-int uobject_module_init(void);
+int u_object_module_init(void);
 
 /*
  * Shutdown the UObject module system.  Returns 0 on success, -1 otherwise.
  * The module system is only shut down when this function has been called as
 
 /*
  * Shutdown the UObject module system.  Returns 0 on success, -1 otherwise.
  * The module system is only shut down when this function has been called as
- * many times as uobject_module_init.
+ * many times as u_object_module_init.
  */
  */
-int uobject_module_exit(void);
+int u_object_module_exit(void);
 
 /*
  * Get a class handle from the UObject module system.  This will load the
 
 /*
  * Get a class handle from the UObject module system.  This will load the
@@ -42,6 +42,6 @@ int uobject_module_exit(void);
  *
  * Returns 0 on failure.
  */
  *
  * Returns 0 on failure.
  */
-GType uobject_module_get_class(const char *package, const char *class);
+GType u_object_module_get_class(const char *package, const char *class);
 
 #endif
 
 #endif
index 6241aee9aac0cd1c11cf9a0a2f8f1f5451630459..f5d20d5472dfff309947b8c96d7251568799290f 100644 (file)
@@ -17,8 +17,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#ifndef UOBJECT_PACKAGE_H_
-#define UOBJECT_PACKAGE_H_
+#ifndef U_OBJECT_PACKAGE_H_
+#define U_OBJECT_PACKAGE_H_
 
 #include <glib-object.h>
 
 
 #include <glib-object.h>
 
index dfca528d10dff03095cc549fa32adc965a0564ef..98ec792494430f13d6def221a68d1faafcd7932a 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#ifndef UOBJECT_UOBJECT_H_
-#define UOBJECT_UOBJECT_H_
+#ifndef U_OBJECT_H_
+#define U_OBJECT_H_
 
 #include <glib-object.h>
 #include "upkg.h"
 
 
 #include <glib-object.h>
 #include "upkg.h"
 
-#define UOBJECT_TYPE uobject_get_type()
-#define UOBJECT(obj) \
-       G_TYPE_CHECK_INSTANCE_CAST(obj, UOBJECT_TYPE, UObject)
-#define UOBJECT_CLASS(class) \
-       G_TYPE_CHECK_CLASS_CAST(class, UOBJECT_TYPE, UObjectClass)
-#define IS_UOBJECT(obj) \
-       G_TYPE_CHECK_INSTANCE_TYPE(obj, UOBJECT_TYPE)
-#define IS_UOBJECT_CLASS(class) \
-       G_TYPE_CHECK_CLASS_TYPE(class, UOBJECT_TYPE, UObjectClass)
-#define UOBJECT_GET_CLASS(obj) \
-       G_TYPE_INSTANCE_GET_CLASS(obj, UOBJECT_TYPE, UObjectClass)
+#define U_OBJECT_TYPE u_object_get_type()
+#define U_OBJECT(obj) \
+       G_TYPE_CHECK_INSTANCE_CAST(obj, U_OBJECT_TYPE, UObject)
+#define U_OBJECT_CLASS(class) \
+       G_TYPE_CHECK_CLASS_CAST(class, U_OBJECT_TYPE, UObjectClass)
+#define IS_U_OBJECT(obj) \
+       G_TYPE_CHECK_INSTANCE_TYPE(obj, U_OBJECT_TYPE)
+#define IS_U_OBJECT_CLASS(class) \
+       G_TYPE_CHECK_CLASS_TYPE(class, U_OBJECT_TYPE, UObjectClass)
+#define U_OBJECT_GET_CLASS(obj) \
+       G_TYPE_INSTANCE_GET_CLASS(obj, U_OBJECT_TYPE, UObjectClass)
 
 typedef struct UObject      UObject;
 typedef struct UObjectClass UObjectClass;
 
 typedef struct UObject      UObject;
 typedef struct UObjectClass UObjectClass;
@@ -52,8 +52,8 @@ struct UObjectClass {
        int (*deserialize)(UObject *obj, struct upkg_file *f);
 };
 
        int (*deserialize)(UObject *obj, struct upkg_file *f);
 };
 
-GType uobject_get_type(void);
+GType u_object_get_type(void);
 
 
-int uobject_deserialize(GObject *obj, struct upkg *pkg, unsigned long idx);
+int u_object_deserialize(GObject *obj, struct upkg *pkg, unsigned long idx);
 
 #endif
 
 #endif
index e1a8a805f8bfbb83a37f112a66b102df04567030..a8c7c7e560ca02bb61bd66d3e36e352d4bcd2b80 100644 (file)
@@ -157,15 +157,15 @@ static int export(struct upkg *pkg, GObject *obj, unsigned idx)
        char name[256];
        FILE *of;
 
        char name[256];
        FILE *of;
 
-       if (uobject_deserialize(obj, pkg, idx) != 0) {
+       if (u_object_deserialize(obj, pkg, idx) != 0) {
                return -1;
        }
 
                return -1;
        }
 
-       if (UOBJECT_IS_LOADABLE(obj) && uobject_load(obj) != 0) {
+       if (U_OBJECT_IS_LOADABLE(obj) && u_object_load(obj) != 0) {
                return -1;
        }
 
                return -1;
        }
 
-       uobject_export_name(obj, name, sizeof name);
+       u_object_export_name(obj, name, sizeof name);
 
        printf("exporting %s to %s\n", upkg_export_name(pkg, idx), name);
        of = fopen(name, "wb");
 
        printf("exporting %s to %s\n", upkg_export_name(pkg, idx), name);
        of = fopen(name, "wb");
@@ -174,15 +174,15 @@ static int export(struct upkg *pkg, GObject *obj, unsigned idx)
                return -1;
        }
 
                return -1;
        }
 
-       uobject_export(obj, of);
+       u_object_export(obj, of);
 
        if (fclose(of) != 0) {
                perror(name);
                return -1;
        }
 
 
        if (fclose(of) != 0) {
                perror(name);
                return -1;
        }
 
-       if (UOBJECT_IS_LOADABLE(obj)) {
-               uobject_unload(obj);
+       if (U_OBJECT_IS_LOADABLE(obj)) {
+               u_object_unload(obj);
        }
 
        return 0;
        }
 
        return 0;
@@ -202,11 +202,11 @@ int package_export(struct upkg *pkg)
                        return EXIT_FAILURE;
                }
 
                        return EXIT_FAILURE;
                }
 
-               type = uobject_module_get_class(package, class);
+               type = u_object_module_get_class(package, class);
                if (!type) continue;
 
                obj = g_object_new(type, NULL);
                if (!type) continue;
 
                obj = g_object_new(type, NULL);
-               if (UOBJECT_IS_EXPORTABLE(obj)) {
+               if (U_OBJECT_IS_EXPORTABLE(obj)) {
                        if (export(pkg, obj, i) != 0) {
                                rc = EXIT_FAILURE;
                        }
                        if (export(pkg, obj, i) != 0) {
                                rc = EXIT_FAILURE;
                        }
@@ -253,7 +253,7 @@ int main(int argc, char **argv)
                return EXIT_FAILURE;
        }
 
                return EXIT_FAILURE;
        }
 
-       if (uobject_module_init() != 0)
+       if (u_object_module_init() != 0)
                return EXIT_FAILURE;
 
        pkg = upkg_fopen(argv[optind]);
                return EXIT_FAILURE;
 
        pkg = upkg_fopen(argv[optind]);
@@ -272,6 +272,6 @@ int main(int argc, char **argv)
        }
 
        upkg_close(pkg);
        }
 
        upkg_close(pkg);
-       uobject_module_exit();
+       u_object_module_exit();
        return rc;
 }
        return rc;
 }