layout_object_create Subroutine
Purpose
Initializes a layout context.
Library
Layout Library (libi18n.a)
Syntax
#include <sys/lc_layout.h>
int layout_object_create (locale_name, layout_object)
const char * locale_name;
LayoutObject * layout_object;
Description
The layout_object_create subroutine creates the LayoutObject structure associated with the locale specified by the locale_name parameter. The LayoutObject structure is a symbolic link containing all the data and methods necessary to perform the layout operations on context dependent and bidirectional characters of the locale specified.
When the layout_object_create subroutine completes without errors, the layout_object parameter points to a valid LayoutObject structure that can be used by other BIDI subroutines. The returned LayoutObject structure is initialized to an initial state that defines the behavior of the BIDI subroutines. This initial state is locale dependent and is described by the layout values returned by the layout_ object_getvalue subroutine. You can change the layout values of the LayoutObject structure using the layout_object_setvalue subroutine. Any state maintained by the LayoutObject structure is independent of the current global locale set with the setlocale subroutine.
Parameters
Item | Description |
---|---|
locale_name | Specifies a locale. It is recommended that you use the LC_CTYPE category by calling the setlocale (LC_CTYPE,NULL) subroutine. |
layout_object | Points to a valid LayoutObject structure that can
be used by other layout subroutines. This parameter is used only when
the layout_object_create subroutine completes without errors.
The layout_object parameter is not set and a non-zero value is returned if a valid LayoutObject structure cannot be created. |
Return Values
Upon successful completion, the layout_object_create subroutine returns a value of 0. The layout_object parameter points to a valid handle.
Error Codes
If the layout_object_create subroutine fails, it returns the following error codes:
Item | Description |
---|---|
LAYOUT_EINVAL | The locale specified by the locale_name parameter is not available. |
LAYOUT_EMFILE | The OPEN_MAX value of files descriptors are currently open in the calling process. |
LAYOUT_ENOMEM | Insufficient storage space is available. |