1.13 Read Requests for Schema Information

The schema read functions work similar to the read functions for database entry (object) information. They use input and output buffers, information types, iteration handles if the result buffer may not be able to contain all the requested information, and specialized functions for retrieving the information from the result (output) buffer. See Section 1.3, Read Requests for Object Information if you are not familiar with these procedures.

Class Definition Functions. The following table lists the functions that you can use to read information about object class definitions.The list includes the functions that read the information and the specialized functions that retrieve the information from the result buffer.

Function

Purpose

NWDSReadClassDef

Reads a class definition. This function is configurable so that you can control the type of information it returns about a class. All requested information about a class must be retrieved before moving to the next class.

NWDSListContainableClasses

Returns the names of the object classes that the specified object class can contain.

NWDSGetClassDefCount

Returns the number of class definitions in the result buffer.

NWDSGetClassDef

Retrieves the name of an object class and, if requested, the class flags and ASN.1 identifier.

NWDSGetClassItemCount

Returns the number of items of a particular information type. Must be called for each information type specified in the read request. For example, the DS_CLASS_DEFS information type returns five types of information: super classes, containment classes, naming attributes, mandatory attributes, and optional attributes. This function must be called once for each of these types, but only after all the information items of the previous type has been retrieved.

NWDSGetClassItem

Returns a class information item. Must be called repeatedly for each item in the count. For example, if the class has two super classes, it must be called twice to retrieve the two super class names.

For step-by-step instructions for reading schema information, see the following:

For sample code, see rdclsdef.c.

Attribute Definition Functions. The following table lists the functions that you can use to read attribute type definitions. The list includes the functions that read the information and the specialized functions that retrieve the information from the result buffer.

Function

Purpose

NWDSReadAttrDef

Reads existing attribute type definitions.

NWDSGetAttrCount

Returns the number of attributes whose information is stored in a result buffer.

NWDSGetAttrDef

Returns the next attribute definition from a result buffer.

For step-by-step instructions on reading attribute definitions, see Reading an Attribute Definition.

For sample code, see rdattdef.c.

Attribute Syntax Definition Functions. The following table lists the functions that you can use to read information about syntaxes and their definitions. The list includes the read functions and the specialized functions that retrieve the information from the result buffer.

Function

Purpose

NWDSReadSyntaxDef

Returns the syntax definition for the specified syntax ID.

NWDSGetSyntaxID

Returns the syntax ID for the specified attribute.

NWDSReadSyntaxes

Returns a list of attribute syntax definitions. You can configure this function to return just names or names and definitions.

NWDSGetSyntaxCount

Returns the number of syntaxes whose information is stored in a result buffer filled by the NWDSReadSyntaxes function.

NWDSGetSyntaxDef

Returns the next syntax definition from a result buffer filled by the NWDSReadSyntaxes function.

For step-by-step instructions on reading syntax definitions, see Retrieving Syntax Names and Definitions.