Skip to content

214B GetUserName

In progress   MON 214B (140 decimal) · Mnemonic GUSNA · Group: File Operations (manual section 2.4)

Available from: All programs (manual compatibility box)

Emulation source: src/handlers/mon_214B_GetUserName.c

Description

Gets the name of a user. The user may be on a remote computer if the COSMOS network is installed. The remote system name is then returned.

  • RT programs return the name of user RT.

Parameters

Name Type Direction Description
UserName STRING Out Buffer to receive user name (16 chars).
DirectoryIndex INTEGER In Directory index.
UserIndex INTEGER In User index.
RemoteFlag INTEGER Out 0 if local user, 1 if remote user.
RemoteSystem STRING Out Remote system identification string (optional, 64 chars).

Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.

See also

GetUserEntry, ExecutionInfo

Compatibility

Machines Users Programs
ND-100 and ND-500 All users All programs

The manual's compatibility box for this call, word for word.

Yes/no fields from the YAML extraction (not in the manual's words):

ND-100 ND-500 User programs RT programs System programs
Yes Yes Yes Yes No

Examples

From the manual (OCR text, not corrected).

INTEGER : DirectoryIndex, UserIndex, RemoteFlag
BYTES : UserName(0:15), RemoteSystem(0:63)
...
ON ROUTINEERROR DO
  IF ErrCode >< 0 THEN ...
ENDON
Monitor_Call('GetUserName', UserName, DirectoryIndex, UserIndex,&
  RemoteFlag, RemoteSystem)
INTEGER DirIndex, UserIndex, RemoteFlag
CHARACTER UserName*16, RemoteSystem*64
...
Monitor_Call('GetUserName', UserName(1:16), DirIndex, UserIndex,
             RemoteFlag, RemoteSystem(1:64))
IF (ErrCode .NE. 0) THEN ...
DirectoryIndex, UserIndex : INTEGER2;
UserName : PACKED ARRAY [0..15] OF CHAR;
...
FindUserName(UserName, DirectoryIndex, UserIndex); [Note routine name.]
IF ErrCode <> 0 THEN ...
01 DirectoryIndex COMP.
01 UserIndex COMP.
01 UserName PIC X(16).
01 RemoteFlag COMP.
01 RemoteSystem PIC X(64).
01 ErrCode COMP.
...
MONITOR-CALL "GetUserName" USING UserName, DirectoryIndex, UserIndex,
              RemoteFlag, RemoteSystem.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
DirectoryIndex : W BLOCK 1
UserIndex : W BLOCK 1
UserName : STRING 16
SysId : STRING 16   %Optional parameter for remote system.
ErrCode : W BLOCK 1
GetUserName : EQU 37B9 + 214B
...
CALLG GetUserName, 3, UserName, DirectoryIndex, UserIndex
  IF K GO ERROR
...
ERROR : W1 =: ErrCode  %ErrorCode in W1 register.
LDA (USER           %Address of string to receive user name.
LDX INDEX           %Left byte: Dir index. Right byte: User index.
LDT (REMID          %Remote identification if bit 15 in register X.
MON 214             %Monitor call GetUserName.
JMP ERROR           %Error return from monitor call.
...                 %Normal return.
ERROR, ...          %Error number in register A.
...

USER, 0             %A string of 16 characters.
*+10/
INDEX, ...          %Set bit 15 if remote user.
REMID, 0            %Remote system identification string.
*+32/

ndmonlib implementation

In progress Registered MON_STATUS_IN_PROGRESS: partly implemented. The dispatcher calls the handler.

Handler mon_214B_GetUserName
Code lines 31 (non-blank, non-comment lines in the file)

Notes from the handler source

src/handlers/mon_214B_GetUserName.c line 22

Carve-verified contract (006-S3FS:105301B): returns the name of the user
identified by (DirectoryIndex, UserIndex) into a 16-char output buffer, plus a
RemoteFlag (0 = local). The ND LINKER uses it in a two-pass file search
(current user, then (SYSTEM)). We return the emulator's current user name
(space-padded to 16 chars), RemoteFlag = 0.

src/handlers/mon_214B_GetUserName.c line 43

Write the user name to arg0, upper-cased and SPACE-padded to 16 chars
(SINTRAN string convention - no NUL terminator, blank-filled).

Source

SINTRAN III Monitor Calls (ND-860228.2 EN), page 299.