Lines Matching defs:pobj

473 hash_add_newobj(hash_t *htbl, picl_hdl_t hdl, void *pobj)
479 n = hash_newobj(hash_val, pobj);
678 alloc_and_add_to_ptree(picl_obj_t *pobj)
680 pobj->ptree_hdl = alloc_ptreehdl();
682 (void) hash_add_newobj(&ptreetbl, pobj->ptree_hdl, pobj);
721 picl_obj_t *pobj;
724 pobj = hash_lookup_obj(&ptreetbl, proph);
725 if (pobj == NULL)
732 if (pobj->obj_type == PICL_OBJ_PROP)
733 nobj = pobj->prop_node;
734 else if (pobj->obj_type == (PICL_OBJ_PROP|PICL_OBJ_TABLEENTRY))
735 nobj = pobj->prop_table->prop_node;
737 *propp = pobj; /* return the prop */
745 *propp = pobj;
758 picl_obj_t *pobj;
761 pobj = hash_lookup_obj(&ptreetbl, tblh);
762 if (pobj == NULL)
769 if (pobj->obj_type != PICL_OBJ_TABLE)
771 nobj = pobj->prop_node;
777 *tblobj = pobj;
790 picl_obj_t *pobj;
793 pobj = hash_lookup_obj(&ptreetbl, tblproph);
794 if (pobj == NULL)
801 if ((pobj->obj_type != PICL_OBJ_TABLE) && /* not a table */
802 !(pobj->obj_type & PICL_OBJ_TABLEENTRY)) /* or an entry */
804 if (pobj->obj_type == PICL_OBJ_TABLE)
805 nobj = pobj->prop_node;
807 nobj = pobj->prop_table->prop_node;
812 *tblpropp = pobj;
898 picl_obj_t *pobj;
901 pobj = hash_lookup_obj(&ptreetbl, *handlep);
902 if (pobj == NULL)
905 (void) memcpy(handlep, &pobj->picl_hdl, sizeof (*handlep));
914 piclize_obj(picl_obj_t *pobj)
917 pobj->picl_hdl = alloc_piclhdl();
918 (void) hash_add_newhdl(&picltbl, pobj->picl_hdl, pobj->ptree_hdl);
977 unpiclize_obj(picl_obj_t *pobj)
980 (void) hash_remove(&picltbl, pobj->picl_hdl);
981 pobj->picl_hdl = PICL_INVALID_PICLHDL;
1207 picl_obj_t *pobj;
1217 pobj = malloc(sizeof (picl_obj_t));
1218 if (pobj == NULL)
1221 pobj->obj_type = PICL_OBJ_PROP;
1222 pobj->pinfo_ver = pinfo->version;
1223 pobj->prop_type = pinfo->piclinfo.type;
1224 pobj->prop_mode = pinfo->piclinfo.accessmode;
1225 pobj->prop_size = pinfo->piclinfo.size;
1226 (void) strcpy(pobj->prop_name, pinfo->piclinfo.name);
1227 pobj->read_func = pinfo->read;
1228 pobj->write_func = pinfo->write;
1230 pobj->prop_val = NULL;
1232 pobj->prop_val = malloc(pinfo->piclinfo.size);
1233 if (pobj->prop_val == NULL) {
1234 free(pobj);
1237 if (pobj->prop_type == PICL_PTYPE_CHARSTRING)
1238 (void) strlcpy(pobj->prop_val, valbuf,
1241 (void) memcpy(pobj->prop_val, valbuf,
1244 pobj->prop_node = NULL;
1245 pobj->ptree_hdl = PICL_INVALID_PICLHDL;
1246 pobj->picl_hdl = PICL_INVALID_PICLHDL;
1247 pobj->next_prop = NULL;
1248 pobj->next_row = NULL;
1249 pobj->next_col = NULL;
1251 *pobjp = pobj;
1265 picl_obj_t *pobj;
1326 err = create_propobj(pinfo, valbuf, &pobj);
1330 alloc_and_add_to_ptree(pobj);
1331 *proph = pobj->ptree_hdl;
1341 destroy_table(picl_obj_t *pobj)
1349 tblh = *(picl_prophdl_t *)pobj->prop_val;
1600 picl_obj_t *pobj;
1602 pobj = malloc(sizeof (picl_obj_t));
1603 if (pobj == NULL)
1605 pobj->obj_type = PICL_OBJ_TABLE;
1606 pobj->prop_val = NULL;
1607 pobj->prop_node = NULL;
1608 pobj->ptree_hdl = PICL_INVALID_PICLHDL;
1609 pobj->picl_hdl = PICL_INVALID_PICLHDL;
1610 pobj->table_prop = NULL;
1611 pobj->next_row = NULL;
1612 pobj->next_col = NULL;
1614 alloc_and_add_to_ptree(pobj);
1615 *tblh = pobj->ptree_hdl;
1633 picl_obj_t *pobj;
1656 pobj = newrow[i] = hash_lookup_obj(&ptreetbl, props[i]);
1657 if (pobj == NULL) { /* no object */
1661 if ((!(pobj->obj_type & PICL_OBJ_PROP)) &&
1662 (!(pobj->obj_type & PICL_OBJ_TABLE))) {
1666 if (IS_PICLIZED(pobj) || (pobj->prop_table != NULL) ||
1667 (pobj->prop_node != NULL)) {
1791 picl_obj_t *pobj;
1808 pobj = malloc(sizeof (picl_obj_t));
1809 if (pobj == NULL)
1811 pobj->obj_type = PICL_OBJ_NODE;
1812 pobj->first_prop = NULL;
1813 pobj->ptree_hdl = PICL_INVALID_PICLHDL;
1814 pobj->picl_hdl = PICL_INVALID_PICLHDL;
1815 pobj->parent_node = NULL;
1816 pobj->sibling_node = NULL;
1817 pobj->child_node = NULL;
1818 pobj->node_classname = strdup(clname);
1819 if (pobj->node_classname == NULL) {
1820 free(pobj);
1823 (void) rwlock_init(&pobj->node_lock, USYNC_THREAD, NULL);
1825 alloc_and_add_to_ptree(pobj); /* commit the node */
1839 (void) ptree_destroy_node(pobj->ptree_hdl);
1842 err = ptree_add_prop(pobj->ptree_hdl, phdl);
1845 (void) ptree_destroy_node(pobj->ptree_hdl);
1858 (void) ptree_destroy_node(pobj->ptree_hdl);
1861 err = ptree_add_prop(pobj->ptree_hdl, cphdl);
1864 (void) ptree_destroy_node(pobj->ptree_hdl);
1868 *nodeh = pobj->ptree_hdl;
2492 picl_obj_t *pobj;
2496 pobj = NULL;
2497 err = lookup_and_lock_node(RDLOCK_NODE, nodeh, &pobj); /* lock node */
2503 if (pobj->first_prop)
2504 *proph = pobj->first_prop->ptree_hdl;
2508 unlock_node(pobj); /* unlock node */
3300 picl_obj_t *pobj;
3304 pobj = NULL;
3305 err = lookup_and_lock_node(RDLOCK_NODE, rooth, &pobj); /* lock node */
3310 piclize_node(pobj);
3311 picl_root_obj = pobj;
3312 ptree_root_hdl = pobj->ptree_hdl;
3313 unlock_node(pobj); /* unlock node */