Lines Matching refs:attrs

159 static NSL_RESULT _addLDAPmodValue(LDAPMod ***attrs, char *type, char *value);
160 static NSL_RESULT _modLDAPmodValue(LDAPMod ***attrs, char *type, char *value);
162 char **attrList, LDAPMod ***attrs);
164 char **attrList, char ***oldKVPList, LDAPMod ***attrs);
174 static NSL_RESULT _attrAddKVP(LDAPMod ***attrs, char **kvpList, int kvpExists);
866 LDAPMod **attrs = NULL;
890 attrList, &attrs);
894 (char *)printerDN, attrs);
907 (void) ldap_mods_free(attrs, 1);
963 LDAPMod **attrs = NULL;
1005 &kvpList, &attrs);
1008 if ((result == NSL_OK) && (attrs != NULL))
1011 ld, (char *)printerDN, attrs);
1024 (void) ldap_mods_free(attrs, 1);
1133 * Input: LDAPMod ***attrs - array to update
1144 _addLDAPmodValue(LDAPMod ***attrs, char *type, char *value)
1153 if ((attrs != NULL) && (type != NULL) && (value != NULL))
1160 for (i = 0; *attrs != NULL && (*attrs)[i] != NULL; i++)
1162 if (strcasecmp((*attrs)[i]->mod_type, type) == 0)
1168 if (*attrs == NULL)
1172 *attrs = (LDAPMod **)calloc(1, 2 * sizeof (LDAPMod *));
1173 if (*attrs != NULL)
1184 if ((*attrs)[i] == NULL)
1186 *attrs = (LDAPMod **)
1187 realloc(*attrs, (i+2) * sizeof (LDAPMod *));
1188 if (*attrs == NULL)
1201 if ((*attrs)[i] == NULL)
1205 (*attrs)[i] = (LDAPMod *) malloc(sizeof (LDAPMod));
1206 if ((*attrs)[i] != NULL)
1208 (*attrs)[i]->mod_op = LDAP_MOD_ADD;
1209 (*attrs)[i]->mod_type = strdup(type);
1210 (*attrs)[i]->mod_values = (char **)
1212 if ((*attrs)[i]->mod_values != NULL)
1214 (*attrs)[i]->mod_values[0] =
1216 (*attrs)[i]->mod_values[1] = NULL;
1217 (*attrs)[i+1] = NULL;
1234 for (j = 0; (*attrs)[i]->mod_values[j] != NULL; j++);
1236 (*attrs)[i]->mod_values =
1237 (char **)realloc((*attrs)[i]->mod_values,
1239 if ((*attrs)[i]->mod_values != NULL)
1241 (*attrs)[i]->mod_values[j] = strdup(value);
1242 (*attrs)[i]->mod_values[j+1] = NULL;
1268 * Input: LDAPMod ***attrs - array to update
1279 _modLDAPmodValue(LDAPMod ***attrs, char *type, char *value)
1288 if ((attrs != NULL) && (type != NULL))
1298 for (i = 0; *attrs != NULL && (*attrs)[i] != NULL; i++)
1300 if (strcasecmp((*attrs)[i]->mod_type, type) == 0)
1306 if (*attrs == NULL)
1310 *attrs = (LDAPMod **)calloc(1, 2 * sizeof (LDAPMod *));
1311 if (*attrs != NULL)
1322 if ((*attrs)[i] == NULL)
1326 *attrs = (LDAPMod **)
1327 realloc(*attrs, (i+2) * sizeof (LDAPMod *));
1328 if (*attrs == NULL)
1341 if ((*attrs)[i] == NULL)
1345 (*attrs)[i] = (LDAPMod *) malloc(sizeof (LDAPMod));
1346 if (((*attrs)[i] != NULL) && (value != NULL))
1350 (*attrs)[i]->mod_op = LDAP_MOD_REPLACE;
1351 (*attrs)[i]->mod_type = strdup(type);
1352 (*attrs)[i]->mod_values = (char **)
1354 if ((*attrs)[i]->mod_values != NULL)
1356 (*attrs)[i]->mod_values[0] =
1358 (*attrs)[i]->mod_values[1] = NULL;
1359 (*attrs)[i+1] = NULL;
1367 if ((*attrs)[i] != NULL)
1371 (*attrs)[i]->mod_op = LDAP_MOD_DELETE;
1372 (*attrs)[i]->mod_type = strdup(type);
1373 (*attrs)[i]->mod_values = NULL;
1374 (*attrs)[i+1] = NULL;
1390 if ((*attrs)[i]->mod_op == LDAP_MOD_REPLACE)
1393 (*attrs)[i]->mod_values[j] != NULL; j++);
1395 (*attrs)[i]->mod_values =
1396 (char **)realloc((*attrs)[i]->mod_values,
1398 if ((*attrs)[i]->mod_values != NULL)
1400 (*attrs)[i]->mod_values[j] =
1402 (*attrs)[i]->mod_values[j+1] = NULL;
1423 (*attrs)[i]->mod_op = LDAP_MOD_DELETE;
1425 if ((*attrs)[i]->mod_values != NULL)
1428 (*attrs)[i]->mod_values[j] != NULL;
1431 free((*attrs)[i]->mod_values[j]);
1434 free((*attrs)[i]->mod_values);
1435 (*attrs)[i]->mod_values = NULL;
1461 * Output: LDAPMod ***attrs - pointer to the constructed array
1469 _constructAddLDAPMod(uchar_t *printerName, char **attrList, LDAPMod ***attrs)
1481 ((attrList != NULL) && (attrList[0] != NULL)) && (attrs != NULL))
1483 *attrs = NULL;
1488 result = _addLDAPmodValue(attrs, ATTR_OCLASS, OCV_TOP);
1493 _addLDAPmodValue(attrs, ATTR_OCLASS, OCV_PSERVICE);
1497 result = _addLDAPmodValue(attrs,
1502 result = _addLDAPmodValue(attrs,
1507 result = _addLDAPmodValue(attrs,
1554 result = _addLDAPmodValue(attrs, attr, value);
1561 if ((result != NSL_OK) && (*attrs != NULL))
1563 (void) ldap_mods_free(*attrs, 1);
1564 attrs = NULL;
1594 * Output: LDAPMod ***attrs - pointer to the constructed array
1603 char ***oldKVPList, LDAPMod ***attrs)
1617 ((attrList != NULL) && (attrList[0] != NULL)) && (attrs != NULL))
1619 *attrs = NULL;
1633 result = _addLDAPmodValue(attrs,
1637 result = _modLDAPmodValue(attrs,
1698 result = _modLDAPmodValue(attrs,
1723 result = _modLDAPmodValue(attrs,
1738 result = _modLDAPmodValue(attrs,
1748 result = _attrAddKVP(attrs, *oldKVPList, kvpExists);
1751 if ((result != NSL_OK) && (*attrs != NULL))
1753 (void) ldap_mods_free(*attrs, 1);
1754 *attrs = NULL;
2344 * Input: LDAPMod ***attrs - array to update
2355 _attrAddKVP(LDAPMod ***attrs, char **kvpList, int kvpExists)
2362 if (attrs != NULL)
2371 _modLDAPmodValue(attrs, ATTR_KVP, *kvpList);
2383 result = _modLDAPmodValue(attrs, ATTR_KVP, NULL);