/******************************************************************************* Copyright by Telesoft Europe AB 1990, 1991. Copyright by Telelogic Malmoe AB 1991, 1992, 1993, 1994. Copyright by Telelogic AB 1994 - 2001. This Program is owned by Telelogic and is protected by national copyright laws and international copyright treaties. Telelogic grants you the right to use this Program on one computer or in one local computer network at any one time. Under this License you may only modify the source code for the purpose of adapting it to your environment. You must reproduce and include any copyright and trademark notices on all copies of the source code. You may not use, copy, merge, modify or transfer the Program except as provided in this License. Telelogic does not warrant that the Program will meet your requirements or that the operation of the Program will be uninterrupted and error free. You are solely responsible that the selection of the Program and the modification of the source code will achieve your intended results and that the results are actually obtained. *******************************************************************************/ /* # clearcase access.pr@@/main/4 : 2001/06/20 pon */ newtype Access literals NotUsed; operators GetPID : CharString, integer -> PId; /* Returns the PId value of a process instance par 1: the name of the process type par 2: instance number of the process instance */ ActivePID : integer -> PId; /* Return the PId of the process that executes. Returns NULL if no process executes. Observer processes are not taken into account. The integer parameter is a dummy parameter needed since operators must have parameters. */ GetState : PId -> CharString; /* Returns the name of the current state of a process instance (or previous if the process is not in a state) par 1: the pid of the process instance */ GetNoOfInst: charstring -> integer; /* Returns the number of instances for a particular process type par 1: the name of the process type */ terminated: PId -> boolean; /* Returns true if the process instance is terminated otherwise false par 1: The PId value of the process instance */ GetProcedure: PId -> charstring; /* Returns the name of the procecure a process instance currently has called. If no procedure is called 'none' is returned par 1: The PId value of the process instance */ InProcedure: PId, CharString -> boolean; /* Returns true if a process instance currently executes in a specific procedure, otherwise false par 1: The PId value of the process instance par 2: The name of the procedure */ GetNoOfSignals: PID -> integer; /* Returns the number of signals currently in the input port of a process. par 1: The PId value of the process instance */ GetSignalType: PId, integer -> charstring; /* Returns the name of the signal type for a signal in the input port of a process instance par 1: The PId value of the process instance. par 2: A number (>=1) identifying the signal */ InQueue: PId, charstring -> boolean; /* Returns true if a process instance currently has a signal of a specific type in its input port queue par 1: The PId value of the process instance. par 2: The name of the signal type. */ EnvOutput : CharString -> Boolean; /* Returns true if the transition currently executing is caused by a signal from the environment with a specified name, otherwise false par 1: The name of the signal type */ /* Variable access functions. These functions return a variable value (or component of a variable value, cmp below) that corresponds to one of the variables of a process instance as specified by the parameters. par 1: The PId value of the process instance. par 2: Variable name */ v /*#NAME 'XVNAME2(SDL_Integer)'*/ : PId, charstring -> integer; /*#OP (H)*/ vInteger /*#NAME 'XVNAME2(SDL_Integer)'*/ : PId, charstring -> integer; /*#OP (H)*/ v /*#NAME 'XVNAME2(SDL_Real)'*/ : PId, charstring -> real; /*#OP (H)*/ vReal /*#NAME 'XVNAME2(SDL_Real)'*/ : PId, charstring -> real; /*#OP (H)*/ v /*#NAME 'XVNAME2(SDL_Boolean)'*/ : PId, charstring -> boolean; /*#OP (H)*/ vBoolean /*#NAME 'XVNAME2(SDL_Boolean)'*/ : PId, charstring -> boolean; /*#OP (H)*/ v /*#NAME 'XVNAME2(SDL_Character)'*/ : PId, charstring -> Character; /*#OP (H)*/ vCharacter /*#NAME 'XVNAME2(SDL_Character)'*/ : PId, charstring -> Character; /*#OP (H)*/ v /*#NAME 'XVNAME2(SDL_Time)'*/ : PId, charstring -> Time; /*#OP (H)*/ vTime /*#NAME 'XVNAME2(SDL_Time)'*/ : PId, charstring -> Time; /*#OP (H)*/ v /*#NAME 'XVNAME2(SDL_Duration)'*/ : PId, charstring -> Duration; /*#OP (H)*/ vDuration /*#NAME 'XVNAME2(SDL_Duration)'*/ : PId, charstring -> Duration; /*#OP (H)*/ v /*#NAME 'XVNAME2(SDL_Charstring)'*/ : PId, charstring -> Charstring; /*#OP (H)*/ vCharstring /*#NAME 'XVNAME2(SDL_Charstring)'*/ : PId, charstring -> Charstring; /*#OP (H)*/ v /*#NAME 'XVNAME2(SDL_PId)'*/ : PId, charstring -> PId; /*#OP (H)*/ vPId /*#NAME 'XVNAME2(SDL_PId)'*/ : PId, charstring -> PId; /*#OP (H)*/ /*#ADT(B) #TYPE #ifndef XVALIDATOR_LIB ERROR__data_type_cannot_be_used_by_SDT_Simulator #endif #ifdef XUSE_GENERIC_FUNC #define XVVar(P,CS,R) xVarVal( P, CS )) #define XVNAME(sortname) (( sortname * )XVVar #define XVVar2(P,CS) xVarVal( P, CS )) #define XVNAME2(sortname) (*( sortname * )XVVar2 #else #define XVVar(P,CS) xVarVal( P, CS )) #define XVNAME(sortname) (*( sortname * )XVVar #define XVNAME2(sortname) (*( sortname * )XVVar #endif #define XVV(P,CS,S) XVNAME(S)(P,xStr2SDL(CS)) #define XVV2(P,CS,S) XVNAME2(S)(P,xStr2SDL(CS)) #define XXREPORT(S) xAssertError((S)+1) #BODY SDL_PId #SDL(GetPID) ( SDL_Charstring str, SDL_integer i ) { return xFindPId( str+1, i ); } SDL_PId #SDL(ActivePID) ( SDL_integer dummy ) { return xGenActivePrs; } SDL_Charstring #SDL(GetState) ( SDL_PId P ) { char * StateName; StateName = xGetState( P ); return xStr2SDL(StateName); } SDL_Integer #SDL(GetNoOfInst) ( SDL_Charstring str ) { return xGetNoOfInstStr(str+1); } SDL_Boolean #SDL(terminated) ( SDL_PId P ) { return xTerminated(P); } SDL_Charstring #SDL(GetProcedure) ( SDL_PId P ) { char * str; str = xGetProcedure( P ); if (str) { return xStr2SDL(str); } else { return xStr2SDL("none"); } } SDL_Boolean #SDL(InProcedure) ( SDL_PId P, SDL_Charstring str ) { return xEq_SDL_Charstring(#SDL(GetProcedure)(P),str); } SDL_Integer #SDL(GetNoOfSignals) ( SDL_PId P ) { return xGetNoOfSignals( P ); } SDL_Charstring #SDL(GetSignalType) ( SDL_PId P, SDL_Integer i ) { char * str; str = xGetSignalType( P, i ); if (str) { return xStr2SDL(str); } else { return xStr2SDL(""); } } SDL_Boolean #SDL(InQueue) ( SDL_PId P, SDL_Charstring str ) { return xInQueue( P, str+1 ); } SDL_Boolean #SDL(EnvOutput) ( SDL_Charstring str ) { return xEnvOutput( str+1 ); } */ endnewtype Access; procedure Report /*#NAME 'XXREPORT'*/; fpar str CharString; external; /* Generates a validator report par 1: The report text */ /*#CODE #SDL(Report) this will get rid of warning Report : procedure not used */