object web, etc master
authorDuncan Cragg <fjord@cilux.org>
Mon, 11 Jan 2010 21:14:50 +0000 (21:14 +0000)
committerDuncan Cragg <fjord@cilux.org>
Mon, 11 Jan 2010 21:14:50 +0000 (21:14 +0000)
doc/intro.txt [new file with mode: 0644]
src/drivers/ot/test/teston.c
src/include/notification.h
src/on/notification.c
www/index.html

diff --git a/doc/intro.txt b/doc/intro.txt
new file mode 100644 (file)
index 0000000..cf267ca
--- /dev/null
@@ -0,0 +1,5 @@
+Cilux
+
+Cilux is a U-Web Exchange or peer. It is the reference implementation of the U-Web's Object Standards.
+
+
index 387becd..deb9ff5 100644 (file)
@@ -83,37 +83,37 @@ void cast_event(n_object* o, n_object* c)
  */
 void start_tests(void)
 {
  */
 void start_tests(void)
 {
-    k_log_out("Creating o11111 ------------------");
+    k_log_out("Creating o1 ------------------");
     char* o11111s = "UID: 11111-4141a\n"
                     "\n"
                     "Cost: £111\n";
     n_object* o11111 = n_object_new(o11111s);
     test_state(o11111, o11111s, "11111-4141a", "£111");
     char* o11111s = "UID: 11111-4141a\n"
                     "\n"
                     "Cost: £111\n";
     n_object* o11111 = n_object_new(o11111s);
     test_state(o11111, o11111s, "11111-4141a", "£111");
-    k_log_out("Committing o11111");
+    k_log_out("Committing o1");
     n_commit(o11111);
 
     n_commit(o11111);
 
-    k_log_out("Creating o22222 ------------------");
+    k_log_out("Creating o2 ------------------");
     char* o22222s = "UID: 22222-ef990\n"
     char* o22222s = "UID: 22222-ef990\n"
-                    "Permit: - UID: 11111-4141a\n"
-                    "          quiet\n"
+                    "Open: - UID: 11111-4141a\n"
+                    "        quiet\n"
                     "\n"
                     "Cost: £222\n";
     n_object* o22222 = n_object_new(o22222s);
     test_state(o22222, o22222s, "22222-ef990", "£222");
 
                     "\n"
                     "Cost: £222\n";
     n_object* o22222 = n_object_new(o22222s);
     test_state(o22222, o22222s, "22222-ef990", "£222");
 
-    k_log_out("o11111 views o22222 ------------------");
+    k_log_out("o1 views o2 ------------------");
     n_object* o2 = n_view(o11111, "22222-ef990");  /* creates Cast:/shell o2 and sends View event to o2 */
     k_assert(!o2, "Object 2 has not been committed yet, but Object 1 can view it:\n%s\n", n_to_string(o2));
     n_commit(o11111); /* ?? commit View (i.e. header change set) */
 
     n_commit(o22222); /* merges with shell and sends Cast event to o1 */
 
     n_object* o2 = n_view(o11111, "22222-ef990");  /* creates Cast:/shell o2 and sends View event to o2 */
     k_assert(!o2, "Object 2 has not been committed yet, but Object 1 can view it:\n%s\n", n_to_string(o2));
     n_commit(o11111); /* ?? commit View (i.e. header change set) */
 
     n_commit(o22222); /* merges with shell and sends Cast event to o1 */
 
-    k_log_out("o11111 views o22222 ------------------");
+    k_log_out("o1 views o2 ------------------");
     o2 = n_view(o11111, "22222-ef990"); /* quiet, so no View event to o2, satisfiable now so no Cast event to o1 */
     k_assert(o2!=0, "Object 2 has been committed, but can't be viewed by Object 1");
     test_state(o2, o22222s, "22222-ef990", "£222");
 
     o2 = n_view(o11111, "22222-ef990"); /* quiet, so no View event to o2, satisfiable now so no Cast event to o1 */
     k_assert(o2!=0, "Object 2 has been committed, but can't be viewed by Object 1");
     test_state(o2, o22222s, "22222-ef990", "£222");
 
-    k_log_out("o22222 views o33333 ------------------");
+    k_log_out("o2 views o3 ------------------");
     n_object* o3 = n_view(o22222, "33333-18bbc"); /* creats Cast:/shell o3 and sends View event to o3 */
     k_assert(!o3, "Object 3 has not been created yet, but Object 2 can view it:\n%s", n_to_string(o3));
     n_commit(o22222); /* ?? commit View (i.e. header change set) */
     n_object* o3 = n_view(o22222, "33333-18bbc"); /* creats Cast:/shell o3 and sends View event to o3 */
     k_assert(!o3, "Object 3 has not been created yet, but Object 2 can view it:\n%s", n_to_string(o3));
     n_commit(o22222); /* ?? commit View (i.e. header change set) */
@@ -127,60 +127,96 @@ void view_event_1(n_object* o, n_object* v)
 
 void cast_event_1(n_object* o, n_object* c)
 {
 
 void cast_event_1(n_object* o, n_object* c)
 {
-    k_log_out("o11111 is cast o22222 ------------------");
+    k_log_out("o1 is cast o2 ------------------");
     test_state(c, 0, "22222-ef990", "£222");
     test_state(c, 0, "22222-ef990", "£222");
-    k_assert(!strcmp(n_header(o, "View:1:UID"),   "22222-ef990"), "o1 <-Cast- o2: o1 first View UID not o2" );
-    k_assert(!strcmp(n_header(c, "Cast:1:UID"),   "11111-4141a"), "o1 <-Cast- o2: o2 first Cast UID not o1" );
-    k_assert(!strcmp(n_header(c, "Permit:1:UID"), "11111-4141a"), "o1 <-Cast- o2: o2 first Permit UID not o1" );
+    k_assert(!strcmp(n_header(o, "View:1:UID"), "22222-ef990"), "o1 <-Cast- o2: o1 first View UID not o2" );
+    k_assert(!strcmp(n_header(c, "Cast:1:UID"), "11111-4141a"), "o1 <-Cast- o2: o2 first Cast UID not o1" );
+    k_assert(!strcmp(n_header(c, "Open:1:UID"), "11111-4141a"), "o1 <-Cast- o2: o2 first Open UID not o1" );
 }
 
 /* -------------------------------------------------------------------------- */
 
 void view_event_2(n_object* o, n_object* v)
 {
 }
 
 /* -------------------------------------------------------------------------- */
 
 void view_event_2(n_object* o, n_object* v)
 {
-    k_log_out("o22222 gets view from o11111 ------------------");
-    test_state(v, 0, "11111-4141a", "£111");
-    k_assert(!strcmp(n_header(v, "View:1:UID"),   "22222-ef990"), "o1 -View-> o2: o1 first View UID not o2" );
-    k_assert(!strcmp(n_header(o, "Cast:1:UID"),   "11111-4141a"), "o1 -View-> o2: o2 first Cast UID not o1" );
-    k_assert(!strcmp(n_header(o, "Permit:1:UID"), "11111-4141a"), "o1 -View-> o2: o2 first Permit UID not o1" );
+    if(n_uid_is(v, "11111-4141a")){
+        k_log_out("o2 gets view from o1 ------------------");
+        test_state(v, 0, "11111-4141a", "£111");
+        k_assert(!strcmp(n_header(v, "View:1:UID"), "22222-ef990"), "o1 -View-> o2: o1 first View UID not o2" );
+        k_assert(!strcmp(n_header(o, "Cast:1:UID"), "11111-4141a"), "o1 -View-> o2: o2 first Cast UID not o1" );
+        k_assert(!strcmp(n_header(o, "Open:1:UID"), "11111-4141a"), "o1 -View-> o2: o2 first Open UID not o1" );
+    }
+    else
+    if(n_uid_is(v, "11111-4141a")){
+        k_log_out("o2 gets view from o3 ------------------");
+        test_state(v, 0, "33333-18bbc", "£333");
+        k_assert(!strcmp(n_header(v, "View:1:UID"), "22222-ef990"), "o3 -View-> o2: o3 first View UID not o2" );
+        k_assert(!strcmp(n_header(o, "Cast:2:UID"), "33333-18bbc"), "o3 -View-> o2: o2 second Cast UID not o3" );
+        k_assert(       !n_header(o, "Open:2:UID"),                 "o3 -View-> o2: o2 has an Open" );
+
+        k_log_out("o2 opens to o3 ------------------");
+        n_open(o, "33333-18bbc", "quiet");
+        k_log_out("Committing o2");
+        n_commit(o);
+        k_assert(!strcmp(n_header(o, "Open:2:UID"), "33333-18bbc"), "o2 second Open UID not o3" );
+        k_assert(!strcmp(n_header(o, "Open:2:quiet"), ""),          "o2 second Open not quiet" );
+    }
+    else{
+        k_assert(0, "o2 got view but not from o1 or o3");
+    }
 }
 
 void cast_event_2(n_object* o, n_object* c)
 {
 }
 
 void cast_event_2(n_object* o, n_object* c)
 {
-    k_log_out("o22222 is cast o33333 ------------------");
+    k_log_out("o2 is cast o3 ------------------");
     test_state(c, 0, "33333-18bbc", "£333");
     test_state(c, 0, "33333-18bbc", "£333");
-    k_assert(!strcmp(n_header(o, "View:1:UID"),   "33333-18bbc"), "o2 <-Cast- o3: o2 first View UID not o3" );
-    k_assert(!strcmp(n_header(c, "Cast:1:UID"),   "22222-ef990"), "o2 <-Cast- o3: o3 first Cast UID not o2" );
-    k_assert(!strcmp(n_header(c, "Permit:1:UID"), "22222-ef990"), "o2 <-Cast- o3: o3 first Permit UID not o2" );
+    k_assert(!strcmp(n_header(o, "View:1:UID"), "33333-18bbc"), "o2 <-Cast- o3: o2 first View UID not o3" );
+    k_assert(!strcmp(n_header(c, "Cast:1:UID"), "22222-ef990"), "o2 <-Cast- o3: o3 first Cast UID not o2" );
+    k_assert(!strcmp(n_header(c, "Open:1:UID"), "22222-ef990"), "o2 <-Cast- o3: o3 first Open UID not o2" );
 }
 
 /* -------------------------------------------------------------------------- */
 
 void view_event_3(n_object* o, n_object* v)
 {
 }
 
 /* -------------------------------------------------------------------------- */
 
 void view_event_3(n_object* o, n_object* v)
 {
-    k_log_out("o33333 gets view from o22222 ------------------");
+    k_log_out("o3 gets view from o2 ------------------");
     test_state(v, 0, "22222-ef990", "£222");
     test_state(v, 0, "22222-ef990", "£222");
-    k_assert(!strcmp(n_header(v, "View:1:UID"),   "33333-18bbc"), "o2 -View-> o3: o2 first View UID not o3" );
-    k_assert(!strcmp(n_header(o, "Cast:1:UID"),   "22222-ef990"), "o2 -View-> o3: o3 first Cast UID not o2" );
-    k_assert(       !n_header(o, "Permit:1:UID"),                 "o2 -View-> o3: o3 has a Permit" );
+    k_assert(!strcmp(n_header(v, "View:1:UID"), "33333-18bbc"), "o2 -View-> o3: o2 first View UID not o3" );
+    k_assert(!strcmp(n_header(o, "Cast:1:UID"), "22222-ef990"), "o2 -View-> o3: o3 first Cast UID not o2" );
+    k_assert(       !n_header(o, "Open:1:UID"),                 "o2 -View-> o3: o3 has an Open" );
 
 
-    k_log_out("Creating o33333 ------------------");
+    k_log_out("Creating o3 ------------------");
     char* o33333s = "UID: 33333-18bbc\n"
     char* o33333s = "UID: 33333-18bbc\n"
-                    "Permit: - UID: 22222-ef990\n"
-                    "          quiet\n"
+                    "Open: - UID: 22222-ef990\n"
+                    "        quiet\n"
                     "\n"
                     "Cost: £333\n";
     n_object* o33333 = n_object_new(o33333s);
     test_state(o33333, o33333s, "33333-18bbc", "£333");
                     "\n"
                     "Cost: £333\n";
     n_object* o33333 = n_object_new(o33333s);
     test_state(o33333, o33333s, "33333-18bbc", "£333");
-    k_assert(!strcmp(n_header(o33333, "Permit:1:UID"), "22222-ef990"), "o3 first Permit not o2" );
-    k_assert(!strcmp(n_header(o33333, "Permit:1:quiet"), ""),          "o3 first Permit not quiet" );
+    k_assert(!strcmp(n_header(o33333, "Open:1:UID"), "22222-ef990"), "o3 first Open not o2" );
+    k_assert(!strcmp(n_header(o33333, "Open:1:quiet"), ""),          "o3 first Open not quiet" );
 
 
-    k_log_out("Committing o33333");
+    k_log_out("Committing o3");
     n_commit(o33333);
     n_commit(o33333);
+
+    k_assert(!strcmp(n_header(o, "Cast:1:UID"), "22222-ef990"), "o3 first Cast UID not o2" );
+    k_assert(!strcmp(n_header(o, "Open:1:UID"), "22222-ef990"), "o3 first Open not o2" );
+    k_assert(!strcmp(n_header(o, "Open:1:quiet"), ""),          "o3 first Open not quiet" );
+
+    k_log_out("o3 views o2 ------------------");
+    n_object* o2 = n_view(o, "22222-ef990");
+    k_assert(!o2, "o2 is not Open to o3, but o3 can view it:\n%s\n", n_to_string(o2));
+
+    k_log_out("Committing o3");
+    n_commit(o);
 }
 
 void cast_event_3(n_object* o, n_object* c)
 {
 }
 
 void cast_event_3(n_object* o, n_object* c)
 {
+    k_log_out("o3 is cast o2 ------------------");
+    test_state(c, 0, "22222-ef990", "£222");
+    k_assert(!strcmp(n_header(o, "View:1:UID"), "22222-ef990"), "o3 <-Cast- o2: o3 first View UID not o2" );
+    k_assert(!strcmp(n_header(c, "Cast:2:UID"), "33333-18bbc"), "o3 <-Cast- o2: o2 second Cast UID not o3" );
+    k_assert(!strcmp(n_header(c, "Open:2:UID"), "33333-18bbc"), "o3 <-Cast- o2: o2 second Open UID not o3" );
 }
 
 /* -------------------------------------------------------------------------- */
 }
 
 /* -------------------------------------------------------------------------- */
index 14a3030..750ad6a 100644 (file)
@@ -28,6 +28,7 @@ PUBLIC void n_register_driver(char*            name,
 PUBLIC n_object*    n_object_new(char* s);
 PUBLIC void         n_commit(n_object* o);
 PUBLIC n_object*    n_view(n_object* o, char* uid);
 PUBLIC n_object*    n_object_new(char* s);
 PUBLIC void         n_commit(n_object* o);
 PUBLIC n_object*    n_view(n_object* o, char* uid);
+PUBLIC void         n_open(n_object* o, char* uid, char* options);
 PUBLIC char*        n_to_string(n_object* o);
 PUBLIC char*        n_uid(n_object* o);
 PUBLIC int          n_uid_is(n_object* o, char* uid);
 PUBLIC char*        n_to_string(n_object* o);
 PUBLIC char*        n_uid(n_object* o);
 PUBLIC int          n_uid_is(n_object* o, char* uid);
index 3833a08..61d25f3 100644 (file)
@@ -30,6 +30,10 @@ EXPORT n_object* n_view(n_object* o, char* uid)
     return 0;
 }
 
     return 0;
 }
 
+EXPORT void n_open(n_object* o, char* uid, char* options)
+{
+}
+
 EXPORT char* n_to_string(n_object* o)
 {
     return 0;
 EXPORT char* n_to_string(n_object* o)
 {
     return 0;
index ef7af28..4ef6798 100644 (file)
@@ -3,25 +3,28 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-  <meta name=description content="The Cilux U-Web Exchange">
-  <meta name=keywords    content="Cilux U-Web Maemo">
+  <meta name=description content="The Cilux Object Web Exchange">
+  <meta name=keywords    content="Cilux ObjectWeb">
   <meta name=author      content="Duncan Cragg">
   <link rel="icon"          href="favicon.ico" type="image/x-icon">
   <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
   <link rel="stylesheet"    href="site.css"    type="text/css" />
   <meta name=author      content="Duncan Cragg">
   <link rel="icon"          href="favicon.ico" type="image/x-icon">
   <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
   <link rel="stylesheet"    href="site.css"    type="text/css" />
-  <title>The Cilux U-Web Exchange</title>
+  <title>The Cilux Object Web Exchange</title>
 </head>
 <body>
 <p>
 <hr />
 </p>
 </head>
 <body>
 <p>
 <hr />
 </p>
-<h2>The Cilux U-Web Exchange</h2>
+<h2>The Cilux Object Web Exchange</h2>
 <p>
 <p>
-Cilux is a <a href="http://the-u-web.org/">U-Web</a> "Exchange": a peer for, and the
-reference implementation of, the U-Web.
+Cilux is a <a href="http://object-web.org/">Object Web</a> "Exchange": a peer for, and the
+reference implementation of, the Object Web.
 </p><p>
 Cilux is Open Source and written in C. It is intended to be run both client-side and
 </p><p>
 Cilux is Open Source and written in C. It is intended to be run both client-side and
-server-side on Linux-based PCs and Ultra-Mobile PCs, as well as MIDs such as Maemo.
+server-side on Linux-based PCs and Ultra-Mobile PCs, including the OpenPandora console,
+as well as Mobile Internet Devices (MIDs) such as Nokia's upcoming Maemo 5 device. The
+typical MID specification and APIs aimed for are: at least 320x320 touch screen with
+OpenGL ES 2.0; GPS, Wifi and 3G; front- and back-facing cameras.
 </p><p>
 See the <a href="https://garage.maemo.org/projects/cilux/">Cilux Maemo site</a>.
 </p><p>
 </p><p>
 See the <a href="https://garage.maemo.org/projects/cilux/">Cilux Maemo site</a>.
 </p><p>