[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

layout_object_getvalue Subroutine


Queries the current layout values of a LayoutObject structure.


Layout Library (libi18n.a)


#include <sys/lc_layout.h> 

int layout_object_getvalue( layout_object, values, index)
LayoutObject layout_object;
LayoutValues values;
int *index;


The layout_object_getvalue subroutine queries the current setting of layout values within the LayoutObject structure. The layout_object parameter specifies the LayoutObject structure created by the layout_object_create subroutine.

The name field of the LayoutValues structure contains the name of the layout value to be queried. The value field is a pointer to where the layout value is stored. The values are queried from the LayoutObject structure and represent its current state.

For example, if the layout value to be queried is of type T, the value parameter must be of type T*. If T itself is a pointer, the layout_object_getvalue subroutine allocates space to store the actual data. The caller must free this data by calling the free(T) subroutine with the returned pointer.

When setting the value field, an extra level of indirection is present that is not present using the layout_object_setvalue parameter. When you set a layout value of type T, the value field contains T. However, when querying the same layout value, the value field contains &T.

If you are developing internationalized applications that may support multibyte locales, please see Use of the libcur Package in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs


layout_object Specifies the LayoutObject structure created by the layout_object_create subroutine.
values Specifies an array of layout values of type LayoutValueRec that are to be queried in the LayoutObject structure. The end of the array is indicated by name=0.
index Specifies a layout value to be queried. If the value cannot be queried, the index parameter causing the error is returned and the subroutine returns a non-zero value.

Return Values

Upon successful completion, the layout_object_getvalue subroutine returns a value of 0. All layout values were successfully queried.

Error Codes

If the layout_object_getvalue subroutine fails, it returns the following values:

LAYOUT_EINVAL The layout value specified by the index parameter is unknown or the layout_object parameter is invalid.
LAYOUT_EMOMEM Insufficient storage space is available.


The following example queries whether the locale is bidirectional and gets the values of the in and out orienations.

#include <sys/lc_layout.h>
#include <locale.h>
LayoutObject plh;
int RC=0;
LayoutValues layout;
LayoutTextDescriptor Descr;
int index;

RC=layout_object_create(setlocale(LC_CTYPE,""),&plh); /* create object */
if (RC) {printf("Create error !!\n"); exit(0);}

                                         /* allocate layout array */
layout[0].name=ActiveBidirection;        /* set name */
layout[1].name=Orientation;              /* set name */
            /* send address of memory to be allocated by function */

layout[2].name=0;                     /* indicate end of array */
if (RC) {printf("Getvalue error at %d !!\n",index); exit(0);}
printf("ActiveBidirection = %d \n",*(layout[0].value));
                                                    /*print output*/
printf("Orientation in = %x  out = %x \n", Descr->>in, Descr->>out);

free(layout);                        /* free layout array */
free (Descr);             /* free memory allocated by function */
RC=layout_object_free(plh);         /* free layout object */
if (RC) printf("Free error !!\n");

Related Information

The layout_object_create Subroutine, layout_object_editshape or wcslayout_object_editshape Subroutine, layout_object_free Subroutine, layout_object_setvalue Subroutine, layout_object_shapeboxchars Subroutine, and layout_object_transform or wcslayout_object_transform Subroutine.

Bidirectionality and Character Shaping and National Language Support Overview in AIX 5L Version 5.2 National Language Support Guide and Reference.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]