Previous section.

Common Security: CDSA and CSSM
Copyright © 1997 The Open Group

NAME

DL_DataInsert

SYNOPSIS

CSSM_DB_UNIQUE_RECORD_PTR CSSMDLI DL_DataInsert
    (CSSM_DL_DB_HANDLE DLDBHandle,
    const CSSM_DB_RECORDTYPE RecordType,
    const CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR Attributes,
    const CSSM_DATA_PTR Data)

DESCRIPTION

This function creates a new persistent data record of the specified type by inserting it into the specified data store. The values contained in the new data record are specified by the Attributes and the Data. The attribute value list contains zero or more attribute values. The DL module may require initial values for the CSSM pre-defined attributes. The DL modules can assume default values for any unspecified attribute values or can return an error condition when DLM-required attributes values are not specified by the caller. The Data is an opaque object to be stored in the new data record.

PARAMETERS

DLDBHandle (input)

The handle pair that describes the add-in data storage library module to be used to perform this function and the open data store in which to insert the new data record.

RecordType (input)

Indicates the type of data record being added to the data store

Attributes (input/optional)

A list of structures containing the attribute values to be stored in that attribute and the meta information (schema) describing those attributes. The list contains at most one entry per attribute in the specified record type. The DL module can assume default values for those attributes that are not assigned values by the caller or may return an error. If the specified record type does not contain any attributes, this parameter must be NULL.

Data (input/optional)

A pointer to the CSSM_DATA structure which contains the opaque data object to be stored in the new data record. If the specified record type does not contain an opaque data object, this parameter must be NULL.

RETURN VALUE

A pointer to a CSSM_DB_UNIQUE_RECORD_POINTER containing a unique identifier associated with the new record. This unique identifier structure can be used in future references to this record using this DLDBHandle pairing. It may not be valid for other DLHandles targeted to this DL module or to other DBHandles targeted to this data store. When NULL is returned, an error has occurred. Use CSSM_GetError to obtain the error code.

ERRORS

CSSM_DL_INVALID_DL_HANDLE

Invalid data storage library handle.

CSSM_DL_INVALID_DB_HANDLE

Invalid Data Store handle.

CSSM_DL_INVALID_RECORDTYPE

Invalid record type for this data store.

CSSM_DL_INVALID_ATTRIBUTE

Invalid attribute for this record type in this data store.

CSSM_DL_MISSING_VALUE

Missing attribute or data value for this record type.

CSSM_DL_DATA_INSERT_FAIL

Add caused an exception.

SEE ALSO

DL_DataDelete

Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.
You should also read the legal notice explaining the terms and conditions relating to the CDSA documentation.

Contents Next section Index