src/knitml.c File Reference

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "xml.h"
#include <libxml/xmlschemas.h>
#include "base.h"

Defines

#define PAT_OUTPUTF(f,...)   fprintf(patfile, f, ##__VA_ARGS__)
#define PAT_OUTPUT(str)   fprintf(patfile, "%s ", str)
#define PAT_COMMENT(str,...)   fprintf(patfile, "# " str "\n", ##__VA_ARGS__);
#define PAT_NEWLINE()   fprintf(patfile, "\n");

Functions

void kmlParseRepeatInstruction (xmlNode *node)
void kmlParseInstruction (xmlNode *node)
void kmlParseRepeat (xmlNode *node)
void kmlParseInfo (xmlNode *node)
int kmlParseGrpInstructions (xmlNode *node)
void printStitch (char *stitch, xmlNode *node)
int kmlParseGrpKnittingOperations (xmlNode *node)
void kmlParseRow (xmlNode *node)
void kmlParseInstructionGroup (xmlNode *node)
void kmlParseDirections (xmlNode *node)
void kmlParseRoot (xmlNode *node)
int kmlValidate (const char *infile)
void kmlTranslate (const char *infile, const char *outfile)
 Translate a KnitML pattern to a Knitter pattern.

Variables

xmlDocPtr doc
FILE * patfile

Define Documentation

#define PAT_COMMENT ( str,
...   )     fprintf(patfile, "# " str "\n", ##__VA_ARGS__);

 
#define PAT_NEWLINE (  )     fprintf(patfile, "\n");

#define PAT_OUTPUT ( str   )     fprintf(patfile, "%s ", str)

#define PAT_OUTPUTF ( f,
...   )     fprintf(patfile, f, ##__VA_ARGS__)


Function Documentation

void kmlParseDirections ( xmlNode *  node  ) 

int kmlParseGrpInstructions ( xmlNode *  node  ) 

int kmlParseGrpKnittingOperations ( xmlNode *  node  ) 

void kmlParseInfo ( xmlNode *  node  ) 

void kmlParseInstruction ( xmlNode *  node  ) 

void kmlParseInstructionGroup ( xmlNode *  node  ) 

void kmlParseRepeat ( xmlNode *  node  ) 

void kmlParseRepeatInstruction ( xmlNode *  node  ) 

void kmlParseRoot ( xmlNode *  node  ) 

void kmlParseRow ( xmlNode *  node  ) 

void kmlTranslate ( const char *  infile,
const char *  outfile 
)

Translate a KnitML pattern to a Knitter pattern.

Parameters:
infile an input KnitML files
outfile the file to create from the XML
Parse and validate the resource and free the resulting tree.

int kmlValidate ( const char *  infile  ) 

void printStitch ( char *  stitch,
xmlNode *  node 
)


Variable Documentation

xmlDocPtr doc

section: Parsing synopsis: Parse and validate an XML file to a tree and free the result purpose: Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree. usage: parse2 test2.xml test: parse2 test2.xml author: Daniel Veillard copy: see Copyright for the status of this software.

FILE* patfile


Generated on Sun Mar 30 14:59:45 2008 for Knitter by  doxygen 1.5.3