1 DENLIB

    DENLIB is a library of useful subroutines and functions supplied by
the Denison University Computer Center.  Many of these subroutines
implement system-dependent features.  Each function is defined under its
own heading.  Those functions which require special care in their use
have additional comments as subheadings.  Most of these routines will
not change, but no absolute commitment is made on this point. 

    The Denison University Computer Center cannot presently support
this library, and any errors incurred are therefore the responsibility
of the user.  However, the Computer Center would greatly appreciate the
reporting of any errors encountered in the use of this library. 

2 BASIC

    All functions and subroutines in DENLIB are capable of handling
both static and dynamic strings.  In some string functions the length
of the actual string returned varies considerably depending on the
input.  An example of a string function declaration is: 

EXTERNAL STRING FUNCTION BASE_STRING

    All integers or integer functions, in or accessed by DENLIB, are
longword integers.  If the default integer size is changed for
compilation, then the integer functions and integers used by and
provided by DENLIB must be declared to be of type LONG.  An example of
an integer function declaration is: 

EXTERNAL LONG FUNCTION DAY_OF_WEEK

    Examples of the BASIC language definitions and calling procedures
for all functions and subroutines provided by DENLIB are contained in
the text library SYS$LIBRARY:DENLIB.TLB under the heading DENLIBBAS .
This sample program may be extracted with the system command: 

LIBRARY/TEXT/EXTRACT=DENLIBBAS/OUTPUT=DENLIBBAS.BAS SYS$LIBRARY:DENLIB

2 FORTRAN

    The returned string for each of the character functions provided by
DENLIB has a maximum length.  However, depending on input values, the
portion of the maximum length used can vary considerably. The maximum
lengths of the character functions are described in their respective
sections.  An example of a character function declaration is: 

CHARACTER*12 USER_NAME

    The integers and integer functions provided and referenced by
DENLIB are four byte or longword integers and should be defined as
such.  An example of an integer function declaration is: 

INTEGER*4 UIC_NUMBER

    Note that even though some functions in DENLIB require no
parameters, the parentheses must still be used to distinquish functions
from variables.  For example: 

I = UIC_NUMBER()

    Examples of the FORTRAN language definitions and calling procedures
for all functions and subroutines provided by DENLIB are contained in
the text library SYS$LIBRARY:DENLIB.TLB under the heading DENLIBFOR .
This sample program may be extracted with the system command: 

LIBRARY/TEXT/EXTRACT=DENLIBFOR/OUTPUT=DENLIBFOR.FOR SYS$LIBRARY:DENLIB

2 PASCAL

    PASCAL does not have external functions and subroutines in its
language definition.  All external functions and subroutines used are 
therefore non-standard features.  The /NOSTANDARD qualifier must be used 
when compiling any PASCAL programs using these subroutines.  Refer to 
the PASCAL Language Reference Manual, Chapter 6, and the PASCAL User's 
Guide, Chapter 6, for further information on creating and using external
procedures and function. 

    String functions require special care in PASCAL.  See the subtopic 
on strings if you wish to use a string function.

    Integer functions provided by DENLIB may be accessed as functions in 
PASCAL.  An example of an integer function declaration is: 

FUNCTION UIC_NUMBER:INTEGER; EXTERN;

    Examples of the PASCAL language definitions and calling procedures
for all functions and subroutines provided by DENLIB are contained in
the text library SYS$LIBRARY:DENLIB.TLB under the heading DENLIBPAS .
This sample program may be extracted with the system command: 

LIBRARY/TEXT/EXTRACT=DENLIBPAS/OUTPUT=DENLIBPAS.PAS SYS$LIBRARY:DENLIB

3 STRINGS

    String functions do not exist in VAX-11 PASCAL version V1.0-1.  
However, these functions can be used if the function is called with a 
procedure mechanism.  This method of accessing these functions works 
only because of the manner in which the compiler was written and is not 
a feature of the language.  It is unlikely that this method will fail in 
the future but no guarantee is made on this point.  Future versions of 
PASCAL will probably correct this omission.  A temporary string is 
created by the calling procedure and then passed using the %STDESCR 
mechanism as the FIRST parameter.  Upon return the called function sets 
the string indicated by the FIRST parameter to the function value.  An
example of a string function being defined and used as a procedure is:

PROGRAM EXAMPLE ( INPUT, OUTPUT );

TYPE
	STRING_12 = PACKED ARRAY [1..12] OF CHAR;
VAR
	TEMP_STR : STRING_12;

PROCEDURE USER_NAME( %STDESCR TEMP_STR : STRING_12 ); EXTERN;

BEGIN
	USER_NAME( TEMP_STR );
	WRITELN( 'USER_NAME = ', TEMP_STR );
END.

2 LINKING

    To link with DENLIB you must use the command:

LINK YOURPROG,YOURSUBS,SYS$LIBRARY:DENLIB/LIBRARY

where YOURPROG is the name of your main program, and YOURSUBS is the
list of your subroutines, and other libraries. 

2 ACCOUNT_NAME

    This is a string function that returns the name of the account to
which all activities by the current user are charged.  This function
requires no parameters.  The account name itself is an ASCII string
eight characters in length.  The function can return either dynamic or
static strings.  It is the policy of the Computer Center that if
information obtained from this function is stored in a file, then a
privacy warning message must be printed before the program proceeds to
measure the performance of any individual. 

3 PASCAL

    This function must be accessed using a procedure mechanism in 
PASCAL.  For further information type:

HELP DENLIB PASCAL STRINGS

2 BASE_STRING

    This function returns a string that is the digit representation of
a given integer in a given base.  The function requires two parameters,
the first is the integer which is to be converted to a string, and the
second is an integer that specifies the base.  Both integers are passed
by reference.  Valid bases are in the range two through thirty-six. If
the integer is negative, or if the base is not valid, the function
returns a null string.  The character set used by BASE_STRING include
zero to nine, and the upper case alphabetic characters, in that order. 
The digit ten is represented by the letter A and the digit thirty-five
is represented by the letter Z.  Leading zeroes are suppressed.  The
length of this character string varies considerably depending on the
base specified.  For instance, if base two was specified, the function 
would return a maximum of 32 characters; if base sixteen was specified 
then the function would return a maximum of eight characters.

3 PASCAL

    This function must be accessed using a procedure mechanism in 
PASCAL.  For further information type:

HELP DENLIB PASCAL STRINGS

2 CPU_TIME

    This function returns an integer which is the amount of CPU time
(in units of ten milliseconds) that the current user has used.  This
function requires no parameters. 

2 DAY_NAME

    This function returns a character string which is the name of the
day indicated by an integer parameter that is passed by reference.  The
integer zero corresponds to Monday, one corresponds to Tuesday, and so
on until six corresponds to Sunday. If an integer is passed that is not
within the range zero through six, then the string 'Error' is returned.
This function can be used with the DAY_OF_WEEK function to obtain a
string that is the current day name. 

3 PASCAL

    This function must be accessed using a procedure mechanism in 
PASCAL.  For further information type:

HELP DENLIB PASCAL STRINGS

2 DAY_OF_WEEK

    This integer function returns an integer corresponding to the
current day of the week.  The integers are defined so that the integer
zero corresponds to Monday, one corresponds to Tuesday, and so on until
six corresponds to Sunday.  This function can be used with the DAY_NAME
function to obtain a string that is the current day name. 

3 FORTRAN

    Due to an incompatibility between FORTRAN version 2.0-2 and BASIC
version 1.0, this function can not be called from a FORTRAN program. 

2 DAY_FROM_DATE

    This integer function returns an integer corresponding to the day
of the week represented by a passed date. The date must be a string in
the format DD-MMM-YYYY and is passed by descriptor.  The integer returned 
has a value of zero through six where zero corresponds to Monday, one 
corresponds to Tuesday, and so on until six corresponds to Sunday.  An 
invalid date results in an error message and a returned value of negative
one.  This function can be used with the DAY_NAME function to obtain a 
string that is the day name.

2 DEFINE_SYMBOL

    This subroutine defines a DCL global symbol for the VAX/VMS
operating system.  The first parameter is a string containing the name
of the symbol to be defined.  The second parameter is a string
containing the value to be assigned to the symbol.  Both strings are
passed "by descriptor."  No values are returned and the user's strings
are left intact. 

3 FORTRAN

    If this subroutine is called from a FORTRAN program care must be
taken to insure that no trailing blanks are contained in the character
variable.  If trailing blanks are contained in the variable then use of
the global symbol so defined is impossible. 

3 PASCAL

    If this subroutine is called from a PASCAL program care must be
taken to insure that no trailing blanks are contained in the character
variable.  If trailing blanks are contained in the variable then use of
the global symbol so defined is impossible. 

2 TEST_IN_BATCH

    This function returns an integer value of -1 (TRUE) if the
program is receiving its input from a disk file, and 0 (FALSE) if the
program is receiving its input from another device such as a terminal.
A program running in batch mode will be receiving its input from an
disk file and the function will return a true value.  A program that is
running from a terminal will receive a false value.  Note that if the
program is run from a command procedure but is not running in batch,
the function will still return a true value.  This feature may change
at a later time. 

3 FORTRAN

    Due to an incompatibility between FORTRAN version 2.0-2 and BASIC
version 1.0, this function can not be called from a FORTRAN program. 

2 LOGIN_DELTA_TIME_STRING

    This parameterless function returns an ASCII string indicating the
amount of time that the user has been logged in.  The string is of the
format: 

 dddd hh:mm:ss.ss

where dddd is the number of days ( with leading zeros blanked ), hh is
the number of hours, mm is the number of minutes, and ss.ss is the
number of seconds and hundredths of seconds.  The maximum length of 
this string is seventeen characters.

3 PASCAL

    Because PASCAL identifiers are limited to fifteen characters, an 
alternate name for this function has been provided.  The alternate 
name is LOGIN_D_TIME_S, and must be used when programming in PASCAL.
This function must be accessed using a procedure mechanism in PASCAL.
For further information type:

HELP DENLIB PASCAL STRINGS

2 OWNER_PID

    This integer function returns the process identification number of
the process which owns the current process. For a main process the
value will be zero, for a subprocess the value will be the process id
number of the process which created the subprocess.  It is the policy
of the Computer Center that if information obtained from this function
is stored in a file, then a privacy warning message must be printed
before the program proceeds to measure the performance of any
individual. 

2 PROCESS_ID

    This function returns the process identification number of user in
integer format.  It is the policy of the Computer Center that if
information obtained from this function is stored in a file, then a
privacy warning message must be printed before the program proceeds to
measure the performance of any individual. 

2 PROCESS_NAME

    This function returns an ASCII string that is the user's process
name. The process name can be up to fifteen characters in length.  This
function requires no parameters.  It is the policy of the Computer
Center that if information obtained from this function is stored in a
file, then a privacy warning message must be printed before the program
proceeds to measure the performance of any individual. 

3 PASCAL

    This function must be accessed using a procedure mechanism in 
PASCAL.  For further information type:

HELP DENLIB PASCAL STRINGS

2 SYS_MESSAGE

    This function returns the ASCII string of the system error message
text based on the value of the integer passed to it.  The integer is
passed by reference.  The string is on the order of one hundred
characters in length.  Trailing spaces should be removed before
printing the message. 

3 PASCAL

    This function must be accessed using a procedure mechanism in 
PASCAL.  For further information type:

HELP DENLIB PASCAL STRINGS

2 TERM_NAME

    This function returns an ASCII string which is the device
designation of the terminal from which the user is currently executing.

3 FORTRAN

    Due to an incompatibility between FORTRAN version 2.0-2 and BASIC
version 1.0, this function must be called useing a subroutine mechanism. 
The calling program must first create a temporary string variable of the
appropriate length, in this case nine characters, and pass it as the 
FIRST and ONLY parameter.

3 PASCAL

    This function must be accessed using a procedure mechanism in 
PASCAL.  For further information type:

HELP DENLIB PASCAL STRINGS

2 TERM_TYPE

    This function returns an ASCII string which indicates the type of the
terminal from which the program is running.  The type of each terminal in the
system is set by the Computer Center.  Any user may temporarily change this
setting to any value desired.  This change will be removed when that user logs
off the system.  Use of this "feature" therefore may not yield the expected
results.  This ability to change the virtual terminal characteristics may
change in the future. 

3 FORTRAN

    Due to an incompatibility between FORTRAN version 2.0-2 and BASIC
version 1.0, this function must be called useing a subroutine mechanism. 
The calling program must first create a temporary string variable of the
appropriate length, in this case nine characters, and pass it as the 
FIRST and ONLY parameter.

3 PASCAL

    This function must be accessed using a procedure mechanism in 
PASCAL.  For further information type:

HELP DENLIB PASCAL STRINGS

2 UIC_GROUP

    This function returns an integer which indicates the user
identification code group to which the user belongs.  The standard
method for printing uic's is to print them to base eight.  A uic code
of [101,22] corresponds to decimal numbers 65 and 18.  It is the policy
of the Computer Center that if information obtained from this function
is stored in a file, then a privacy warning message must be printed
before the program proceeds to measure the performance of any
individual. 

2 UIC_MEMBER

    This function returns an integer which corresponds to the member
number inside the users uic group.  Thus with a uic of [33,15] the
member number is 15 in octal or 13 in decimal.  The standard method for
printing uic's is to print them to base eight.  A uic code of [33,15]
corresponds to decimal numbers 27 and 13.  It is the policy of the
Computer Center that if information obtained from this function is stored
in a file, then a privacy warning message must be printed before the
program proceeds to measure the performance of any individual. 

2 UIC_NUMBER

    This function returns an integer which describes the user
indentification code completely.  The function UIC_STRING can then be
used to convert this number to a string.  It is the policy of the
Computer Center that if information obtained from this function is
stored in a file, then a privacy warning message must be printed before
the program proceeds to measure the performance of any individual. 

2 UIC_STRING

    This function returns an ASCII character string which represents
the user identification code in the standard system format.  This
function requires the UIC in the integer form that is provided by the
function UIC_NUMBER.  Note that the UIC's are printed with base eight.
It is the policy of the Computer Center that if information obtained from
this function is stored in a file, then a privacy warning message must be
printed before the program proceeds to measure the performance of any
individual. 

3 PASCAL

    This function must be accessed using a procedure mechanism in 
PASCAL.  For further information type:

HELP DENLIB PASCAL STRINGS

2 USER_NAME

    This function returns the user name of the current process in ASCII
string format of up to twelve characters.  It is the policy of the
Computer Center policy that if information obtained from this function
is stored in a file, then a privacy warning message must be printed
before the program proceeds to measure the performance of any
individual. 

3 PASCAL

    This function must be accessed using a procedure mechanism in 
PASCAL.  For further information type:

HELP DENLIB PASCAL STRINGS

