Lines Matching refs:rv
45 freeRuleValue(__nis_rule_value_t *rv, int count) { in freeRuleValue() argument
48 if (rv == 0) in freeRuleValue()
53 if (rv[n].colName != 0) { in freeRuleValue()
54 for (i = 0; i < rv[n].numColumns; i++) { in freeRuleValue()
55 sfree(rv[n].colName[i]); in freeRuleValue()
57 free(rv[n].colName); in freeRuleValue()
59 if (rv[n].colVal != 0) { in freeRuleValue()
60 for (i = 0; i < rv[n].numColumns; i++) { in freeRuleValue()
61 for (j = 0; j < rv[n].colVal[i].numVals; j++) { in freeRuleValue()
62 sfree(rv[n].colVal[i].val[j].value); in freeRuleValue()
64 if (rv[n].colVal[i].numVals > 0) in freeRuleValue()
65 sfree(rv[n].colVal[i].val); in freeRuleValue()
67 free(rv[n].colVal); in freeRuleValue()
70 if (rv[n].attrName != 0) { in freeRuleValue()
71 for (i = 0; i < rv[n].numAttrs; i++) { in freeRuleValue()
72 sfree(rv[n].attrName[i]); in freeRuleValue()
74 free(rv[n].attrName); in freeRuleValue()
76 if (rv[n].attrVal != 0) { in freeRuleValue()
77 for (i = 0; i < rv[n].numAttrs; i++) { in freeRuleValue()
78 for (j = 0; j < rv[n].attrVal[i].numVals; in freeRuleValue()
80 sfree(rv[n].attrVal[i].val[j].value); in freeRuleValue()
82 if (rv[n].attrVal[i].numVals > 0) in freeRuleValue()
83 sfree(rv[n].attrVal[i].val); in freeRuleValue()
85 free(rv[n].attrVal); in freeRuleValue()
89 sfree(rv); in freeRuleValue()
112 __nis_rule_value_t *rv; in growRuleValue() local
127 rv = realloc(old, newCount * sizeof (rv[0])); in growRuleValue()
128 if (rv == 0) { in growRuleValue()
131 myself, (oldCount+newCount) * sizeof (rv[0]), in growRuleValue()
132 oldCount, newCount, sizeof (rv[0])); in growRuleValue()
137 (void) memset(&rv[oldCount], 0, (newCount-oldCount)*sizeof (rv[0])); in growRuleValue()
140 rv[i].numColumns = rvIn->numColumns; in growRuleValue()
141 if (rv[i].numColumns > 0) { in growRuleValue()
142 rv[i].colName = cloneName(rvIn->colName, in growRuleValue()
143 rv[i].numColumns); in growRuleValue()
144 rv[i].colVal = cloneValue(rvIn->colVal, in growRuleValue()
145 rv[i].numColumns); in growRuleValue()
147 if (rv[i].numColumns > 0 && in growRuleValue()
148 (rv[i].colName == 0 || rv[i].colVal == 0)) { in growRuleValue()
149 freeRuleValue(rv, i); in growRuleValue()
152 rv[i].numAttrs = rvIn->numAttrs; in growRuleValue()
153 rv[i].attrName = cloneName(rvIn->attrName, rv[i].numAttrs); in growRuleValue()
154 rv[i].attrVal = cloneValue(rvIn->attrVal, rv[i].numAttrs); in growRuleValue()
155 if (rv[i].numAttrs > 0 && in growRuleValue()
156 (rv[i].attrName == 0 || rv[i].attrVal == 0)) { in growRuleValue()
157 freeRuleValue(rv, i); in growRuleValue()
162 return (rv); in growRuleValue()
388 int valueLen, __nis_rule_value_t *rv) { in addAttr2RuleValue() argument
391 if (name == 0 || rv == 0) in addAttr2RuleValue()
395 &rv->numAttrs, &rv->attrName, &rv->attrVal)); in addAttr2RuleValue()
399 addSAttr2RuleValue(char *name, char *value, __nis_rule_value_t *rv) { in addSAttr2RuleValue() argument
400 return (addAttr2RuleValue(vt_string, name, value, slen(value), rv)); in addSAttr2RuleValue()
405 int valueLen, __nis_rule_value_t *rv) { in addCol2RuleValue() argument
408 if (name == 0 || rv == 0) in addCol2RuleValue()
412 &rv->numColumns, &rv->colName, &rv->colVal)); in addCol2RuleValue()
416 addSCol2RuleValue(char *name, char *value, __nis_rule_value_t *rv) { in addSCol2RuleValue() argument
417 return (addCol2RuleValue(vt_string, name, value, slen(value), rv)); in addSCol2RuleValue()
427 __nis_rule_value_t *rv) { in buildNisPlusRuleValue() argument
433 rv = initRuleValue(1, rv); in buildNisPlusRuleValue()
434 if (rv == 0) in buildNisPlusRuleValue()
454 itemvalue.itemvalue_len, rv) != 0) { in buildNisPlusRuleValue()
455 freeRuleValue(rv, 1); in buildNisPlusRuleValue()
456 rv = 0; in buildNisPlusRuleValue()
461 return (rv); in buildNisPlusRuleValue()
572 __nis_rule_value_t *rv, int *stat) { in buildRvalue() argument
592 vnew = getMappingElement(&rl->element[i], native, rv, stat); in buildRvalue()
613 __nis_rule_value_t *rv, in addLdapRuleValue() argument
625 if (rv == 0) in addLdapRuleValue()
645 rval = buildRvalue(&r->rhs, rnative, rv, stat); in addLdapRuleValue()
651 return (rv); in addLdapRuleValue()
661 return (rv); in addLdapRuleValue()
668 return (rv); in addLdapRuleValue()
691 dn = findDNs(myself, rv, 1, in addLdapRuleValue()
729 return (rv); in addLdapRuleValue()
736 lval->val[i].value, 0, 0, rv); in addLdapRuleValue()
765 rval->val[j].length, rv); in addLdapRuleValue()
782 return (rv); in addLdapRuleValue()
790 delAttrFromRuleValue(__nis_rule_value_t *rv, char *attrName) { in delAttrFromRuleValue() argument
793 if (rv == 0 || attrName == 0) in delAttrFromRuleValue()
796 for (i = 0; i < rv->numAttrs; i++) { in delAttrFromRuleValue()
797 if (strcasecmp(attrName, rv->attrName[i]) == 0) { in delAttrFromRuleValue()
800 for (j = 0; j < rv->attrVal[i].numVals; j++) in delAttrFromRuleValue()
801 sfree(rv->attrVal[i].val[j].value); in delAttrFromRuleValue()
802 if (rv->attrVal[i].numVals > 0) in delAttrFromRuleValue()
803 sfree(rv->attrVal[i].val); in delAttrFromRuleValue()
805 sfree(rv->attrName[i]); in delAttrFromRuleValue()
808 for (j = i+1; j < rv->numAttrs; j++) { in delAttrFromRuleValue()
809 rv->attrName[j-1] = rv->attrName[j]; in delAttrFromRuleValue()
810 rv->attrVal[j-1] = rv->attrVal[j]; in delAttrFromRuleValue()
813 rv->numAttrs -= 1; in delAttrFromRuleValue()
825 delColFromRuleValue(__nis_rule_value_t *rv, char *colName) { in delColFromRuleValue() argument
828 if (rv == 0 || colName == 0) in delColFromRuleValue()
831 for (i = 0; i < rv->numColumns; i++) { in delColFromRuleValue()
832 if (strcmp(colName, rv->colName[i]) == 0) { in delColFromRuleValue()
835 for (j = 0; j < rv->colVal[i].numVals; j++) in delColFromRuleValue()
836 sfree(rv->colVal[i].val[j].value); in delColFromRuleValue()
837 if (rv->colVal[i].numVals > 0) in delColFromRuleValue()
838 sfree(rv->colVal[i].val); in delColFromRuleValue()
840 sfree(rv->colName[i]); in delColFromRuleValue()
843 for (j = i+1; j < rv->numColumns; j++) { in delColFromRuleValue()
844 rv->colName[j-1] = rv->colName[j]; in delColFromRuleValue()
845 rv->colVal[j-1] = rv->colVal[j]; in delColFromRuleValue()
848 rv->numColumns -= 1; in delColFromRuleValue()
861 addObjectClasses(__nis_rule_value_t *rv, char *objClassAttrs) { in addObjectClasses() argument
869 if (rv == 0) in addObjectClasses()
877 return (rv); in addObjectClasses()
886 freeRuleValue(rv, 1); in addObjectClasses()
893 freeRuleValue(rv, 1); in addObjectClasses()
913 if (addSAttr2RuleValue(name, value, rv) != 0) { in addObjectClasses()
916 freeRuleValue(rv, 1); in addObjectClasses()
924 return (rv); in addObjectClasses()
959 findVal(char *name, __nis_rule_value_t *rv, __nis_mapping_item_type_t type) { in findVal() argument
963 for (i = 0; i < rv->numColumns; i++) { in findVal()
964 if (rv->colName[i] == 0) in findVal()
966 if (strcmp(name, rv->colName[i]) == 0) { in findVal()
967 return (valString(&rv->colVal[i])); in findVal()
971 for (i = 0; i < rv->numAttrs; i++) { in findVal()
972 if (rv->attrName[i] == 0) in findVal()
974 if (strcasecmp(name, rv->attrName[i]) == 0) { in findVal()
975 return (valString(&rv->attrVal[i])); in findVal()
992 rvId(__nis_rule_value_t *rv, __nis_mapping_item_type_t type) { in rvId() argument
995 if (rv == 0) in rvId()
998 if (rv->numColumns > 0 && type == mit_nisplus) { in rvId()
1003 if ((v = findVal("cname", rv, type)) != 0) in rvId()
1005 else if ((v = findVal("name", rv, type)) != 0) in rvId()
1007 else if ((v = findVal("key", rv, type)) != 0) in rvId()
1009 else if ((v = findVal("alias", rv, type)) != 0) in rvId()
1011 } else if (rv->numAttrs > 0 && type == mit_ldap) { in rvId()
1015 if ((v = findVal("dn", rv, type)) != 0) in rvId()
1017 else if ((v = findVal("cn", rv, type)) != 0) in rvId()
1031 mergeRuleValueWithSameDN(__nis_rule_value_t *rv, int *numVals) { in mergeRuleValueWithSameDN() argument
1041 if ((dn = findVal("dn", &rv[i], mit_ldap)) != 0) { in mergeRuleValueWithSameDN()
1049 &rv[i]) == -1) { in mergeRuleValueWithSameDN()
1064 &rv[i]); in mergeRuleValueWithSameDN()