?? RIGHT := 110 ??
*copyc osd$default_pragmats
?? NEWTITLE := 'NOS/VE PTF Application : Verify Family' ??

MODULE nfm$verify_family;

{
{ PURPOSE:
{   This module contains a procedure to check if a family
{   is registered on the local mainframe.
{

?? NEWTITLE := '  Global Declarations', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc ost$status
?? POP ??
*copyc dfp$locate_served_family
*copyc osp$get_set_name

?? TITLE := '  [XDCL, #GATE] nfp$verify_family', EJECT ??
{
{     The purpose of this request is to determine if the specified family name
{ is an active family on the local NOS/VE mainframe.  For the purpose of this
{ routine a family served by the file server is viewed as local.
{
{       NFP$VERIFY_FAMILY (FAMILY_NAME, FAMILY_IS_LOCAL, STATUS)
{
{ FAMILY_NAME: (input)  This parameter specifies the name of the family being
{       checked.
{
{ FAMILY_IS_LOCAL: (output)  This parameter is a boolean value that specifies
{       whether the family is active on the local mainframe.
{
{ STATUS: (output)  This parameter specifies the request status.
{       CONDITIONS: none.
{

  PROCEDURE [XDCL, #GATE] nfp$verify_family (family_name: ost$family_name;
    VAR family_is_local: BOOLEAN;
    VAR status: ost$status);

    VAR
      file_server_family: boolean,
      served_family_table_index: dft$served_family_table_index,
      server_mainframe_id: pmt$binary_mainframe_id,
      p_queue_interface_table: dft$p_queue_interface_table,
      queue_index: dft$queue_index,
      server_state: dft$server_state,

      local_status: ost$status,
      set_name: stt$set_name;


    status.normal := TRUE;
    dfp$locate_served_family (family_name, file_server_family, served_family_table_index,
           server_mainframe_id, p_queue_interface_table, queue_index, server_state);
    IF file_server_family THEN
      family_is_local := TRUE;
      RETURN;
    IFEND;

    local_status.normal := TRUE;
    osp$get_set_name (family_name, set_name, local_status);
    IF local_status.normal THEN
      family_is_local := TRUE;
    ELSEIF local_status.condition = pfe$unknown_family THEN
      family_is_local := FALSE;
    ELSE
      status := local_status;
    IFEND;

  PROCEND nfp$verify_family;

MODEND nfm$verify_family;

