#include
directives, followed by declarations, followed by the main program. A literate presentation is
So let's go ahead and define our #include
s, shall we?
#include <stdio.h> #include <malloc.h> #include <stdarg.h> #include <string.h> #include "xmlparse.h" #include "localdefs.h" void output (char type, const char *format, ...); |
localdefs.h
file contains whatever local definitions a particular wftk
installation needs: particularly the locations of the process definition repository and the
datasheet repository (remember that in this version both of these are simply directories in
the local filesystem, but that later we'll have much more flexible options for both locations.)
Next we define all our data structures and helper functions. XML and expat are rather core
to this. Under the rubric of "XML" we'll define our central XML data structures and the
functions we'll use to work with them. The use of the expat parser to parse XML text into
these structures will be in a separate section because it's not trivial.
See In-memory XML data structures and functionality See xml_read: Using expat to parse XML files into memory |
See The command stack and how to load it See Our oh-so-complex output stream |
See Global variables: state |
See Interpreting the process definition See Interpreting command streams |
int main(int argc, char * argv[]) { See Initializing global variables from the command line interpret (command_stack); xml_free (datasheet); xml_free (procdef); return 0; } |
printf ("usage: wftk <command> <arguments>\n"); printf (" Commands:\n"); printf (" start <process id> <procdef>\n"); printf (" activate <process id> <locator> <task id>\n"); printf (" complete <process id> <task id>\n"); printf (" reject <process id> <task id>\n"); printf (" setvalue <process id> <name> <type> <file> or value on stdin\n"); printf (" settaskvalue <process id> <task id> <name> <type> <file> or value on stdin\n"); printf (" script <process id> <file> or command list on stdin\n"); |
This code and documentation are released under the terms of the GNU license. They are additionally copyright (c) 2000, Vivtek. All rights reserved except those explicitly granted under the terms of the GNU license. |