/** Adds an attribute-value pair to the given list * * @note Always appends the new pair to the end of the list. * * @param rh a handle to parsed configuration. * @param list a #VALUE_PAIR array of values; initially must be %NULL. * @param attrid The attribute of the pair to add (e.g., %PW_USER_NAME). * @param pval the value (e.g., the actual username). * @param len the length of @pval, or -1 if to calculate (in case of strings). * @param vendorpec The vendor ID in case of a vendor specific value - 0 otherwise. * @return pointer to added a/v pair upon success, NULL pointer upon failure. */ VALUE_PAIR *rc_avpair_add (rc_handle const *rh, VALUE_PAIR **list, int attrid, void const *pval, int len, int vendorpec) { VALUE_PAIR *vp; vp = rc_avpair_new (rh, attrid, pval, len, vendorpec); if (vp != NULL) { rc_avpair_insert (list, NULL, vp); } return vp; }
VALUE_PAIR *rc_avpair_add (VALUE_PAIR **list, int attrid, void *pval, int len, int vendorcode) { VALUE_PAIR *vp; vp = rc_avpair_new (attrid, pval, len, vendorcode); if (vp != (VALUE_PAIR *) NULL) { rc_avpair_insert (list, (VALUE_PAIR *) NULL, vp); } return vp; }