om_intro - This reference page introduces the OM API functions.
Syntax
This reference page defines the functions of the C interface in the Digital X.500 product.
As indicated in the table, the service interface comprises a number of functions whose purpose and range of capabilities are summarized as follows:
The intent of the interface definition is that each function be atomic; that is, either it carries out its assigned task in full and reports success, or it fails to carry out even a part of the task and reports an exeception. However, the service does not guarantee that a task is always carried out in full.
om_copy(3xom)
Name
om_copy - Creates a copy of an existing private object.
Syntax
OM_return_code om_copy(original, workspace, copy)
Argument | Data Type | Access |
---|---|---|
original
|
OM_private object
|
read
|
workspace
|
OM_workspace
|
read
|
copy
|
OM_private_object
|
write
|
return_code
|
OM_return_code
|
|
OM_return_code om_copy(original, workspace, copy)
OM_workspace workspace,
OM_private_object #copy
Arguments
The copy of the original object. The Service returns this argument if the
Return Code of the function is OM_SUCCESS.
Description
The Client can specify a workspace in which the Service should place the copy. If the Client does not do so, the Service places the copy in the original's workspace.
Return Values
OM_return_code result;
OM_private_object ndr,
ndr_copy;
OM_workspace workspace;
result = copy (ndr,
/* object to be copied */
workspace,
/* workspace in which to create copy */
&ndr_copy);
/* the copy */
om_copy_value(3xom)
Name
om_copy_value - Copies a value (string) from a private object and places it in another private object.
Syntax
OM_return_code om_copy_value(source, source_type, source_value_position, destination, destination_type, destination_value_position)
C Binding
OM_return_code om_copy_value(source, source_type, source_value_position,destination, destination_type, destination_value_position)
OM_type source_type,
OM_value_position source_value_position,
OM_private_object destination,
OM_type destination_type,
OM_value_position destination_value_position
Arguments
The object from which you want to copy the value.
The type of the attribute value from which you want tocopy the value.
The position within the attribute of the value to be copied.
The object to which you want to copy the value.
The type of the attribute to which you want to copy thevalue.
The position within the destination attribute at which you want to place the
copied value. If the value of this argument exceeds the number of values in
the Destination attribute, then it is taken to be equal to that number.
Description
This function either replaces, or fills in for the first time, an attribute value in the destination object with a copy of an attribute value from the source object. The source value should be a string. The copy has the same syntax as the source value.
Return Values
This call to Copy Value reads the string value at position 0 in the Content Identifier attribute of
envelope1
. This value is then copied to position 0 in the Content Identifier attribute of envelope2
.
om_create(3xom)
Name
om_create - Creates a new private object that is an instance of a particular class.
Syntax
OM_return_code om_create(class, initialize, workspace, object)
Argument | Data Type | Access |
---|---|---|
class
|
OM_object_identifier
|
read
|
initialize
|
OM_boolean
|
read
|
workspace
|
OM_workspace
|
read
|
object
|
OM_private_object
|
write
|
return_code
|
OM_return_code
|
|
OM_return_code om_create(class, initialize, workspace, object)
OM_boolean initialize,
OM_workspace workspace,
OM_private_object #object
Arguments
The class of the object you are creating. It must be a concrete class.
This is the created object. The Service returns this argument if the Return
Code of the function is OM_SUCCESS.
Description
This function creates a private object in the workspace that you specify.
You can add new values and replace or remove existing values, any time after the object has been created. In this way, you can create any possible instance of the object's class.
Return Values
OM_private_object ndr;
OM_workspace workspace;
OM_return_code result;
OM_private_object select_info;
OM_workspace workspace;
OM_return_code result;
result = om_create (DS_C_ENTRY_INFO_SELECTION,
/* class of object */
OM_TRUE,
/* initialize attributes */
workspace,
/* workspace in which object created */
&select_info);
/* created object */
om_decode(3xom)
Name
om_decode - Creates a new private object that decodes an existing ASN.1 private object.
Syntax
OM_return_code om_decode(encoding, original)
Argument | Data Type | Access |
---|---|---|
encoding
|
OM_private_object
|
read
|
original
|
OM_private_object
|
write
|
return_code
|
OM_return_code
|
|
OM_return_code om_decode(encoding, original)
OM_private_object #original
Arguments
The encoded object that you want to decode. It must be an instance of the
Encoding class.
An object that is the decoded version of the encoding. The Service creates
this object in the workspace in which the encoding is located. The Service
returns this argument if the Return Code of the function is
OM_SUCCESS.
Description
This function creates a new private object by decoding the ASN.1 of the original object.
In the Encoding argument, you specify the class of the existing object and the rules used to encode it. In the current version of the OM API, you must specify ASN.1 BER.
Return Values
OM_return_code result;
OM_private_object encoding,
decoded_object;
result = om_decode (encoding,
/* object to be decoded */
&decoded_object);
/* decoded object */
om_delete(3xom)
Name
om_delete - Deletes a service-generated public object or makes a private object inaccessible.
Syntax
OM_return_code om_delete(subject)
Argument | Data Type | Access |
---|---|---|
subject
|
OM_object
|
read
|
return_code
|
OM_return_code
|
|
OM_return_code om_delete(subject)
The object that you want the Service to delete. It must be a
service-generated public object or a private object. If the object that you
specify is a client-generated public object, the function returns an error
status.
Description
This function deletes a service-generated public object, or makes a private object inaccessible.
When you apply this function to a private object, the function makes the object inaccessible by making its Handle invalid. The function also makes invalid the Handles of any private subobjects of the subject. Note that the effect of using an object's Handle once it has been made invalid is undefined.
Return Values
OM_return_code result;
OM_private_object info_select;
OM_object info_select_copy;
OM_value_position total_number;
result = om_get (info_select,
/* object to be copied */
OM_NO_EXCLUSIONS,
/* no exclusions */
NULL,
/* ignored because no exclusions specified */
OM_FALSE,0,0,
/* no translation into local char set */
&info_select_copy,
/* the copy */
&total_number);
/* number of attributes copied */
/* Examine info_select_copy public object using C programming language
constructs */
/* Delete object when finished with it */
result = om_delete (info_select_copy);
/* the object to be deleted */
om_encode(3xom)
Name
om_encode - Creates a new private object that encodes an existing private object.
Syntax
OM_return_code om_encode(original, rules, encoding)
Argument | Data Type | Access |
---|---|---|
original
|
OM_private_object
|
read
|
rules
|
OM_object_identifier
|
read
|
encoding
|
OM_private_object
|
write
|
return_code
|
OM_return_code
|
|
OM_return_code om_encode(original, rules, encoding)
OM_object_identifier rules,
OM_private_object #encoding
Arguments
The object you want to encode.
An object that is the encoded version of the original. The Service creates
this object in the workspace in which the original is located. The Service
returns this argument if the Return Code of the function is
OM_SUCCESS. The returned object is an instance of the Encoding class.
Description
This function creates a new private object, the encoding, which exactly and independently encodes an existing private object, the original. When you apply this function to a private object, the function uses the encoding rules you specify to create a new private object. The new encoded private object is independent of the original private object.
Return Values
OM_return_code result;
OM_private_object encodable_object,
encoding;
result = om_encode (encodable_object,
/* object to be encoded */
OM_BER,
/* encoding rules */
&encoding);
/* encoded object */
om_get(3xom)
Name
om_get - Creates a new public object that is a copy of the whole or part of a private object.
Syntax
OM_return_code om_get(original, exclusions, included_types, local_strings, initial_value, limiting_value, copy, total_number)
C Binding
OM_return_code om_get(original, exclusions, included_types, local_strings, initial_value, limiting_value, copy, total_number)
OM_exclusions exclusions,
OM_type_list included_types,
OM_boolean local_strings,
OM_value_position initial_value,
OM_value_position limiting_value,
OM_public_object #copy,
OM_value_position #total_number
Arguments
The private object, all or part of which you want to copy.
The copy includes descriptors of attributes of specified types only.
The copy includes a single descriptor for each attribute having two or
more values, instead of one descriptor for each value. Each such
descriptor contains no attribute value, and the No-Value bit of the syntax
component is set. If the attribute has values of two or more syntaxes, the
descriptor identifies one of those syntaxes. Which syntax it identifies is
unspecified.
The copy includes descriptors encompassing only values at specified
positions within an attribute.
The copy includes a single descriptor for each attribute value, but the
descriptor does not contain the value, and the No-Value bit of the syntax
component is set.
The copy includes a descriptor for each value which has a syntax of
object. Each descriptor contains an object Handle for the original private
subobject, instead of a public copy of the original private subobject. The
Handle makes the private subobject accessible for use in OM function
calls.
The function does not return any descriptors, nor does it return a value
in the Copy argument. The value of the Total Number argument gives
the number of descriptors which would have otherwise been returned.
The copy contains descriptors and values for all attributes in the
original.
The number of attribute descriptors in the copy. This does not include
descriptors in any subobjects of the copy. If you specify the
OM_EXCLUDE_DESCRIPTORS exclusion, then there is no copy.
Therefore, the value in Total Number is the number of descriptors that the
Service would return if you did not specify
OM_EXCLUDE_DESCRIPTORS (applying any other exclusions that you
specified). Total Number excludes the special descriptor that signals the
end of a public object, OM_NULL_DESCRIPTOR.
Description
Note that if you are using the OM API with the X.400 API, you can read
long strings using om_read.
dsX_trace_object(spub_RDNS);
/* Now loop around each RDN, extract a pointer to the AVAS
and then extract the attribute type and value
*/
...
/* When finished, remember to delete all the objects you have used */
om_instance(3xom)
Name
om_instance - Determines whether an object is an instance of a particular class or of one of its subclasses.
Syntax
OM_return_code om_instance(subject, class, instance)
Argument | Data Type | Access |
---|---|---|
subject
|
OM_object
|
read
|
class
|
OM_object_identifier
|
read
|
instance
|
OM_boolean
|
write
|
return_code
|
OM_return_code
|
|
OM_return_code om_instance(subject, class, instance)
OM_object_identifier class,
OM_boolean #instance
Arguments
The object whose class you want to verify.
The class against which you want to verify the subject.
The Service sets this argument to OM_TRUE if the subject is an instance
of the class you specified, and OM_FALSE if the subject is not. The
Service returns this argument if the Return Code of the function is
OM_SUCCESS.
Description
Note that it is possible to determine an object's class by using programming constructs to inspect the object, if it is public, or by using om_get, if it is private. The advantage of the Instance function is that it indicates whether the object is an instance of the specified class, even when it is also a subclass of the specified class.
Return Values
OM_private_object sub_mess_rd;
OM_return_code result;
OM_boolean inst;
result = om_instance (an_object,
/* object to be checked */
MH_C_SUBMITTED_MESSAGE_RD,
/* class to be checked against */
&inst);
/* result */
if (inst == OM_TRUE)
/* the object is an instance of specified class */
else
/* the object is not an instance of specified class */
om_put(3xom)
Name
om_put - Places copies of the attribute values of a private or public object into a private object.
Syntax
OM_return_code om_put(destination, modification, source, included_types, initial_value, limiting_value)
C Binding
OM_return_code om_put (destination, modification, source, included_types, initial_value, limiting_value)
OM_modification modification,
OM_object source,
OM_type_list included_types,
OM_value_position initial_value,
OM_value_position limiting_value
Arguments
The Modification argument can have one of the following values:
The Service inserts the source values before all existing destination
values. This does not affect the existing destination values.
The Service inserts the source values before the value at a specified
position in the destination attribute. This does not affect the existing
destination values.
The Service inserts the source values after all existing destination
values. This does not affect the existing destination values.
The Service replaces any destination values with the source values, and
discards the original destination values.
Meaning of the Initial Value Argument
The position within each destination attribute at which the Service should
insert source values
The first value that the Service should replace
If you give this argument a value that is greater than the number of values
present in a destination attribute, or if you use the value
OM_ALL_VALUES, the Service takes Limiting Value to be equal to the
number of values present in the destination attribute.
Description
You must specify that the Service does one of the following:
The destination object contains an attribute, D, which is not affected by om_put.
Return Values
The following example shows how to put the values from a public object into the private object.
result = om_put (modification,
/* destination object */
OM_REPLACE_ALL,
/* type of modification */
pub_mod,
/* source of values to be put */
0,0,0);
/* include all attributes, all positions */
om_read(3xom)
Name
om_read - Reads a segment of a string from a private object.
Syntax
OM_return_code om_read(subject, type, value_position, local_string, string_offset, elements)
C Binding
OM_return_code om_read(subject, type, value_position, local_string, string_offset, elements)
OM_type type,
OM_value_position value_position,
OM_boolean local_string,
OM_string_length #string_offset,
OM_string #elements
Arguments
The private object from which you want to read the segment.
The type of the attribute containing the value that youwant to read.
The position in a multivalued attribute of the value that you want to read.
The following shows the initial values that you should give to these
components:
String Component
|
Initial Value
|
Elements
|
Pointer to a buffer
|
Length
|
The number of octets required to contain the segment that the function returns
|
You must make sure that the buffer is big enough to hold the number of
octets.
If the value of Local Strings is OM_TRUE, the final length of the string
may not be the same as the initial length of the string. This depends on the
characteristics of the translation into the local character set.
Description
The function enables you to read a long string without requiring the Service to place a copy of the entire string in memory.
Return Values
The type of the attribute read is
IM_TEXT
. The first element of the first value in this attribute is read into message
.
om_remove(3xom)
Name
om_remove - Removes and discards specified values of an attribute of a private object.
Syntax
OM_return_code om_remove(subject, type, initial_value, limiting_value)
Argument | Data Type | Access |
---|---|---|
subject
|
OM_private_object
|
read
|
type
|
OM_type
|
read
|
initial_value
|
OM_value_position
|
read
|
limiting_value
|
OM_value_position
|
read
|
return_code
|
OM_return_code
|
|
OM_return_code om_remove(subject, type, initial_value, limiting_value) OM_private_object subject,
OM_value_position initial_value,
OM_value_position limiting_value
Arguments
The type of the attribute from which you want to remove values. The type
must not be OM_CLASS.
The position within the attribute of the first value to be removed.
If the value of Limiting Value is OM_ALL_VALUES, or if the value
exceeds the number of values present in an attribute, the Service takes this
argument to be equal to thenumber of values present in the attribute.
Description
This function removes and discards particular values of an attribute of a private object, the subject. If no values remain in an attribute after removal of the values you specify, the Service removes the attribute. If one of the values you specify is a subobject, the Service removes that value, and then applies om_delete to make the subobject inaccessible.
Return Values
OM_private_object select_info;
OM_return_code result;
result = om_remove (select_info,
/* object from which to remove value */
DS_ATTRIBUTES_SELECTED,
/* attribute to remove */
1,4));
/* range of values to remove */
om_write(3xom)
Name
om_write - Writes a segment of a string to an attribute in a private object.
Syntax
OM_return_code om_write(subject, type, value_position, syntax, string_offset, elements )
C Binding
OM_return_code om_write(subject, type, value_position, syntax, string_offset, elements )
OM_type type,
OM_value_position value_position,
OM_syntax syntax,
OM_string_length #string_offset,
OM_string elements
Arguments
The object into which you want to write the string segment.
The type of the attribute to which you want to write the string segment.
The elements are bits, octets, or characters, depending on the nature of the
string.
Description
If the segment that the Service writes is in the local representation, the Service converts it to the nonlocal representation. This can result in loss of information and may result in a different number of elements than that specified.
Return Values
input_string);
/* string segment to be written */
To make comments or ask for help, contact support@entegrity.com.