INFORMIX
DataBlade API Programmer's Manual
Chapter 12: DataBlade API Function Descriptions
Home Contents Index Master Index New Book

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.

    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().

    2. It initializes the fields in the LO-specification structure, which LOspec_dptr references.

    When the smart-large-object optimizer receives this initialized LO-specification structure, it uses system-specified storage characteristics for the new smart large object.

Important: Before you use an LO-specification structure in a DataBlade routine, 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 allocate a new LO-specification structure and the mi_lo_spec_free() function to deallocate an LO-specification structure.

Return Values

MI_OK

The function was successful.

MI_ERROR

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().

In Chapter 3, "Handling Smart Large Objects," see "The LO-Specification Structure", "Initializing an LO-Specification Structure", and "Choosing Storage Characteristics".




DataBlade API Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.