om_encode(3xom) — Subroutines
(c) Digital Equipment Corporation. 1994. All rights reserved.
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 |
C Binding
OM_return_code om_encode(original, rules, encoding) OM_private_object original,
OM_object_identifier rules,
OM_private_object ∗encoding
Arguments
OriginalThe object you want to encode.
RulesThe set of rules that the Service must follow to produce an encoding. In this version of the OM API, you can only specify ASN.1 BER.
EncodingAn 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 routine is OM_SUCCESS. The returned object is an instance of the Encoding class.
Description
This routine creates a new private object, the encoding, which exactly and independently encodes an existing private object, the original.
When you apply this routine to a private object, the routine 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_SUCCESS | The routine has completed its task successfully |
| OM_FUNCTION_DECLINED | The routine does not apply to the object to which it is addressed |
| OM_FUNCTION_INTERRUPTED | The routine was aborted by external intervention |
| OM_MEMORY_INSUFFICIENT | There is not enough memory to complete the routine |
| OM_NETWORK_ERROR | The Service cannot use the underlying network |
| OM_NO_SUCH_OBJECT | You have specified a nonexistent object, or an invalid Handle for an object |
| OM_NO_SUCH_RULES | There is an undefined rules identifier |
| OM_NOT_PRIVATE | There is a public object where there should be a private object |
| OM_NOT_THE_SERVICES | There is a client-generated public object where there should be either a service-generated public object or a private object |
| OM_PERMANENT_ERROR | The Service encountered a permanent problem for which there is no defined error code |
| OM_POINTER_INVALID | An invalid pointer was supplied as a routine argument |
| OM_SYSTEM_ERROR | The Service cannot use the operating system |
| OM_TEMPORARY_ERROR | The Service encountered a temporary problem for which there is no defined error code |
Examples
The following example shows the encoding of an object of the MH class Report (encodable_object). The object is encoded according to the rules OM_BER, and the encoded object is encoding.
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 ∗/