Lines Matching refs:cp

100 	struct config *cp;
145 for (cp = parent->child; cp; lastcp = cp, cp = cp->next)
146 if (cp->s == s && cp->num == num) {
148 parent = cp;
189 struct config *cp = (struct config *)arg;
191 ASSERT(cp != NULL);
196 config_setprop(cp, lhs, STRDUP(rhs->u.quote.s));
207 struct config *cp;
228 for (cp = parent->child; cp; lastcp = cp, cp = cp->next)
229 if (cp->s == s && cp->num == num) {
231 parent = cp;
434 structconfig_free(struct config *cp)
436 if (cp == NULL)
439 structconfig_free(cp->child);
440 structconfig_free(cp->next);
441 lut_free(cp->props, prop_destructor, NULL);
442 FREE(cp);
449 config_free(struct cfgdata *cp)
451 if (cp == NULL)
454 if (--cp->raw_refcnt == 0) {
455 if (cp->devcache != NULL)
456 lut_free(cp->devcache, NULL, NULL);
457 cp->devcache = NULL;
458 if (cp->tpcache != NULL)
459 lut_free(cp->tpcache, NULL, NULL);
460 cp->tpcache = NULL;
461 if (cp->devidcache != NULL)
462 lut_free(cp->devidcache, NULL, NULL);
463 cp->devidcache = NULL;
464 if (cp->cpucache != NULL)
465 lut_free(cp->cpucache, NULL, NULL);
466 cp->cpucache = NULL;
467 if (cp->begin != NULL)
468 FREE(cp->begin);
469 FREE(cp);
477 config_next(struct config *cp)
479 ASSERT(cp != NULL);
481 return ((struct config *)((struct config *)cp)->next);
489 config_child(struct config *cp)
491 ASSERT(cp != NULL);
493 return ((struct config *)((struct config *)cp)->child);
500 config_parent(struct config *cp)
502 ASSERT(cp != NULL);
504 return ((struct config *)((struct config *)cp)->parent);
511 config_setprop(struct config *cp, const char *propname, const char *propvalue)
515 cp->props = lut_add(cp->props, (void *)pn, (void *)propvalue, NULL);
522 config_getprop(struct config *cp, const char *propname)
524 return (lut_lookup(cp->props, (void *) stable(propname), NULL));
531 config_getcompname(struct config *cp, char **name, int *inst)
533 ASSERT(cp != NULL);
536 *name = (char *)cp->s;
538 *inst = cp->num;
542 * config_nodeize -- convert the config element represented by cp to struct
546 config_nodeize(struct config *cp)
552 if (cp == NULL || cp->s == NULL)
555 sname = stable(cp->s);
557 numn->u.ull = cp->num;
560 if ((ptmpn = config_nodeize(cp->parent)) == NULL)
712 pconf(int flags, struct config *cp, char *buf, int offset, int limit)
721 sep, cp->s, cp->num);
722 if (cp->child == NULL) {
724 lut_walk(cp->props, (lut_cb)printprop, (void *)flags);
726 pconf(flags, cp->child, buf, strlen(buf), limit);
727 if (cp->next)
728 pconf(flags, cp->next, buf, offset, limit);