
?? SET (LISTCTS := OFF) ??
?? LEFT := 1, RIGHT := 110 ??
?? FMT (FORMAT := ON, keyw := upper, ident := lower) ??
?? NEWTITLE := 'NOS/VE: Program Control - Job Local Queues' ??
?? NEWTITLE := '  pmm$manage_local_queues - Global System Declarations' ??
MODULE pmm$status_queues_defined;
{   PURPOSE:
{     The purpose of this module is to provide the interface to
{     pmp$status_queues_defined (See: NOS/VE Program Interface ERS - Program
{     Communications) and to declare the queue definition table in the
{     task shared SECTION.

{   DESIGN:
{     The procedure contained in this module is designed to execute with
{     an execution bracket of 1, 13 and a call bracket of 13.
?? EJECT ??
?? SET (LIST := OFF) ??
*copyc OST$STATUS
*copyc OSD$VIRTUAL_ADDRESS
*copyc OST$WAIT
*copyc PMK$KEYPOINTS
?? SET (LIST := ON) ??

*copyc PMD$LOCAL_QUEUES
?? TITLE := '  pmm$status_queues_defined - Global External Procedures' ??
?? EJECT ??
?? TITLE := '  pmm$status_queues_defined - Internal Declarations' ??
?? EJECT ??

*copyc PMT$QUEUE_DEFINITION
?? TITLE := '  [XDCL] pmv$queue_definition_table' ??
?? EJECT ??

  CONST
    unlocked = 0;

*copyc OSS$TASK_SHARED

  VAR
    pmv$queue_definition_table: [XDCL, oss$task_shared] record
      definition_lock: ost$signature_lock,
      queues: ^pmt$queue_definition_table, {NIL = local queues undefined}
    recend := [[unlocked], NIL];

?? TITLE := '  pmm$status_queues_defined - External Procedures' ??
?? EJECT ??
?? TITLE := '  [XDCL, #gate] pmp$status_queues_defined' ??
?? EJECT ??

  PROCEDURE [XDCL, #GATE] pmp$status_queues_defined (VAR count: pmt$queues_per_job;
    VAR status: ost$status);
*copyc PMH$STATUS_QUEUES_DEFINED

    VAR
      q_index: pmt$queues_per_job,
      number_defined: pmt$queues_per_job;

    status.normal := TRUE;
    #INLINE ('keypoint', osk$entry, 0, pmk$status_queues_defined);
    count := 0;
    number_defined := 0;
    IF (pmv$queue_definition_table.queues <> NIL) THEN
      FOR q_index := LOWERBOUND (pmv$queue_definition_table.queues^) TO UPPERBOUND
            (pmv$queue_definition_table.queues^) DO
        IF (pmv$queue_definition_table.queues^ [q_index].definition <> NIL) THEN
          number_defined := number_defined + 1;
        IFEND;
      FOREND;
    IFEND;
    count := number_defined;
    #INLINE ('keypoint', osk$exit, 0, pmk$status_queues_defined);
  PROCEND pmp$status_queues_defined;
MODEND pmm$status_queues_defined;
