oid_find_valid_insert
oid_find_valid_insert(oid[, offset[, flags]])
This function returns the nearest valid insertion point if the oid passed in is within generated text, a protected region, a text entity, or a protected change tracking region. The offset parameter is modified indirectly. The optional flags parameter controls the search and defaults to 0 (search forward).
• 0x1 — backward (search backward if set, otherwise forward)
• 0x2 — autoreverse (if search fails try the other direction)
• 0x4 — Returns an insertion point that is not read-only even if the location does not allow markup such as a comment or CDATA section. Otherwise, the function will disallow these areas.
If no valid insertion point is found, this function returns the null oid.