RCFLG

Control the receive option flags

 

 

USupported on UNIX
VSupported on OpenVMS
xcall RCFLG(flags[, control])

Arguments

flags

The receive option flags. Each flag is a single digit, and the digit positions are assigned ordinal numbers from right to left. Thus, the low-order digit is digit number one. Synergy DBL examines the flags value digit by digit to determine which flags are set, and hence, which functions are to be performed. The Discussion contains a detailed description of the flags and their meanings. (n)

control

(optional) A value that controls how the individual digit positions in the flag specification value are interpreted. If control is not specified, each digit in flags is interpreted as follows: (n)

0

Reset the associated flag.

1

Set the associated flag.

n

Leave the associated flag unmodified, where n is any other decimal number.

We recommend that you use the control value when setting and resetting your flags values. If control is present, its value is interpreted as follows:

0

Reset all flags whose corresponding digit position contains a nonzero number. Don’t modify the other flags.

1

Set all flags whose corresponding digit position contains a nonzero number. Don’t modify the other flags.

2

Set flags to a value that reflects the current settings of the flags and leave all flags unmodified. Each digit of the flags variable is set to zero if the associated flag is currently reset or to one if the flag is set. If the length of the variable is less than three characters, the settings are returned as in a decimal-to-decimal assignment. (See Moving decimal/packed data to a decimal/packed destination for more information about decimal-to-decimal assignments.)

Discussion

The RCFLG subroutine controls the settings for the receive option flags, which affect how a RECV statement searches for local, group, and global message queues.

Synergy DBL interprets the flags argument as if it were storing it to a d3 variable. All rules that apply when storing to a decimal variable apply here. For example, if you specify

xcall rcflg(01)

Synergy DBL interprets your argument as 001. (All flags corresponding to these zeros are cleared.)

The Synergy DBL message facilities maintain the following queues for messages:

Normally, when a Synergy program executes a RECV statement, the message controller begins searching for the requested message ID in the local queue for that process. If it can’t find a message that matches the ID, the message controller searches first in the group queue and finally in the system-wide global message queue. If the requested ID is not found in any of the queues, the RECV statement transfers control to a specified label.

The RCFLG subroutine enables you to change the searching algorithm of the message controller by setting one or more flags. Remember that the rightmost digit in the flag specification string corresponds to flag number one, as shown in figure 1.

1. RCFLG terminal-oriented flags.

The following list describes the flags in more detail. The initial state of the search flags is zero (reset).

Flags for RCFLG

Flag

Description

1

When flag 1 is set, the message controller won’t search for the message ID in the local message queue.

2

When flag 2 is set, the message controller won’t search for the message ID in the group message queue.

3

When flag 3 is set, the message controller won’t search for the message ID in the global message queue.

Examples

The following subroutine restricts message queue access depending on the user’s security level.

subroutine securmsg
    a_securlvl          ,d2             ;Security level: 1-local only
.define NO_LOCAL        ,1              ; 2-group and local, 
.define NO_GROUP        ,10             ; 3-local, group, and global
.define NO_GLOBAL       ,100
proc
    xcall rcflg(111,0)                  ;Clear flags
    case a_securlvl of
      begincase
        xcall rcflg(NO_GROUP + NO_GLOBAL, 1)
        xcall rcflg(NO_GLOBAL, 1)
        nop
      endcase
    return
endsubroutine