Initializing help system before first use

findident

Purpose
Find an identifier in the dictionary.
Synopsis
int findident(XPRMcontext ctx, const char *name, XPRMalltypes *value,int flags);
Arguments
ctx 
Mosel's execution context
name 
Identifier
value 
Pointer to an area where the dictionary entry is returned
flags 
Bit encoded options. Possible values:
XPRM_FID_NOLOC 
Look only for global symbols (local symbols, if any, are ignored)
XPRM_FID_BTREF 
For a reference to a basic type entity return the pointer instead of the value
Return value
Aggregated type information of the returned dictionary entry, or 0 if the identifier is not registered.
Example
Further information
1. This function returns the dictionary entry of a given identifier for a given model together with its type. By default the dictionary contains only global public symbols, private symbols are included when the model is compiled with option "-g". The routine will also return local symbols (according to the current context) if the model was compiled with option "-G" and the option flag does not include XPRM_FID_NOLOC.
2. The returned type information is bit encoded and associates a type code and a structure that can be extracted using the macros XPRM_TYP(t) and XPRM_STR(t).
The possible structures are:
XPRM_STR_CONST 
the object is a constant scalar
XPRM_STR_REF 
the object is a reference
XPRM_STR_LIST 
the object is a list
XPRM_STR_SET 
the object is a set
XPRM_STR_ARR 
the object is an array
XPRM_STR_PROC 
the object is a procedure or function
XPRM_STR_MEM 
the object is a memory block
XPRM_STR_UTYP 
the object is a user defined type
Depending on the structure, the possible type codes are:
XPRM_TYP_NOT 
no type (procedure)
XPRM_TYP_INT 
integer (constant, reference, list, set, array, function)
XPRM_TYP_REAL 
real (constant, reference, list, set, array, function)
XPRM_TYP_STRING 
text string (constant, reference, list, set, array, function)
XPRM_TYP_BOOL 
Boolean (constant, reference, list, set, array, function)
XPRM_TYP_MPVAR 
decision variable (reference, list, set, array)
XPRM_TYP_LINCTR 
linear constraint (reference, list, set, array)
Any other value designates an external type (type provided by a module or defined in the model). Moreover, if the structure is XPRM_STR_UTYP, the identifier is the name of a user type and the value (an integer) corresponds to the expanded form of this type (see gettypeprop). Otherwise, the function gettypeprop can be used to get the name and the properties of this type.
The union XPRMalltypes groups all possible types and the result of a call to findident is decoded as follows depending on the structure:
value.integer 
for constant, reference (without option XPRM_FID_BTREF) or user type
value.real 
for constant or reference (without option XPRM_FID_BTREF)
value.string 
for constant or reference (without option XPRM_FID_BTREF)
value.boolean 
for constant or reference (without option XPRM_FID_BTREF)
value.mpvar 
for reference
value.linctr 
for reference
value.list 
for list (to be used as input for list functions)
value.set 
for set (to be used as input for set functions)
value.array 
for array (to be used as input for array functions)
value.ref 
for a reference to an external type (available operations depend on the actual type) or a reference to a basic type (if option XPRM_FID_BTREF is used)
value.proc 
for procedure and function
value.memblk 
for memory block
Memory blocks are generated by the mem IO driver when used with a label. Blocks created this way can be found using the label: the name is linked to the following structure describing the block:
typedef struct
   {
    void *ref;    /* Base address of the block */
    size_t size;  /* Size of the block */
   } XPRMmemblk;
Note that memory blocks allocated by Mosel are managed by the memory manager of the IO driver and must not be explicitly released.
3. When the model is compiled with debug information (flags "-g" or "-G") both public and private symbols may be returned by this function. The macro XPRM_IS_PUBLIC(t) applied to the encoded type makes it possible to identify public entities.
Related topics

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.