Permalink
Browse files

- updated example and documentation

  • Loading branch information...
1 parent f6d0058 commit f4e5cf3ffa27b9246b594e5c436382cc89f94ab4 @penduin penduin committed Aug 18, 2012
Showing with 13 additions and 3 deletions.
  1. +2 −2 documentation/wjelement.html
  2. +11 −1 example/example.c
@@ -27,7 +27,7 @@
properties) comes in handy.
</p>
<p>
-From wjelemeht.h:
+From wjelement.h:
<blockquote><pre>
typedef struct WJElementPublic {
char *name;
@@ -69,7 +69,7 @@
functions.
</p>
<p>
-From wjelemeht.h:
+From wjelement.h:
<blockquote><pre>
typedef enum {
WJE_GET = 0,
View
@@ -29,12 +29,20 @@ var doc = {
]
};
var person = null;
+
+for(i in doc.crew) {
+ person = doc.crew[i];
+ if(person.born == 2468) {
+ person.born = 2486;
+ }
+}
+
for(i in doc.crew) {
person = doc.crew[i];
console.log(person.name +" ("+ person.job +") is "+ (2517 - person.born));
}
-console.log(JSON.stringify(doc));
+console.log(JSON.stringify(doc));
*/
@@ -65,6 +73,8 @@ int main(int argc, char **argv) {
WJEString(doc, "crew[-1].job", WJE_SET, "public relations");
WJEInt64(doc, "crew[-1].born", WJE_SET, 2485);
+ WJEInt64(doc, "crew[].born == 2468", WJE_SET, 2486); /* note: awesome! */
+
while((person = _WJEObject(doc, "crew[]", WJE_GET, &person))) {
printf("%s (%s) is %d\n",
WJEString(person, "name", WJE_GET, ""),

0 comments on commit f4e5cf3

Please sign in to comment.