/*************************************************** NAME : SlotPublicP DESCRIPTION : Determines if a slot is public INPUTS : 1) The class 2) The slot name RETURNS : True if slot is public, false otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ bool SlotPublicP( Defclass *theDefclass, const char *slotName) { SlotDescriptor *sd; Environment *theEnv = theDefclass->header.env; if ((sd = LookupSlot(theEnv,theDefclass,slotName,false)) == NULL) return false; return(sd->publicVisibility ? true : false); }
/*************************************************** NAME : SlotInitableP DESCRIPTION : Determines if a slot is initable INPUTS : 1) The class 2) The slot name RETURNS : True if slot is initable, false otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ bool SlotInitableP( Defclass *theDefclass, const char *slotName) { SlotDescriptor *sd; Environment *theEnv = theDefclass->header.env; if ((sd = LookupSlot(theEnv,theDefclass,slotName,true)) == NULL) return false; return((sd->noWrite && (sd->initializeOnly == 0)) ? false : true); }
/*************************************************** NAME : EnvSlotPublicP DESCRIPTION : Determines if a slot is public INPUTS : 1) The class 2) The slot name RETURNS : TRUE if slot is public, FALSE otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ globle intBool EnvSlotPublicP( void *theEnv, void *theDefclass, const char *slotName) { SLOT_DESC *sd; if ((sd = LookupSlot(theEnv,(DEFCLASS *) theDefclass,slotName,FALSE)) == NULL) return(FALSE); return(sd->publicVisibility ? TRUE : FALSE); }
/*************************************************** NAME : EnvSlotInitableP DESCRIPTION : Determines if a slot is initable INPUTS : 1) The class 2) The slot name RETURNS : TRUE if slot is initable, FALSE otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ globle intBool EnvSlotInitableP( void *theEnv, void *theDefclass, const char *slotName) { SLOT_DESC *sd; if ((sd = LookupSlot(theEnv,(DEFCLASS *) theDefclass,slotName,TRUE)) == NULL) return(FALSE); return((sd->noWrite && (sd->initializeOnly == 0)) ? FALSE : TRUE); }
/*************************************************** NAME : EnvSlotDirectAccessP DESCRIPTION : Determines if a slot is directly accessible from message-handlers on class INPUTS : 1) The class 2) The slot name RETURNS : TRUE if slot is directly accessible, FALSE otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ globle intBool EnvSlotDirectAccessP( void *theEnv, void *theDefclass, char *slotName) { SLOT_DESC *sd; if ((sd = LookupSlot(theEnv,(DEFCLASS *) theDefclass,slotName,TRUE)) == NULL) return(FALSE); return((sd->publicVisibility || (sd->cls == (DEFCLASS *) theDefclass)) ? TRUE : FALSE); }
/*************************************************** NAME : SlotDirectAccessP DESCRIPTION : Determines if a slot is directly accessible from message-handlers on class INPUTS : 1) The class 2) The slot name RETURNS : True if slot is directly accessible, false otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ bool SlotDirectAccessP( Defclass *theDefclass, const char *slotName) { SlotDescriptor *sd; Environment *theEnv = theDefclass->header.env; if ((sd = LookupSlot(theEnv,theDefclass,slotName,true)) == NULL) return false; return((sd->publicVisibility || (sd->cls == theDefclass)) ? true : false); }
/*************************************************** NAME : EnvSlotDefaultP DESCRIPTION : Determines if a slot has a default value INPUTS : 1) The class 2) The slot name RETURNS : TRUE if slot is public, FALSE otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ globle int EnvSlotDefaultP( void *theEnv, void *theDefclass, char *slotName) { SLOT_DESC *sd; if ((sd = LookupSlot(theEnv,(DEFCLASS *) theDefclass,slotName,FALSE)) == NULL) return(NO_DEFAULT); if (sd->noDefault) { return(NO_DEFAULT); } else if (sd->dynamicDefault) { return(DYNAMIC_DEFAULT); } return(STATIC_DEFAULT); }
/*************************************************** NAME : SlotDefaultP DESCRIPTION : Determines if a slot has a default value INPUTS : 1) The class 2) The slot name RETURNS : True if slot is public, false otherwise SIDE EFFECTS : None NOTES : None ***************************************************/ int SlotDefaultP( Environment *theEnv, Defclass *theDefclass, const char *slotName) { SlotDescriptor *sd; if ((sd = LookupSlot(theEnv,theDefclass,slotName,false)) == NULL) return(NO_DEFAULT); if (sd->noDefault) { return(NO_DEFAULT); } else if (sd->dynamicDefault) { return(DYNAMIC_DEFAULT); } return(STATIC_DEFAULT); }