Difference between revisions of "Peerd.c"
m |
m |
||
| Line 22: | Line 22: | ||
// Store the command-line args in the listSpace hash, eg char *name = *hash("name") | // Store the command-line args in the listSpace hash, eg char *name = *hash("name") | ||
printf("argc=%d\n",argc); | printf("argc=%d\n",argc); | ||
| − | + | while (argc-->2) { | |
char **arg = split('=',argv[argc]); | char **arg = split('=',argv[argc]); | ||
| − | *hash(arg[0]) = arg[1]; printf("\t*hash(\"%s\")=\"%s\"\n",arg[0],arg[1]); | + | //*hash(arg[0]) = arg[1]; |
| + | printf("\t*hash(\"%s\")=\"%s\"\n",arg[0],arg[1]); | ||
free(arg); | free(arg); | ||
| − | } | + | } |
printf("postargs\n"); | printf("postargs\n"); | ||
#include "nodeSpace.c" // NodeSpace function declarations and initialisation | #include "nodeSpace.c" // NodeSpace function declarations and initialisation | ||
| Line 32: | Line 33: | ||
#include "interface.c" // Layer model (currently bitmap/imagemap-based) | #include "interface.c" // Layer model (currently bitmap/imagemap-based) | ||
#include "nodalHusk.c" // Build initial nodal environment | #include "nodalHusk.c" // Build initial nodal environment | ||
| − | + | #include "server.c" // Set up listening socket and declare serverIterate | |
printf("port=%s\n",*hash("port")); | printf("port=%s\n",*hash("port")); | ||
Revision as of 23:35, 21 July 2006
// This article and all its includes are licenced under LGPL // GPL: http://www.gnu.org/copyleft/lesser.html // SRC: http://www.organicdesign.co.nz/husk.c
- include <unistd.h>
- include <stdlib.h>
- include <stdio.h>
- include <string.h>
int main(int argc, char **argv) {
#include "util.c" // General utils, file,log,string etc
#ifdef WINDOWS // Set up as a daemon or service #include "servicate.c" #else #include "daemonise.c" #endif
#include "listSpace.c" // listSpace and some C-specific extras: hash, trie, linked-list
// Store the command-line args in the listSpace hash, eg char *name = *hash("name") printf("argc=%d\n",argc); while (argc-->2) { char **arg = split('=',argv[argc]); //*hash(arg[0]) = arg[1]; printf("\t*hash(\"%s\")=\"%s\"\n",arg[0],arg[1]); free(arg); } printf("postargs\n"); #include "nodeSpace.c" // NodeSpace function declarations and initialisation #include "serialise.c" // Nodal-to-text and visa-versa #include "interface.c" // Layer model (currently bitmap/imagemap-based) #include "nodalHusk.c" // Build initial nodal environment #include "server.c" // Set up listening socket and declare serverIterate
printf("port=%s\n",*hash("port")); printf("fredie=%s\n",*hash("fred")); logAdd("\nEntering nodal reduction...\n"); while(nodeReduce(this=ROOT));
free(space);
}



