tldm-universe/Ardent/UV/APP.PROGS/SETPU.B
2024-09-09 17:51:08 -04:00

61 lines
2.0 KiB
Brainfuck
Executable File

*******************************************************************************
*
* uniVerse port of PI/open !SETPU subroutine
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software Inc.
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*
*******************************************************************************
*
* Maintenance log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description.........................................
* 10/14/98 23801 SAP Change copyrights.
* 10/05/95 16881 PGW Added check for PU$FONTNAME for Windows NT.
* 10/27/93 12299 LA Changed to use printerio opcode.
* 11/12/92 10638 PVW Port PI/open SETPU subroutine to uniVerse.
*
*******************************************************************************
$OPTIONS INFORMATION
SUBROUTINE SETPU (KEY, UNIT, VALUE, CODE)
$INCLUDE UNIVERSE.INCLUDE GETPU.H
$INCLUDE UNIVERSE.INCLUDE PRINTERIO.H
CODE = 0
UNUSED = ''
IF (KEY = PU$FORM) OR (KEY = PU$BANNER) OR (KEY = PU$LOCATION) THEN
VALUE2 = TRIMB(VALUE)
VALUE2 = VALUE2[1,33]
END ELSE IF (KEY = PU$FONTNAME) THEN
VALUE2 = TRIMB(VALUE)
END ELSE IF (KEY = PU$SPOOLFLAGS) THEN
* 2147483648 is 2**31 and 4294967296 is 2**32. The calculations using
* these numbers are necessary because SPOOLFLAGS is handled in the
* underlying code as an unsigned 32 bit quantity. Therefore if bit 1
* needs to be set, the number passed over must be negative.
IF VALUE GE 2147483648 THEN VALUE2 = VALUE - 4294967296
ELSE VALUE2 = VALUE
END ELSE
IF (KEY = PU$CONNECT) AND (VALUE = '') THEN
VALUE2 = PU$DISCONNECT
END ELSE
VALUE2 = VALUE
END
END
PRINTERIO PK$SETPU, KEY, VALUE2, UNIT, CODE, UNUSED, UNUSED, UNUSED
RETURN
END