1 Introduction
2 Ground Rules

Building a File System
3 File Systems
4 File Content Data Structure
5 Allocation Cluster Manager
6 Exceptions and Emancipation
7 Base Classes, Testing, and More
8 File Meta Data
9 Native File Class
10 Our File System
11 Allocation Table
12 File System Support Code
13 Initializing the File System
14 Contiguous Files
15 Rebuilding the File System
16 Native File System Support Methods
17 Lookups, Wildcards, and Unicode, Oh My
18 Finishing the File System Class

The Init Program
19 Hardware Abstraction and UOS Architecture
20 Init Command Mode
21 Using Our File System
22 Hardware and Device Lists
23 Fun with Stores: Partitions
24 Fun with Stores: RAID
25 Fun with Stores: RAM Disks
26 Init wrap-up

The Executive
27 Overview of The Executive
28 Starting the Kernel
29 The Kernel
30 Making a Store Bootable
31 The MMC
32 The HMC
33 Loading the components
34 Using the File Processor
35 Symbols and the SSC
36 The File Processor and Device Management
37 The File Processor and File System Management
38 Finishing Executive Startup

Users and Security
39 Introduction to Users and Security
40 More Fun With Stores: File Heaps
41 File Heaps, part 2
42 SysUAF
43 TUser
44 SysUAF API

Terminal I/O
45 Shells and UCL
46 UOS API, the Application Side
47 UOS API, the Executive Side
48 I/O Devices
49 Streams
50 Terminal Output Filters
51 The TTerminal Class
52 Handles
53 Putting it All Together
54 Getting Terminal Input
55 QIO
56 Cooking Terminal Input
57 Putting it all together, part 2
58 Quotas and I/O

UCL
59 UCL Basics
60 Symbol Substitution
61 Command execution
62 Command execution, part 2
63 Command Abbreviation
64 ASTs
65 Expressions, Part 1
66 Expressions, Part 2: Support code
67 Expressions, part 3: Parsing
68 SYS_GETJPIW and SYS_TRNLNM
69 Expressions, part 4: Evaluation

UCL Lexical Functions
70 PROCESS_SCAN
71 PROCESS_SCAN, Part 2
72 TProcess updates
73 Unicode revisted
74 Lexical functions: F$CONTEXT
75 Lexical functions: F$PID
76 Lexical Functions: F$CUNITS
77 Lexical Functions: F$CVSI and F$CVUI
78 UOS Date and Time Formatting
79 Lexical Functions: F$CVTIME
80 LIB_CVTIME
81 Date/Time Contexts
82 SYS_GETTIM, LIB_Get_Timestamp, SYS_ASCTIM, and LIB_SYS_ASCTIM
83 Lexical Functions: F$DELTA_TIME
84 Lexical functions: F$DEVICE
85 SYS_DEVICE_SCAN
86 Lexical functions: F$DIRECTORY
87 Lexical functions: F$EDIT and F$ELEMENT
88 Lexical functions: F$ENVIRONMENT
89 SYS_GETUAI
90 Lexical functions: F$EXTRACT and F$IDENTIFIER
91 LIB_FAO and LIB_FAOL
92 LIB_FAO and LIB_FAOL, part 2
93 Lexical functions: F$FAO
94 File Processing Structures
95 Lexical functions: F$FILE_ATTRIBUTES
96 SYS_DISPLAY
97 Lexical functions: F$GETDVI
98 Parse_GetDVI
99 GetDVI
100 GetDVI, part 2
101 GetDVI, part 3
102 Lexical functions: F$GETJPI
103 GETJPI
104 Lexical functions: F$GETSYI
105 GETSYI
106 Lexical functions: F$INTEGER, F$LENGTH, F$LOCATE, and F$MATCH_WILD
107 Lexical function: F$PARSE
108 FILESCAN
109 SYS_PARSE
110 Lexical Functions: F$MODE, F$PRIVILEGE, and F$PROCESS
111 File Lookup Service
112 Lexical Functions: F$SEARCH
113 SYS_SEARCH
114 F$SETPRV and SYS_SETPRV
115 Lexical Functions: F$STRING, F$TIME, and F$TYPE
116 More on symbols
117 Lexical Functions: F$TRNLNM
118 SYS_TRNLNM, Part 2
119 Lexical functions: F$UNIQUE, F$USER, and F$VERIFY
120 Lexical functions: F$MESSAGE
121 TUOS_File_Wrapper
122 OPEN, CLOSE, and READ system services

UCL Commands
123 WRITE
124 Symbol assignment
125 The @ command
126 @ and EXIT
127 CRELNT system service
128 DELLNT system service
129 IF...THEN...ELSE
130 Comments, labels, and GOTO
131 GOSUB and RETURN
132 CALL, SUBROUTINE, and ENDSUBROUTINE
133 ON, SET {NO}ON, and error handling
134 INQUIRE
135 SYS_WRITE Service
136 OPEN
137 CLOSE
138 DELLNM system service
139 READ
140 Command Recall
141 RECALL
142 RUN
143 LIB_RUN
144 The Data Stream Interface
145 Preparing for execution
146 EOJ and LOGOUT
147 SYS_DELPROC and LIB_GET_FOREIGN

CUSPs and utilities
148 The I/O Queue
149 Timers
150 Logging in, part one
151 Logging in, part 2
152 System configuration
153 SET NODE utility
154 UUI
155 SETTERM utility
156 SETTERM utility, part 2
157 SETTERM utility, part 3
158 AUTHORIZE utility
159 AUTHORIZE utility, UI
160 AUTHORIZE utility, Access Restrictions
161 AUTHORIZE utility, Part 4
162 AUTHORIZE utility, Reporting
163 AUTHORIZE utility, Part 6
164 Authentication
165 Hashlib
166 Authenticate, Part 7
167 Logging in, part 3
168 DAY_OF_WEEK, CVT_FROM_INTERNAL_TIME, and SPAWN
169 DAY_OF_WEEK and CVT_FROM_INTERNAL_TIME
170 LIB_SPAWN
171 CREPRC
172 CREPRC, Part 2
173 COPY
174 COPY, part 2
175 COPY, part 3
176 COPY, part 4
177 LIB_Get_Default_File_Protection and LIB_Substitute_Wildcards
178 CREATESTREAM, STREAMNAME, and Set_Contiguous
179 Help Files
180 LBR Services
181 LBR Services, Part 2
182 LIBRARY utility
183 LIBRARY utility, Part 2
184 FS Services
185 FS Services, Part 2
186 Implementing Help
187 HELP
188 HELP, Part 2
189 DMG_Get_Key and LIB_Put_Formatted_Output
190 LIBRARY utility, Part 3
191 Shutting Down UOS
192 SHUTDOWN
193 WAIT
194 SETIMR
195 WAITFR and Scheduling
196 REPLY, OPCOM, and Mailboxes
197 REPLY utility
198 Mailboxes
199 BRKTHRU
200 OPCOM

Glossary/Index


Downloads

UUI

In the last article we made use of the Universal User Interface (UUI) facility for the setnode CUSP. In this article we will officially introduce the UUI. We will only present the basics - we'll build upon this in the future. Here is the introductory documentation.

Introduction

The UUI is a facility used by most UOS system programs which provides a consistant way to easily create a command line/graphical user interface. UUI is controlled by a text definition that the program passes to UUI. In a graphical environment, the definition is used to create the graphical elements of the UI.

TUUI Class

The UUI is implemented via the TUUI class, which has the following methods:

Clear
procedure Clear

This procedure clears the user interface.

Execute
function Execute( Name : PChar = nil ) : boolean
bool Execute( char* Name )

This procedure stars the user interface, using the command line to fill the values of the components. It exits upon completion of parsing the command line. If no command line is provided, it will exit when the user requests an exit or if an error occurs. If it exits due to an error, the result will be false, otherwise it will be true.

If there is only one input component, the method returns as soon as that item is provided by either the user or the command line. If there is no command line, the user will be prompted. The way the prompt is derived is as follows.

If the input component is contained within a parent component, a label component is searched for within the parent. Otherwise, all components are searched. The prompt is derived from the only label component found in the search. If no label component (or multiple label components) is defined, the prompt will be taken from the $prompt variable, if defined. The prompt is prefixed with an underscore (_) when displayed to the user.

If a non-null name is passed to the routine, only the component with that name is executed.

Get_Component_By_Name
function Get_Component_By_Name( X : PChar ) : TUUI_Component TUUI_Component Get_Component_By_Name( char* X )

Returns an instance of a UUI component whose name matches the passed name. Nil is returned if the component wasn't found.

Definition
property Definition : PChar

Returns/sets the UI definition. Error is set if there was an error compiling the definition. Setting the definition clears any previous UI definition.

Error
function Error : PChar
char* Error()

Returns the text of the last error. It returns null if there is no error.

Error_Line
function Error_Line : PChar
char* Error_Line()

Returns the text of the source line that causes the last error. The return value is undefined if there was no error.

Get_Variable
function Get_Variable( N : PChar ) : PChar
char* Get_Variable( char* N )

Returns the value of the passed variable. Null is returned if the variable isn't defined. The only default variable is $margin, which defaults to 8.

Set_Variable
procedure Set_Variable( N, V : string )
void Set_Variable( char* N, char* V )

Sets the value of the variable named by N to the value specified by V. If the variable isn't defined, it is created.

 

TUUI_Component class

TUUI_Component encapsulates a UUI component. These are created as a result of setting the UI Definition in a TUUI instance. Components can be broadly categorized as either input components or display components.

Input components

Input components are those that are directly changed by interaction of the user or via the command line.

TUUI_Actionrepresents an operation that can be performed.
TUUI_Booleanrepresents a boolean value.
TUUI_Integerrepresents an integer value provided by the user.
TUUI_Listrepresents an text value that is one of a list of valid values.
TUUI_Stringrepresents a single line of text provided by the user.

Display components

Display components don't usually have direct user interaction and are used for layout and/or informational purposes.

TUUI_Label represents static text. This usually doesn't show in a command line interface, unless a prompt is needed.

TUUI_Rectangle represents a rectangular area. This is ignored in a command line interface.

All TUUI_Components have the following properties:
PropertyValueDescription
False_HintPCharHint for a boolean component when it is not selected
FlagscardinalFlags
LeftintegerThe left pixel of the component
HeightintegerThe height of the component
HintPCharHint for the component
InversePCharName of the inverse component
ListTStringListValid items for the component
MaximumintegerMaximum valid value
MinimumintegerMinimum valid value
NamePCharName of the component
ParentTUUI_ComponentThe parent (containing) object of this component
SelectedbooleanTrue if boolean item is selected
TextPCharText value of the component
TopintegerThe top pixel of the component
True_HintPCharHint for a boolean component when it is selected
UUIbooleanTrue if the current value/state of the component was set by UUI from the command line when it was executed.
WidthintegerThe width of the component

 

UUI Definitions

The UUI UI definition is a text source consisting of one item per line. Blank lines are ignored and leading and trailing spaces are ignored. A line ends with a combination of one or more CR (ASCII 13) and/or LF (ASCII 10) characters.

The defintion source defines one or more components, each of which contain various attributes. Undefined attributes are assigned a default value. A component can be nested within any other component.

A component definition starts with a line of the following format:

object name:type

where "name" is the component name and "type" is the component type. Component names must contain only alphanumeric and dollar signs ($) or underscores (_). Component names are case-insensitive and must be unique within the UI definition. The component type can be one of the following:

TypeCategoryClassDescription
booleanInputTUUI_BooleanA true/false item (such as a checkbox).
integerInputTUUI_IntegerAn integer value.
labelDisplayTUUI_LabelStatic text.
listInputTUUI_ListA list of possible values.
operationInputTUUI_ActionAn operation (such as a button or menu item).
rectangleDisplayTUUI_RectangleRectangular area.
stringInputTUUI_Stringsingle line of text.

A component definition ends with a line consisting of:
end

Between the object and end lines, other objects can be defined and/or attributes set. Although examples are shown with indentation, the indentation is entirely to make the definition easier to read - it is ignored by UUI.

Attribute lines have the format:

attributename = value

where "attributename" is the name of one of the valid component attributes and "value" is the value for that attribute. If the value is text, it must be delimited with single or double quotes. If the value is numeric, it can be a number or an expression. Note that case is ignored except within quotes. The following list of attributes are common to all components. Attributes with the "GUI only" note indicate that the attribute only has an effect in a GUI interface.

AttributeValue typeApplies toDescription
allownullbooleanstringsTrue to allow the text to be null. Defaults to true. Only applies to text/string input components - ignored on all others.
falsehinttextbooleansPopup hint to show when a boolean component is not selected. GUI only.
hinttextallPopup hint to show. Defaults to null. GUI only.
inversecomponent namebooleansName of boolean component that represents the opposite of this component. Only applies to boolean components.
leftintegerallPixel position of left side of component relative to its parent's left side. Defaults to 0. GUI only.
listlistlistsA list of items, delimited by commas.
maximumintegerintegersMaximum value for an integer component. Has no meaning for other types of components.
minimumintegerintegersMinimum value for an integer component. Has no meaning for other types of components.
selectedbooleanbooleansTrue if item is selected/checked/active/set. Only has meaning for boolean components.
texttextallText of component. Defaults to null.
topintegerallPixel position of top side of component relative to its parent's top. Defaults to 0 GUI only.
truehinttextbooleansPopup hint to show when a boolean component is selected. GUI only.
typetextlistsIndicates options for the component. For list components, this can be "constrained" to mean that the component's value must be one of the items in the list.
visiblebooleanallTrue for component to be visible. Default is true. GUI only.
widthintegerallWidth of component, in pixels. Defaults to the actual width of the text or image. GUI only.

Boolean values
Boolean values are either "True" or "False".

Integer values
Integer values must be numeric. If they contain fractional parts, they will be truncated to an integer value. The value may be an expression that evaluates to a number. See the appendix on Numeric Expressions for details.

List values
List values are a series of values, separated by commas. Any string values must be included within quotes.

Text values
Text values must be delimited by either single (') or double (") quotes.

Here is an example UUI defintion:

object Main:rectangle
  top = 2
  object label:label
    text = "Name:"
    top = $margin
    left = $margin
  end
  object name:string
    hint = "Name"
    top = $margin
    left = label.width + $margin
    allownull = false
  end
end
Note: the spaces around the equal signs are not required.

Numeric Expressions

The basic format of a numeric expression is:
term operator term
where "term" is a number, a variable, a function, a constant, or two terms separated by an operator. "operator" is a arithmetic operator. The following arithmetic operators are available:
! Factorial (do a factorial of the previous value)
% Percentage (divide the previous value by 100)
* Multiply
/ Divide
^ Exponentiation
+ Addition (or unary plus)
- Subtraction (or unary minus)
# Round to the specified number of digits. If rounded to a negative number, it is rounded to the right of the decimal point.
D Random gaussian distribution. For instance, 2D10 will return a random integer between 1 and 10, plus a random integer between 1 and 10 (ie a value between 2 and 20).
MOD Division remainder only
MIN Return left side value if greater than the right side value, otherwise, return the right side value
MAX Return left side value if less than the right side value, otherwise, return the right side value

Note that all operators operate on two values except for unary plus, unary minus, percent, and factorial.

The following integer bit operators are available:
NOT 1's-complement inversion.
AND Bitwise AND
OR Bitwise OR
XOR Bitwise exclusive-OR
NAND Bitwise NOT AND
NOR Bitwise NOT OR
XNOR Bitwise NOT XOR

Constants
PI is a predefined constant equal to 3.14159265...

Functions
Functions have the form:

FUNCTION(expression)

where expression is the value to perform the function on. Available trigonometric functions are:
TAN Tangent
SIN Sine
COS Cosine
SEC Secant
COT Cotangent
CSC Cosecant

ARC and Hyperbolic functions are available by prefixing the trigonometric function name with "ARC", "HYP", or "HYPARC". For instance, "HYPARCSIN".

Other functions available:
ABS Absolute value
DEG Radian to degree conversion
EXP Constant E raised to the specified power
FIB Fibonacci sequence
INT Integer
LOG Natural logrithm
LOG10 Common logrithm
RAD Degree to radian conversion
SGN Sign (returns -1 if negative, 1 if positive, or 0 if 0)
SQR Square root

Variables
A variable is either a defined variable or a component and attribute pair of the form:

name.attribute

where "name" is the name of a component, and "attribute" is the attribute of that component. Note that this attribute must be numeric or the expression is invalid. For example:

Main.top

Variables are defined via the TUUI.Set_Variable method. The only pre-defined variable is "$margin", which indicates the current margin (default is 8).

In the next article, we will look at the SET TERMINAL CUSP.

 

Copyright © 2022 by Alan Conroy. This article may be copied in whole or in part as long as this copyright is included.