[seed] [docs] Use to make empty lines not disappear. Hackk..
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] [docs] Use to make empty lines not disappear. Hackk..
- Date: Wed, 8 Jul 2009 20:20:11 +0000 (UTC)
commit 11df7daf19cf4eaf064fdd1cbee83e8f24228eec
Author: Tim Horton <hortont424 gmail com>
Date: Wed Jul 8 16:19:41 2009 -0400
[docs] Use to make empty lines not disappear. Hackk..
doc/reference/tmpl/seed-main.sgml | 8 ++++----
doc/reference/tmpl/seed-modules.sgml | 25 ++++++++++++-------------
2 files changed, 16 insertions(+), 17 deletions(-)
---
diff --git a/doc/reference/tmpl/seed-main.sgml b/doc/reference/tmpl/seed-main.sgml
index f8e76e2..88484c1 100644
--- a/doc/reference/tmpl/seed-main.sgml
+++ b/doc/reference/tmpl/seed-main.sgml
@@ -16,16 +16,16 @@ int main (int argc, char **argv)
{
SeedEngine * eng;
SeedScript * script;
-
+
/* Initialize the Seed engine */
eng = seed_init(&argc, &argv);
-
+
/* Create a simple #SeedScript */
script = seed_make_script(eng->context, "print('Hello, world!')", NULL, 0);
-
+
/* Evaluate the #SeedScript in the default context */
seed_evaluate(eng->context, script, 0);
-
+
g_free(script);
return 0;
}
diff --git a/doc/reference/tmpl/seed-modules.sgml b/doc/reference/tmpl/seed-modules.sgml
index 28886d2..4f446dc 100644
--- a/doc/reference/tmpl/seed-modules.sgml
+++ b/doc/reference/tmpl/seed-modules.sgml
@@ -21,7 +21,7 @@ SeedObject seed_module_init(SeedEngine * eng)
{
/* Say hello! */
g_print("Hello, Seed Module World!\n");
-
+
/* Return an empty object as the module's namespace */
return seed_make_object (eng->context, NULL, NULL);
}
@@ -45,42 +45,41 @@ SeedValue say_hello_to(SeedContext ctx,
SeedException *exception)
{
guchar * name;
-
+
/* Check that only one argument was passed into the function.
CHECK_ARG_COUNT() is from seed-module.h, which you might find useful. */
CHECK_ARG_COUNT("hello.say_hello_to", 1);
-
+
/* Convert the first argument, a #SeedValue, to a C string */
name = seed_value_to_string(ctx, arguments[0], exception);
-
+
g_print("Hello, %s!\n", name);
-
+
g_free(name);
-
+
return seed_make_null(ctx);
}
-
-
+
/* Define an array of #seed_static_function */
seed_static_function gettext_funcs[] = {
{"say_hello_to", say_hello_to, 0}
};
-
+
SeedObject seed_module_init(SeedEngine * eng)
{
SeedGlobalContext ctx = eng->context;
-
+
/* Create a new class definition with our array of static functions */
seed_class_definition ns_class_def = seed_empty_class;
ns_class_def.static_functions = example_funcs;
-
+
/* Create a class from the class definition we just created */
SeedClass ns_class = seed_create_class(&ns_class_def);
-
+
/* Instantiate the class; this instance will be the namespace we return */
ns_ref = seed_make_object (ctx, ns_class, NULL);
seed_value_protect (ctx, ns_ref);
-
+
return ns_ref;
}
</programlisting>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]