Changes

Jump to: navigation, search

IPDL/Five minute example

1,657 bytes added, 02:54, 18 July 2009
Run the IPDL compiler
== Run the IPDL compiler ==
 
The IPDL compiler is a python script wrapped around an IPDL module. It can be invoked in two different ways: directly, by calling the IPDL script; and indirectly, through the Mozilla build system.
 
To invoke it directly, use a command such as
$ python $ELECTROLYSIS/ipc/ipdl/ipdl.py -d /tmp Test.ipdl
This will run the compiler on "Test.ipdl" and spit out the generated headers into /tmp. (Try <code>python ipdl.py --help</code> for a list of all options.)
 
The second, recommended way is to use the build system. Assuming your working directory is set up correctly (<code>ipc/test-harness</code> is), you only need to add your new protocol specification file to the <code>ipdl.mk</code> file in your working directory, then invoke
$ make -C $OBJDIR/ipc/ipdl
(If your working directory is not set up correctly, see [[IPDL/Low level setup]] for guidance.)
 
After invoking IPDL on the file <code>Test.ipdl</code>, you should see three new headers generated (or updated) in the output directory (-d DIR when invoked directory, $OBJDIR/ipc/ipdl/_ipdlheaders when invoked through the build system). The headers are output in directories corresponding to the namespace(s) the protocol was defined within. So invoking the IPDL compiler on the Test protocol above, through the build system, will result in these files being (re)generated: <code>$OBJDIR/ipc/ipdl/_ipdlheaders/mozilla/test/TestProtocol.h</code>, <code>$OBJDIR/ipc/ipdl/_ipdlheaders/mozilla/test/TestProtocolParent.h</code>, <code>$OBJDIR/ipc/ipdl/_ipdlheaders/mozilla/test/TestProtocolChild.h</code>. Don't worry, the build system also sets up the C++ compiler's include path appropriately.
== Implement your protocol's generated C++ interface ==
Confirm
699
edits

Navigation menu