prt_api_init

Name

prt_api_init

Purpose

Initialize the PRT_API interface.

Description

The PRT_API initialization routine is responsible for initializing the interface between an application process and the PRT_API utilities. prt_api_init must be called by an application before any other PRT_API functions. If an application process wishes to be an interested process to PRT it must instead call one of the PRT interested process initialization routines prt_api_register_intproc or prt_api_register_dyn_intproc . If an application process wants to access the standard PRT_API routines as well as sign up as an interested PRT process it must call both PRT_API initialization routines.

Syntax

int prt_api_init (event_flag, rcv_req_flag, prt_system, cimp_sys, retstat)
COR_U4 event_flag;
COR_BOOLEAN rcv_req_flag;
Char *prt_system;
Char *cimp_sys;
COR_STATUS *retstat;

Data Structures

None

Arguments

Argument Description
Input
event_flag Message receipt event flag; not used if rcv_req_flag is FALSE
rcv_req_flag Receive requests flag; if TRUE, this indicates the application will receive requests from PRT Data Collector processes for item tracking data and serialized item hold information.
prt_system Name of the PRT data server to connect to. This parameter allows you to connect to different Production Tracking systems with the same API. You may also specify the prefix of all the data servers you wish to connect to. This allows the API to connect to multiple servers.
cimp_sys Name of the project or node where the PRT data collector(s) reside.
Output
* retstat Pointer to COR_STATUS structure

Return Value

Either COR_SUCCESS or COR_FAILURE .

If the function returns COR_FAILURE additional error information can be found in the COR_STATUS structure.

Error Codes

PRTI_MF_INIT_ERR Error initializing segment (Failure)
PRTI_CRESEG_ERR Error creating segment (Failure)
PRTI_BAD_MSG Error in segment (Failure)
PRTI_FILE_OPEN_ERR Error opening one of the configuration files (Failure)
PRTI_EMPTY_FILE Configuration file has no records (Failure)
PRTI_FILE_READ_ERR Error reading configuration file (Failure)
PRTI_REG_DEF_MISSING Undefined Region in file (Failure)
PRTI_GRP_DEF_MISSING Undefined Group in file (Failure)
PRTI_REGION_NOT_IN_GROUP Region does not belong to any group (Failure)
PRTI_GROUP_HAS_NO_REGIONS Group does not 'own' any regions (Failure)
PRTI_CFG_NO_ROUTE Route has no source and no destination region (Failure)
PRTI_ITEM_TYPE_NDEF Item type identifier not valid (Failure)
PRTI_ROUTE_NDEF Non-exist. route in PRT_INV_TYPE (Failure)
PRTI_INV_EXPLICIT_ROUTE Can't deny explicit item-route (Failure)
PRTI_NO_TYPE_FOR_ROUTE Denied type not on route (Failure)
PRTI_SVC_DEF_MISSING Undefined Service in file (Failure)
PRTI_BAD_SVC_NAME Bad service name (no underscore) (Failure)
PRTI_XLATE_ERR Error in ipc_xlate getting physical addr (Failure)
PRTI_AUX_NAM_ERR Error in ipc_aux_nam (Failure)
PRTI_ADD_PORT_ERR Error in ipc_add_port (Failure)
PRTI_WRITE_PORT_ERR Error in ipc_write_port (Warn/Fail)