Initializes the Information Catalog Manager API DLL for use, connects the application to the database, and retrieves environmental information that you can use with other API calls.
Authorization
Administrator or user
Syntax
APIRET APIENTRY FLGInit( PSZ pszUserID,
PSZ pszPassword,
PSZ pszDatabaseName,
FLGADMIN Admin,
PFLGHEADERAREA * ppListStruct,
PFLGEXTCODE pExtCode );
Parameters
If there is no output structure, the pointer to the output structure is set to NULL, and the Information Catalog Manager returns an error condition with a reason code.
See Appendix D, Information Catalog Manager reason codes for an explanation of the returned reason codes.
Output structure
FLGInit produces an output structure containing information about the Information Catalog Manager environment, as shown in Figure 83.
The object area of the output structure contains the required registration and object properties in the user's national language. The object area also contains values that provide information about the user's Information Catalog Manager environment.
Figure 83. FLGInit output structure
Usage
The output structure returns the 80-byte property names required for all object type registrations, object types, and objects.
If you are using a non-English version of the Information Catalog Manager, the values in the object area for each of these properties are translated. You need to save these translated values so that you can use them with FLGCreateReg and FLGCreateType.
Freeing memory allocated for an output structure
If FLGInit returned data in the output structure, you must save the data returned in the output structure and then call FLGFreeMem (see FLGFreeMem). Do not use other methods, for example, C language instructions, to free memory.
Table 17 shows the required properties that are returned by
FLGInit.
Table 17. Required property names returned by FLGInit
Property name | Description |
---|---|
EXTERNAL NAME OF OBJ TYPE | First registration property in any object type registration |
PHYSICAL TYPE NAME | Second registration property in any object type registration |
DP NAME | Third registration property in any object type registration |
CREATOR | Fourth registration property in any object type registration |
LAST CHANGED BY | Fifth registration property in any object type registration |
LAST CHANGED DATE AND TIME | Sixth registration property in any object type registration |
Object type identifier | First required property on any object type |
Instance identifier | Second required property on any object type |
Name | Third required property on any object type |
Last Changed Date and Time | Fourth required property on any object type |
Last Changed By | Fifth required property on any object type |
This output structure also returns environmental values. Save these
values to use with other API calls.
Table 18. Environmental values returned by FLGInit
Property name | Description |
---|---|
STORE ENVIRON | Database product name with the release number in
VxRxMx format. For example:
|
STORE ENVSIZE | Value indicating the maximum length of PTNAME for the information catalog in this environment. |
Not-applicable symbol | 1-character default token of the Information Catalog Manager environment to represent an unspecified data field. This value was set during installation. |
VERSION | 20-character indicator of the version of the Information Catalog Manager. |
LANGUAGE | 3-character national language code; for example, ENU indicates
English. Valid values are:
|
KAUSERID | 8-character user ID for the administrator currently logged on. |
Product Path | 260-character full working path for the Information Catalog Manager. |
System Path Length | 8-character value for the maximum path length for the system. |
Code page | 4-character code page identifier |
User Type | 1-character identifier, set to:
|
Figure 84 shows the C language code required to invoke the FLGInit API call. This sample code initializes the Information Catalog Manager API DLL so that information applications can issue calls to the Information Catalog Manager API.
Figure 84. Sample C language call to FLGInit
UCHAR pszUserID[FLG_USERID_LEN + 1];
UCHAR pszPassword[FLG_PASSWORD_LEN + 1];
UCHAR pszDatabaseName[FLG_DATABASENAME_LEN + 1];
FLGADMIN admin = FLG_YES;
APIRET rc; // reason code
PFLGHEADERAREA * ppListStruct; // pointer to output structure pointer
FLGEXTCODE ExtCode = 0; // Extended code
.
. // IA specific code
.
strcpy( pszUserID, "LAUTZ" );
strcpy( pszPassword, "MYPASSWD");
strcpy( pszDatabaseName, "CATALOG");
rc = FLGInit (pszUserName,
pszPassword,
pszDatabaseName,
admin,
ppListStruct,
&ExtCode );
. // Issue FLGFreeMem to release the output structure created by FLGInit
. // Calls to the FLG API
. // When complete, call
. // FLGTerm()
Figure 85 shows the output structure.
Figure 85. Sample output structure for FLGInit