informix
Informix DataBlade API Programmer's Manual
DataBlade API Function Descriptions

mi_lo_spec_init()

The mi_lo_spec_init() function allocates and initializes the default system storage characteristics that are used to create a new smart large object.

Syntax

Usage

The mi_lo_spec_init() function is a constructor for the LO-specification structure. It performs the following steps to initialize an LO-specification structure:

  1. It handles memory allocation for an LO-specification structure.
  2. When the *LOspec_dptr value (a single indirect pointer to an LO-specification structure) is NULL, this function allocates an LO-
    specification structure. Before you use an LO-specification structure, set *LOspec_dptr to NULL so that mi_lo_spec_init() allocates space for the LO-specification structure. When *LOspec_dptr does not point to NULL, the mi_lo_spec_init() function assumes that *LOspec_dptr points to an LO-specification structure that has already been allocated via a previous call to mi_lo_spec_init().

  3. It initializes the fields in the LO-specification structure, which LOspec_dptr references.
  4. When the smart-large-object optimizer receives this initialized LO-specification structure, it uses system-specified storage characteristics for the new smart large object.

The mi_lo_spec_init() function allocates a new LO-specification structure in the current memory duration.

Important: Before you use an LO-specification structure in a DataBlade API module, you must either allocate a new one with the mi_lo_spec_init() function or obtain one from an existing smart large object with the mi_lo_stat_cspec() function. You can use the mi_lo_colinfo_by_ids() or mi_lo_colinfo_by_name() function to obtain storage characteristics that are associated with a particular column.

Do not use system memory-allocation calls (such as malloc() or mi_alloc()) to perform memory management for LO-specification structures. Use the mi_lo_spec_init() function to create a new LO-specification structure and the mi_lo_spec_free() function to free an LO-specification structure.

Return Values

MI_OK indicates that the function was successful.
MI_ERROR indicates that the function was not successful.

Related Topics

See the descriptions of the following functions: mi_lo_open(), mi_lo_spec_free(), mi_lo_specget_estbytes(), mi_lo_specget_extsz(), mi_lo_specget_flags(), mi_lo_specget_maxbytes(), mi_lo_specget_sbspace(), mi_lo_specset_estbytes(), mi_lo_specset_extsz(), mi_lo_specset_flags(), mi_lo_specset_maxbytes(), mi_lo_specset_sbspace(), and mi_lo_stat_cspec().

For more information, see The LO-Specification Structure, Initializing an LO-Specification Structure, and Choosing Storage Characteristics.


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved