trm_get_access()

Purpose

Obtains the user's access level

Old name

#define get_access trm_get_access

Syntax

int trm_get_access(void);

Description

The trm_get_access() function retrieves the user's access level as given in the file USERDATA.SYS. You do not need to include the file USERDATA.SYS to use this function.

The write access is returned in the high-order byte and the read access in the low-order byte.

If the function trm_read_user() has been called, you can directly read the read_access and write_access fields from the user record.

Return values

Returns the access level

See also

trm_read_user()

Example

/*
C Functions Reference Manual
----------------------------
Filename: TRM_GET_.C
Example: trm_get_access
Purpose: Simple program to display the access
levels
*/

/*
#db salesord
#c
#end
*/

#include "dp4.h"
#include "trm_get_.h"
/* generate this file by running LIBMAKE */
void process()
{
int n;
map_datamap(1);
n = trm_get_access();
map_datamap(2);
show_h(2,1,(n > 8) & 0x00ff);
/* display write access */
show_h(2,2,n & 0x00ff);
/* display read access */
}