home *** CD-ROM | disk | FTP | other *** search
-
- /*
- *
- * Description
- * Remove the named property from a property list.
- *
- * Output
- *
- * Input
- * Obj Pointer to object structure from which to remove prop.
- * PropName Name of property to be removed.
- *
- * Diagnostics
- * Returns 0 if successful, -1 if named property is not found.
- *
- * Author
- * Randi J. Rost
- * Digital Equipment Corp.
- * Workstation Systems Engineering
- * Palo Alto, CA
- *
- * History
- * 17-Nov-86 Created
- *
- */
-
- #include <stdio.h>
- #include "off.h"
-
- OFFRemoveProperty(Obj, PropName)
- OFFObjDesc *Obj; /* Pointer to object */
- char *PropName; /* Name of property to be deleted */
-
- {
- OFFProperty **ppProp;
- OFFProperty *nextProp;
-
- ppProp = &(Obj->FirstProp);
- while (*ppProp != NULL)
- {
- if (strcmp(PropName, (*ppProp)->PropName) != 0)
- {
- nextProp = (*ppProp)->NextProp;
- OFFFreeProperty(*ppProp);
- (*ppProp) = nextProp;
- return(0);
- }
- ppProp = &((*ppProp)->NextProp);
- }
-
- fprintf(stderr,
- "OFFRemoveProperty: specified property not in property list\n");
- return(-1);
-
- }
-