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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

284 APPENDIX B. PROGRAM LISTINGS<br />

int parseUpstream(xmlDocPtr doc, xmlNodePtr node, Vector* bore,<br />

double* flange);<br />

/*<br />

Creates a TerminalSection <strong>of</strong> BoreSegments from data in the xml<br />

document.<br />

Parameters:<br />

doc: the parsed xmlDocPtr <strong>of</strong> the XML document.<br />

node: the current node.<br />

bore: to be initialised with data in doc.<br />

flange: the impedance condition at the end <strong>of</strong> the pipe.<br />

Returns:<br />

1 if all parameters are valid.<br />

0 otherwise.<br />

*/<br />

int parseDownstream(xmlDocPtr doc, xmlNodePtr node, Vector* bore,<br />

Vector* cells, double* flange);<br />

/*<br />

Creates a Vector <strong>of</strong> BoreSegments <strong>and</strong> a Vector <strong>of</strong> UnitCells<br />

from data in the xml document.<br />

Parameters:<br />

doc: the parsed xmlDocPtr <strong>of</strong> the XML document.<br />

node: the current node.<br />

bore: to be initialised with data in doc.<br />

cells: to be initialised with data in doc.<br />

flange: the impedance condition at the end <strong>of</strong> the pipe.<br />

Returns:<br />

1 if all parameters are valid.<br />

0 otherwise.<br />

*/<br />

int parseBore(xmlDocPtr doc, xmlNodePtr node, BoreSegment* s);<br />

/*<br />

Creates a BoreSegment struct from data in the xml document.<br />

Parameters:<br />

doc: the parsed xmlDocPtr <strong>of</strong> the XML document.<br />

node: the current node.<br />

s: to be initialised with data in doc.<br />

Returns:<br />

1 if all parameters are valid.<br />

0 otherwise.<br />

*/<br />

xmlNodePtr getAndAssertDocRoot(xmlDocPtr doc);<br />

/*<br />

Retrieves the root node <strong>of</strong> the XML document,<br />

asserting that it is a element.<br />

Parameters:<br />

doc: the parsed xmlDocPtr <strong>of</strong> the XML document.<br />

Returns:<br />

An xmlNodePtr, pointing at the root node.<br />

NULL if root element is not found.<br />

*/<br />

int isXMLElement(xmlNodePtr node, const char* expectedname);<br />

/*<br />

Determines whether the supplied element node is the same type<br />

as the expected element name.

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

Saved successfully!

Ooh no, something went wrong!