Queries the current layout values of a LayoutObject structure.
#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.
Note: If you are developing internationalized applications that may support multibyte locales, please see Use of the libcur Package in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs
Upon successful completion, the layout_object_getvalue subroutine returns a value of 0. All layout values were successfully queried.
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> main() { 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);} layout=malloc(3*sizeof(LayoutValueRec)); /* allocate layout array */ layout[0].name=ActiveBidirection; /* set name */ layout[1].name=Orientation; /* set name */ layout[1].value=(caddr_t)&Descr; /* send address of memory to be allocated by function */ layout[2].name=0; /* indicate end of array */ RC=layout_object_getvalue(plh,layout,&index); 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"); }
This subroutine is part of Base Operating System (BOS) Runtime.
The layout_object_create subroutine, layout_object_editshape subroutine, layout_object_free subroutine, layout_object_setvalue subroutine, layout_object_shapeboxchars subroutine, layout_object_transform subroutine.
Bidirectionality and Arabic Character Shaping Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.
National Language Support Overview for Programming in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.