From RTSC-Pedia

Jump to: navigation, search
revision tip
—— LANDSCAPE orientation
[printable version]  [offline version]offline version generated on 04-Aug-2010 21:08 UTC

C - Params init

Initialize new instance creation parameters

Contents

Synopsis

 
 
#include <«pkg»/«Mod».h>
Void «Mod»_init(«Mod»_Params *params);

Description

Prior to creating a new instance managed by «Mod» with non-default parameters, you must first initialize a structure, named «Mod»_Params, with the default parameters.

 
 
 
 
Mod_Params params;           /* declare space for a Mod_Params structure */
Mod_Params_init(&params);    /* initialize all params to their defaults */
params.«inst_config» = ...;  /* assign a custom value to «inst_config» */
Mod_create(&params, NULL);   /* create an instance with this custom setting */

It is possible to "bind" a name to each instance of any module at the time the instance is created (or constructed).

 
 
 
 
Mod_Params params;
Mod_Params_init(&params);
params.instance->name = "myInstance";
Mod_create(&params, NULL);

The name field must be assigned a pointer to a buffer that persists as long as the instance that it names exists. Only a reference to the name is retained in the instance, the name is not copied to a secondary buffer. If instances have been configured to not support names, it is still possible to assign to the instance.name field of the parameter structure (as shown above). However, the pointer is not retained and methods that normally return an instance's name will return NULL instead.

See also

C - create Allocate and initialize a new instance object and return its handle
C - construct Initialize a new instance object inside the provided structure
C - Params_copy Copy instance creation parameters
[printable version]  [offline version]offline version generated on 04-Aug-2010 21:08 UTC
Copyright © 2008 The Eclipse Foundation. All Rights Reserved


Views
Personal tools
package reference