support access through instance/2
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@899 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
514ef300e3
commit
a32d37c753
30
C/dbase.c
30
C/dbase.c
@ -3998,9 +3998,18 @@ p_instance(void)
|
|||||||
Term t1 = Deref(ARG1);
|
Term t1 = Deref(ARG1);
|
||||||
DBRef dbr;
|
DBRef dbr;
|
||||||
|
|
||||||
if (IsVarTerm(t1) || !IsDBRefTerm(t1))
|
if (IsVarTerm(t1) || !IsDBRefTerm(t1)) {
|
||||||
return (FALSE);
|
if (IsIntegerTerm(t1))
|
||||||
dbr = DBRefOfTerm(t1);
|
dbr = (DBRef)IntegerOfTerm(t1);
|
||||||
|
else
|
||||||
|
return (FALSE);
|
||||||
|
/* limited sanity checking */
|
||||||
|
if (dbr->id != FunctorDBRef) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dbr = DBRefOfTerm(t1);
|
||||||
|
}
|
||||||
if (dbr->Flags & LogUpdMask) {
|
if (dbr->Flags & LogUpdMask) {
|
||||||
op_numbers opc;
|
op_numbers opc;
|
||||||
LogUpdClause *cl = (LogUpdClause *)dbr;
|
LogUpdClause *cl = (LogUpdClause *)dbr;
|
||||||
@ -4041,9 +4050,18 @@ p_instance_module(void)
|
|||||||
Term t1 = Deref(ARG1);
|
Term t1 = Deref(ARG1);
|
||||||
DBRef dbr;
|
DBRef dbr;
|
||||||
|
|
||||||
if (IsVarTerm(t1) || !IsDBRefTerm(t1))
|
if (IsVarTerm(t1) || !IsDBRefTerm(t1)) {
|
||||||
return (FALSE);
|
if (IsIntegerTerm(t1))
|
||||||
dbr = DBRefOfTerm(t1);
|
dbr = (DBRef)IntegerOfTerm(t1);
|
||||||
|
else
|
||||||
|
return (FALSE);
|
||||||
|
/* limited sanity checking */
|
||||||
|
if (dbr->id != FunctorDBRef) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dbr = DBRefOfTerm(t1);
|
||||||
|
}
|
||||||
if (dbr->Flags & LogUpdMask) {
|
if (dbr->Flags & LogUpdMask) {
|
||||||
LogUpdClause *cl = (LogUpdClause *)dbr;
|
LogUpdClause *cl = (LogUpdClause *)dbr;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user