/*-------------------------------------------------------------------------* * PL_CURRENT_ATOM_2 * * * *-------------------------------------------------------------------------*/ Bool Pl_Current_Atom_2(WamWord atom_word, WamWord hide_word) { WamWord word, tag_mask; Bool hide; int atom; hide = Pl_Rd_Integer_Check(hide_word); DEREF(atom_word, word, tag_mask); if (tag_mask != TAG_REF_MASK) return *Pl_Rd_String_Check(word) != '$' || !hide; atom = -1; for (;;) { atom = Pl_Find_Next_Atom(atom); if (atom == -1) return FALSE; if (!hide || pl_atom_tbl[atom].name[0] != '$') break; } /* non deterministic case */ A(0) = atom_word; A(1) = hide; A(2) = atom; Pl_Create_Choice_Point((CodePtr) Prolog_Predicate(CURRENT_ATOM_ALT, 0), 3); return Pl_Get_Atom(atom, atom_word); }
/*-------------------------------------------------------------------------* * PL_DEFINE_MATH_BIP_2 * * * * Called by compiled prolog code. * *-------------------------------------------------------------------------*/ void Pl_Define_Math_Bip_2(WamWord func_word, WamWord arity_word) { char *cur_bip_func; int cur_bip_arity; cur_bip_func = Pl_Rd_String_Check(func_word); cur_bip_arity = Pl_Rd_Integer_Check(arity_word); Pl_Set_C_Bip_Name(cur_bip_func, cur_bip_arity); }
/*-------------------------------------------------------------------------* * PL_ATOM_CODES_2 * * * *-------------------------------------------------------------------------*/ Bool Pl_Atom_Codes_2(WamWord atom_word, WamWord codes_word) { WamWord word, tag_mask; DEREF(atom_word, word, tag_mask); if (tag_mask != TAG_REF_MASK) return Pl_Un_Codes_Check(Pl_Rd_String_Check(word), codes_word); return Pl_Un_String_Check(Pl_Rd_Codes_Check(codes_word), atom_word); }