Copy storage characteristics from an existing smart large object

The mi_lo_stat_cspec() function copies the created specification storage characteristics from an existing smart large object to a flags field that can then be passed to mi_lo_create() to create a smart large object. This function is used when you want a new smart large object to have the same characteristics as an existing smart large object.

The LO_stat structure in the following example holds status information for an existing smart large object. You initialize an LO-status structure with the mi_lo_stat() function.

The following code fragment assumes that the old_LOfd variable has already been initialized as the LO file descriptor of an existing smart large object. This code fragment uses the storage characteristics of the existing smart large object (which the mi_lo_stat() function puts into the MI_LO_STAT structure that LO_stat specifies) as the create time storage characteristics for the new smart large object that the mi_lo_create() function creates.

MI_LO_HANDLE *LO_hdl = NULL;
MI_LO_STAT *LO_stat = NULL;
MI_LO_SPEC *LO_spec;
MI_LO_FD new_LOfd, old_LOfd;
mi_integer  flags;
...
if ( mi_lo_stat(conn, old_LOfd, &LO_stat) != MI_OK )
   {
   /* handle error and exit */
   }
LO_spec = mi_lo_stat_cspec(LO_stat);
new_LOfd = mi_lo_create(conn, LO_spec, flags, &LO_hdl);