11.07.2014 Views

Flute acoustics: measurement, modelling and design - School of ...

Flute acoustics: measurement, modelling and design - School of ...

Flute acoustics: measurement, modelling and design - School of ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

282 APPENDIX B. PROGRAM LISTINGS<br />

Listing B.20: ParseXML.h<br />

/*<br />

ParseXML.c<br />

By Paul Dickens, 2006<br />

Based on ParseXML.c by Andrew Botros, 2003<br />

ParseXML.c reads a woodwind definition file for Impedance.c<br />

to use in its calculation.<br />

*/<br />

#ifndef PARSEXML_H_PROTECTOR<br />

#define PARSEXML_H_PROTECTOR<br />

#include <br />

#include "Vector.h"<br />

#include "Woodwind.h"<br />

/* Elements <strong>and</strong> attributes <strong>of</strong> the woodwind schema */<br />

#define WOODWIND "woodwind"<br />

#define DESCRIPTION "description"<br />

#define EMBOUCHUREHOLE "embouchurehole"<br />

#define UPSTREAM "upstream"<br />

#define DOWNSTREAM "downstream"<br />

#define BORE "bore"<br />

#define HOLE "hole"<br />

#define RADIUS "radius"<br />

#define RADIUSIN "radiusin"<br />

#define RADIUSOUT "radiusout"<br />

#define RADIUS1 "radius1"<br />

#define RADIUS2 "radius2"<br />

#define BORERADIUS "boreradius"<br />

#define LENGTH "length"<br />

#define FLANGE "flange"<br />

#define KEY "key"<br />

#define HOLERADIUS "holeradius"<br />

#define HEIGHT "height"<br />

#define THICKNESS "thickness"<br />

#define WALLTHICKNESS "wallthickness"<br />

#define CHIMNEYHEIGHT "chimneyheight"<br />

int parseXMLFile(char* xml_filename, Woodwind* w);<br />

/*<br />

Creates a Woodwind struct after parsing the given XML definition<br />

file.<br />

Parameters:<br />

xml_filename: filename <strong>of</strong> the XML file.<br />

w: to be initialised with data given in XML file.<br />

Returns<br />

1 if the parse was successful.<br />

0 otherwise.<br />

*/<br />

int parseAndValidateFile(char* xml_filename, xmlDocPtr* doc);<br />

/*

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!