om_copy(3xom) — Subroutines
(c) Digital Equipment Corporation. 1994. All rights reserved.
Name
om_copy − Creates a copy of an existing private object.
Syntax
OM_return_code om_copy(original, workspace, copy)
original@OM_private object@T{ read T} workspace@OM_workspace@T{ read T} copy@OM_private_object@T{ write T} return_code@T{ OM_return_code T}
C Binding
OM_return_code om_copy(original, workspace, copy)
OM_private_object original,
OM_workspace workspace,
OM_private_object #copy
Arguments
Original
The original private object.
Workspace
The workspace in which the Service creates the copy. The workspace that the Client specifies in this argument must be one that is associated with a package containing the class of the original object.
Copy
The copy of the original object. The Service returns this argument if the Return Code of the function is OM_SUCCESS.
Description
This function creates a new private object, the copy, which is an exact but independent copy of an existing private object, the original. The function also copies the original’s subobjects, if it has any.
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
The function has completed its task successfully T} OM_FUNCTION_INTERRUPTED@T{ The function was aborted by external intervention T} OM_MEMORY_INSUFFICIENT@T{ There is not enough memory to complete the function T} OM_NETWORK_ERROR@T{ The Service cannot use the underlying network T} OM_NO_SUCH_CLASS@T{ There is an undefined class identifier T} OM_NO_SUCH_OBJECT@T{ You have specified a nonexistent object, or an invalid Handle for an object T} OM_NO_SUCH_WORKSPACE@T{ You have specified a nonexistent workspace T} OM_NOT_PRIVATE@T{ There is a public object where there should be a private object T} OM_PERMANENT_ERROR@T{ The Service encountered a permanent problem for which there is no defined error code T} OM_POINTER_INVALID@T{ An invalid pointer was supplied as a function argument T} OM_SYSTEM_ERROR@T{ The Service cannot use the operating system T} OM_TEMPORARY_ERROR@T{ The Service encountered a temporary problem for which there is no defined error code T} OM_TOO_MANY_VALUES@T{ An implementation limit prevents the addition to an object of another attribute value T}
Examples
The following example shows how to copy an object of the MH class Local NDR (ndr). The copy is ndr_copy.
Exhibit 0-0.
OM_return_code result;
OM_private_object ndr,
ndr_copy;
OM_workspace workspace;
result = om_copy (ndr,
/∗ object to be copied ∗/
workspace,
/∗ workspace in which to create copy ∗/
&ndr_copy);
/∗ the copy ∗/