Lines Matching defs:elem
94 struct tpctl_data_elem *elem;
122 elem = alloc(sizeof(*elem));
123 elem->type = TPCTL_COMMENT;
124 elem->name = strdup_prune(buf);
125 TAILQ_INSERT_TAIL(&data->list, elem, link);
130 elem = alloc(sizeof(*elem));
131 elem->type = TPCTL_CALIBCOORDS;
138 free(elem);
142 elem->name = strdup_prune(p);
143 if (search_data(data, elem->name) != NULL) {
144 free(elem);
148 TAILQ_INSERT_TAIL(&data->list, elem, link);
170 elem->calibcoords.minx = t;
173 elem->calibcoords.miny = t;
176 elem->calibcoords.maxx = t;
179 elem->calibcoords.maxy = t;
200 elem->calibcoords.samplelen = n;
221 elem->calibcoords.samples[i / 4].rawx = t;
224 elem->calibcoords.samples[i / 4].rawy = t;
227 elem->calibcoords.samples[i / 4].x = t;
230 elem->calibcoords.samples[i / 4].y = t;
259 struct tpctl_data_elem *elem;
289 TAILQ_FOREACH(elem, &data->list, link) {
290 switch (elem->type) {
292 write_coords(fp, elem->name, &elem->calibcoords);
295 fprintf(fp, "%s\n", elem->name);
339 struct tpctl_data_elem *elem;
342 elem = TAILQ_FIRST(&data->list);
343 TAILQ_REMOVE(&data->list, elem, link);
345 switch (elem->type) {
348 free(elem->name);
361 struct tpctl_data_elem *elem;
363 TAILQ_FOREACH(elem, &data->list, link) {
364 if (elem->type == TPCTL_CALIBCOORDS &&
365 strcmp(name, elem->name) == 0) {
366 elem->calibcoords = *calibcoords;
371 elem = alloc(sizeof(*elem));
372 elem->type = TPCTL_CALIBCOORDS;
373 elem->name = strdup(name);
374 elem->calibcoords = *calibcoords;
375 if (elem->name == NULL) {
379 TAILQ_INSERT_TAIL(&data->list, elem, link);
387 struct tpctl_data_elem *elem;
389 TAILQ_FOREACH(elem, &data->list, link) {
390 if (elem->type == TPCTL_CALIBCOORDS &&
391 strcmp(name, elem->name) == 0) {
392 return (&elem->calibcoords);