1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >The CDL Language</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="The eCos Component Writer's Guide"
20 HREF="cdl-guide.html"><LINK
22 TITLE="Making a Package Distribution"
23 HREF="package.distrib.html"><LINK
26 HREF="language.commands.html"></HEAD
37 SUMMARY="Header navigation table"
49 > Component Writer's Guide</TH
57 HREF="package.distrib.html"
71 HREF="language.commands.html"
84 NAME="LANGUAGE">Chapter 3. The CDL Language</H1
94 HREF="language.html#LANGUAGE.OVERVIEW"
99 HREF="language.commands.html"
104 HREF="language.properties.html"
109 HREF="language.naming.html"
110 >Option Naming Convention</A
114 HREF="language.tcl.html"
115 >An Introduction to Tcl</A
119 HREF="language.values.html"
120 >Values and Expressions</A
124 HREF="language.interface.html"
129 HREF="language.database.html"
141 > language is a key part of the <SPAN
144 > component framework.
145 All packages must come with at least one <SPAN
148 > script, to describe
149 that package to the framework. The information in that script includes
150 details of all the configuration options and how to build the package.
151 Implementing a new component or turning some existing code into an
155 > component always involves writing corresponding <SPAN
159 chapter provides a description of the <SPAN
163 information on specific parts of the language can be found in <A
164 HREF="reference.html"
172 NAME="LANGUAGE.OVERVIEW">Language Overview</H1
177 > script would look like this:</P
185 CLASS="PROGRAMLISTING"
186 >cdl_package CYGPKG_ERROR {
187 display "Common error code support"
189 include_dir cyg/error
191 This package contains the common list of error and
192 status codes. It is held centrally to allow
193 packages to interchange error codes and status
194 codes in a common way, rather than each package
195 having its own conventions for error/status
196 reporting. The error codes are modelled on the
197 POSIX style naming e.g. EINVAL etc. This package
198 also provides the standard strerror() function to
199 convert error codes to textual representation."
205 >This describes a single package, the error code package, which does
206 not have any sub-components or configuration options. The package has
207 an internal name, <TT
211 referenced in other <SPAN
217 >requires CYGPKG_ERROR</TT
218 >. There will also be a
222 > for this symbol in a configuration header
223 file. In addition to the package name, this script provides a number
224 of properties for the package as a whole. The <SPAN
228 provides a short description. The <SPAN
231 > property involves a
232 rather longer one, for when users need a bit more information. The
239 > properties list the consequences of this
240 package at build-time. The package appears to lack any on-line
243 >Packages could be even simpler than this. If the package only provides
244 an interface and there are no files to be compiled then there is no
248 > property. Alternatively if there are no exported
249 header files, or if the exported header files should go to the
253 > directory, then there is
257 > property. Strictly speaking the
264 > properties are optional as well, although
265 application developers would not appreciate the resulting lack of
266 information about what the package is supposed to do.</P
268 >However many packages tend to be a bit more complicated than the error
269 package, containing various sub-components and configuration options.
270 These are also defined in the <SPAN
273 > scripts and in much the same way
274 as the package. For example, the following excerpt comes from the
275 infrastructure package:</P
283 CLASS="PROGRAMLISTING"
284 >cdl_component CYGDBG_INFRA_DEBUG_TRACE_ASSERT_BUFFER {
285 display "Buffered tracing"
287 active_if CYGDBG_USE_TRACING
289 An output module which buffers output from tracing and
290 assertion events. The stored messages are output when an
291 assert fires, or CYG_TRACE_PRINT() (defined in
292 <cyg/infra/cyg_trac.h>) is called. Of course, there will
293 only be stored messages if tracing per se (CYGDBG_USE_TRACING)
296 cdl_option CYGDBG_INFRA_DEBUG_TRACE_BUFFER_SIZE {
297 display "Trace buffer size"
300 legal_values 5 to 65535
302 The size of the trace buffer. This counts the number of
303 trace records stored. When the buffer fills it either
304 wraps, stops recording, or generates output."
319 > has a name and a body. The
320 body contains various properties for that component, and may also
321 contain sub-components or options. Similarly a <TT
325 name and a body of properties. This example lists a number of
326 new properties: <SPAN
339 >. The meaning of most of these should be fairly obvious.
340 The next sections describe the various <SPAN
343 > commands and properties. </P
345 >There is one additional and very important point: <SPAN
349 completely new language; instead it is implemented as an extension of
353 > scripting language. The syntax of a <SPAN
360 > syntax, which is described below. In addition some of the more
361 advanced facilities of <SPAN
364 > involve embedded fragments of <SPAN
368 for example there is a <SPAN
371 > property which specifies some
372 code that needs to be executed when the component framework generates
373 the configuration header files.</P
381 SUMMARY="Footer navigation table"
392 HREF="package.distrib.html"
401 HREF="cdl-guide.html"
410 HREF="language.commands.html"
420 >Making a Package Distribution</TD