added spn_ctx_*objdata functions to load and execute object data from buffer
fixed C89 incompatibility and incorrect NULL check