This is version 3.
It is not the current version, and thus it cannot be edited.
[Back to current version]
[Restore this version]
New Initialization Scheme for SICS
The idea behind this scheme is, to have to edit only
one list when adding a new feature. Let us look at the
difference when adding a command or driver. Before using this
scheme, there were many different places in psi/psi.c where
modifications had to be added:
- when adding a new command
- prototype declaration of the command function or include
statement
- inserting the command to the AddPsiCommands function
- if it is a startup command, inserting the command to
the RemovePsiCommands function
- when adding a new driver
- prototype declaration of the driver creation function or
include statement
- adding a "else if" clause to the CreatePsiXXX function
- in the case of an envitonment driver, also add an "else if"
clause to the ConfigureController function.
With the new scheme, for a module one has one init function,
with prototype "void (void)" placed in the source file of the module.
In this function, for standalone commands, either AddIniCmd or
AddCmd is called to insert a startup or normal command. To create
a new driver, use either the MakeDriver function, if you want
to use the MakeObject command to create the driver, or the functions
MakeInitializer/GetInitializer, if you want to do use an other
factory command.
SCinter.h
initializer.h
This particular version was published on 13-Sep-2005 06:27:03 UTC by MarkusZolliker.
|