PreviousNext

Procedure for Creating New Attributes

To create new attributes of your own on cell namespace entries, you must do the following:

1. Allocate a new ISO OID for the new attribute. For information on how to do this, see Programming in the CDS Namespace of this guide and the OSF DCE Administration Guide.

2. Enter the new attribute's name and OID in the file /.:/opt/dcelocal/etc/cds_attributes. This text file contains OID-to-readable string mappings that are used, for example, by cdscp when it displays CDS entry attributes. Each entry also gives a syntax for reading the information in the entry itself. This should be congruent with the format of the data you intend to write in the attribute. For more information about the cds_attributes file, see the OSF DCE Administration Guide.

3. In the xdscds.h header file, define an appropriate OID string constant to represent the new attribute.

For example, the following shows the xdscds.h definition for the CDS CDS_Class attribute:

# define OMP_O_DSX_A_CDS_Class "\x2B\x16\x01\x03\x0F"

Note the XDS internal form of the name. This is what DSX_A_CDS_Class looks like when it has been exported using OM_EXPORT in an application, as all OIDs must be. Thus, if you wanted to create a CDS attribute called CDS_Brave_New_Attrib, you would obtain an OID from your administrator and add the following line to xdscds.h:

# define OMP_O_DSX_A_CDS_Brave_New_Attrib "your_OID"

4. In an application, call the XDS ds_modify_entry( ) routine to add the attribute to the cell namespace entry of your choice.