seed r335 - trunk/libseed



Author: racarr
Date: Tue Nov 25 00:56:38 2008
New Revision: 335
URL: http://svn.gnome.org/viewvc/seed?rev=335&view=rev

Log:
Some API cleanup.


Modified:
   trunk/libseed/seed-api.c
   trunk/libseed/seed-engine.c
   trunk/libseed/seed.h

Modified: trunk/libseed/seed-api.c
==============================================================================
--- trunk/libseed/seed-api.c	(original)
+++ trunk/libseed/seed-api.c	Tue Nov 25 00:56:38 2008
@@ -4,3 +4,39 @@
 {
 	return JSObjectMake(eng->context, class, private);
 }
+
+SeedScript *seed_make_script(const gchar * js, const gchar * source_url,
+							 gint line_number)
+{
+	SeedScript *ret = g_new0(SeedScript, 1);
+
+	ret->script = JSStringCreateWithUTF8CString(js);
+
+	if (source_url)
+	{
+		ret->source_url = JSStringCreateWithUTF8CString(source_url);
+	}
+	ret->line_number = line_number;
+
+	JSCheckScriptSyntax(eng->context, ret->script,
+						ret->source_url, ret->line_number, &ret->exception);
+
+	return ret;
+}
+
+JSValueRef seed_evaluate(SeedScript * js, JSObjectRef this)
+{
+	JSValueRef ret;
+
+	js->exception = 0;
+	ret = JSEvaluateScript(eng->context,
+						   js->script, this, js->source_url,
+						   js->line_number, &js->exception);
+
+	return ret;
+}
+
+JSValueRef seed_script_exception(SeedScript * s)
+{
+	return s->exception;
+}

Modified: trunk/libseed/seed-engine.c
==============================================================================
--- trunk/libseed/seed-engine.c	(original)
+++ trunk/libseed/seed-engine.c	Tue Nov 25 00:56:38 2008
@@ -1320,38 +1320,3 @@
 	return TRUE;
 }
 
-SeedScript *seed_make_script(const gchar * js, const gchar * source_url,
-							 gint line_number)
-{
-	SeedScript *ret = g_new0(SeedScript, 1);
-
-	ret->script = JSStringCreateWithUTF8CString(js);
-
-	if (source_url)
-	{
-		ret->source_url = JSStringCreateWithUTF8CString(source_url);
-	}
-	ret->line_number = line_number;
-
-	JSCheckScriptSyntax(eng->context, ret->script,
-						ret->source_url, ret->line_number, &ret->exception);
-
-	return ret;
-}
-
-JSValueRef seed_evaluate(SeedScript * js, JSObjectRef this)
-{
-	JSValueRef ret;
-
-	js->exception = 0;
-	ret = JSEvaluateScript(eng->context,
-						   js->script, this, js->source_url,
-						   js->line_number, &js->exception);
-
-	return ret;
-}
-
-JSValueRef seed_script_exception(SeedScript * s)
-{
-	return s->exception;
-}

Modified: trunk/libseed/seed.h
==============================================================================
--- trunk/libseed/seed.h	(original)
+++ trunk/libseed/seed.h	Tue Nov 25 00:56:38 2008
@@ -32,15 +32,21 @@
 typedef gpointer SeedException;
 typedef gpointer SeedFunction;
 
-typedef gpointer SeedContextRef;
+typedef gpointer SeedContext;
 
 typedef struct _SeedScript SeedScript;
 
 typedef struct _SeedEngine {
-	SeedContextRef context;
+	SeedContext context;
 	SeedValue global;
 } SeedEngine;
 
+typedef enum {
+	SEED_CLASS_ATTRIBUTE_NONE = 0,
+	SEED_CLASS_ATTRIBUTE_NO_SHARED_PROTOTYPE = 1 << 1
+} SeedClassAttributes;
+
+
 /*
  * seed-engine.c 
  */
@@ -112,7 +118,7 @@
 GObject *seed_value_to_object(SeedValue val, SeedException * exception);
 SeedValue seed_value_from_object(GObject * val, SeedException * exception);
 
-typedef void (*SeedFunctionCallback) (SeedContextRef ctx,
+typedef void (*SeedFunctionCallback) (SeedContext ctx,
 									  SeedObject function,
 									  SeedObject this_object,
 									  size_t argument_count,



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