;T4.2-1 ;Please do not remove the preceeding version line .TITLE DTRFND VAX Datatrieve User Function Definitions ;+++++++++++++++++++++++++++++++++++++++++++++++++++ ; ; F U N C T I O N D E F I N I T I O N S ; ;--------------------------------------------------- .PSECT FND,NOWRT,SHR,PIC,2 .LIBRARY /DTR$LIBRARY:DTRFNLB/ .LIBRARY /SYS$LIBRARY:STARLET/ ;.SHOW EXPANSIONS $DSCDEF $DTR$FUN_INIT ; FN$GET_SYMBOL - Get symbol string ; ; output is a string descriptor ; input is a string descriptor ; $DTR$FUN_DEF FN$GET_SYMBOL, LIB$GET_SYMBOL, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_NOOPTIMIZE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE $DTR$FUN_END_DEF ;;; Begin user supplied functions ;;; Insert this after FN$GET_SYMBOL in DTRFNDnn.MAR ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Warning: the functions in the following block allow access to ; operating system functions, and do not go through the internal ; DTR checks for a captive account. If you are running DTR in ; captive environments and don't want users to get to the operating ; system, think carefully about which, if any, of the following ; functions you want to include. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; FN$DELETE_FILE - Delete a file ; Don Stern ; Input is a filename to delete ; output: none $DTR$FUN_DEF FN$DELETE_FILE, LIB$DELETE_FILE, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_NOVALUE $DTR$FUN_NOOPTIMIZE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_END_DEF ; FN$DELETE_LOGICAL - deletes a supervisor-mode logical from a specified table ; Don Stern ; argument 1 is a char. string containing the logical name ; arg. 2 is a char. string cont. the logical name table ; no output $DTR$FUN_DEF FN$DELETE_LOGICAL, LIB$DELETE_LOGICAL, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_NOVALUE $DTR$FUN_NOOPTIMIZE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 $DTR$FUN_END_DEF ; FN$EDT - Edit a text file. ; Don Stern ; input is a filename passed by descriptor ; No output ; ; This function requires linking to the shared EDT image. ;; .LINK "SYS$SHARE:EDTSHR.EXE"/SHAREABLE ; in link command file ;; ; NOTE !!! ; ; The .LINK directive doesn't do what is desired anymore (at least, not ; on the Alpha systems I've tried). So to use FN$EDT, FN$CONVERT_RECLAIM, ; FN$FDL_CREATE, and other functions that use shareable images of utilities, ; you must add ; ; "SYS$COMMON:[SYSSHARE]IMAGELIB.OLB /LIBRARY" ; ; to the Datatrieve build command procedure file where DTRSHR.EXE is linked, ; after the ; ; "sys$common:[syslib]starlet.olb /library" ; ; line. ;! $DTR$FUN_DEF FN$EDT, EDT$EDIT, 1 ;! $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS ;! $DTR$FUN_NOVALUE ;! $DTR$FUN_NOOPTIMIZE ;! $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 ;! $DTR$FUN_END_DEF ; FN$RENAME_FILE - Renames a file ; Don Stern ; Argument 1 is the source filename passed by descriptor ; Argument 2 is the new filename passed by descriptor ; No output $DTR$FUN_DEF FN$RENAME_FILE, LIB$RENAME_FILE, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_NOVALUE $DTR$FUN_NOOPTIMIZE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 $DTR$FUN_END_DEF ; FN$SET_DEFAULT - Set Default Directory ; Philip A. Naecker $DTR$FUN_DEF FN$SET_DEFAULT, SYS$SETDDIR, 3 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_NOVALUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_NULL $DTR$FUN_IN_ARG TYPE = FUN$K_NULL $DTR$FUN_END_DEF ; FN$SET_LOGICAL - (re)defines a supervisor mode logical in a specified table ; Don Stern ; arg. 1 is a char. string containing the logical name ; arg. 2 is a char string containing the value to assign ; arg. 3 is a char. string cont. the name of the table ; no output $DTR$FUN_DEF FN$SET_LOGICAL, LIB$SET_LOGICAL, 3 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_NOVALUE $DTR$FUN_NOOPTIMIZE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 3 $DTR$FUN_END_DEF ; FN$SET_SYMBOL - define or redefine a CLI symbol ; Don Stern ; arg. 1 is a string descriptor containing the CLI symbol ; arg. 2 is a string descriptor cont. the CLI symbol value ; no output $DTR$FUN_DEF FN$SET_SYMBOL, LIB$SET_SYMBOL, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_NOVALUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 $DTR$FUN_END_DEF ; FN$TPU - Edit or process an ASCII file ; B. Z. Lederman ; Input is an input file specification ; an output file specification ; No output ; ; There are problems with this because there is ; no TPU environment set up. I'm leaving it here for ; future reference in case DTR/TPU fixes the problem, ; but it is 'disabled' by commenting out the lines. ; ; This function requires linking to the shared TPU image. ; .LINK "SYS$SHARE:TPUSHR.EXE"/SHAREABLE ; ; See the comment under FN$EDT instead of using .LINK ; ;$DTR$FUN_DEF FN$TPU, TPU$EDIT, 2 ; $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS ; $DTR$FUN_NOVALUE ; $DTR$FUN_NOOPTIMIZE ; $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 ; $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 ;$DTR$FUN_END_DEF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Functions appearing after this point allow some access to system ; features, but will probably not be dangerous in most ; environments. One reason for including them is to allow some ; functions to be performed from within DTR without allowing the ; user to get to DCL either directly or with FN$SPAWN. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; FN$CONVERT_RECLAIM - Invoke the CONVERT/RECLAIM facility ; B. Z. Lederman ; input is a filename passed by descriptor ; No output ; ; This function requires linking to the shared CONV image. ;; .LINK "SYS$SHARE:CONVSHR.EXE"/SHAREABLE ; in link command file ; See the comment under FN$EDT instead of using .LINK ;! $DTR$FUN_DEF FN$CONVERT_RECLAIM, CONV$RECLAIM, 1 ;! $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS ;! $DTR$FUN_NOVALUE ;! $DTR$FUN_NOOPTIMIZE ;! $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 ;! $DTR$FUN_END_DEF ; FN$FDL_CREATE - Create a file from an FDL description ; B. Z. Lederman ; input is the name of an FDL file ; the name of the file to create ; No output ; ; This function requires linking to the shared FDL image. ; .LINK "SYS$SHARE:FDLSHR.EXE"/SHAREABLE ; in link command file ; See the comment under FN$EDT instead of using .LINK ;! $DTR$FUN_DEF FN$FDL_CREATE, FDL$CREATE, 2 ;! $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS ;! $DTR$FUN_NOVALUE ;! $DTR$FUN_NOOPTIMIZE ;! $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 ;! $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 ;! $DTR$FUN_END_DEF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Functions appearing after this point should not allow users to ; reach operating system functions. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; FN$BAS_EDIT - process a character string with BAS$EDIT ; B. Z. Lederman ; output is a one character string ; input is an unsigned byte ASCII code ; ; For Alpha and Itanium, the routine name changes to DBASIC$EDIT to use ; the native RTL ; ; $DTR$FUN_DEF FN$BAS_EDIT, BAS$EDIT, 3 ! VAX only $DTR$FUN_DEF FN$BAS_EDIT, DBASIC$EDIT, 3 ! Alpha and IA64 $DTR$FUN_NOOPTIMIZE $DTR$FUN_HEADER HDR = <"Edited"> $DTR$FUN_EDIT_STRING ^\T(80)\ $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE, ALL_LEN = 255 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1, ALL_LEN = 255 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 2 $DTR$FUN_END_DEF ; FN$CHAR - convert an ASCII Code to an ASCII Character ; Don Stern ; output is a one character string ; input is an unsigned byte ASCII code ; $DTR$FUN_DEF FN$CHAR, LIB$CHAR, 2 $DTR$FUN_HEADER HDR = <"Char"> $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_BU, ORDER = 1 $DTR$FUN_END_DEF ; FN$CLEAR_BIT - Clear a bit in a longword ; Philip A. Naecker ; Input is a source longword (to be changed by a single bit) ; and a bit position. ; Output is a value in R0, R1. -1 if operation successful ; $DTR$FUN_DEF FN$CLEAR_BIT, FOR$JIBCLR, 2 ; $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L ; $DTR$FUN_HEADER HDR = <"Bit"/"Cleared"> ; $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 1 ; $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 2 ; $DTR$FUN_END_DEF ; FN$DAYS_SINCE - returns the number of days since the base date 17-Nov-1858 ; Don Stern ; input is a binary quadword date ; output is a longword integer cont. the days since base date ; $DTR$FUN_DEF FN$DAYS_SINCE, LIB$DAY, 2 $DTR$FUN_HEADER HDR = <"Days"/"Since"> $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_ADT, ORDER = 1 $DTR$FUN_END_DEF ; FN$DAY_OF_WEEK - Day of the week ; B. Z. Lederman (though Don Stern did one too.) ; ; Routine to give a numeric value for the day of the week. Refer ; to LIB$DAY_OF_WEEK for more detail. ; ; Input is a date. ; Output is a number (longword integer). (1 = Monday, 7 = Sunday). $DTR$FUN_DEF FN$DAY_OF_WEEK, LIB$DAY_OF_WEEK, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_HEADER HDR = <"Day"/"of"/"Week"> $DTR$FUN_NOOPTIMIZE $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_ADT, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, OUT_PUT = TRUE $DTR$FUN_END_DEF ; FN$FAO - Formatted ASCII Output ; Philip A. Naecker ; Input is of any data type converted to ASCII representation ; and substituted into the output string as specified ; by directive parameters. ; Output is a character string ; $DTR$FUN_DEF FN$FAO, LIB$SYS_FAO, 11 $DTR$FUN_HEADER HDR = <"String"> $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_NULL $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 2 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 3 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 4 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 5 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 6 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 7 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_ADT, ORDER = 9 $DTR$FUN_END_DEF ; ; FN$GETJPI - Return info from LIB$GETJPI (Mary Henning?) ; ; output is varying text, returned in input args ; input is passed by reference or null value ; $DTR$FUN_DEF FN$GETJPI, LIB$GETJPI, 6 $DTR$FUN_OUT_ARG TYPE = FUN$K_INPUT, DTYPE = DSC$K_DTYPE_VT $DTR$FUN_NOOPTIMIZE $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_NULL $DTR$FUN_IN_ARG TYPE = FUN$K_NULL $DTR$FUN_IN_ARG TYPE = FUN$K_NULL $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE, $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_WU, ORDER = 2 $DTR$FUN_END_DEF ; FN$GETMSG - Get System Message ; B. Z. Lederman ; ; Input is longword message-id (condition), longword (unsigned) flags ; Output is string $DTR$FUN_DEF FN$GETMSG, LIB$SYS_GETMSG, 5 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_EDIT_STRING ^\T(80)\ $DTR$FUN_HEADER HDR = <"Message"/"Text"> $DTR$FUN_NOOPTIMIZE $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_NULL $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_LU, ORDER = 2 $DTR$FUN_IN_ARG TYPE = FUN$K_NULL $DTR$FUN_END_DEF ; FN$JIAND - Bitwise Logical AND of two values ; B. Z. Lederman ; Input is two Longword Integers ; Output is Bitwise Logical AND $DTR$FUN_DEF FN$JIAND, MTH$JIAND, 2 $DTR$FUN_HEADER HDR = <"Bitwise"/"AND"> $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_LU $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_LU, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_LU, ORDER = 2 $DTR$FUN_END_DEF ; FN$JIOR - Bitwise Logical Inclusive OR of two values ; B. Z. Lederman ; Input is two Longword Integers ; Output is Bitwise Logical Inclusive OR $DTR$FUN_DEF FN$JIOR, MTH$JIOR, 2 $DTR$FUN_HEADER HDR = <"Bitwise"/"OR"> $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_LU $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_LU, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_LU, ORDER = 2 $DTR$FUN_END_DEF ; FN$JIEOR - Bitwise Logical Exclusive OR of two values ; B. Z. Lederman ; Input is two Longword Integers ; Output is Bitwise Logical Exclusive OR $DTR$FUN_DEF FN$JIEOR, MTH$JIEOR, 2 $DTR$FUN_HEADER HDR = <"Bitwise"/"Exclusive"/"OR"> $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_LU $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_LU, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_LU, ORDER = 2 $DTR$FUN_END_DEF ; FN$JNOT - Bitwise Logical Complement of two values ; B. Z. Lederman ; Input is two Longword Integers ; Output is Bitwise Logical Complement $DTR$FUN_DEF FN$JNOT, MTH$JNOT, 1 $DTR$FUN_HEADER HDR = <"Bitwise"/"Complement"> $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_LU $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_LU, ORDER = 1 $DTR$FUN_END_DEF ; FN$JMOD - Remainder of two Longwords ; B. Z. Lederman ; Input is two Longword Integers ; Output is Remainder of division $DTR$FUN_DEF FN$JMOD, MTH$JMOD, 2 $DTR$FUN_HEADER HDR = <"Remainder"> $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 2 $DTR$FUN_END_DEF ; FN$MAX - Maximum ; Philip A. Naecker ; Input is two longwords ; Output is a longword containing the maximum of the two inputs $DTR$FUN_DEF FN$MAX, MTH$AMAX1, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_F $DTR$FUN_HEADER HDR = <"Maximum"> $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_F, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_F, ORDER = 2 $DTR$FUN_END_DEF ; FN$MIN - Minimum ; Philip A. Naecker ; Input is two longwords ; Output is a longword containing the minimum of the two inputs $DTR$FUN_DEF FN$MIN, MTH$AMIN1, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_F $DTR$FUN_HEADER HDR = <"Minimum"> $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_F, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_F, ORDER = 2 $DTR$FUN_END_DEF ; FN$OCTL - Octal string B. Z. Lederman ; ; input is a longword (unsigned) ; output is a fixed length string $DTR$FUN_DEF FN$OCTL, OTS$CVT_L_TO, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_HEADER HDR = <"Octal"> $DTR$FUN_EDIT_STRING ^\X(11)\ $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_LU, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, ALL_LEN = 11, OUT_PUT = TRUE $DTR$FUN_END_DEF ; FN$POWER - Raise a real number to a real power ; Philip A. Naecker ; Input is two floating values passed by immediate value ; Output is a floating value in R0, R1 ; $DTR$FUN_DEF FN$POWER, OTS$POWGG, 2 $DTR$FUN_HEADER HDR = <"Power"> $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_G $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_G, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_G, ORDER = 2 $DTR$FUN_END_DEF ; FN$RANDOM - a random number generator ; Don Stern ; input is an unsigned integer longword ; output is an F-floating random number $DTR$FUN_DEF FN$RANDOM, MTH$RANDOM, 1 $DTR$FUN_HEADER HDR = <"Random"/"Value"> $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_F $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 1 $DTR$FUN_END_DEF ; FN$SET_BIT - Set a bit in a longword ; Philip A. Naecker ; Input is a longword source (to be changed by a single bit) ; and, a bit position ; Output is a value in R0, R1 ; $DTR$FUN_DEF FN$SET_BIT, FOR$JIBSET, 2 ; $DTR$FUN_HEADER HDR = <"Set"/"Bit"> ; $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L ; $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 1 ; $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 2 ; $DTR$FUN_END_DEF ; FN$STR_CASE_BLIND_COMPARE - Compare Strings Without Regard to Case ; B. Z. Lederman ; Input is two strings to compare ; ; Output is -1 if first string is less than second ; 0 if strings are equal (with blank fill) ; +1 if first string is greater than second $DTR$FUN_DEF FN$STR_CASE_BLIND_COMPARE, STR$CASE_BLIND_COMPARE, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L $DTR$FUN_HEADER HDR = <"String"/"Comparison"> $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 $DTR$FUN_END_DEF ; FN$STR_DUPL_CHAR - Duplicate a character in a string. ; B. Z. Lederman ; ; output is a string with one or more of the input characters in it ; input is the number of times the caracter is inserted, ; and the character ; Doesn't work. Apparently needs dynamic string output. It is ; currently 'disabled'. It can be activated by removing the ";" ; characters from the beginning of the next 7 lines. ;$DTR$FUN_DEF FN$STR_DUPL_CHAR, STR$DUPL_CHAR, 3 ; $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS ; $DTR$FUN_HEADER HDR = <"String"> ; $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE ; $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 1 ; $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 ;$DTR$FUN_END_DEF ; FN$STR_ELEMENT - Extract Delimited Element Substring. ; B. Z. Lederman ; ; input is the element number (starting with zero for the 1st element) ; the delimiter string which separates elements ; and the source string ; output is the selected substring. $DTR$FUN_DEF FN$STR_ELEMENT, STR$ELEMENT, 4 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_HEADER HDR = <"Element"> $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 3 $DTR$FUN_END_DEF ; FN$STR_FIND_FIRST_IN_SET - Find First Character in Set of Characters ; B. Z. Lederman ; ; input is a source string descriptor, ; and a set of characters, any one of which may be matched. ; output is the position of the substring (a number) $DTR$FUN_DEF FN$STR_FIND_FIRST_IN_SET, STR$FIND_FIRST_IN_SET, 2 $DTR$FUN_HEADER HDR = <"In"/"Set"> $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 $DTR$FUN_END_DEF ; FN$STR_FIND_FIRST_NOT_SET - Find First Character That Does Not Occur in Set. ; B. Z. Lederman ; ; input is a source string descriptor, ; and a set of characters, none of which may be matched. ; output is the position of the substring (a number) $DTR$FUN_DEF FN$STR_FIND_FIRST_NOT_SET, STR$FIND_FIRST_NOT_IN_SET, 2 $DTR$FUN_HEADER HDR = <"Not"/"In"/"Set"> $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 $DTR$FUN_END_DEF ; FN$STR_FIRST_CHAR - ASCII value of first string character ; Philip A. Naecker ; Input is a string descriptor ; Output is a longword $DTR$FUN_DEF FN$STR_FIRST_CHAR, LIB$ICHAR, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L $DTR$FUN_EDIT_STRING ^\ZZ9\ $DTR$FUN_HEADER HDR = <"First"/"Character"/"Value"> $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_END_DEF ; FN$STR_LENGTH - Length of a string ; Philip A. Naecker ; Input is a source string descriptor ; Output is a longword $DTR$FUN_DEF FN$STR_LENGTH, LIB$LEN, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L $DTR$FUN_HEADER HDR = <"String"/"Length"> $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_END_DEF ; FN$STR_POS_EXTRACT - String extract B. Z. Lederman ; ; input is an output string descriptor, ; an input string descriptor ; a starting position in the string ; the ending position in the string ; output is a string $DTR$FUN_DEF FN$STR_POS_EXTRACT, STR$POS_EXTR, 4 $DTR$FUN_HEADER HDR = <"String"> $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 2 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 3 $DTR$FUN_END_DEF ; FN$STR_REPLACE - String replace ; Joe H. Gallagher ; input is an output string descriptor, ; an input string descriptor ; a starting position in the input string ; an ending position in the input string ; the replacement string ; output is a string ; ; Refer to the Combined Newsletters September 1988 Page DTR-11 $DTR$FUN_DEF FN$STR_REPLACE, STR$REPLACE, 5 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_HEADER HDR = <"String"> $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 2 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 3 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 4 $DTR$FUN_END_DEF ; FN$STR_TRANSLATE - String translate ; Philip A. Naecker ; Input is an output string descriptor, ; an input string descriptor, ; a translation table descriptor, and ; a match-string descriptor. ; Output is a string $DTR$FUN_DEF FN$STR_TRANSLATE, STR$TRANSLATE, 4 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_HEADER HDR = <"Translated"/"String"> $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 3 $DTR$FUN_END_DEF ; FN$STR_TRIM - Trim trailing blanks and spaces from strings B. Z. Lederman ; ; input is a string (descriptor) ; output is a string $DTR$FUN_DEF FN$STR_TRIM, STR$TRIM, 2 $DTR$FUN_HEADER HDR = <"Trimmed"/"String"> $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_END_DEF ; FN$STR_EBCDIC_TO_ASCII - Translate EBCDIC to ASCII ; Philip A. Naecker ; Input is an output string descriptor, ; an input string descriptor, ; Output is a string $DTR$FUN_DEF FN$STR_EBCDIC_TO_ASCII, LIB$TRA_EBC_ASC, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_HEADER HDR = <"ASCII"/"String"> $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE $DTR$FUN_END_DEF ; FN$STR_ASCII_TO_EBCDIC - Translate ASCII to EBCDIC ; Philip A. Naecker ; Input is an output string descriptor, ; an input string descriptor, ; Output is a string $DTR$FUN_DEF FN$STR_ASCII_TO_EBCDIC, LIB$TRA_ASC_EBC, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_HEADER HDR = <"EBCDIC"/"String"> $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE $DTR$FUN_END_DEF ; FN$TEST_BIT - Test a bit in a longword ; Philip A. Naecker ; Input is a longword source (to be changed by a single bit) ; and, a bit position ; Output is a value in R0, R1 ; $DTR$FUN_DEF FN$TEST_BIT, FOR$BJTEST, 2 ; $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L ; $DTR$FUN_EDIT_STRING ^\-9\ ; $DTR$FUN_HEADER HDR = <"Test"/"Bit"> ; $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 1 ; $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 2 ; $DTR$FUN_END_DEF ; FN$TRIM_FILESPEC - Trims a VMS file specification. ; B. Z. Lederman. ; Used to trim file specs to fit shorter strings when ; you don't have room to fit the entire original spec. ; ; Please see the VMS LIB$ RTL manual ; ; input is a source string descriptor ; and a desired maximum width. ; output is the trimmed file specification $DTR$FUN_DEF FN$TRIM_FILESPEC, LIB$TRIM_FILESPEC, 3 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_HEADER HDR = <"File"/"Spec"> $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE, ALL_LEN = 4 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_W, ORDER = 2 $DTR$FUN_END_DEF ; FN$WAIT - places current process in hibernation for specified time ; Don Stern ; input is the number of seconds to wait - F-floating by ref. ; no output $DTR$FUN_DEF FN$WAIT, LIB$WAIT, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_NOVALUE $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_F, ORDER = 1 $DTR$FUN_END_DEF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; The following functions are optional and require that you link to ; layered products which you may not have. ; You must also "un-comment" the definitions for them ; to be effective. (Remove the ; from the beginning of the ; lines with $DTR or .LINK in them.) ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; FN$RALLY - Access to Rally applications ; B. Z. Lederman ; Input is a Rally command line ; No output ; ; This function requires linking to the shared Rally image. ;; .LINK "SYS$SHARE:RALLY$SHARE.EXE"/SHAREABLE ;; $DTR$FUN_DEF FN$RALLY, RALLY$RALLY, 1 ;; $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS ;; $DTR$FUN_NOVALUE ;; $DTR$FUN_NOOPTIMIZE ;; $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 ;; $DTR$FUN_END_DEF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; The following functions are optional and require that you link in ; additional code, found in directories in the DTR/4GL SIG ; collection. You must also "un-comment" the definitions for them ; to be effective. (see above section) ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; FN$HELP - Get Help from a Library ; B. Z. Lederman ; ; Requires HELP_RELAY.MAR to be assembled and inserted ; in DTRFUNxx.OLB ; ; Input: text containing a help string (may be omitted) ; help library name (may be omitted) ; formatting flags (normally 31 decimal, may be omitted) ; ; Output: none. System outputs text directly to the terminal. ; ; Must call a user-supplied relay program because we can't put ; constants or addresses as inputs to called functions here. ; ;! $DTR$FUN_DEF FN$HELP, HELP_RELAY, 3 ;! $DTR$FUN_EDIT_STRING ^\T(80)\ ;! $DTR$FUN_HEADER HDR = <> ;! $DTR$FUN_NOOPTIMIZE ;! $DTR$FUN_NOVALUE ;! $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS ;! $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 ;! $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 ;! $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_LU, ORDER = 3 ;! $DTR$FUN_END_DEF ; FN$SOUNDEX - Return a Soundex value for a character string ; B. Z. Lederman. ; Requires SOUNDEX_DESC.MAR to be assembled and inserted ; in DTRFUNxx.OLB ; ; output is the Soundex value in a 4 character string ; input is a source string descriptor ;! $DTR$FUN_DEF FN$SOUNDEX, SOUNDEX_DESC, 2 ;! $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS ;! $DTR$FUN_HEADER HDR = <"Soundex"> ;! $DTR$FUN_EDIT_STRING ^\X(4)\ ;! $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 ;! $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT, OUT_PUT = TRUE, ALL_LEN = 4 ;! $DTR$FUN_END_DEF ;;; End Customized Functions ;;; This should come right before $DTR$FUN_FINI and .END $DTR$FUN_FINI .END