Test whether an object can be modified¶
ss_pers_iswritable
is a function defined in sspers.c.
Synopsis:
-
htri_t
ss_pers_iswritable
(ss_pers_t *pers)¶
Description: An object can be modified if it belongs to a scope that is modifiable. This function tests whether that is true.
Return Value: Returns true (positive) if pers
points to a persistent object that exists in a writable scope and false
otherwise. If pers
points to a persistent object that is not in memory (e.g., it’s file is not open or its
file has been subsequently closed) then this function returns false. Errors are indicated with a negative
return value.
Parallel Notes: Independent
Issues: Since the client can always obtain a pointer into memory for the object by dereferencing the link, there is nothing stopping the client from modifying that memory and setting the object’s dirty bit and since all of that can be done with straight C code (without SSlib assistance) it is impossible for SSlib to warn about that situation. However, a synchronization should be able to detect and report it.
See Also:
- Persistent Objects: Introduction for current chapter