Difference between revisions of "Peerd.c"

From Organic Design wiki
m
(add nodal reduction loop)
Line 21: Line 21:
 
#include "nodalHusk.c"  // Actual nodal content and predeclared's
 
#include "nodalHusk.c"  // Actual nodal content and predeclared's
 
#include "interface.c"  // Layer model (currently bitmap/imagemap-based)
 
#include "interface.c"  // Layer model (currently bitmap/imagemap-based)
#include "server.c"    // Server must be last because it never returns
+
#include "server.c"    // Set up listening socket and declare serverIterate
  
int test = deserialise( "testing deserialise:\n\r== can do headings for wiki ==\n*[[7491|Foo]]\n*[[2401|bar]]:[[1928|hello]] # my special association\r\r\n*[[2401|baz]]:[[1328|world]]\n*[[2421|key]]:[[1628]]\n*[[5061|key2]]:[[8928|]]\n*[[2821|key3]]:[[3928|value]]");
+
// Main nodal reduction loop
printf("\n%d list-space items have been created.\n", items);
+
while(nodeReduce(ROOT));
 
 
// Count how many nodes have payloads
 
int i,j,p=0;
 
for (i=0; i<MAXITEMS; i++) if (listGetValue(i)) p++;
 
printf("%d items in use:\n", p);
 
for (i=0; i<MAXITEMS; i++) if (j=listGetValue(i)) printf("    %d = %d\n",i,j);
 
printf("\n\n");
 
  
 
}
 
}

Revision as of 12:16, 5 July 2006

// This article and all its includes are licenced under LGPL // http://www.gnu.org/copyleft/lesser.html

  1. include <types.h>
  2. include <unistd.h>
  3. include <stdlib.h>
  4. include <stdio.h>
  5. include <string.h>

int main(int argc, char *argv[]) {

#include "file.c" // Logging and file read/write #ifdef WINDOWS #include "servicate.c" // Make into a service for Win32 #else #include "daemonise.c" // Make into a daemon for Linux and OSX #endif #include "listSpace.c" // ListSpace function declarations and initialisation #include "nodeSpace.c" // NodeSpace function declarations and initialisation #include "serialise.c" // Nodal-to-text and visa-versa #include "nodalHusk.c" // Actual nodal content and predeclared's #include "interface.c" // Layer model (currently bitmap/imagemap-based) #include "server.c" // Set up listening socket and declare serverIterate

// Main nodal reduction loop while(nodeReduce(ROOT));

}