IFR Markup Language File Format

From PhoenixWiki

(Redirected from IFR Markup Language)
Jump to: navigation, search

This section describes the XML encoding used by Phoenix for IFR. The driver configuration information is stored in an XML file along with the driver or BIOS source code. The information is an extended version of the Human Interface Infrastructure (HII) portions of the UEFI 2.1 specification.

In the Human Interface Infrastructure, configuration settings are stored as questions, questions are grouped into forms and forms are grouped into form sets. There are several types of questions, each related to editing a particular data type, such as number, string, date or time.

Contents

Questions

Each configuration setting is described using a question. There are several types of questions, each tied to a particular data type.

Question Type Data Type Description
actionbutton * Button which can be used to reset options to pre-defined values or (in setup) can call a callback.
checkbox Boolean Selects between two alternatives which have yes/no, on/off, enable/disable meanings.
crossref * Cross-reference button.
date Date Selects a year, month or day or any combination of those.
numeric, one-of Unsigned integer Selects a number. Can have pre-defined values.
ordered-list Buffer Selects options in different “slots” Slots can be required to be unique and may or may not be empty.
string, password String Allows string input. Output can be masked. Can be single-line or multi-line.
time Time Selects an hour, a minute or second or any combination of those.

Statements

Statements provide additional information and assistance to users of forms which is not directly related to a configuration setting.

Statement Type Description
static text Provides static text and/or a static image.
cross-reference Provides a button link to a question on this form or another form.
resetbutton Resets all of the items on the page to a specific set of default values.
subtitle Provides static text header and grouping hints for questions and statements.

Configuration File Syntax

The configuration file syntax is designed to be an XML representation of the Internal Forms Representation encoding found in the UEFI 2.1a specification. The main elements in the encoding are the various types of objects (form, form set, question, statement or option). Conditionals are encoded as properties of these objects.

Extensions to the encoding are related to: specifying whether the objects are used for a particular code base or for build vs. runtime. Extensions to the encoding also relate to the source code modifications which are made when driver or BIOS code is installed.

Configuration Syntax Summary

Name Description
<formset>…</formset> Create a new form set.
<form>…</form> Create a new form
<option>…</option> Create a new question option.
<question>…</question> Create a new question
<statement>…</statement> Create a new statement

Data Types

This section describes the various data types used within the grammar and how they are represented.

Type Representation
Form Identifier Unsigned integer or identifier.
String Identifier Unsigned integer or identifier.
Question Identifier Unsigned integer or identifier.
Unsigned Integer Unsigned integer.
Variable Store Identifier Unsigned integer or identifier.
Date efidate(“mm/dd/yyyy”) mm – Month. 1-12. dd – Day. 1-31. yyyy – Year. 0-9999.
Time efitime(“hh[:mm[:ss]]”) hh – Hour. 0-23. mm – Minute. 0-59. ss – Second. 0-59.
GUID String with this format: efiguid(“70B1E96F-6543-435c-8B15-DE8F5BBA6129”)

Expressions

Expressions use normal C/C++ operation order and association.

Expressions are encoded as:

 <![CDATA[expression]]>

The expression follows standard C expression syntax, with the addition of the following built-in functions:

Syntax

The root of the grammar is:

<?xml version="1.0" encoding=”UTF-8”?>
    <packagelist>…</packagelist>


<animation>...</animation>

Create an animation in an animation package.

Syntax

<animation
  id="animation-identifier"
  name="animation-name"
  type="animation-type"
  width="window-width"
  height="window-height"
  >
  <image>...</image>
  <jpeg>...</jpeg>
  <cell>...</cell>
</animation>
<animation name="animation-name"/>
<animation id="animation-identifier"/>


Attributes

Attribute Description
name Unique C-style identifier which identifies the image. (Optional)
id Unique 16-bit unsigned integer which identifies the animation. If the name is not specified and the id is not specified, then an unique id will be generated. If the name is specified and was previously defined, then the id associated with the previous name will be used. (Optional)
type The animation type, which is one of the following: overlay, clear, restorescreen, overlayloop, clearloop, restorescreenloop.
width The usigned integer width of the animation's display window, in pixels.
height The unsigned integer width of the animation's display window, in pixels.

Members

Member Description
image, jpeg The default image which will be displayed if animation is not supported. There may be, at most, one image or jpeg member.
cell An individual frame in the animation.

Description
This operator creates a new animation within an animation package.

<animationpackage>...</animationpackage>

Create an animation package.

Syntax

<animationpackage>
  <animation>...</animation>
</animationpackage>

Members

Member Description
animation Specifies the nested animation or animations within the animation package.

Description
This object creates an animationpackage. Within the animation package, there can be animations. Each animation has a name and a 16-bit unsigned integer identifier. The names must be unique within a package list. The identifiers must be unique within a package list. There is a one-to-one relationship betwee the names and the identifiers.

<cell>...</cell>

Create a single cell within an animation.

Syntax

<cell
  x="offset-from-left"
  y="offset-from-top"
  delay="delay-milliseconds"
  >
  <image>...</image>
  <jpeg>...</jpeg>
</cell>

Attributes

Attribute Description
x The offset from the left edge of the animation window to display the image.
y The offset from the top edge of the animation window to display the image.
delay The number of milliseconds to delay after displaying the indexed image and before continuing on to the next linked image. If value is zero, no delay.

Members

Member Description
image, jpeg The image which makes up the animation cell. There may be, at most, one image or jpeg in an animation cell.


Description
The logical window definition allows the animation to be centered, even though the first image might be way off center (bounds the sequence of images). All images will be clipped to the defined logical window, since the logical window is suppose to bound all images, normally there is nothing to clip.

<default>...</default>

Create a default value for a question.

Syntax

<default
  name="defaultstore-name"
  id="defaultstore-id"
  >
  <title>...</title>
  <value>expression</value>
</default>

Attributes

Attribute Description
name Optional C-style identifier which uniquely identifies the default store that this default value belongs to. There are three pre-defined names: safe, manufacturing or normal. If not specified, then id must be specified.
id Optional unique unsigned integer which identifies the default store that this default value belongs to. If specified, it must match the identifier previously associated with name (if any and if name is specified).

Members

Member Description
title Specifies the name for this set of defaults. Only valid in forms.
value Specifies the value for the default. Only valid in questions.

Description
This operator creates a new default store and/or associates a question's default value with the default store. There are always assumed to be three default stores: safe, manufacturing and normal.

If the default store specified by name doesn't exist, then create the default store and give it the title specified by title and the identifier specified by id. If no id was specified, then assign a new, unique value. If the default store specified by name exists, then use the id which was previously associated with it.

Notes
When used as a member of <form>...</form>, this operator is encoded using the EFI_IFR_DEFAULTSTORE IFR opcode. The title string is automatically added to the string package and it's identifier is encoded as the opcode's DefaultName member. The identifier id is encoded as the opcode's DefaultId member.

When used as a member of <question>...</question>, this operator is encoded using the EFI_IFR_DEFAULT IFR opcode. The default store referred to by either name or id is encoded as the opcode's DefaultId member. If the value is a simple data type, it is encoded directly in the opcode's Type and Value fields. If the value is a complex expression, then the value EFI_IFR_TYPE_OTHER is placed in the opcode's Type member, the Value member is not present and the expression is encoded using a nested EFI_IFR_VALUE opcode.

<displayanimation>...</displayanimation>

Display an animation in a Phoenix Desktop Script

Syntax

<displayanimation>
  <advancex/>
  <advancey/>
  <animation>...</animation>
  <displayx>expression</displayx>
  <displayy>expression</displayy>
</displayform>

Members

Member Description
advancex The current horizontal (X) position is advanced to the right edge of the animation.
advancey The current vertical (Y) position is advanced to the bottom edge of the animation.
displayx Optional expression which specifies the left edge of the animation relative to the left edge of the parent window's client area.
displayy Optional expression which specifies the top edge of the animation relative to the top edge of the parent window's client area.
animation Specifies the animation to display.

Description
This operator displays an animation at either the current horizontal and vertical position or else that specified by a nested displayx or display member. The form is a child window of the window in which the script is being processed. The form is created as modeless.

Notes
This operator is only available in Phoenix firmware.

This operator is encoded using PHOENIX_DSR_ANIMATION.

<displayform>...</displayform>

Display a form in a Phoenix Desktop Script

Syntax

<displayform>
  <advancex/>
  <advancey/>
  <form>...</form>
  <displayx>expression</displayx>
  <displayy>expression</displayy>
</displayform>

Members

Member Description
advancex The current horizontal (X) position is advanced to the right edge of the form.
advancey The current vertical (Y) position is advanced to the bottom edge of the form.
displayx Optional unsigned integer expression which specifies the left edge of the form relative to the left edge of the parent window's client area.
displayy Optional unsigned integer expression which specifies the top edge of the form relative to the top edge of the parent window's client area.
form Specifies the form to display.

Description
This operator displays a form at either the current horizontal and vertical position or else that specified by a nested displayx or displayy expression. The form is a child window of the window in which the script is being processed. The form is created as modeless.

Notes
This operator is only available in Phoenix firmware.

This operator is encoded using PHOENIX_DSR_FORM.

<displayimage>...</displayimage>

Display an image in a Phoenix Desktop Script

Syntax

<displayimage>
  <advancex/>
  <advancey/>
  <image>...</image>
  <displayx>expression</displayx>
  <displayy>expression</displayy>
</displayimage>

Members

Member Description
advancex The current horizontal (X) position is advanced to the right edge of the image.
advancey The current vertical (Y) position is advanced to the bottom edge of the image.
displayx Optional expression which returns the left edge of the image relative to the left edge of the parent window's client area as an unsigned integer.
displayy Optional expression which returns the top edge of the image relative to the top edge of the parent window's client area as an unsigned integer.
image Specifies the image to display. The image can be referenced or can actually be specified here.

Description
This operator displays an image at either the current horizontal and vertical position or else that specified by a nested displayx or displayy member. The image is drawn in the window in which the script is being processed.

Notes
This operator is only available in Phoenix firmware.

This operator is encoded using PHOENIX_DSR_IMAGE.

<displaypackage>...</displaypackage>

Create a new display script package.

Syntax

<displaypackage>
  <displayscreen>...</displayscreen>
</displaypackage>

Members

Member Description
displayscreen Individual screens in the display script

Description
This operator creates a a display script package, which contains zero or more display screens.

Notes
This operator is only available in Phoenix firmware.

<displayscreen>...</displayscreen>

Describe a screen to be displayed.

Syntax

<displayscreen 
   name="screen-name" 
   id="screen-identifier"
   >
   <displayanimation>...</displayanimation>
   <displayform>...</displayform>
   <displayimage>...</displayimage>
   <displayimagegroup>...</displayimagegroup>
   <displaytext>...</displaytext>
</displayscreen>

Attributes

Attribute Description
name Unique C-style identifier for the display screen.
id Unique 16-bite identifier for the display screen. If not present, then the identifier associated with name is used. If name is not present, then a unique number is assigned.

Members

Member Description
displayanimation Display an animation.
displayform Display a modeless form.
displayimage Display an image.
displayimagegroup Display an image from an image group.
displaytext Display text.

Description
This operator creates a new display screen, associated with the specified identifier. The display screen can contain images, animations and text.

Notes
This operator is only available in Phoenix firmware.

<displaytext>...</displaytext>

Display text in a window as part of a Phoenix Desktop Script.

Syntax

<displaytext>
  <advancex/>
  <advancey/>
  <displayx>expression</displayx>
  <displayy>expression</displayy>
  <text>...</text>
</displaytext>

Members

Member Description
advancex The current horizontal (X) position is advanced to the right edge of the text.
advancey The current vertical (Y) position is advanced to the bottom edge of the text.
displayx Optional expression which specifies the left edge of the text relative to the left edge of the parent window's client area.
displayy Optional expression which specifies the top edge of the text relative to the top edge of the parent window's client area.
text The text to be displayed.

Description
This operator displays text either at the current position or else at the position specified by the nested <displayx>...</displayx> or <displayy>...</displayy> operators.

Notes
This operator is only available in Phoenix firmware.

This operator is encoded using PHOENIX_DSR_TEXT.

<fontpackage>...</fontpackage>

Create a font package.

Syntax

<fontpackage
  fontname=”font-family” 
  fontheight=”font-height”
  fontwidth="font-width"
  fontoriginx="font-origin-x"
  fontoriginy="font-origin-y"
  fontadvancex="font-advance-x"
  fontstyle=”font-style”   
  >
  <glyph>...</glyph>
</fontpackage>

Attributes

Attribute Description
fontadvancex Signed integer which specifies the amount to advance horizontally to get to the origin of the next character.
fontname Specifies the name of the font. Must be specified.
fontheight Unsigned integer which specifies the size (height) of the font's character cell, in pixels. Must be specified.
fontoriginx Signed integer which specifies the horizontal origin point relative to the left edge of the character cell.
fontoriginy Signed integer which specifies the vertical origin point relative to the top edge of the character cell.
fontstyle Specifies zero or more font styles (bold, italic, underline, double_underline, emboss, outline, shadow) separated by the bar character . If none is specified, then the normal style will be used.
fontwidth Unsigned integer which specifies the size (width) of the font's character cell, in pixels. Must be specified.

Members

Member Description
glyph Describes a single glyph.

<form>...</form>

Creates a new form.

Syntax

<form 
  name=”form-name” 
  id=“form-identifier”
  >
  <default>...</default>
  <title>...</title>
  <image>...</image>
  <jpeg>...</jpeg
  <disableif>expression</disableif>
  <locked/>
  <statement>...</statement>
  <question>...</question>
</form>

Attributes

Attribute Description
form-name Unique C-identifier which uniquely identifies this form within the form set. The form name can be used
form-identifier Unique, non-zero, 16-bit unsigned integer which identifies the form within the form set. If not specified, then a unique value will be assigned.

Members

Member Description
default Specifies the name and identifier for a group of defaults (called a default store). Zero or more can appear in a form.
title Specifies the title text which is used with the form. Only one can appear in a form.
image Specifies the image which is associated with the form. Either image or jpeg can be specified for a form, but not both.
jpeg Specifies the JPEG image which is associated with the form. Either image or jpeg can be specified for a form, but not both.
disableif Optional boolean expression which determines whether this form will be ignored by a Forms Processor (true) or not (false). Only one can appear in a form.
locked Indicates that this form should not be editable by a Forms Editor. Only one can appear in a form.
statement Specifies a nested statement within the form. Zero or more can appear in a form.
question Specifies a nested question within the form. Zero or more can appear in a form.

<formpackage>…</formpackage>

Create a form package.

Syntax

<formpackage>
  <formset>…</formset>
</formpackage>

Members

Member Description
formset Specifies the nested form set within the form package.

Description
Creates a form package.

<formset>…</formset>

Creates a new form set.

Syntax

<formset 
  name=”formset-name”
  id=”form-set-identifer”
  >
  <title>...</title>
  <image>...</image>
  <default>...</default>
  <form>...</form>
</formset>

Attributes

Attribute Description
formset-name Optional C-style identifier which uniquely identifies the form set within the package list.
form-set-identifier Optional GUID which uniquely identifies this form set.

Members

Member Description
title Specifies the title text which is used with the form set.
image Specifies the image which is associated with the form set.
form Specifies a nested form within the form set.

<glyph>...</glyph>

Create a new glyph within a font package.

Syntax

<glyph
  id="unicode-value"
  width="glyph-width"
  height="glyph-height"
  offsetx="glyph-offset-x"
  offsety="glyph-offset-y"
  advancex="glyph-advance-x"
  >
  <![CDATA[glyph-data]]>
</glyph>

Attributes

Attribute Description
id Unsigned integer representing the character value of the glyph.
width Unsigned integer which specifies the width of the encoded bitmap.
height Unsigned integer which specifies the height of the encoded bitmap
offsetx Signed integer which specifies the number of pixels to the right of the character cell origin where the left edge of the glyph bitmap should be placed.
offsety Signed integer which specifies the number of pixels above the character cell origin where the top edge of the glyph bitmap should be placed.
advancex Number of pixels to move to the right to find the origin of the next character cell.

Members

Member Description
glyph-data Specifies the glyph data as a series of hexadecimal bytes, two ASCII characters per byte ('0'-'9', 'a'-'f', 'A'-'F'). Each byte contains 8 pixels, where bit 0 of byte 0 is the top-left pixel in the character cell, bit 1 of byte 0 is the top,left+1 pixel in the character cell, etc. Each row of pixels is padded out to the nearest byte, so for example, if the glyph data is 9 pixels wide, there will still be 2 bytes (4 ASCII characters) to encode it, with the unused bits being set to 0. This means that there will always be (((glyph-width + 7)/8) * glyph-height) bytes encoded.

<help>...</help>

Create a new string for a question or statement prompt, a form or form set title or help text.

Syntax

<help 
 name=”string-name”
 id=”string-id”
 fontname=”font” 
 fontsize=”font-size”
 fontstyle=”font-style”
 language=”language”
>
  text
</help>

Attributes

Attribute Description
name Optional string name.
id Optional 16-bit unsigned integer string-id. If not specified, then the one associated with name will be used. If name is not specified, then a unique id will be assigned.
font-family Specifies the name of the font. If not specified, then the default font specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
font-size Specifies the size of the font, in pixels. If none is specified, then the default font size specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
font-style Specifies zero or more font styles (bold, italic, underline, double_underline, emboss, outline, shadow) separated by the bar character. If none is specified, then the default font style specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
language Specifies the language for the string. The language is encoded using RFC-3066 in the manner specified in Appendix M of the UEFI 2.1b specification. If none is specified, then “en-us” is used.

Members

Member Description
text The text is encoded as UTF-8, but can contain some control characters, as follows:

^B = Bold on/off ^I = Italics on/off ^U = Underline on/off ^FN(font-name) ^FS(font-size)

<image>...</image>

Creates a new image.

Syntax

<image 
  name=”image-name”
  id=”image-identifier” 
  width=”width” 
  height=”height” 
  >
  <![CDATA[hex-data]]>
</image>
<image name="image-name"/>
<image id="image-identifier"/>

Attributes

Attribute Description
name Unique C-style identifier which identifies the image. (Optional)
id Unique 16-bit unsigned integer which identifies the image. If the name is not specified and the id is not specified, then an unique id will be generated. If the name is specified and was previously defined, then the id associated with the previous name will be used. (Optional)
width Width of the image, in pixels.
height Height of the image, in pixels.

Members

Member Description
hex-data Bitmap image data, with each byte encoded as two ASCII characters (0-9, a-f, A-F). There should be four bytes (eight characters) for each pixel. There are width x height pixels.

Description
This operator associates an image with a parent question, statement, form or image package. If the short form with only the name is used, then the image must have been previously defined with the specified name. If the short form with only the id is used, then the image must have been previously defined with the specified identifier.

<imagegroup>...</imagegroup>

Creates a new image group.

Syntax

<imagegroup 
  name=”image-group-name”
  id=”image-group-identifier” 
  >
  <image>...</image>
  <jpeg>...</jpeg>
</imagegroup>
<imagegroup name="image-name"/>
<imagegroup id="image-identifier"/>

Attributes

Attribute Description
name Unique C-style identifier which identifies the image group. (Optional)
id Unique 16-bit unsigned integer which identifies the image group. If the name is not specified and the id is not specified, then an unique id will be generated. If the name is specified and was previously defined, then the id associated with the previous name will be used. (Optional)

Members

Member Description
image Describes an image which is part of the image group.
jpeg Describes a JPEG image which is part of the image group.

Description
This operator associates an image group with a parent question, statement, form or image group package. If the short form with only the name is used, then the image must have been previously defined with the specified name. If the short form with only the id is used, then the image must have been previously defined with the specified identifier.

There cannot be two images or JPEG images with the same resolution in the same image group.

The images identifiers will be encoded in the order they appear in the XML.

<imagepackage>...</imagepackage>

Create an image package.

Syntax

<imagepackage>
  <image>...</image>
  <jpeg>...</jpeg>
</imagepackage>

Members

Member Description
image Specifies the nested image or images within the image package.
jpeg Specifies the nested JPEG image or images within the image package.

Description
This object creates an image package. Within the image package, there can be bitmap images or JPEG images. Each image has a name and a 16-bit unsigned integer identifier. The names must be unique within a package list. The identifiers must be unique within a package list. There is a one-to-one relationship betwee the names and the identifiers.

<imagegrouppackage>...</imagegrouppackage>

Create an image package.

Syntax

<imagegrouppackage>
  <image>...</image>
  <imagegroup>...</imagegroup>
  <jpeg>...</jpeg>
</imagegrouppackage>

Members

Member Description
image Specifies the nested image or images within the image group package.
imagegroup Specifies the nested image group within the image group package.
jpeg Specifies the nested JPEG image or images within the image group package.

Description
This object creates an image group package. Image groups are collections of images designed to work together. Within the image group package, there can be image groups or individual bitmap images or JPEG images. Each image or image group has a name and a 16-bit unsigned integer identifier. The names must be unique within a package list. The identifiers must be unique within a package list. There is a one-to-one relationship betwee the names and the identifiers.

If an individual image or JPEG is specified, an image group is created with only the single image embedded.

Image group packages are encoded as described in Phoenix Image Groups.

<inconsistentif>...</inconsistentif>

Provides an error checking expression for question values and an error message.

Syntax

<inconsistentif>
 <![CDATA[expression]]>
 <help>...</help>
</inconsistentif>

Members

Member Description
expression Boolean expression which tests the question's value (this) to see whether it is valid (false) or invalid (true).
help Error text to display if expression evaluates to false.

Description
This operator provides a boolean expression which is evaluated each time the question value is modified. This expression determines whether or not the question's value is valid (false) or invalid (true). If the expression returns false, then the Forms Browser can display the error message text.

Notes
This operator is encoded using EFI_IFR_INCONSISTENT_IF. The expression is nested in the scope. The help text is placed in the string package and the corresponding EFI_STRING_ID is placed in the Error member field.

<jpeg>...</jpeg>

Creates a new JPEG image.

Syntax

<jpeg 
  name=”image-name”
  id=”image-identifier” 
>
  <![CDATA[hex-data]]>
</jpeg>

Attributes

Attribute Description
name Unique C-style identifier which identifies the image. (Optional)
id Unique 16-bit unsigned integer which identifies the image. If the name is not specified and the id is not specified, then an unique id will be generated. If the name is specified and was previously defined, then the id associated with the previous name will be used. (Optional)

Members

Member Description
hex-data JPEG image data, with each byte encoded as two ASCII characters (0-9, a-f, A-F).


<nosubmitif>...</nosubmitif>

Provides an error checking expression for question values and an error message.

Syntax

<nosubmitif>
 <![CDATA[expression]]>
 <help>...</help>
</nosubmitif>

Members

Member Description
expression Boolean expression which tests the question's value (this) to see whether it is valid (false) or invalid (true).
help Error text to display if expression evaluates to false.

Description
This operator provides a boolean expression which is evaluated when the form is submitted. This expression determines whether or not the question's value is valid (false) or invalid (true). If the expression returns false, then the Forms Browser can display the error message help.

Notes
This operator is encoded using the EFI_IFR_NO_SUBMIT_IF opcode. The expression is nested in the opcode's scope. The help text is added to the string package and the generated EFI_STRING_ID is encoded as the Error member of the opcode.

<option>...</option>

Creates a pre-defined option for a question.

Syntax

<option>  
  <prompt>…</prompt>
  <help>…</help>
  <image>…</image>
  <jpeg>...</jpeg>
  <default/>
  <manufacturingdefault/>
  <value>expression</value>
  <suppressif>expression</suppressif>
</option>

Members

Member Description
prompt Prompt text associated with the option. Only one can appear in an option.
help Help text associated with the option. Only one can appear in an option.
image Image associated with the option. Either image or jpeg may be specified but not both.
jpeg JPEG image associated with the option. Either image or jpeg may be specified but not both.
default If present then this option's value will be the default for the question.
manufacturingdefault If present then this option's value will be the manufacturing default for the question.
value Expression which returns the value associated with this option. The value's type must be the same as the question. Only one can appear in an option.
suppressif Optional boolean expression which determines whether this option can be selected by the user (true) or not (false). Only one can appear in an option.


<question>...</question>

Creates a question

Syntax

<question 
 type=”type” 
 name=”name”
 id=”question-id”
 minimum=”min”
 maximum=”max”
 skip=”skip”
 display=”display-option”
>
  <containers>integer</containers>
  <default>...</default>
  <disableif>expression</disableif>
  <grayoutif>expression</grayoutif>
  <help>...</help>
  <image>...</image>
  <inconsistentif>...</inconsistentif>
  <jpeg>...</jpeg>
  <locked/>
  <noempty/>
  <nosubmitif>...</nosubmitif>
  <option>...</option>
  <prompt>...</prompt>
  <read>expression</read>
  <readonly/>
  <refresh>integer</refresh> 
  <suppressif>expression</supressif>
  <unique/>
  <value>expression</value>
  <varstore>...</varstore>
  <write>expression</write>
</question>

Attributes

Attribute Description
name C-style identifier which uniquely identifies this question within the form set.
id Optional 16-bit unsigned integer question-id. If one is not specified, then the one associated with name will be used. If name is not specified, then a unique id will be assigned.
type Specifies the question type: actionbutton, checkbox, date, numeric, oneof, orderedlist, password, crossref, string, time
minimum When the type attribute is numeric or oneof, specifies the minimum integer value for the question.

When the type attribute is string or password, specifies the minimum string length. In either case, the default is 0.

maximum When the type attribute is numeric or oneof, specifies the maximum integer value for the question. If not specified, the default is 255.

When the type attribute is string or password, specifies the maximum string length. If not specified, the default is 0xFFFFFFFFFFFFFFFF.

skip When the type attribute is numeric or oneof, specifies the default increment for the value.
display When the type attribute is numeric or oneof, specifies the type of numeric display: signedint, unsignedint or hex. The default is signedint.

When the type attribute is string or password, specifies whether the display is multiline or singleline. The default is singleline.
When the type attribute is date, specifies the portions of the date to display: d = day, m = month, y = year. The default is dmy. When the type attribute is time, specifies the portions of the time to display: h = hour, m = minute, s = second. The default is hms.

Members

Member Description
default Specifies the default value for a question. There can be several groups of defaults (called default stores). Zero or more can be present in a question.
disableif Optional boolean expression which determines whether the question is ignored by the Forms Processor altogether (true) or processed normally (false). If not present, the default is false. Only one can be present in a question.
grayoutif Optional boolean expression which determines whether the question is displayed normally and is selectable (false) or grayed-out and unselectable (true). If not present, the default is false. Only one can be present in a question.
help Help text which is associated with the question. Only one can be present in a question.
image Image which is associated with the question. Either image or jpeg can be present, but not both. Only one can be present in a question.
inconsistentif Optional boolean expression which will determine if a new question value is valid (false) or (true) as soon as the value as changed. If not present, then only error checking related to the question's type (i.e. integers which fit in storage, etc.) will be performed. If the expression is present and evaluates to false, then the specified error text will be displayed.
jpeg JPEG image which is associated with the question. Either image or jpeg can be present, but not both.
locked Whether the statement should be editable by a Forms Editor. Only one can be present in a question.
nosubmitif Optional boolean expression which will determine if a new question value is valid (false) or (true) when the entire form is submitted. If not present, then only error checking related to the question's type (i.e. integers which fit in storage, etc.) will be performed. If the expression is present and evaluates to false, then the specified error text will be displayed.
option List of possible values for the question, including text descriptions and, optionally, images. The valid values for a question are not limited to those found in options. Zero or more of these can be present in a question.
prompt Prompt text which is used with the question. Only one can be present in a question.
refresh Integer which represents the minimum number of seconds before the Forms Browser will attempt to refresh the question’s value from the question's storage. Only one can be present in a question.
suppressif Optional boolean expression which determines whether the question will be visible (false) or invisible (true). If not present, the default is false. Only one can be present in a question.
value Optional expression which specifies the question's value. Either varstore or value must be present for a question.
varstore Describes how the question value will be stored. Either varstore or value must be present for a question.

<packagelist>…</packagelist>

Create a new package list.

Syntax

<packagelist>
   <formpackage>…</formpackage>
   <imagepackage>...</imagepackage>
   <stringpackage>...</stringpackage>
   <displaypackage>...</displaypackage>
   <fontpackage>...</fontpackage>
   <imagegrouppackage>...</imagegrouppackage>
   <animationpackage>...</animationpackage>
</packagelist>

Attributes
None

Notes
This operator is encoded using the EFI_HII_PACKAGE_LIST_HEADER. The PackageListGuid member is generated automatically.

<prompt>...</prompt>

Create a new string for a question or statement prompt.

Syntax

<prompt 
 name=”string-name”
 id=”string-id”
 fontname=”font” 
 fontsize=”font-size”
 fontstyle=”font-style”
 language=”language”
>
  text
</prompt>
<prompt 
  name="string-name"
  id="string-id"
/>

Attributes

Attribute Description
name Optional string name.
id Optional 16-bit unsigned integer string-id. If not specified, then the one associated with name will be used. If name is not specified, then a unique id will be assigned.
font-family Specifies the name of the font. If not specified, then the default font specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
font-size Specifies the size of the font, in pixels. If none is specified, then the default font size specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
font-style Specifies zero or more font styles (bold, italic, underline, double_underline, emboss, outline, shadow) separated by the bar character. If none is specified, then the default font style specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
language Specifies the language for the string. The language is encoded using RFC-3066 in the manner specified in Appendix M of the UEFI 2.1b specification. If none is specified, then “en-us” is used.

Members

Member Description
text The text is encoded as UTF-8, but can contain some control characters, as follows:

^B = Bold on/off
^I = Italics on/off
^U = Underline on/off
^FN(font-name)
^FS(font-size)

<statement>...</statement>

Create a new statement

Syntax

<statement type=”type”>
  <prompt>...</prompt>
  <help>...</help>
  <image>...</image>
  <jpeg>...</jpeg>
  <locked/>
  <disableif>expression</disableif>
  <suppressif>expression</supressif>
  <grayoutif>expression</grayoutif>
  <targetform>form-identifier</targetform>
  <targetformset>form-set-identifier</targetformset>
  <targetquestion>question-identifier</targetquestion>
  <targetdevicepath>string-identifier</targetdevicepath>
  <text>...</text>
</statement>

Attributes

Attribute Description
type Specifies the type of statement: statictext, resetbutton, subtitle

Members

Member Description
prompt Specifies the prompt text which is used with the statement. See [[#<prompt>…</prompt>]|<prompt>…</prompt>]] for more information.
help Specifies the help text which is associated with the statement. See <help>…</help> for more information.
image Specifies the image which is associated with the statement. See <image>…</image> for more information.
jpeg Specifies the JPEG image which is associated with the statement. See <jpeg>...</jpeg> for more information. <image> and <jpeg> cannot both be specified for the same statement.
locked Specifies whether the statement should be editable by a Forms Editor.
disableif Optional boolean expression which determines whether this statement will be processed by a Forms Processor (true) or not (false). If not present, the default is disabled.
suppressif Optional boolean expression which determines whether this statement will be visible (true) or not (false). If not present, the default is visible.
grayoutif Optional boolean expression which determines whether this statement will be grayed out (true) or not (false). If not present, the default is not grayed-out.
targetform When the type attribute is ref, specifies the identifier of the target form. If not specified, then the current form is assumed.
targetformset When the type attribute is ref, specifies the GUID of the target form set. If not specified, then the current form set is assumed.
targetquestion When the type attribute is ref, specifies the question identifier of the target question on the target form. If not specified, then the first question on the form is assumed.
targetdevicepath When the type attribute is ref, specifies the string form of the device path of the device where the form and question can be found.
text When the type attribute is statictext, specifies the secondary text for statements.

<string>...</string>

Create a new string or refer to an existing string in a string package.

Syntax

<string
 name=”string-name”
 id=”string-id”
 fontname=”font-family” 
 fontsize=”font-size”
 fontstyle=”font-style”
 language=”language”
>
  text
</string>
<string
  name="string-name"
  id="string-id"
  />

Attributes

Attribute Description
name Optional C-style string identifier. If name has been used before, then id should not be present or else must match the previously used value.
id Optional 16-bit unsigned integer string-id. If not specified, then the one associated with name will be used. If name is not specified, then a unique identifier will be assigned.
fontname Specifies the name of the font. If not specified, then the default font specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
fontsize Specifies the size of the font, in pixels. If none is specified, then the default font size specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
fontstyle Specifies zero or more font styles (bold, italic, underline, double_underline, emboss, outline, shadow) separated by the bar character . If none is specified, then the default font style specified by the string package will be used.
language Specifies the language for the string. The language is encoded using RFC-3066 in the manner specified in Appendix M of the UEFI 2.1b specification. If none is specified, then “en-us” is used. Must not match the language for a previously defined string with the same identifier.

Members

Member Description
text The text is encoded as UTF-8, but can contain some control characters, as follows:

^B = Bold on/off ^I = Italics on/off ^U = Underline on/off ^FN(font-name) ^FS(font-size)


Description
This operator creates a string (first form) or refers to an existing string (second form) in a string package.

<stringpackage>...</stringpackage>

Creates string packages in the current package list.

Syntax

<stringpackage
 fontname=”font-family” 
 fontsize=”font-size”
 fontstyle=”font-style”
 >
 <string>...</string>
</stringpackage>

Attributes

Attribute Description
font-family Optionally specifies a font family name. If no font family is specified with an individual string, then this font-family will be used. If none is specified then ‘system’ is assumed.
font-size Optionally specifies a font size (height), in pixels. If none is specified, then 19 will be used.
font-style Optionally specifies zero or more font styles (bold, italic, underline, double_underline, emboss, outline, shadow) separated by the ‘nar’ character. If none is specified, then the normal font style is used.

Description
This object creates string packages, which consist of strings.

<text>...</text>

Create new text.

Syntax

<text
 name=”string-name”
 id=”string-id”
 fontname=”font-family” 
 fontsize=”font-size”
 fontstyle=”font-style”
 language=”language”
 >
  text
</text>

Attributes

Attribute Description
name Optional string name.
id Optional 16-bit unsigned integer string-id. If not specified, then the one associated with name will be used. If name is not specified, then a unique id will be assigned.
font-family Specifies the name of the font. If not specified, then the default font specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
font-size Specifies the size of the font, in pixels. If none is specified, then the default font size specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
font-style Specifies zero or more font styles (bold, italic, underline, double_underline, emboss, outline, shadow) separated by the bar character. If none is specified, then the default font style specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
language Specifies the language for the string. The language is encoded using RFC-3066 in the manner specified in Appendix M of the UEFI 2.1b specification. If none is specified, then “en-us” is used.

Members

Member Description
text The text is encoded as UTF-8, but can contain some control characters, as follows:

^B = Bold on/off ^I = Italics on/off ^U = Underline on/off ^FN(font-name) ^FS(font-size)


<title>...</title>

Create a new form or form set title.

Syntax

<title
 name=”string-name”
 id=”string-id”
 fontname=”font-family” 
 fontsize=”font-size”
 fontstyle=”font-style”
 language=”language”
>
  text
</title>

Attributes

Attribute Description
name Optional string name.
id Optional 16-bit unsigned integer string-id. If not specified, then the one associated with name will be used. If name is not specified, then a unique id will be assigned.
font-family Specifies the name of the font. If not specified, then the default font specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
font-size Specifies the size of the font, in pixels. If none is specified, then the default font size specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
font-style Specifies zero or more font styles (bold, italic, underline, double_underline, emboss, outline, shadow) separated by the bar character. If none is specified, then the default font style specified by the string package will be used. See <stringpackage>…</stringpackage> for more information.
language Specifies the language for the string. The language is encoded using RFC-3066 in the manner specified in Appendix M of the UEFI 2.1b specification. If none is specified, then “en-us” is used.

Members

Member Description
text The text is encoded as UTF-8, but can contain some control characters, as follows:

^B = Bold on/off ^I = Italics on/off ^U = Underline on/off ^FN(font-name) ^FS(font-size)

<varstore>...</varstore>

Describe the question value storage for a question.

Syntax

<varstore
 type="varstore-type"
 guid=”variable-guid”
 name=”variable-name”
 offset="variable-offset"
 attribs="attributes"
>
  device-path
</varstore>

Attributes

Attribute Description
type Question value storage type. One of the following: accessbuffer, accessnamevalue, efitime, efiwakeuptime, efidate, efiwakeupdate or efivariable.
guid The GUID to associate with the question value. If type is accessbuffer or accessnamevalue, then this is the GUID used in the Configuration Strings as described in Chapter 29.2 of the UEFI 2.1 specification. If type is efivariable then this is the GUID passed in to SetVariable(). For other types, this attribute should not be present.
name The name to associate with the question value. If type is accessnamevalue, then this is the name used in the Configuration Strings as described in Chapter 29.2 of the UEFI 2.1 specification. If type is efivariable then this is the name passed in to SetVariable(). For other types, this attribute should not be present.
offset The offset of the question value within the buffer (type is accessbuffer) or the EFI variable (type is efivariable). For other types, this attribute should not be present.
attribs The attributes used for EFI variables (type is efivariable). If not specified, the default is "bsrtnv". The attributes consist of zero or more of the following:
bs = Boot Service
rt = Runtime
ro = Read-Only
nv = Non-Volatile
size The maximum size of the of the buffer (type is accessbuffer) or the EFI variable (type is efivariable). For other types, the size should not be present. If not specified, then the size will be calculated from the last byte referenced by any question in the form set.

Members

Member Description
device-path Text form of the device path which specifies the driver which produces the EFI_HII_CONFIG_ACCESS_PROTOCOL. If not present, then the driver which installed the form is assumed to be the driver which produces the EFI_HII_CONFIG_ACCESS_PROTOCOL. Only when type is accessbuffer or accessnamevalue.

Description
This operator describes how the question value will be stored. This should not be present if <value> is also specified.

There are seven different types of question storage, as described in the following table:

Type Description
accessbuffer The Forms Browser provides a buffer which contains the values for one or more questions. Each question provides the offset within the buffer and the size of the required storage. These variable stores are exposed by the driver using the EFI_HII_CONFIG_ACCESS_PROTOCOL, which is installed on the same handle as the package list. The guid, name and offset attributes must be specified. The device-path member may be specified.
accessnamevalue The Forms Browser provides a string which contains the encoded values for a single question. These variable stores are exposed by the driver using the

EFI_HII_CONFIG_ACCESS_PROTOCOL, which is installed on the same handle as the package list. The guid and name attirbutes must be specified. The device-path member may be specified.

efidate The question value is stored using SetTime(). Only valid for questions where the type attribute is date.
efitime The question value is stored using SetTime(). Only valid for questions where the type attribute is time.
efivariable The question value is stored using SetVariable().
efiwakeupdate The question value is stored using SetWakeupTime(). Only valid for questions where the type attribute is date.
efiwakeuptime The question value is stored using SetWakeupTime(). Only valid for questions where the type attribute is time.

Notes
This operator is encoded using several different IFR opcodes:

The guid is encoded by creating a variable store using EFI_IFR_VARSTORE, EFI_IFR_VARSTORE_NAME_VALUE or EFI_IFR_VARSTORE_EFI and then using the unique EFI_VARSTORE_ID generated for that variable store in the VarStoreId member of the question's EFI_IFR_QUESTION_HEADER.

The name is encoded as a string in the string package and then using the EFI_STRING_ID generated for that string in the VarName member of the question's EFI_IFR_QUESTION_HEADER.

The offset is encoded as an unsigned 16-bit integer in the VarOffset member of the question's EFI_IFR_QUESTION_HEADER.

The device-path is stored using an EFI_IFR_VARSTORE_DEVICE, nested inside the question.

When the type is accessbuffer, accessnamevalue or efivariable, then the type is selected by the variable store referred to by the VarStoreId member of the question's EFI_IFR_QUESTION_HEADER. When the type is efitime or efiwakeuptime, then the type is selected by OR'ing the Flags member of the EFI_IFR_TIME structure with either QF_TIME_STORAGE_TIME (efitime) or QF_TIME_STORAGE_WAKEUP (efiwakeuptime). When the type is efidate or efiwakeupdate then the type is selected by OR'ing the Flags member of the EFI_IFR_TIME structure with either QF_DATE_STORAGE_TIME (efitime) or QF_DATE_STORAGE_WAKEUP (efiwakeuptime).

Expression Syntax

catenate

Concatenate two strings.

Syntax

catenate(expression1,expression2)

Parameters

Parameter Description
expression1, expression2 Two expressions which evaluate to strings.

Description
This built-in function returns the null-terminated string composed of the concatenated strings resulting from expression1 and expression2. If either expression1 or expression2 does not evaluate to a string, then the result is Undefined.

currentx

Returns the current X position of the Phoenix Desktop Script

Syntax

currentx

Parameters
None

Description
While processing the expressions in a Phoenix Desktop Script, this built-in constant returns the current X drawing position.

Notes
This operator is only available in Phoenix firmware.

This operator is encoded using PHOENIX_DSR_CONST_CURRENT_X.

currenty

Returns the current Y position of the Phoenix Desktop Script

Syntax

currenty

Parameters
None

Description
While processing the expressions in a Phoenix Desktop Script, this built-in constant returns the current Y drawing position.

Notes
This operator is only available in Phoenix firmware.

This operator is encoded using PHOENIX_DSR_CONST_CURRENT_Y.


false

The boolean constant false.

Syntax

false

Description
This is the built-in constant, false.

Notes
This operator is encoded using EFI_IFR_FALSE.

efidate

Specifies a constant date.

Syntax

efidate(“mm/dd/yyyy”) 

Parameters

Parameter Description
mm Month. 1-12.
dd Day. 1-31.
yyyy Year. 0-9999.

Description
This operator specifies a constant date. It can only be used in specified-value expressions, such as used with <option>...</option> or <default>...</default>.

efitime

Specifies a constant time.

Syntax

efitime(“hh:mm:ss”) 

Parameters

Parameter Description
hh Hour. 0-23.
mm Minute. Optional. 0-59. If not specified, 0 is assumed.
ss Second. Optional. 0-59. If not specified, 0 is assumed.

Description
This operator specifies a constant time. It can only be used in specified-value expressions, such as used with <option>...</option> or <default>...</default>.

find

Find a string within a string.

Syntax

find(string-to-search,string-to-find,starting-index)

Parameters

Parameter Description
string-to-search Expression which evaluates to the string to be searched.
string-to-find Expression which evaluates to the string to search with.
starting-index Expression which evaluates to the unsigned integer for the starting character to search.

Description
This built-in function searches for a string (string-to-find) inside another string (string-to-search) starting at the character specified by starting-index. The match is case-sensitive. If the string is not found, then 0xFFFFFFFFFFFFFFFF is returned. Otherwise the index of the first matching character is returned.

Notes
The string-to'search expression is encoded first. Then the string-to-find expression is encoded second. Then the starting-index expression is encoded third. Then the EFI_IFR_FIND opcode is encoded with EFI_IFR_FF_CASE_SENSITIVE set in the opcode's Format member.

findi

Find a string within a string.

Syntax

findi(string-to-search,string-to-find,starting-index)

Parameters

Parameter Description
string-to-search Expression which evaluates to the string to be searched.
string-to-find Expression which evaluates to the string to search with.
starting-index Expression which evaluates to the unsigned integer for the starting character to search.

Description
This built-in function searches for a string (string-to-find) inside another string (string-to-search) starting at the character specified by starting-index. The match is case-insensitive. If the string is not found, then 0xFFFFFFFFFFFFFFFF is returned. Otherwise the index of the first matching character is returned..

Notes
The string-to'search expression is encoded first. Then the string-to-find expression is encoded second. Then the starting-index expression is encoded third. Then the EFI_IFR_FIND opcode is encoded with EFI_IFR_FF_CASE_INSENSITIVE set in the opcode's Format member.

get

length

Returns the length of a string.

Syntax

length(expression)

Parameters

Parameter Description
expression String expression.

Description
This built-in function returns the number of characters in the string, excluding the null-terminator. If expression does not evaluate to a string, then the result is Undefined.

map

Return a value which corresponds to a matching expression.

Syntax

map(expression,expression1a,expression1b[,…])

Parameters

Parameter Description
expression Expression whose value will be compared against each ‘a’ expression.
expression1a A matching value.
expression1b A return value.

Description
This operator contains zero or more expression pairs nested within its scope. Each expression pair contains a match value (‘a’) and a return value (‘b’). This operator compares expression against each of the match values. If there is a match, then the corresponding return value is returned. If there is no match, then Undefined is returned.

match

Returns if a string matches a pattern.

Syntax

match(match-string,pattern-string)

Parameters

Parameter Description
match-string Expression which evaluates to a string.
pattern-string Expression which evaluates to a string which is a pattern to match against.

Description
If the match-string or the pattern-string cannot be evaluated as a string, then return Undefined.

The two strings are processed using the MetaiMatch() function. If the result is TRUE, then true is returned. If the result is FALSE, then false is returned.

Notes
The pattern-string expression is encoded first. Then the match-string expression is encoded second. Finally, the EFI_IFR_MATCH opcode is encoded.

mid

Returns a portion of a string or a buffer.

Syntax

mid(string-or-buffer,starting-index,count)

Parameters

Parameter Description
string-or-buffer Expression which evaluates as a string or a buffer.
starting-index Expression which evaluates as an unsigned integer which is the first character in the string/buffer to extract.
count Expression which evaluates as an unsigned integer which is the number of characters to extract.

Description
If string-or-buffer cannot be evaluated as a string or a buffer, return Undefined. If starting-index or count cannot be evaluated as unsigned integers, return Undefined.

If string-or-buffer is a string, then starting-index is the 0-based index of the first character in the string to extract and count is the number of characters to extract. If count is zero or starting-index is greater than or equal the string’s length, then return an empty string. Otherwise, return the extracted string. If count would cause extraction to extend beyond the end of the string, then only the characters up to and include the last character of the string are returned.

If string-or-buffer is a buffer, then starting-index is the 0-based index of the first byte in the buffer to extract and count is the number of bytes to extract. If count is zero or starting-index is greater than the buffer’s length, then return an empty buffer. Otherwise, return the extracted buffer. If count would cause extraction to extend beyond the end of the buffer, then only the bytes up to and include the last byte of the buffer are returned.

Notes
The string-or-buffer expression is encoded first. The starting-index expression is encoded second. The count expression is encoded third. Finally, the EFI_IFR_MID opcode is encoded.

objectheight

Returns the height of the current object in the Phoenix Desktop Script.

Syntax

objectheight

Parameters
None

Description
This operator returns the height of the current object being displayed in the Phoenix Desktop Script. In other contexts, this returns Undefined.

Notes
This operator is only available in Phoenix firmware.

This operator is encoded using PHOENIX_DSR_CONST_OBJECT_HEIGHT.

objectwidth

Returns the width of the current object in the Phoenix Desktop Script.

Syntax

objectwidth

Parameters
None

Description
This operator returns the width of the current object being displayed in the Phoenix Desktop Script. In other contexts, this returns Undefined.

Notes
This operator is only available in Phoenix firmware.

This operator is encoded using PHOENIX_DSR_CONST_OBJECT_WIDTH.

qref1

Returns the value of a specific question.

Syntax

qref1(question-id)

Parameters

Parameter Description
question-id Identifier of the string.

Description
This function returns the value of the question specified by the EFI_QUESTION_ID question-id. If the resulting value is not a valid 16-bit integer or the value is zero, the result of the function is Undefined. If the question does not exist on the current form, the result of the function is Undefined.

qref2

Returns the value of a question whose identifier is determined by an expression.

Syntax

qref2(expression)

Parameters

Parameter Descritpion
expression Expression which evaluates to a 16-bit, non-zero integer.

Description
This function returns the value of the question specified by the EFI_QUESTION_ID returned by expression. If the resulting value is not a valid 16-bit integer or the value is zero, the result of the function is Undefined. If the question does not exist on the current form, the result of the function is Undefined.

qref3

Returns the value of a question from another form set or device.

Syntax

qref3(expression[,guid[,string-id]])

Parameters

Parameter Description
expression Expression which evaluates to a 16-bit, non-zero integer.

Description
This function returns the value of the question inside a specific form set installed by a specific driver. The question is specified by the 16-bit integer returned by expression. If the resulting value of expression is not a valid 16-bit integer or the value is zero, the result of the function is Undefined.

The form-set is specified by the form set identifier guid. If guid is not present or is Nil, then the question is in the current form set (string-id is not present or empty) or the in the first form set installed by the specified driver (string id is present and not empty).

The driver which installed the form set is specified by string-id. If string-id is not present or is empty, then the driver which installed the current form is assumed.

set

span

Returns the number of characters in a string which are part of a set of characters.

Syntax

span(expression,matching-characters,starting-index)

Parameters

Parameter Description
expression Expression which evaluates to a string which will be scanned.
matching-characters Expression which evaluates to a string where each pair of characters represents a lower- (even index) and upper- (odd index) character values.
starting-index Expression which evaluates to an unsigned integer which indicates the starting character to start matching.

Description
If expression and matching-characters cannot be evaluated as a string, return Undefined. If starting-index cannot be evaluated as an unsigned integer, return Undefined.

The expression is the string to scan. The matching-characters consists of character pairs representing the low-end of a range and the high-end of a range of characters. The starting-index is an unsigned integer represents the starting location for the scan.

The operation will return the number of characters starting-index which are a part of a set of characters.

spann

Returns the number of characters in a string which are not part of a set of characters.

Syntax

spann(expression,matching-characters,starting-index)

Parameters

Parameter Description
expression Expression which evaluates to a string which will be scanned.
matching-characters Expression which evaluates to a string where each pair of characters represents a lower- (even index) and upper- (odd index) character values.
starting-index Expression which evaluates to an unsigned integer which indicates the starting character to start matching.

Description
If expression and matching-characters cannot be evaluated as a string, return Undefined. If starting-index cannot be evaluated as an unsigned integer, return Undefined.

The expression is the string to scan. The matching-characters consists of character pairs representing the low-end of a range and the high-end of a range of characters. The starting-index is an unsigned integer represents the starting location for the scan. The operation will return the number of characters starting-index which are not part of a set of characters.

sref1

Return the contents of a string.

Syntax

sref1(string-id)

Parameters

Parameter Description
string-id Identifier of the string.

Description
This built-in function returns the null-terminated Unicode string referred to by the EFI_STRING_ID returned by string-id. If the resulting value is not a valid 16-bit integer or the value is zero, the result of the function is Undefined. If the string identifier does not exist in the same HII database as the current form, the result of the function is Undefined.

sref2

Return the contents of a string.

Syntax

sref2(expression)

Parameters

Parameter Description
expression Expression which evaluates to a 16-bit, non-zero integer.

Description
This built-in function returns the null-terminated Unicode string referred to by the EFI_STRING_ID returned by expression. If the resulting value is not a valid 16-bit integer or the value is zero, the result of the function is Undefined. If the string identifier does not exist in the same HII database as the current form, the result of the function is Undefined.

this

Return the value of the current question.

Syntax

this

Parameters
None

Description
This built-in constant returns the value of the current question. It is only valid in the context of a nosubmitif or inconsistentif expression.

toboolean

Convert the value to a Boolean.

Syntax

toboolean(expression)

Parameters

Parameter Description
expression Expression which evaluates to a string, integer, or buffer.

Description
This built-in function converts an expression to a Boolean. If the expression evaluates to an unsigned integer, zero will be converted to false and any other value will be converted to true. When converting from a string, if the string (case-insensitive) is “true” then this will return true. If the string (case-insensitive) is “false” then this will return false. Otherwise it will return Undefined.

When converting from a buffer, if the buffer is all zeroes, then return false. Otherwise return true.

tolower

Convert a string to lower-case.

Syntax

tolower(expression)

Parameters

Parameter Description
expression Expression which evaluates to a string.

Description
If the expression is Undefined or cannot be evaluated as a string, return Undefined. Otherwise, convert the string to all upper case using the StrLwr() and return the string.

token

Extract a delimited string from another string.

Syntax

token(expression1,expression2,starting-index)

Parameters

Parameter Description
expression1 Evaluates to a string which is the string to tokenize.
expression2 Evaluates to a string which is a list of characters which act as valid delimiters.
starting-index Evaluates to an unsigned integer which is the instance number of the token to return.

Description
If expression1 or expression2 cannot be evaluated as a string, then return Undefined. If starting-index cannot be evaluated as an unsigned integer, return Undefined.

The expression1 is a string. The expression2 is the pattern string, where each character is a valid delimiter. The starting-index is the zero-based index. Then returns the nth delimited sub-string (0 = left of the first delimiter). The end of the string always acts as the final delimiter. If no such string exists, an empty string is returned.

tostring

Convert the value to a string.

Syntax

tostring(flag,expression)

Parameters

Parameter Description
flag ’ character. The flags are unsigneddecimal|signeddecimal|uppercasehex|lowercasehex and ascii|unicode.
expression Expression which evaluates to a Boolean, integer or buffer.

Description
When converting from an unsigned integer, the number will be converted to a unsigned decimal string, signed decimal string or a hexadecimal string.

When converting from a Boolean, the Boolean will be converted to “True” (true) or “False” (false).

When converting from a buffer, each 8-bit (ascii) or 16-bit (unicode) value will be converted into a character and appended to the string, up until the end of the buffer or a NULL character.

touint

Convert the value to an unsigned integer.

Syntax

touint(expression)

Parameters

Parameter Description
expression Expression which evaluates to a Boolean, string or buffer.

Description
When converting from a boolean, if true, return 1 and if false, return 0.

When converting from a string, whitespace is skipped. The prefix ‘0x’ or ‘0X’ indicates to convert from a hexadecimal string while the prefix ‘-‘ indicates conversion from a signed integer string.

When converting from a buffer, if the buffer is greater than 8 bytes in length, return Undefined. Otherwise, zero-extend the contents of the buffer to 64-bits and return the unsigned integer.

toupper

Convert a string to all upper-case.

Syntax

toupper(expression)

Parameters

Parameter Description
expression Expression which evaluates to a string.

Description
If the expression is Undefined or cannot be evaluated as a string, return Undefined. Otherwise, convert the string to all upper case using the StrUpr() and return the string.

true

The Boolean constant true.

Syntax

true

Description
This is the built-in constant, true.

undefined

The constant undefined.

Syntax

undefined

Description
This is the built-in constant, undefined.

version

The version of the UEFI specification to which the interpreter is conformant.

Syntax

version

Description
This is a built-in constant, a 16-bit unsigned integer. Bits 15:8 are the major revision, bits 4-7 are the minor revision and bits 0-3 are the errata level.

winheight

Returns the window client area height while processing a Phoenix Desktop Script

Syntax

winheight

Parameters
None

Description
While processing the expressions in a Phoenix Desktop Script, this built-in constant returns the height of the client area of the window on which the display script is being executed.

In forms, this always returns Undefined.

Notes
This operator is only available in Phoenix firmware.

This operator is encoded using PHOENIX_DSR_CONST_WIN_HEIGHT.

winwidth

Returns the window client area width while processing a Phoenix Desktop Script

Syntax

winwidth

Parameters
None Description
While processing the expressions in a Phoenix Desktop Script, this built-in constant returns the width of the client area of the window on which the display script is being executed.

In forms, this always returns Undefined.

Notes
This operator is only available in Phoenix firmware.

This operator is encoded using PHOENIX_DSR_CONST_WIN_WIDTH.


Copyright (C) 2009 Phoenix Technologies Ltd. All Rights Reserved.

Personal tools