Difference between revisions of "Peerd.c"
(Store the command-line args in the listSpace hash) |
|||
| Line 12: | Line 12: | ||
#include "util.c" // General utils, file,log,string etc | #include "util.c" // General utils, file,log,string etc | ||
| − | #ifdef WINDOWS | + | #include "listSpace.c" // ListSpace function declarations and initialisation |
| − | #include "servicate.c" | + | |
| + | // Store the command-line args in the listSpace hash | ||
| + | for (i=0; i<argc; i++) { | ||
| + | char **arg = split('=',argv[i]); | ||
| + | *hash(arg[0]) = arg[1]; | ||
| + | free(arg); | ||
| + | } | ||
| + | |||
| + | #ifdef WINDOWS // Set up as a daemon or service | ||
| + | #include "servicate.c" | ||
#else | #else | ||
| − | #include "daemonise.c" | + | #include "daemonise.c" |
#endif | #endif | ||
| − | + | ||
#include "nodeSpace.c" // NodeSpace function declarations and initialisation | #include "nodeSpace.c" // NodeSpace function declarations and initialisation | ||
#include "serialise.c" // Nodal-to-text and visa-versa | #include "serialise.c" // Nodal-to-text and visa-versa | ||
#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 "server.c" // Set up listening socket and declare serverIterate | #include "server.c" // Set up listening socket and declare serverIterate | ||
| − | |||
while(nodeReduce(ROOT)); | while(nodeReduce(ROOT)); | ||
| − | |||
free(space); | free(space); | ||
} | } | ||
Revision as of 10:34, 15 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
- include <types.h>
- 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 #include "listSpace.c" // ListSpace function declarations and initialisation
// Store the command-line args in the listSpace hash for (i=0; i<argc; i++) { char **arg = split('=',argv[i]); *hash(arg[0]) = arg[1]; free(arg); }
#ifdef WINDOWS // Set up as a daemon or service #include "servicate.c" #else #include "daemonise.c" #endif
#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
while(nodeReduce(ROOT));
free(space);
}



