Rate This Document
Findability
Accuracy
Completeness
Readability

DG_InitConfigOpts

Initializes DataGuard's configuration function group.

int DG_InitConfigOpts ( 
   	DG_BusinessType type, 
        DG_ConfigOpts **opts
   )

Parameters

Table 1 Description

Parameter

Description

Value Range

Input/Output

type

Indicates the DataGuard component type, which is DG_BusinessType.

For cryptographic computing, the relevant enumerator leverages KCAL.

Input

opts

Indicates DataGuard's configuration function group. For details, see Table 2.

It is null as a single pointer and cannot be null as a double pointer.

Output

Table 2 DG_ConfigOpts structure

Member

Type

Description

init

Function pointer

int (*init)(DG_Cfg *config);

Initializes the config object.

release

Function pointer

int (*release)(DG_Cfg *config);

Releases the config object.

setIntValue

Function pointer

int (*setIntValue)(DG_Cfg config, const char* key, int value);

Sets the int value using a key-value pair.

setVoidValue

Function pointer

int (*setVoidValue)(DG_Cfg config, const char* key, const DG_Void* value);

Sets the void value using a key-value pair.

Return Values

  • Success: 0 is returned.
  • Failure: The error code is returned.

Error Codes

Table 3 Error codes

Error Code

Value

Description

Remarks

DG_ERR_CONFIG_PARAM

62

Failed to verify input parameters.

-

DG_ERR_CONFIG_DG_BUSINESS_TYPE

61

The type is incorrect.

For cryptographic computing, the relevant enumerator leverages KCAL.

Dependency

#include "data_guard_config.h": the header file where the API declaration is stored.

For cryptographic computing, the relevant enumerator leverages KCAL.

Example

#include "data_guard_config.h"
DG_ConfigOpts *opts = NULL;
int rv = DG_InitConfigOpts(DG_BusinessType::KCAL, &opts);
if (rv != 0) {
return rv;
}