DeleteBinderyObjectFromSet
Deletes a bindery object from a property of type Set (For cross-platform functionality, see Developing NLMs with Cross-Platform Functions ( NDK: NLM Development Concepts, Tools, and Functions) and call NWDeleteObjectFromSet )
#include <\nlm\nit\nwbindry.h>
int DeleteBinderyObjectFromSet (
char *objectName,
WORD objectType,
char *propertyName,
char *memberName,
WORD memberType);
The objectName, objectType, and propertyName parameters must uniquely identify a bindery object’s properties. These parameters must not contain wildcard characters. The property must be of type Set. The objectName can be from 1 to 48 characters long, including the NULL terminator. The propertyName can be from 1 to 16 characters long, including the NULL terminator. Only printable characters can be used. Slashes, backslashes, colons, semicolons, commas, asterisks, and question marks are prohibited.
The memberName and memberType parameters must uniquely identify the bindery object to be deleted and must not contain wildcard characters.
This function searches consecutive segments of the property’s value for a unique object ID that matches the unique object ID of the member to be deleted. When the member is found it is deleted. The remaining IDs in the segment are shifted and the last previously used slot in the segment is filled with zeros. This ensures that IDs within a segment are packed. However, IDs are not packed between segments.
#include <stdio.h>
#include <\nlm\nit\nwbindry.h>
main()
{
int completionCode;
char objectName[48];
char propertyName[16];
char memberName[48];
WORD objectType, memberType;
strcpy (objectName, "SUPERVISOR");
objectType = OT_USER;
strcpy (propertyName, "BASEBALL_TEAM");
strcpy (memberName, "PROSE");
memberType = OT_USER;
if (completionCode)
switch (completionCode)
{
case 150:
printf ("SERVER OUT OF MEMORY\n");
break;
case 234:
printf ("NO SUCH MEMBER\n");
break;
case 235:
printf ("NOT GROUP PROPERTY\n");
break;
case 240:
printf ("WILDCARD NOT ALLOWED\n");
break;
case 248:
printf ("NO PROPERTY WRITE PRIVILEGE\n");
break;
case 251:
printf ("NO SUCH PROPERTY\n");
break;
case 252:
printf ("NO SUCH OBJECT\n");
break;
case 254:
printf ("SERVER BINDERY LOCKED\n");
break;
case 255:
printf ("BINDERY FAILURE\n");
break;
case default:
printf ("completionCode = %d\n",
completionCode);
break;
}
else
printf ("SUCCESSFULLY deleted member %s from %s\n",
memberName, propertyName);
}