<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- Copyright (C) 2003 Red Hat, Inc. -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- This material may be distributed only subject to the terms -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- and conditions set forth in the Open Publication License, v1.0 -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- or later (the latest version is presently available at -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- http://www.opencontent.org/openpub/). -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- Distribution of the work or derivative of the work in any -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- standard (paper) book form is prohibited unless prior -->
|
<!-- permission is obtained from the copyright holder. -->
|
<!-- permission is obtained from the copyright holder. -->
|
<HTML
|
<HTML
|
><HEAD
|
><HEAD
|
><TITLE
|
><TITLE
|
>legal_values</TITLE
|
>legal_values</TITLE
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
><meta name="MSSmartTagsPreventParsing" content="TRUE">
|
<META
|
<META
|
NAME="GENERATOR"
|
NAME="GENERATOR"
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
"><LINK
|
"><LINK
|
REL="HOME"
|
REL="HOME"
|
TITLE="The eCos Component Writer's Guide"
|
TITLE="The eCos Component Writer's Guide"
|
HREF="cdl-guide.html"><LINK
|
HREF="cdl-guide.html"><LINK
|
REL="UP"
|
REL="UP"
|
TITLE="CDL Language Specification"
|
TITLE="CDL Language Specification"
|
HREF="reference.html"><LINK
|
HREF="reference.html"><LINK
|
REL="PREVIOUS"
|
REL="PREVIOUS"
|
TITLE="include_files"
|
TITLE="include_files"
|
HREF="ref.include-files.html"><LINK
|
HREF="ref.include-files.html"><LINK
|
REL="NEXT"
|
REL="NEXT"
|
TITLE="library"
|
TITLE="library"
|
HREF="ref.library.html"></HEAD
|
HREF="ref.library.html"></HEAD
|
><BODY
|
><BODY
|
CLASS="REFENTRY"
|
CLASS="REFENTRY"
|
BGCOLOR="#FFFFFF"
|
BGCOLOR="#FFFFFF"
|
TEXT="#000000"
|
TEXT="#000000"
|
LINK="#0000FF"
|
LINK="#0000FF"
|
VLINK="#840084"
|
VLINK="#840084"
|
ALINK="#0000FF"
|
ALINK="#0000FF"
|
><DIV
|
><DIV
|
CLASS="NAVHEADER"
|
CLASS="NAVHEADER"
|
><TABLE
|
><TABLE
|
SUMMARY="Header navigation table"
|
SUMMARY="Header navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TH
|
><TH
|
COLSPAN="3"
|
COLSPAN="3"
|
ALIGN="center"
|
ALIGN="center"
|
>The <SPAN
|
>The <SPAN
|
CLASS="APPLICATION"
|
CLASS="APPLICATION"
|
>eCos</SPAN
|
>eCos</SPAN
|
> Component Writer's Guide</TH
|
> Component Writer's Guide</TH
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="ref.include-files.html"
|
HREF="ref.include-files.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="80%"
|
WIDTH="80%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="10%"
|
WIDTH="10%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="bottom"
|
VALIGN="bottom"
|
><A
|
><A
|
HREF="ref.library.html"
|
HREF="ref.library.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"></DIV
|
WIDTH="100%"></DIV
|
><H1
|
><H1
|
><A
|
><A
|
NAME="REF.LEGAL-VALUES"><SPAN
|
NAME="REF.LEGAL-VALUES"><SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>legal_values</SPAN
|
>legal_values</SPAN
|
></H1
|
></H1
|
><DIV
|
><DIV
|
CLASS="REFNAMEDIV"
|
CLASS="REFNAMEDIV"
|
><A
|
><A
|
NAME="AEN4615"
|
NAME="AEN4615"
|
></A
|
></A
|
><H2
|
><H2
|
>Name</H2
|
>Name</H2
|
>Property <SPAN
|
>Property <SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>legal_values</SPAN
|
>legal_values</SPAN
|
> -- Impose constraints on the possible values for an option.</DIV
|
> -- Impose constraints on the possible values for an option.</DIV
|
><DIV
|
><DIV
|
CLASS="REFSYNOPSISDIV"
|
CLASS="REFSYNOPSISDIV"
|
><A
|
><A
|
NAME="AEN4619"><H2
|
NAME="AEN4619"><H2
|
>Synopsis</H2
|
>Synopsis</H2
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="SYNOPSIS"
|
CLASS="SYNOPSIS"
|
>cdl_option <name> {
|
>cdl_option <name> {
|
legal_values <list expression>
|
legal_values <list expression>
|
…
|
…
|
}</PRE
|
}</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="AEN4621"
|
NAME="AEN4621"
|
></A
|
></A
|
><H2
|
><H2
|
>Description</H2
|
>Description</H2
|
><P
|
><P
|
>Options with the <TT
|
>Options with the <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>data</TT
|
>data</TT
|
> or
|
> or
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>booldata</TT
|
>booldata</TT
|
> flavors can have an arbitrary sequence of
|
> flavors can have an arbitrary sequence of
|
characters as their data. In nearly all cases some restrictions have
|
characters as their data. In nearly all cases some restrictions have
|
to be imposed, for example the data should correspond to a number
|
to be imposed, for example the data should correspond to a number
|
within a certain range, or it should be one of a small number of
|
within a certain range, or it should be one of a small number of
|
constants. The <SPAN
|
constants. The <SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>legal_values</SPAN
|
>legal_values</SPAN
|
> property can be used to impose such
|
> property can be used to impose such
|
constraints. The arguments to the property should be a <SPAN
|
constraints. The arguments to the property should be a <SPAN
|
CLASS="APPLICATION"
|
CLASS="APPLICATION"
|
>CDL</SPAN
|
>CDL</SPAN
|
> list
|
> list
|
expression, see <A
|
expression, see <A
|
HREF="language.values.html#LANGUAGE.LIST-EXPRESSION"
|
HREF="language.values.html#LANGUAGE.LIST-EXPRESSION"
|
>the Section called <I
|
>the Section called <I
|
>List Expressions</I
|
>List Expressions</I
|
> in Chapter 3</A
|
> in Chapter 3</A
|
> for the
|
> for the
|
syntactic details. Common examples include:</P
|
syntactic details. Common examples include:</P
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
> legal_values 0 to 0x7fff
|
> legal_values 0 to 0x7fff
|
legal_values 9600 19200 38400
|
legal_values 9600 19200 38400
|
legal_values { "RAM" "ROM" }</PRE
|
legal_values { "RAM" "ROM" }</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
><P
|
><P
|
>The <SPAN
|
>The <SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>legal_values</SPAN
|
>legal_values</SPAN
|
> property can only be used for options with the
|
> property can only be used for options with the
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>data</TT
|
>data</TT
|
> or <TT
|
> or <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>booldata</TT
|
>booldata</TT
|
> flavors, since
|
> flavors, since
|
it makes little sense to further constrain the legal values of a
|
it makes little sense to further constrain the legal values of a
|
boolean option. An option can have at most one <SPAN
|
boolean option. An option can have at most one <SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>legal_values</SPAN
|
>legal_values</SPAN
|
>
|
>
|
property.</P
|
property.</P
|
><DIV
|
><DIV
|
CLASS="TIP"
|
CLASS="TIP"
|
><BLOCKQUOTE
|
><BLOCKQUOTE
|
CLASS="TIP"
|
CLASS="TIP"
|
><P
|
><P
|
><B
|
><B
|
>Tip: </B
|
>Tip: </B
|
>If the first entry in a <SPAN
|
>If the first entry in a <SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>legal_values</SPAN
|
>legal_values</SPAN
|
> list expression is a negative
|
> list expression is a negative
|
number, for example
|
number, for example
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>legal_values -1 to 1</TT
|
>legal_values -1 to 1</TT
|
> then this can
|
> then this can
|
be misinterpreted as an option instead of as part of the expression.
|
be misinterpreted as an option instead of as part of the expression.
|
Currently the <SPAN
|
Currently the <SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>legal_values</SPAN
|
>legal_values</SPAN
|
> property does not take any options, but
|
> property does not take any options, but
|
this may change in future. Option processing halts at the sequence
|
this may change in future. Option processing halts at the sequence
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>--</TT
|
>--</TT
|
>, so the desired range can be expressed safely
|
>, so the desired range can be expressed safely
|
using <TT
|
using <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>legal_values -- -1 to 1</TT
|
>legal_values -- -1 to 1</TT
|
></P
|
></P
|
></BLOCKQUOTE
|
></BLOCKQUOTE
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><BLOCKQUOTE
|
><BLOCKQUOTE
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><P
|
><P
|
><B
|
><B
|
>Note: </B
|
>Note: </B
|
>Architectural HAL packages should provide constants which can be used
|
>Architectural HAL packages should provide constants which can be used
|
in <SPAN
|
in <SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>legal_values</SPAN
|
>legal_values</SPAN
|
> list expressions. For example it should be possible
|
> list expressions. For example it should be possible
|
to specify a numeric range such as
|
to specify a numeric range such as
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>0 to CYGARC_MAXINT</TT
|
>0 to CYGARC_MAXINT</TT
|
>, rather than
|
>, rather than
|
hard-wiring numbers such as <TT
|
hard-wiring numbers such as <TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>0x7fffffff</TT
|
>0x7fffffff</TT
|
> which may
|
> which may
|
not be valid on all targets. Current HAL packages do not define such
|
not be valid on all targets. Current HAL packages do not define such
|
constants. </P
|
constants. </P
|
></BLOCKQUOTE
|
></BLOCKQUOTE
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><BLOCKQUOTE
|
><BLOCKQUOTE
|
CLASS="NOTE"
|
CLASS="NOTE"
|
><P
|
><P
|
><B
|
><B
|
>Note: </B
|
>Note: </B
|
>The <SPAN
|
>The <SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>legal_values</SPAN
|
>legal_values</SPAN
|
> property is restricted mainly to numerical ranges
|
> property is restricted mainly to numerical ranges
|
and simple enumerations, and cannot cope with more complicated data
|
and simple enumerations, and cannot cope with more complicated data
|
items. Future versions of the configuration system will provide
|
items. Future versions of the configuration system will provide
|
additional data validation facilities, for example a
|
additional data validation facilities, for example a
|
<TT
|
<TT
|
CLASS="LITERAL"
|
CLASS="LITERAL"
|
>check_proc</TT
|
>check_proc</TT
|
> property which specifies a Tcl script
|
> property which specifies a Tcl script
|
that can be used to perform the validation.</P
|
that can be used to perform the validation.</P
|
></BLOCKQUOTE
|
></BLOCKQUOTE
|
></DIV
|
></DIV
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="AEN4651"
|
NAME="AEN4651"
|
></A
|
></A
|
><H2
|
><H2
|
>Example</H2
|
>Example</H2
|
><TABLE
|
><TABLE
|
BORDER="5"
|
BORDER="5"
|
BGCOLOR="#E0E0F0"
|
BGCOLOR="#E0E0F0"
|
WIDTH="70%"
|
WIDTH="70%"
|
><TR
|
><TR
|
><TD
|
><TD
|
><PRE
|
><PRE
|
CLASS="PROGRAMLISTING"
|
CLASS="PROGRAMLISTING"
|
>cdl_option CYGNUM_LIBC_TIME_STD_DEFAULT_OFFSET {
|
>cdl_option CYGNUM_LIBC_TIME_STD_DEFAULT_OFFSET {
|
display "Default Standard Time offset"
|
display "Default Standard Time offset"
|
flavor data
|
flavor data
|
legal_values -- -90000 to 90000
|
legal_values -- -90000 to 90000
|
default_value -- 0
|
default_value -- 0
|
description "
|
description "
|
This option controls the offset from UTC in
|
This option controls the offset from UTC in
|
seconds when in local Standard Time. This
|
seconds when in local Standard Time. This
|
value can be positive or negative. It
|
value can be positive or negative. It
|
can also be set at run time using the
|
can also be set at run time using the
|
cyg_libc_time_setzoneoffsets() function."
|
cyg_libc_time_setzoneoffsets() function."
|
}</PRE
|
}</PRE
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="REFSECT1"
|
CLASS="REFSECT1"
|
><A
|
><A
|
NAME="AEN4654"
|
NAME="AEN4654"
|
></A
|
></A
|
><H2
|
><H2
|
>See Also</H2
|
>See Also</H2
|
><P
|
><P
|
>Properties <A
|
>Properties <A
|
HREF="ref.calculated.html"
|
HREF="ref.calculated.html"
|
><SPAN
|
><SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>calculated</SPAN
|
>calculated</SPAN
|
></A
|
></A
|
>,
|
>,
|
<A
|
<A
|
HREF="ref.default-value.html"
|
HREF="ref.default-value.html"
|
><SPAN
|
><SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>default_value</SPAN
|
>default_value</SPAN
|
></A
|
></A
|
>, and
|
>, and
|
<A
|
<A
|
HREF="ref.flavor.html"
|
HREF="ref.flavor.html"
|
><SPAN
|
><SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>flavor</SPAN
|
>flavor</SPAN
|
></A
|
></A
|
>.</P
|
>.</P
|
></DIV
|
></DIV
|
><DIV
|
><DIV
|
CLASS="NAVFOOTER"
|
CLASS="NAVFOOTER"
|
><HR
|
><HR
|
ALIGN="LEFT"
|
ALIGN="LEFT"
|
WIDTH="100%"><TABLE
|
WIDTH="100%"><TABLE
|
SUMMARY="Footer navigation table"
|
SUMMARY="Footer navigation table"
|
WIDTH="100%"
|
WIDTH="100%"
|
BORDER="0"
|
BORDER="0"
|
CELLPADDING="0"
|
CELLPADDING="0"
|
CELLSPACING="0"
|
CELLSPACING="0"
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="ref.include-files.html"
|
HREF="ref.include-files.html"
|
ACCESSKEY="P"
|
ACCESSKEY="P"
|
>Prev</A
|
>Prev</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="cdl-guide.html"
|
HREF="cdl-guide.html"
|
ACCESSKEY="H"
|
ACCESSKEY="H"
|
>Home</A
|
>Home</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="ref.library.html"
|
HREF="ref.library.html"
|
ACCESSKEY="N"
|
ACCESSKEY="N"
|
>Next</A
|
>Next</A
|
></TD
|
></TD
|
></TR
|
></TR
|
><TR
|
><TR
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="left"
|
ALIGN="left"
|
VALIGN="top"
|
VALIGN="top"
|
><SPAN
|
><SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>include_files</SPAN
|
>include_files</SPAN
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="34%"
|
WIDTH="34%"
|
ALIGN="center"
|
ALIGN="center"
|
VALIGN="top"
|
VALIGN="top"
|
><A
|
><A
|
HREF="reference.html"
|
HREF="reference.html"
|
ACCESSKEY="U"
|
ACCESSKEY="U"
|
>Up</A
|
>Up</A
|
></TD
|
></TD
|
><TD
|
><TD
|
WIDTH="33%"
|
WIDTH="33%"
|
ALIGN="right"
|
ALIGN="right"
|
VALIGN="top"
|
VALIGN="top"
|
><SPAN
|
><SPAN
|
CLASS="PROPERTY"
|
CLASS="PROPERTY"
|
>library</SPAN
|
>library</SPAN
|
></TD
|
></TD
|
></TR
|
></TR
|
></TABLE
|
></TABLE
|
></DIV
|
></DIV
|
></BODY
|
></BODY
|
></HTML
|
></HTML
|
|
|