struct hwCstStruct *list = GetConstants(void);
struct hwCstStruct
items
that contains a number of constants this plugin wants to make available. The array
must be terminated by three NULL
elements. struct hwCstStruct
looks like this:
struct hwCstStruct { STRPTR Name; STRPTR StrVal; double Val; }; |
Constants can be either a string or a number. If the StrVal
member is set
to NULL
, the constant will use the numerical value specified in Val
. Please
note that the name you pass in Name
must not contain the hash prefix.
The array that is to be returned by this function may look like this then:
struct hwCstStruct plugin_constants[] = { {"NUMBERTEST", NULL, 1234}, {"STRINGTEST", "Hello World", 0}, ... {NULL, NULL, 0} }; |
With a table like this the user would then be able to access the two new constants
#NUMBERTEST
and #STRINGTEST
if your plugin is installed.
Please note that your constant names should be chosen in a way that they do not conflict with inbuilt constants. It is good practice to prefix the constant names with the name of your plugin so that they can be clearly distinguished from inbuilt constants and there is no risk of conflict with existing constants.
If your plugin doesn't define any constants, you may also return NULL
.
struct hwCstStruct
elements or NULL