[seed] [libseed] Added seed_value_is_string() and seed_value_is_number()



commit 1c2eb6bd0f55aa47594387fad35791da96b1f287
Author: Matt ARSENAULT <arsenm2 rpi edu>
Date:   Fri Jul 3 00:25:00 2009 -0400

    [libseed] Added seed_value_is_string() and seed_value_is_number()

 libseed/seed-api.c |   28 ++++++++++++++++++++++++++++
 libseed/seed.h     |    2 ++
 2 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/libseed/seed-api.c b/libseed/seed-api.c
index bc080a6..e302fff 100644
--- a/libseed/seed-api.c
+++ b/libseed/seed-api.c
@@ -521,6 +521,34 @@ seed_value_is_function (JSContextRef ctx, JSObjectRef value)
 }
 
 /**
+ * seed_value_is_string:
+ * @ctx: A #SeedContext.
+ * @value: A #SeedValue.
+ *
+ * Return value: #true if @value is a string, and #false otherwise.
+ *
+ */
+gboolean
+seed_value_is_string (JSContextRef ctx, JSValueRef value)
+{
+  return JSValueIsString (ctx, value);
+}
+
+/**
+ * seed_value_is_number:
+ * @ctx: A #SeedContext.
+ * @value: A #SeedValue.
+ *
+ * Return value: #true if @value is a number), #false otherwise.
+ *
+ */
+gboolean
+seed_value_is_number (JSContextRef ctx, JSValueRef value)
+{
+  return JSValueIsNumber (ctx, value);
+}
+
+/**
  * seed_engine_set_search_path:
  * @eng: A #SeedEngine, on which to set the path.
  * @path: A #const gchar*, a colon separated string containing the path to set
diff --git a/libseed/seed.h b/libseed/seed.h
index 80ac694..42ff873 100644
--- a/libseed/seed.h
+++ b/libseed/seed.h
@@ -130,6 +130,8 @@ gboolean seed_value_is_null (SeedContext ctx, SeedValue value);
 gboolean seed_value_is_undefined (SeedContext ctx, SeedValue value);
 gboolean seed_value_is_object (SeedContext ctx, SeedValue value);
 gboolean seed_value_is_function (SeedContext ctx, SeedObject value);
+gboolean seed_value_is_string (SeedContext ctx, SeedValue value);
+gboolean seed_value_is_number (SeedContext ctx, SeedValue value);
 
 SeedValue seed_object_call (SeedContext ctx,
 			    SeedObject object,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]