]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] Remove print object function which was unused
authorCharlie Brej <cbrej@cs.man.ac.uk>
Sun, 12 Jul 2009 18:04:53 +0000 (19:04 +0100)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Sun, 12 Jul 2009 18:04:53 +0000 (19:04 +0100)
It was useful when the language was being constructed to make sure reference
counts were sane but only worked in text mode.

src/plugins/splash/script/script-object.c
src/plugins/splash/script/script-object.h

index 7c12c1eb9eff61521574d70876813279916000cd..22d84e2b94c1d188d185c8107ca063378da40039 100644 (file)
@@ -36,7 +36,6 @@
 #include "script.h"
 #include "script-object.h"
 
-char *script_obj_print (script_obj_t *obj);
 void script_obj_reset (script_obj_t *obj);
 
 void script_obj_free (script_obj_t *obj)
@@ -143,87 +142,6 @@ void script_obj_deref (script_obj_t **obj_ptr)
   *obj_ptr = obj;
 }
 
-static void foreach_print_vareable (void *key,
-                                    void *data,
-                                    void *user_data)
-{
-  script_vareable_t *vareable = data;
-  char *string = script_obj_print (vareable->object);
-  char *reply;
-  char *prev = *(char **) user_data;
-
-  if (!prev) prev = strdup ("");
-  asprintf (&reply, "%s%s = %s\n", prev, vareable->name, string);
-  free (string);
-  free (prev);
-  *(char **) user_data = reply;
-}
-
-char *script_obj_print (script_obj_t *obj)
-{
-  char *reply;
-
-  switch (obj->type)
-    {
-      case SCRIPT_OBJ_TYPE_REF:
-        {
-          char *subobj = script_obj_print (obj->data.obj);
-          asprintf (&reply, "->[%d]%s", obj->refcount, subobj);
-          free (subobj);
-          return reply;
-        }
-
-      case SCRIPT_OBJ_TYPE_INT:
-        {
-          asprintf (&reply, "%d[%d]", obj->data.integer, obj->refcount);
-          return reply;
-        }
-
-      case SCRIPT_OBJ_TYPE_FLOAT:
-        {
-          asprintf (&reply, "%f[%d]", obj->data.floatpoint, obj->refcount);
-          return reply;
-        }
-
-      case SCRIPT_OBJ_TYPE_STRING:
-        {
-          asprintf (&reply, "\"%s\"[%d]", obj->data.string, obj->refcount);
-          return reply;
-        }
-
-      case SCRIPT_OBJ_TYPE_NULL:
-        {
-          asprintf (&reply, "NULL[%d]", obj->refcount);
-          return reply;
-        }
-
-      case SCRIPT_OBJ_TYPE_HASH:
-        {
-          char *sub = NULL;
-          ply_hashtable_foreach (obj->data.hash, foreach_print_vareable, &sub);
-          asprintf (&reply, "HASH{\n%s}[%d]", sub, obj->refcount);
-          free (sub);
-          return reply;
-        }
-
-      case SCRIPT_OBJ_TYPE_FUNCTION:
-        {
-          asprintf (&reply, "function()[%d]", obj->refcount);
-          return reply;
-        }
-
-      case SCRIPT_OBJ_TYPE_NATIVE:
-        {
-          asprintf (&reply,
-                    "(%s)[%d]",
-                    obj->data.native.class->name,
-                    obj->refcount);
-          return reply;
-        }
-    }
-  return NULL;
-}
-
 script_obj_t *script_obj_new_null (void)
 {
   script_obj_t *obj = malloc (sizeof (script_obj_t));
index 355d9f7fb1cffa8c44991c2a0f4eb0608a8aaebb..4740cccf52b8124bee7395375d8fd956f1455fb9 100644 (file)
@@ -39,7 +39,6 @@ void script_obj_unref (script_obj_t *obj);
 void script_obj_reset (script_obj_t *obj);
 script_obj_t *script_obj_deref_direct (script_obj_t *obj);
 void script_obj_deref (script_obj_t **obj_ptr);
-char *script_obj_print (script_obj_t *obj);
 script_obj_t *script_obj_new_int (int number);
 script_obj_t *script_obj_new_float (float number);
 script_obj_t *script_obj_new_string (const char *string);