Lines Matching defs:mt

67 	struct mystate *mt;
72 mt = userData;
73 mt->level++;
74 mt->sbuf[mt->level] = sbuf_new_auto();
80 mt->nident++;
85 mt->level + 1, mt->level + 1, "",
88 if (!strcmp(name, "class") && mt->class == NULL) {
89 mt->class = calloc(1, sizeof *mt->class);
90 if (mt->class == NULL) {
91 mt->error = errno;
92 XML_StopParser(mt->parser, 0);
97 mt->class->lg_id = id;
98 LIST_INSERT_HEAD(&mt->mesh->lg_class, mt->class, lg_class);
99 LIST_INIT(&mt->class->lg_geom);
100 LIST_INIT(&mt->class->lg_config);
103 if (!strcmp(name, "geom") && mt->geom == NULL) {
104 mt->geom = calloc(1, sizeof *mt->geom);
105 if (mt->geom == NULL) {
106 mt->error = errno;
107 XML_StopParser(mt->parser, 0);
112 mt->geom->lg_id = id;
113 LIST_INSERT_HEAD(&mt->class->lg_geom, mt->geom, lg_geom);
114 LIST_INIT(&mt->geom->lg_provider);
115 LIST_INIT(&mt->geom->lg_consumer);
116 LIST_INIT(&mt->geom->lg_config);
119 if (!strcmp(name, "class") && mt->geom != NULL) {
120 mt->geom->lg_class = ref;
123 if (!strcmp(name, "consumer") && mt->consumer == NULL) {
124 mt->consumer = calloc(1, sizeof *mt->consumer);
125 if (mt->consumer == NULL) {
126 mt->error = errno;
127 XML_StopParser(mt->parser, 0);
132 mt->consumer->lg_id = id;
133 LIST_INSERT_HEAD(&mt->geom->lg_consumer, mt->consumer,
135 LIST_INIT(&mt->consumer->lg_config);
138 if (!strcmp(name, "geom") && mt->consumer != NULL) {
139 mt->consumer->lg_geom = ref;
142 if (!strcmp(name, "provider") && mt->consumer != NULL) {
143 mt->consumer->lg_provider = ref;
146 if (!strcmp(name, "provider") && mt->provider == NULL) {
147 mt->provider = calloc(1, sizeof *mt->provider);
148 if (mt->provider == NULL) {
149 mt->error = errno;
150 XML_StopParser(mt->parser, 0);
155 mt->provider->lg_id = id;
156 LIST_INSERT_HEAD(&mt->geom->lg_provider, mt->provider,
158 LIST_INIT(&mt->provider->lg_consumers);
159 LIST_INIT(&mt->provider->lg_config);
162 if (!strcmp(name, "geom") && mt->provider != NULL) {
163 mt->provider->lg_geom = ref;
167 if (mt->provider != NULL) {
168 mt->config = &mt->provider->lg_config;
171 if (mt->consumer != NULL) {
172 mt->config = &mt->consumer->lg_config;
175 if (mt->geom != NULL) {
176 mt->config = &mt->geom->lg_config;
179 if (mt->class != NULL) {
180 mt->config = &mt->class->lg_config;
189 struct mystate *mt;
194 mt = userData;
196 if (sbuf_finish(mt->sbuf[mt->level]) == 0)
197 p = strdup(sbuf_data(mt->sbuf[mt->level]));
198 sbuf_delete(mt->sbuf[mt->level]);
199 mt->sbuf[mt->level] = NULL;
200 mt->level--;
202 mt->error = errno;
203 XML_StopParser(mt->parser, 0);
214 if (mt->provider != NULL) {
215 mt->provider->lg_name = p;
217 } else if (mt->geom != NULL) {
218 mt->geom->lg_name = p;
220 } else if (mt->class != NULL) {
221 mt->class->lg_name = p;
225 if (!strcmp(name, "rank") && mt->geom != NULL) {
226 mt->geom->lg_rank = strtoul(p, NULL, 0);
230 if (!strcmp(name, "mode") && mt->provider != NULL) {
231 mt->provider->lg_mode = p;
234 if (!strcmp(name, "mode") && mt->consumer != NULL) {
235 mt->consumer->lg_mode = p;
238 if (!strcmp(name, "mediasize") && mt->provider != NULL) {
239 mt->provider->lg_mediasize = strtoumax(p, NULL, 0);
243 if (!strcmp(name, "sectorsize") && mt->provider != NULL) {
244 mt->provider->lg_sectorsize = strtoul(p, NULL, 0);
248 if (!strcmp(name, "stripesize") && mt->provider != NULL) {
249 mt->provider->lg_stripesize = strtoumax(p, NULL, 0);
253 if (!strcmp(name, "stripeoffset") && mt->provider != NULL) {
254 mt->provider->lg_stripeoffset = strtoumax(p, NULL, 0);
260 mt->config = NULL;
265 if (mt->config != NULL || (!strcmp(name, "wither") &&
266 (mt->provider != NULL || mt->geom != NULL))) {
267 if (mt->config != NULL)
268 c = mt->config;
269 else if (mt->provider != NULL)
270 c = &mt->provider->lg_config;
272 c = &mt->geom->lg_config;
275 mt->error = errno;
276 XML_StopParser(mt->parser, 0);
284 mt->error = errno;
285 XML_StopParser(mt->parser, 0);
304 if (!strcmp(name, "consumer") && mt->consumer != NULL) {
305 mt->consumer = NULL;
308 if (!strcmp(name, "provider") && mt->provider != NULL) {
309 mt->provider = NULL;
312 if (!strcmp(name, "geom") && mt->consumer != NULL) {
315 if (!strcmp(name, "geom") && mt->provider != NULL) {
318 if (!strcmp(name, "geom") && mt->geom != NULL) {
319 mt->geom = NULL;
322 if (!strcmp(name, "class") && mt->geom != NULL) {
325 if (!strcmp(name, "class") && mt->class != NULL) {
326 mt->class = NULL;
334 struct mystate *mt;
337 mt = userData;
346 sbuf_bcat(mt->sbuf[mt->level], b, e - b + 1);
375 struct mystate *mt;
387 mt = calloc(1, sizeof *mt);
388 if (mt == NULL) {
392 mt->mesh = gmp;
393 mt->parser = parser;
395 XML_SetUserData(parser, mt);
399 if (mt->error != 0)
400 error = mt->error;
407 free(mt);
410 gmp->lg_ident = calloc(mt->nident + 1, sizeof(*gmp->lg_ident));
411 free(mt);