Tizen Native API  5.0
Immutable Index

Immutable, thread-safe version of Alphabetic Index.

Required Header

#include <utils_i18n.h>

Overview

This module provides thread-safe methods for bucketing, and random access to buckets and their properties, but does not offer adding records to the index.

Functions

int i18n_immutable_idx_create (i18n_alpha_idx_h index, i18n_immutable_idx_h *immutable_index)
 Creates an immutable index object.
int i18n_immutable_idx_destroy (i18n_immutable_idx_h index)
 Destroys the immutable index object.
int i18n_immutable_idx_get_bucket_count (i18n_immutable_idx_h index, int32_t *count)
 Returns the number of index buckets and labels, including underflow/inflow/overflow.
int i18n_immutable_idx_get_bucket_index (i18n_immutable_idx_h index, char *name, int32_t *number)
 Finds the index bucket for the given name and returns the number of that bucket.
int i18n_immutable_idx_get_bucket_label (i18n_immutable_idx_h index, int32_t bucket_index, char **label)
 Returns the label string of the index-th bucket.
int i18n_immutable_idx_get_bucket_label_type (i18n_immutable_idx_h index, int32_t bucket_index, i18n_alpha_idx_label_type_e *type)
 Returns the label type of the index-th bucket.

Typedefs

typedef void * i18n_immutable_idx_h
 An i18n_immutable_idx_h handle.

Typedef Documentation

typedef void* i18n_immutable_idx_h

An i18n_immutable_idx_h handle.

Use i18n_immutable_idx_* functions to operate on i18n_immutable_idx_h objects.

Since :
5.0

Function Documentation

int i18n_immutable_idx_create ( i18n_alpha_idx_h  index,
i18n_immutable_idx_h immutable_index 
)

Creates an immutable index object.

Since :
5.0
Remarks:
The created object should be released by the caller with the i18n_immutable_idx_destroy() function.
Parameters:
[in]indexThe alphabetic index the thread-safe version of which is to be created
[out]immutable_indexThe created immutable index object
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory

Destroys the immutable index object.

Since :
5.0
Parameters:
[in]indexThe immutable index to be destroyed
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
int i18n_immutable_idx_get_bucket_count ( i18n_immutable_idx_h  index,
int32_t *  count 
)

Returns the number of index buckets and labels, including underflow/inflow/overflow.

Since :
5.0
Parameters:
[in]indexThe immutable index object
[out]countThe number of index buckets
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
int i18n_immutable_idx_get_bucket_index ( i18n_immutable_idx_h  index,
char *  name,
int32_t *  number 
)

Finds the index bucket for the given name and returns the number of that bucket.

Use i18n_immutable_idx_get_bucket_label() or i18n_immutable_idx_get_bucket_label_type() to get bucket properties.

Since :
5.0
Parameters:
[in]indexThe immutable index object
[in]nameThe string to be sorted into an index bucket
[out]numberThe bucket number for the name
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
int i18n_immutable_idx_get_bucket_label ( i18n_immutable_idx_h  index,
int32_t  bucket_index,
char **  label 
)

Returns the label string of the index-th bucket.

Since :
5.0
Remarks:
The returned string should be freed by the caller with free() function.
Parameters:
[in]indexThe immutable index object
[in]bucket_indexThe bucket number
[out]labelThe label string for the bucket
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_INDEX_OUTOFBOUNDSDesired position is out of bounds

Returns the label type of the index-th bucket.

Since :
5.0
Parameters:
[in]indexThe immutable index object
[in]bucket_indexThe bucket number
[out]typeThe alphabetic index label type
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_INDEX_OUTOFBOUNDSDesired position is out of bounds