This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: CDL question


>>>>> "Trenton" == Trenton D Adams <tadams@extremeeng.com> writes:

    Trenton> Is the following
    Trenton>         define_proc {__DEVICE_NAME "eth1"}
    Trenton> the same as 
    Trenton> 	  #define __DEVICE_NAME "eth1"
    Trenton> ???

No.

define_proc provides a fragment of Tcl code which can be used to put
arbitrary text into a header file. The "proc" bit stands for
procedure, and "proc" also happens to be the standard Tcl command for
defining a new command.

What would happen in this case is that a Tcl interpreter running
inside the configuration tools would attempt to execute the Tcl
command __DEVICE_NAME with a single argument, eth1. Since there is no
such Tcl command that is not going to work very well.

Instead you can use something like:

    define_proc {
        puts $cdl_header "#define __DEVICE_NAME \"eth1\""
    }

using the Tcl "puts" command with appropriate arguments. See
http://sources.redhat.com/ecos/docs-latest/cdl/ref.define-proc.html
and the Component Writer's Guide generally for more details.

Bart


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]