mash/beerxml.c

Sun, 31 Aug 2014 17:51:04 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 31 Aug 2014 17:51:04 +0200
changeset 272
f436d826de4b
parent 103
99c47a8a61cb
permissions
-rw-r--r--

Added Heater and Cooler delay edit fields. Added more checks on entered data in the units edit screen.

103
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /*****************************************************************************
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * Copyright (C) 2014
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Michiel Broek <mbroek at mbse dot eu>
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * This file is part of the mbsePi-apps
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 *
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * This is free software; you can redistribute it and/or modify it
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * under the terms of the GNU General Public License as published by the
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 * Free Software Foundation; either version 2, or (at your option) any
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * later version.
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 *
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * mbsePi-apps is distributed in the hope that it will be useful, but
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * General Public License for more details.
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 *
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * along with EC-65K; see the file COPYING. If not, write to the Free
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 *****************************************************************************/
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23 #include "mash.h"
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
24 #include "beerxml.h"
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
25
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
26
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27 recipe_rec *recipes = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 int parseStyle(xmlDocPtr, xmlNodePtr, style_rec **);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 int parseEquipment(xmlDocPtr, xmlNodePtr, equipment_rec **);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 int parseMashStep(xmlDocPtr, xmlNodePtr, mash_step **);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33 int parseMashSteps(xmlDocPtr, xmlNodePtr, mash_step **);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34 int parseMash(xmlDocPtr, xmlNodePtr, mash_profile **);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 int parseFermentable(xmlDocPtr, xmlNodePtr, fermentable_rec **);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36 int parseFermentables(xmlDocPtr, xmlNodePtr, fermentable_rec **);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42 * Parse style
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44 int parseStyle(xmlDocPtr doc, xmlNodePtr cur, style_rec **style)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 xmlChar *key;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47 style_rec *item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 float val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 item = (style_rec *)malloc(sizeof(style_rec));
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 item->name = item->category = item->category_number = item->style_letter = item-> style_guide =
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 item->type = item->notes = item->profile = item->ingredients = item->examples = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 item->og_min = item->og_max = item->fg_min = item->fg_max = item->ibu_min = item->ibu_max =
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 item->color_min = item->color_max = item->carb_min = item->carb_max =
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 item->abv_min = item->abv_max = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VERSION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 if (xmlStrcmp(key, (const xmlChar *)"1")) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 item->version = 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 item->name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CATEGORY"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 item->category = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CATEGORY_NUMBER"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 item->category_number = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 if ((!xmlStrcmp(cur->name, (const xmlChar *)"STYLE_LETTER"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 item->style_letter = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 if ((!xmlStrcmp(cur->name, (const xmlChar *)"STYLE_GUIDE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 item->style_guide = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TYPE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 item->type = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 if ((!xmlStrcmp(cur->name, (const xmlChar *)"OG_MIN"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 item->og_min = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 if ((!xmlStrcmp(cur->name, (const xmlChar *)"OG_MAX"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 item->og_max = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
98 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FG_MIN"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
99 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
101 item->fg_min = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FG_MAX"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
105 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 item->fg_max = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
108 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
109 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
110 if ((!xmlStrcmp(cur->name, (const xmlChar *)"IBU_MIN"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
111 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
113 item->ibu_min = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 if ((!xmlStrcmp(cur->name, (const xmlChar *)"IBU_MAX"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 item->ibu_max = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COLOR_MIN"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
123 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
124 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 item->color_min = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COLOR_MAX"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 item->color_max = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
134 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CARB_MIN"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 item->carb_min = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CARB_MAX"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
141 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
142 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
143 item->carb_max = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
144 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ABV_MIN"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
149 item->abv_min = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
150 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ABV_MAX"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 item->abv_max = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
157 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NOTES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 item->notes = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
160 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
161 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROFILE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
162 item->profile = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
163 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
164 if ((!xmlStrcmp(cur->name, (const xmlChar *)"INGREDIENTS"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
165 item->ingredients = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167 if ((!xmlStrcmp(cur->name, (const xmlChar *)"EXAMPLES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
168 item->examples = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
169 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
170 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
171 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
172
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
173 *style = item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
174 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
175 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
176
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
177
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
178
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
179 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
180 * Parse equipment
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
181 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
182 int parseEquipment(xmlDocPtr doc, xmlNodePtr cur, equipment_rec **equipment)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
183 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
184 xmlChar *key;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
185 equipment_rec *item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
186 float val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
187
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
188 item = (equipment_rec *)malloc(sizeof(equipment_rec));
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
189 item->name = item->notes = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
190 item->version = 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
191 item->boil_size = item->batch_size = item->tun_volume = item->tun_weight =
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
192 item->tun_specific_heat = item->top_up_water = item->trub_chiller_loss =
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
193 item->evap_rate = item->boil_time = item->lauter_deadspace =
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
194 item->top_up_kettle = item->hop_utilization = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
195 item->calc_boil_volume = FALSE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
196
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
197 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
198 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
199 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VERSION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
200 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
201 if (xmlStrcmp(key, (const xmlChar *)"1")) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
202 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
203 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
204 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
205 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
206 item->version = 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
207 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
208 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
209 item->name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
210 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
211 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BOIL_SIZE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
212 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
213 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
214 item->boil_size = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
215 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
216 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
217 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BATCH_SIZE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
218 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
219 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
220 item->batch_size = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
221 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
222 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
223 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TUN_VOLUME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
224 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
225 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
226 item->tun_volume = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
227 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
228 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
229 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TUN_WEIGHT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
230 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
231 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
232 item->tun_weight = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
233 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
234 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
235 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TUN_SPECIFIC_HEAT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
236 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
237 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
238 item->tun_specific_heat = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
239 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
240 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
241 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TOP_UP_WATER"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
242 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
243 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
244 item->top_up_water = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
245 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
246 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
247 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TRUB_CHILLER_LOSS"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
248 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
249 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
250 item->trub_chiller_loss = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
251 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
252 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
253 if ((!xmlStrcmp(cur->name, (const xmlChar *)"EVAP_RATE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
254 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
255 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
256 item->evap_rate = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
257 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
258 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
259 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BOIL_TIME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
260 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
261 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
262 item->boil_time = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
263 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
264 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
265 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CALC_BOIL_VOLUME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
266 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
267 if (! xmlStrcmp(key, (const xmlChar *)"TRUE"))
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
268 item->calc_boil_volume = TRUE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
269 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
270 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LAUTER_DEADSPACE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
271 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
272 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
273 item->lauter_deadspace = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
274 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
275 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
276 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HOP_UTILIZATION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
277 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
278 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
279 item->hop_utilization = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
280 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
281 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
282 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NOTES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
283 item->notes = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
284 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
285 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
286 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
287
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
288 *equipment = item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
289 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
290 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
291
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
292
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
293
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
294 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
295 * Parse a Mash step and add it to the linked list
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
296 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
297 int parseMashStep(xmlDocPtr doc, xmlNodePtr cur, mash_step **mashstep)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
298 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
299 xmlChar *key;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
300 mash_step *step, *tmp;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
301 float val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
302
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
303 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
304
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
305 step = (mash_step *)malloc(sizeof(mash_step));
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
306 step->next = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
307 step->name = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
308 step->type = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
309 step->infuse_amount = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
310 step->step_temp = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
311 step->end_temp = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
312 step->step_time = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
313 step->ramp_time = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
314 step->version = 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
315
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
316 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
317 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VERSION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
318 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
319 if (xmlStrcmp(key, (const xmlChar *)"1")) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
320 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
321 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
322 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
323 step->version = 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
324 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
325 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
326 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
327 step->name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
328 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
329 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TYPE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
330 step->type = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
331 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
332 if ((!xmlStrcmp(cur->name, (const xmlChar *)"INFUSE_AMOUNT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
333 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
334 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
335 step->infuse_amount = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
336 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
337 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
338 if ((!xmlStrcmp(cur->name, (const xmlChar *)"STEP_TEMP"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
339 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
340 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
341 step->step_temp = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
342 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
343 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
344 if ((!xmlStrcmp(cur->name, (const xmlChar *)"STEP_TIME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
345 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
346 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
347 step->step_time = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
348 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
349 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
350 if ((!xmlStrcmp(cur->name, (const xmlChar *)"END_TEMP"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
351 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
352 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
353 step->end_temp = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
354 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
355 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
356 if ((!xmlStrcmp(cur->name, (const xmlChar *)"RAMP_TIME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
357 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
358 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
359 step->ramp_time = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
360 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
361 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
362
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
363 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
364 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
365
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
366 if (*mashstep == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
367 *mashstep = step;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
368 } else {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
369 for (tmp = *mashstep; tmp; tmp = tmp->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
370 if (tmp->next == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
371 tmp->next = step;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
372 break;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
373 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
374 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
375 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
376 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
377 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
378
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
379
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
380
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
381 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
382 * Parse all Mash steps
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
383 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
384 int parseMashSteps(xmlDocPtr doc, xmlNodePtr cur, mash_step **step)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
385 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
386 int rc;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
387
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
388 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
389 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
390 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MASH_STEP"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
391 if ((rc = parseMashStep(doc, cur, step)))
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
392 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
393 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
394 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
395 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
396 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
397 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
398
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
399
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
400
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
401 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
402 * Parse Mash profile
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
403 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
404 int parseMash(xmlDocPtr doc, xmlNodePtr cur, mash_profile **mash)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
405 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
406 xmlChar *key;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
407 mash_profile *mashprofile;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
408 float val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
409
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
410 mashprofile = (mash_profile *)malloc(sizeof(mash_profile));
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
411 mashprofile->name = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
412 mashprofile->version = 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
413 mashprofile->notes = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
414 mashprofile->grain_temp = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
415 mashprofile->mash_steps = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
416 mashprofile->tun_temp = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
417 mashprofile->sparge_temp = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
418 mashprofile->ph = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
419 mashprofile->tun_weight = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
420 mashprofile->tun_specific_heat = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
421 mashprofile->equip_adjust = FALSE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
422
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
423 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
424 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
425 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VERSION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
426 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
427 if (xmlStrcmp(key, (const xmlChar *)"1")) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
428 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
429 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
430 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
431 mashprofile->version = 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
432 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
433 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
434 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
435 mashprofile->name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
436 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
437 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NOTES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
438 mashprofile->notes = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
439 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
440 if ((!xmlStrcmp(cur->name, (const xmlChar *)"GRAIN_TEMP"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
441 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
442 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
443 mashprofile->grain_temp = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
444 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
445 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
446 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TUN_TEMP"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
447 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
448 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
449 mashprofile->tun_temp = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
450 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
451 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
452 if ((!xmlStrcmp(cur->name, (const xmlChar *)"SPARGE_TEMP"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
453 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
454 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
455 mashprofile->sparge_temp = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
456 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
457 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
458 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PH"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
459 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
460 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
461 mashprofile->ph = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
462 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
463 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
464 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TUN_WEIGHT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
465 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
466 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
467 mashprofile->tun_weight = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
468 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
469 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
470 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TUN_SPECIFIC_HEAT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
471 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
472 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
473 mashprofile->tun_specific_heat = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
474 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
475 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
476 if ((!xmlStrcmp(cur->name, (const xmlChar *)"EQUIP_ADJUST"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
477 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
478 if (! xmlStrcmp(key, (const xmlChar *)"TRUE"))
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
479 mashprofile->equip_adjust = TRUE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
480 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
481 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MASH_STEPS"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
482 parseMashSteps(doc, cur, &(mashprofile)->mash_steps);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
483 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
484 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
485 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
486
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
487 *mash = mashprofile;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
488 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
489 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
490
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
491
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
492
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
493 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
494 * Parse fermentable
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
495 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
496 int parseFermentable(xmlDocPtr doc, xmlNodePtr cur, fermentable_rec **fr)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
497 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
498 xmlChar *key;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
499 fermentable_rec *item, *tmp;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
500 float val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
501
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
502 item = (fermentable_rec *)malloc(sizeof(fermentable_rec));
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
503 item->next = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
504 item->name = item->type = item->notes = item->origin = item->supplier = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
505 item->version = 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
506 item->amount = item->yield = item->color = item->coarse_fine_diff = item->moisture =
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
507 item->diastatic_power = item->protein = item->max_in_batch = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
508 item->add_after_boil = item->recommend_mash = FALSE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
509
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
510 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
511 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
512 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VERSION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
513 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
514 if (xmlStrcmp(key, (const xmlChar *)"1")) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
515 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
516 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
517 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
518 item->version = 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
519 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
520 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
521 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
522 item->name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
523 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
524 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NOTES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
525 item->notes = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
526 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
527 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TYPE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
528 item->type = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
529 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
530 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ORIGIN"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
531 item->origin = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
532 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
533 if ((!xmlStrcmp(cur->name, (const xmlChar *)"SUPPLIER"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
534 item->supplier = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
535 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
536 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AMOUNT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
537 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
538 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
539 item->amount = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
540 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
541 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
542 if ((!xmlStrcmp(cur->name, (const xmlChar *)"YIELD"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
543 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
544 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
545 item->yield = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
546 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
547 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
548 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COLOR"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
549 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
550 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
551 item->color = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
552 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
553 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
554 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ADD_AFTER_BOIL"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
555 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
556 if (! xmlStrcmp(key, (const xmlChar *)"TRUE"))
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
557 item->add_after_boil = TRUE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
558 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
559 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COARSE_FINE_DIFF"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
560 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
561 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
562 item->coarse_fine_diff = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
563 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
564 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
565 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MOISTURE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
566 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
567 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
568 item->moisture = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
569 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
570 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
571 if ((!xmlStrcmp(cur->name, (const xmlChar *)"DIASTATIC_POWER"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
572 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
573 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
574 item->diastatic_power = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
575 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
576 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
577 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PROTEIN"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
578 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
579 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
580 item->protein = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
581 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
582 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
583 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_IN_BATCH"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
584 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
585 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
586 item->max_in_batch = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
587 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
588 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
589 if ((!xmlStrcmp(cur->name, (const xmlChar *)"RECOMMEND_MASH"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
590 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
591 if (! xmlStrcmp(key, (const xmlChar *)"TRUE"))
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
592 item->recommend_mash = TRUE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
593 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
594 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
595 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
596
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
597 if (*fr == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
598 *fr = item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
599 } else {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
600 for (tmp = *fr; tmp; tmp = tmp->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
601 if (tmp->next == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
602 tmp->next = item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
603 break;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
604 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
605 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
606 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
607
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
608 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
609 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
610
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
611
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
612
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
613 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
614 * Parse fermentables
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
615 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
616 int parseFermentables(xmlDocPtr doc, xmlNodePtr cur, fermentable_rec **fr)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
617 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
618 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
619 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
620 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FERMENTABLE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
621 parseFermentable(doc, cur, fr);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
622 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
623 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
624 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
625 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
626 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
627
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
628
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
629
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
630 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
631 * Parse hop
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
632 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
633 int parseHop(xmlDocPtr doc, xmlNodePtr cur, hop_rec **hr)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
634 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
635 xmlChar *key;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
636 hop_rec *item, *tmp;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
637 float val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
638
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
639 item = (hop_rec *)malloc(sizeof(hop_rec));
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
640 item->next = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
641 item->name = item->use = item->notes = item->type = item->form =
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
642 item->origin = item->substitutes = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
643 item->version = 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
644 item->alpha = item->amount = item->time = item->beta = item->hsi =
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
645 item->humulene = item->caryophyllene = item->cohumulone = item->myrcene = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
646
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
647 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
648 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
649 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VERSION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
650 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
651 if (xmlStrcmp(key, (const xmlChar *)"1")) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
652 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
653 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
654 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
655 item->version = 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
656 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
657 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
658 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
659 item->name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
660 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
661 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ALPHA"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
662 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
663 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
664 item->alpha = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
665 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
666 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
667 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AMOUNT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
668 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
669 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
670 item->amount = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
671 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
672 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
673 if ((!xmlStrcmp(cur->name, (const xmlChar *)"USE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
674 item->use = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
675 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
676 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
677 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
678 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
679 item->time = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
680 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
681 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
682 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NOTES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
683 item->notes = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
684 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
685 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TYPE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
686 item->type = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
687 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
688 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FORM"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
689 item->form = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
690 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
691 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BETA"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
692 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
693 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
694 item->beta = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
695 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
696 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
697 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HSI"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
698 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
699 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
700 item->hsi = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
701 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
702 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
703 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ORIGIN"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
704 item->origin = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
705 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
706 if ((!xmlStrcmp(cur->name, (const xmlChar *)"SUBSTITITES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
707 item->substitutes = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
708 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
709 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HUMULENE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
710 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
711 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
712 item->humulene = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
713 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
714 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
715 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CARYOPHYLLENE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
716 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
717 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
718 item->caryophyllene = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
719 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
720 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
721 if ((!xmlStrcmp(cur->name, (const xmlChar *)"COHUMULONE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
722 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
723 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
724 item->cohumulone = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
725 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
726 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
727 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MYRCENE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
728 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
729 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
730 item->myrcene = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
731 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
732 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
733 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
734 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
735
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
736 if (*hr == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
737 *hr = item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
738 } else {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
739 for (tmp = *hr; tmp; tmp = tmp->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
740 if (tmp->next == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
741 tmp->next = item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
742 break;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
743 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
744 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
745 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
746
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
747 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
748 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
749
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
750
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
751
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
752 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
753 * Parse hops
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
754 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
755 int parseHops(xmlDocPtr doc, xmlNodePtr cur, hop_rec **hr)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
756 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
757 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
758 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
759 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HOP"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
760 parseHop(doc, cur, hr);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
761 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
762 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
763 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
764 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
765 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
766
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
767
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
768
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
769 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
770 * Parse Yeast
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
771 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
772 int parseYeast(xmlDocPtr doc, xmlNodePtr cur, yeast_rec **yr)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
773 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
774 xmlChar *key;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
775 yeast_rec *item, *tmp;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
776 float val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
777 int ival;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
778
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
779 item = (yeast_rec *)malloc(sizeof(yeast_rec));
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
780 item->next = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
781 item->name = item->type = item->form = item->laboratory = item->product_id = item->flocculation = item->notes = item->best_for = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
782 item->amount = item->min_temperature = item->max_temperature = item->attenuation = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
783 item->amount_is_weight = item->add_to_secondary = FALSE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
784 item->version = item->times_cultured = item->max_reuse = 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
785
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
786 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
787 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
788 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VERSION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
789 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
790 if (xmlStrcmp(key, (const xmlChar *)"1")) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
791 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
792 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
793 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
794 item->version = 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
795 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
796 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
797 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
798 item->name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
799 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
800 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TYPE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
801 item->type = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
802 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
803 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FORM"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
804 item->form = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
805 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
806 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AMOUNT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
807 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
808 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
809 item->amount = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
810 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
811 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
812 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AMOUNT_IS_WEIGHT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
813 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
814 if (! xmlStrcmp(key, (const xmlChar *)"TRUE"))
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
815 item->amount_is_weight = TRUE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
816 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
817 if ((!xmlStrcmp(cur->name, (const xmlChar *)"LABORATORY"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
818 item->laboratory = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
819 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
820 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRODUCT_ID"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
821 item->product_id = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
822 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
823 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MIN_TEMPERATURE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
824 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
825 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
826 item->min_temperature = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
827 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
828 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
829 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_TEMPERATURE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
830 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
831 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
832 item->max_temperature = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
833 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
834 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
835 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FLOCCULATION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
836 item->flocculation = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
837 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
838 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ATTENUATION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
839 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
840 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
841 item->attenuation = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
842 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
843 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
844 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NOTES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
845 item->notes = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
846 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
847 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BEST_FOR"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
848 item->best_for = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
849 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
850 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIMES_CULTURED"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
851 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
852 if (sscanf((const char *)key, "%d", &ival) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
853 item->times_cultured = ival;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
854 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
855 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
856 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAX_REUSE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
857 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
858 if (sscanf((const char *)key, "%d", &ival) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
859 item->max_reuse = ival;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
860 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
861 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
862 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ADD_TO_SECONDARY"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
863 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
864 if (! xmlStrcmp(key, (const xmlChar *)"TRUE"))
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
865 item->add_to_secondary = TRUE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
866 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
867 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
868 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
869
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
870 if (*yr == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
871 *yr = item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
872 } else {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
873 for (tmp = *yr; tmp; tmp = tmp->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
874 if (tmp->next == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
875 tmp->next = item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
876 break;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
877 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
878 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
879 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
880
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
881 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
882 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
883
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
884
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
885
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
886 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
887 * Parse Yeasts
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
888 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
889 int parseYeasts(xmlDocPtr doc, xmlNodePtr cur, yeast_rec **yr)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
890 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
891 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
892 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
893 if ((!xmlStrcmp(cur->name, (const xmlChar *)"YEAST"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
894 parseYeast(doc, cur, yr);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
895 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
896 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
897 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
898 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
899 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
900
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
901
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
902
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
903 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
904 * Parse Misc
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
905 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
906 int parseMisc(xmlDocPtr doc, xmlNodePtr cur, misc_rec **mr)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
907 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
908 xmlChar *key;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
909 misc_rec *item, *tmp;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
910 float val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
911
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
912 item = (misc_rec *)malloc(sizeof(misc_rec));
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
913 item->next = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
914 item->name = item->type = item->use = item->use_for = item->notes = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
915 item->amount = item->time = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
916 item->amount_is_weight = FALSE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
917 item->version = 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
918
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
919 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
920 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
921 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VERSION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
922 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
923 if (xmlStrcmp(key, (const xmlChar *)"1")) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
924 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
925 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
926 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
927 item->version = 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
928 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
929 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
930 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
931 item->name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
932 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
933 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TYPE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
934 item->type = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
935 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
936 if ((!xmlStrcmp(cur->name, (const xmlChar *)"USE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
937 item->use = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
938 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
939 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TIME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
940 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
941 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
942 item->time = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
943 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
944 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
945 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AMOUNT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
946 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
947 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
948 item->amount = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
949 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
950 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
951 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AMOUNT_IS_WEIGHT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
952 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
953 if (! xmlStrcmp(key, (const xmlChar *)"TRUE"))
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
954 item->amount_is_weight = TRUE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
955 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
956 if ((!xmlStrcmp(cur->name, (const xmlChar *)"USE_FOR"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
957 item->use_for = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
958 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
959 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NOTES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
960 item->notes = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
961 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
962 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
963 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
964
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
965 if (*mr == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
966 *mr = item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
967 } else {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
968 for (tmp = *mr; tmp; tmp = tmp->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
969 if (tmp->next == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
970 tmp->next = item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
971 break;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
972 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
973 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
974 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
975
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
976 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
977 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
978
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
979
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
980
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
981 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
982 * Parse Miscs
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
983 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
984 int parseMiscs(xmlDocPtr doc, xmlNodePtr cur, misc_rec **mr)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
985 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
986 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
987 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
988 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MISC"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
989 parseMisc(doc, cur, mr);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
990 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
991 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
992 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
993 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
994 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
995
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
996
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
997
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
998 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
999 * Parse Water
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1000 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1001 int parseWater(xmlDocPtr doc, xmlNodePtr cur, water_rec **wr)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1002 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1003 xmlChar *key;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1004 water_rec *item, *tmp;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1005 float val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1006
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1007 item = (water_rec *)malloc(sizeof(water_rec));
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1008 item->next = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1009 item->name = item->notes = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1010 item->amount = item->calcium = item->bicarbonate = item->sulfate = item->chloride = item->sodium = item->magnesium = item->ph = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1011 item->version = 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1012
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1013 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1014 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1015 if ((!xmlStrcmp(cur->name, (const xmlChar *)"VERSION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1016 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1017 if (xmlStrcmp(key, (const xmlChar *)"1")) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1018 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1019 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1020 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1021 item->version = 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1022 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1023 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1024 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1025 item->name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1026 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1027 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AMOUNT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1028 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1029 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1030 item->amount = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1031 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1032 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1033 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CALCIUM"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1034 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1035 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1036 item->calcium = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1037 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1038 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1039 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BICARBONATE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1040 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1041 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1042 item->bicarbonate = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1043 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1044 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1045 if ((!xmlStrcmp(cur->name, (const xmlChar *)"SULFATE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1046 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1047 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1048 item->sulfate = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1049 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1050 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1051 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CHLORIDE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1052 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1053 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1054 item->chloride = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1055 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1056 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1057 if ((!xmlStrcmp(cur->name, (const xmlChar *)"SODIUM"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1058 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1059 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1060 item->sodium = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1061 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1062 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1063 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MAGNESIUM"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1064 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1065 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1066 item->magnesium = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1067 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1068 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1069 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PH"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1070 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1071 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1072 item->ph = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1073 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1074 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1075 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NOTES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1076 item->notes = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1077 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1078 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1079 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1080
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1081 if (*wr == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1082 *wr = item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1083 } else {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1084 for (tmp = *wr; tmp; tmp = tmp->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1085 if (tmp->next == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1086 tmp->next = item;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1087 break;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1088 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1089 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1090 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1091
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1092 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1093 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1094
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1095
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1096
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1097 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1098 * Parse Waters
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1099 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1100 int parseWaters(xmlDocPtr doc, xmlNodePtr cur, water_rec **wr)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1101 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1102 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1103 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1104 if ((!xmlStrcmp(cur->name, (const xmlChar *)"WATER"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1105 parseWater(doc, cur, wr);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1106 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1107 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1108 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1109 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1110 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1111
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1112
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1113
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1114 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1115 * Parse a recipe
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1116 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1117 void parseRecipe(xmlDocPtr doc, xmlNodePtr cur)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1118 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1119 xmlChar *key;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1120 recipe_rec *recipe, *tmp;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1121 float val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1122 int ival;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1123
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1124 recipe = (recipe_rec *)malloc(sizeof(recipe_rec));
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1125 recipe->next = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1126 recipe->name = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1127 recipe->brewer = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1128 recipe->asst_brewer = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1129 recipe->type = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1130 recipe->style = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1131 recipe->equipment = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1132 recipe->batch_size = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1133 recipe->boil_time = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1134 recipe->efficiency = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1135 recipe->hops = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1136 recipe->fermentables = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1137 recipe->miscs = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1138 recipe->yeasts = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1139 recipe->waters = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1140 recipe->notes = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1141 recipe->taste_notes = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1142 recipe->taste_rating = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1143 recipe->og = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1144 recipe->fg = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1145 recipe->fermentation_stages = 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1146 recipe->primary_age = recipe->secondary_age = recipe->tertiary_age = recipe->age = 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1147 recipe->primary_temp = recipe->secondary_temp = recipe->tertiary_temp = recipe->age_temp = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1148 recipe->date = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1149 recipe->carbonation = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1150 recipe->forced_carbonation = FALSE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1151 recipe->priming_sugar_name = NULL;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1152 recipe->carbonation_temp = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1153 recipe->priming_sugar_equiv = recipe->keg_priming_factor = 0.0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1154
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1155 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1156 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1157 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NAME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1158 recipe->name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1159 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1160 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TYPE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1161 recipe->type = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1162 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1163 if ((!xmlStrcmp(cur->name, (const xmlChar *)"STYLE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1164 parseStyle(doc, cur, &(recipe)->style);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1165 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1166 if ((!xmlStrcmp(cur->name, (const xmlChar *)"EQUIPMENT"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1167 parseEquipment(doc, cur, &(recipe)->equipment);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1168 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1169 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BREWER"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1170 recipe->brewer = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1171 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1172 if ((!xmlStrcmp(cur->name, (const xmlChar *)"ASST_BREWER"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1173 recipe->asst_brewer = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1174 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1175 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BATCH_SIZE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1176 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1177 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1178 recipe->batch_size = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1179 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1180 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1181 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BOIL_SIZE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1182 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1183 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1184 recipe->boil_size = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1185 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1186 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1187 if ((!xmlStrcmp(cur->name, (const xmlChar *)"BOIL_TIME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1188 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1189 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1190 recipe->boil_time = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1191 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1192 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1193 if ((!xmlStrcmp(cur->name, (const xmlChar *)"EFFICIENCY"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1194 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1195 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1196 recipe->efficiency = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1197 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1198 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1199 if ((!xmlStrcmp(cur->name, (const xmlChar *)"HOPS"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1200 parseHops(doc, cur, &(recipe)->hops);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1201 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1202 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FERMENTABLES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1203 parseFermentables(doc, cur, &(recipe)->fermentables);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1204 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1205 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MISCS"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1206 parseMiscs(doc, cur, &(recipe)->miscs);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1207 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1208 if ((!xmlStrcmp(cur->name, (const xmlChar *)"YEASTS"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1209 parseYeasts(doc, cur, &(recipe)->yeasts);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1210 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1211 if ((!xmlStrcmp(cur->name, (const xmlChar *)"WATERS"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1212 parseWaters(doc, cur, &(recipe)->waters);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1213 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1214 if ((!xmlStrcmp(cur->name, (const xmlChar *)"MASH"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1215 parseMash(doc, cur, &(recipe)->mash);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1216 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1217 if ((!xmlStrcmp(cur->name, (const xmlChar *)"NOTES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1218 recipe->notes = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1219 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1220 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TASTE_NOTES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1221 recipe->taste_notes = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1222 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1223 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TASTE_RATING"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1224 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1225 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1226 recipe->taste_rating = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1227 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1228 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1229 if ((!xmlStrcmp(cur->name, (const xmlChar *)"OG"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1230 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1231 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1232 recipe->og = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1233 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1234 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1235 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FG"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1236 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1237 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1238 recipe->fg = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1239 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1240 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1241 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FERMENTATION_STAGES"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1242 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1243 if (sscanf((const char *)key, "%d", &ival) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1244 recipe->fermentation_stages = ival;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1245 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1246 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1247 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRIMARY_AGE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1248 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1249 if (sscanf((const char *)key, "%d", &ival) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1250 recipe->primary_age = ival;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1251 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1252 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1253 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRIMARY_TEMP"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1254 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1255 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1256 recipe->primary_temp = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1257 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1258 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1259 if ((!xmlStrcmp(cur->name, (const xmlChar *)"SECONDARY_AGE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1260 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1261 if (sscanf((const char *)key, "%d", &ival) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1262 recipe->secondary_age = ival;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1263 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1264 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1265 if ((!xmlStrcmp(cur->name, (const xmlChar *)"SECONDARY_TEMP"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1266 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1267 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1268 recipe->secondary_temp = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1269 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1270 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1271 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TERTIARY_AGE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1272 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1273 if (sscanf((const char *)key, "%d", &ival) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1274 recipe->tertiary_age = ival;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1275 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1276 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1277 if ((!xmlStrcmp(cur->name, (const xmlChar *)"TERTIARY_TEMP"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1278 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1279 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1280 recipe->tertiary_temp = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1281 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1282 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1283 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1284 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1285 if (sscanf((const char *)key, "%d", &ival) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1286 recipe->age = ival;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1287 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1288 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1289 if ((!xmlStrcmp(cur->name, (const xmlChar *)"AGE_TEMP"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1290 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1291 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1292 recipe->age_temp = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1293 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1294 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1295 if ((!xmlStrcmp(cur->name, (const xmlChar *)"DATE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1296 recipe->date = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1297 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1298 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CARBONATION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1299 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1300 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1301 recipe->carbonation = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1302 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1303 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1304 if ((!xmlStrcmp(cur->name, (const xmlChar *)"FORCED_CARBONATION"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1305 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1306 if (! xmlStrcmp(key, (const xmlChar *)"TRUE"))
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1307 recipe->forced_carbonation = TRUE;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1308 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1309 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRIMING_SUGAR_NAME"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1310 recipe->priming_sugar_name = (char *)xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1311 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1312 if ((!xmlStrcmp(cur->name, (const xmlChar *)"CARBONATION_TEMP"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1313 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1314 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1315 recipe->carbonation_temp = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1316 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1317 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1318 if ((!xmlStrcmp(cur->name, (const xmlChar *)"PRIMING_SUGAR_EQUIV"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1319 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1320 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1321 recipe->priming_sugar_equiv = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1322 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1323 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1324 if ((!xmlStrcmp(cur->name, (const xmlChar *)"KEG_PRIMING_FACTOR"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1325 key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1326 if (sscanf((const char *)key, "%f", &val) == 1)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1327 recipe->keg_priming_factor = val;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1328 xmlFree(key);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1329 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1330 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1331 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1332
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1333 if (recipes == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1334 recipes = recipe;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1335 } else {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1336 for (tmp = recipes; tmp; tmp = tmp->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1337 if (tmp->next == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1338 tmp->next = recipe;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1339 break;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1340 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1341 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1342 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1343 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1344
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1345
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1346
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1347 int parseBeerXML(char *docname)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1348 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1349 xmlDocPtr doc;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1350 xmlNodePtr cur;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1351
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1352 if ((doc = xmlParseFile(docname)) == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1353 fprintf(stderr, "XML file %s errors.\n", docname);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1354 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1355 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1356
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1357 if ((cur = xmlDocGetRootElement(doc)) == NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1358 fprintf(stderr, "XML file %s empty.\n", docname);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1359 xmlFreeDoc(doc);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1360 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1361 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1362
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1363 if (xmlStrcmp(cur->name, (const xmlChar*)"RECIPES")) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1364 fprintf(stderr, "XML file %s is not a BeerXML file.\n", docname);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1365 xmlFreeDoc(doc);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1366 return 1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1367 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1368
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1369 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1370 * Parse all recipes
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1371 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1372 cur = cur->xmlChildrenNode;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1373 while (cur != NULL) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1374 if ((!xmlStrcmp(cur->name, (const xmlChar *)"RECIPE"))) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1375 parseRecipe(doc, cur);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1376 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1377 cur = cur->next;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1378 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1379
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1380 xmlFreeDoc(doc);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1381 return 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1382 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1383
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1384
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1385
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1386 /*
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1387 * For debugging purposes, dump the recipes
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1388 */
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1389 void printBeerXML(void)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1390 {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1391 recipe_rec *tmp0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1392 mash_step *tmp1;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1393 fermentable_rec *tmp2;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1394 equipment_rec *tmp3;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1395 style_rec *tmp4;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1396 hop_rec *tmp5;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1397 yeast_rec *tmp6;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1398 misc_rec *tmp7;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1399 water_rec *tmp8;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1400 int mashstep = 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1401 float grain_weight = 0.0, water_grain_ratio, tun_water = 0.0, temp;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1402
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1403 for (tmp0 = recipes; tmp0; tmp0 = tmp0->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1404 printf("--------------------------------------------------------------------------------\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1405 printf("Recipe: %s\n", tmp0->name);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1406 printf("Type: %s\n", tmp0->type);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1407 if (tmp0->notes)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1408 printf("Notes: %s\n", tmp0->notes);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1409 if (tmp0->brewer || tmp0->asst_brewer)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1410 printf("Brewer: %s Assistent brewer: %s\n", tmp0->brewer, tmp0->asst_brewer);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1411 printf("Batch size: %5.1f Boil time: %5.1f Efficiency: %5.1f\n", tmp0->batch_size, tmp0->boil_time, tmp0->efficiency);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1412 printf("Taste rate: %5.1f Taste notes: %s\n", tmp0->taste_rating, tmp0->taste_notes);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1413 printf("Original G: %5.3f Final G: %5.3f\n", tmp0->og, tmp0->fg);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1414 printf("\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1415
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1416 if (tmp0->equipment) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1417 tmp3 = tmp0->equipment;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1418 printf("Equipment: %s\n", tmp3->name);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1419 if (tmp3->notes)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1420 printf(" Notes: %s\n", tmp3->notes);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1421 printf(" Boil size: %5.1f Batch size: %5.1f Boil time: %5.1f\n", tmp3->boil_size, tmp3->batch_size, tmp3->boil_time);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1422 printf(" Tun volume: %5.1f Tun weight: %5.1f Specific heat: %5.1f\n", tmp3->tun_volume, tmp3->tun_weight, tmp3->tun_specific_heat);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1423 printf(" TopUp: %5.1f Chiller loss: %5.1f Evaporation rate: %5.1f\n", tmp3->top_up_water, tmp3->trub_chiller_loss, tmp3->evap_rate);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1424 printf(" Tun loss: %5.1f TopUp kettle: %5.1f Hop utilization: %5.1f\n", tmp3->lauter_deadspace, tmp3->top_up_kettle, tmp3->hop_utilization);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1425 printf(" CalcBoilVol: %s\n", tmp3->calc_boil_volume ? "YES":"NO");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1426 printf("\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1427 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1428
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1429 if (tmp0->style) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1430 tmp4 = tmp0->style;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1431 printf("Style: %s-%s Type: %s\n", tmp4->style_letter, tmp4->name, tmp4->type);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1432 if (tmp4->category || tmp4->category_number || tmp4->style_guide)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1433 printf(" Category: %s Cat nr: %s Guide: %s\n", tmp4->category, tmp4->category_number, tmp4->style_guide);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1434 printf(" OG: %5.3f - %5.3f\n", tmp4->og_min, tmp4->og_max);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1435 printf(" FG: %5.3f - %5.3f\n", tmp4->fg_min, tmp4->fg_max);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1436 printf(" Bittern: %5.1f - %5.1f IBU\n", tmp4->ibu_min, tmp4->ibu_max);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1437 printf(" Color: %5.1f - %5.1f SRM\n", tmp4->color_min, tmp4->color_max);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1438 printf(" Carb: %5.1f - %5.1f V-CO2\n", tmp4->carb_min, tmp4->carb_max);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1439 printf(" ABV: %5.1f - %5.1f %%\n", tmp4->abv_min, tmp4->abv_max);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1440 if (tmp4->notes)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1441 printf(" Notes: %s\n", tmp4->notes);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1442 if (tmp4->profile)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1443 printf(" Profile: %s\n", tmp4->profile);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1444 if (tmp4->examples)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1445 printf(" Examples: %s\n", tmp4->examples);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1446 printf("\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1447 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1448
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1449 printf("Fermentables:\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1450 printf(" Type Name Kg Mash Moist\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1451 for (tmp2 = tmp0->fermentables; tmp2; tmp2 = tmp2->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1452 printf(" %-12s %-25s %6.3f %-5s %5.1f\n", tmp2->type, tmp2->name, tmp2->amount,
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1453 tmp2->recommend_mash ? "TRUE":"FALSE", tmp2->moisture);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1454 if (tmp2->recommend_mash)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1455 grain_weight += tmp2->amount;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1456 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1457 printf("\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1458
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1459 if (tmp0->hops) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1460 printf("Hops:\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1461 // 123456789 1234567890 1234567890123456789012345 123456 12345 12345
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1462 printf(" Type Use Name Kg Time Alpha\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1463 for (tmp5 = tmp0->hops; tmp5; tmp5 = tmp5->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1464 printf(" %-9s %-10s %-25s %6.3f %5.1f %5.1f\n", tmp5->type, tmp5->use, tmp5->name, tmp5->amount, tmp5->time, tmp5->alpha);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1465 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1466 printf("\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1467 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1468
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1469 if (tmp0->miscs) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1470 printf("Miscs:\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1471 // 12345678901 123456789 1234567890123456789012345 123456 12345 12345
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1472 printf(" Type Use Name Kg Time\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1473 for (tmp7 = tmp0->miscs; tmp7; tmp7 = tmp7->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1474 printf(" %-11s %-9s %-25s %6.3f %5.1f\n", tmp7->type, tmp7->use, tmp7->name, tmp7->amount, tmp7->time);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1475 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1476 printf("\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1477 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1478
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1479 if (tmp0->waters) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1480 printf("Wateren:\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1481 // 1234567890123456789012345 12345 12345 1234...
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1482 printf(" Name Ltrs PH Notes\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1483 for (tmp8 = tmp0->waters; tmp8; tmp8 = tmp8->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1484 printf(" %-25s %5.1f %5.1f %s\n", tmp8->name, tmp8->amount, tmp8->ph, tmp8->notes);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1485 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1486 printf("\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1487 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1488
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1489 printf("Mash profile: %s\n", tmp0->mash->name);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1490 if (tmp0->mash->notes)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1491 printf(" Notes: %s\n", tmp0->mash->notes);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1492 printf(" Grain temp: %5.1f Tun temp: %5.1f Sparge temp: %5.1f\n", tmp0->mash->grain_temp, tmp0->mash->tun_temp, tmp0->mash->sparge_temp);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1493 printf(" PH: %5.1f Tun weight: %6.2f Tun specific heat: %6.2f\n", tmp0->mash->ph, tmp0->mash->tun_weight, tmp0->mash->tun_specific_heat);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1494 printf(" Equip adjust: %s\n", tmp0->mash->equip_adjust ? "TRUE":"FALSE");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1495 printf("\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1496
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1497 if (tmp0->mash->mash_steps) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1498 mashstep = 0;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1499 printf("st Name Type Temp Endtmp Dur Rmp Inf/Dec L/Kg\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1500 for (tmp1 = tmp0->mash->mash_steps; tmp1; tmp1 = tmp1->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1501 mashstep++;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1502 tun_water += tmp1->infuse_amount;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1503 water_grain_ratio = tun_water / grain_weight;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1504 temp = tmp1->infuse_amount;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1505 // if ((tmp1->infuse_amount == 0.0) && (tmp1->decotion_amt > 0.0))
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1506 // temp = tmp1->decotion_amt;
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1507 printf("%2d %-16s %-12s %6.1f %6.1f %3.0f %3.0f %6.1f %6.2f\n", mashstep, tmp1->name, tmp1->type,
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1508 tmp1->step_temp, tmp1->end_temp, tmp1->step_time, tmp1->ramp_time, temp, water_grain_ratio);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1509 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1510 printf("\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1511 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1512
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1513 if (tmp0->yeasts) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1514 for (tmp6 = tmp0->yeasts; tmp6; tmp6 = tmp6->next) {
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1515 printf("Yeast: %s\n", tmp6->name);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1516 printf(" Type: %-20s Form: %-20s Amount: %7.4f %s\n",
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1517 tmp6->type, tmp6->form, tmp6->amount, tmp6->amount_is_weight ? "Kg":"L");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1518 printf(" Lab: %-20s Product id: %-20s Flocculation: %s\n", tmp6->laboratory, tmp6->product_id, tmp6->flocculation);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1519 printf(" Min temp: %5.1f Max temp: %5.1f Attenuation: %5.1f\n",
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1520 tmp6->min_temperature, tmp6->max_temperature, tmp6->attenuation);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1521 if (tmp6->notes)
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1522 printf(" Notes: %s\n", tmp6->notes);
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1523 printf("\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1524 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1525 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1526
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1527 printf("\n");
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1528 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1529 }
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1530
99c47a8a61cb Added the mash sourcecode, this does nothing useful yet.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1531

mercurial