+Gom_ctxt dup_gom_ctxt(Gom_ctxt ctxt, int ctxt_type)
+{
+ return make_gom_ctxt(ctxt_type, ctxt->obj_type, ctxt->ctxt_ptr);
+}
+
+int ctxt_type(Gom_ctxt ctxt)
+{
+ return ctxt->ctxt_type;
+}
+
+OBJ_TYPE ctxt_obj_type(Gom_ctxt ctxt)
+{
+ return ctxt->obj_type;
+}
+
+void* safe_ctxt_cast(Gom_ctxt ctxt, OBJ_TYPE type, const char* file, int line)
+{
+ if (ctxt->obj_type != type) {
+ gom_cast_error(file, line, type, ctxt->obj_type);
+ }
+ return ctxt->ctxt_ptr;
+}
+