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

Technical Reference: Base Operating System and Extensions, Volume 1

layout_object_setvalue Subroutine

Purpose

Sets the layout values of a LayoutObject structure.

Library

Layout Library (libi18n.a)

Syntax

#include <sys/lc_layout.h> 


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

Description

The layout_object_setvalue subroutine changes the current layout values of the LayoutObject structure. The layout_object parameter specifies the LayoutObject structure created by the layout_object_create subroutine. The values are written into the LayoutObject structure and may affect the behavior of subsequent layout functions.

Note
Some layout values do alter internal states maintained by a LayoutObject structure.

The name field of the LayoutValueRec structure contains the name of the layout value to be set. The value field contains the actual value to be set. The value field is large enough to support all types of layout values. For more information on layout value types, see "Layout Values for the Layout Library" in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

Note
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

Parameters

layout_object Specifies the LayoutObject structure returned by the layout_object_create subroutine.
values Specifies an array of layout values of the type LayoutValueRec that this subroutine sets. 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. If an error is generated, a subset of the values may have been previously set.

Return Values

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

Error Codes

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

LAYOUT_EINVAL The layout value specified by the index parameter is unknown, its value is invalid, or the layout_object parameter is invalid.
LAYOUT_EMFILE The (OPEN_MAX) file descriptors are currently open in the calling process.
LAYOUT_ENOMEM Insufficient storage space is available.

Examples

The following example sets the TypeofText value to Implicit and the out value to Visual.

#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(2*sizeof(LayoutValueRec)); /*allocate layout array*/  
Descr=malloc(sizeof(LayoutTextDescriptorRec)); /* allocate text descriptor */
layout[0].name=TypeOfText;            /* set name */  
layout[0].value=(caddr_t)Descr;       /* set value */  
layout[1].name=0;                     /* indicate end of array */

Descr->in=TEXT_IMPLICIT;
Descr->out=TEXT_VISUAL;  RC=layout_object_setvalue(plh,layout,&index);
if (RC) printf("SetValue error at %d!!\n",index); /* check return code */
free(layout);                       /* free allocated memory */  
free (Descr);
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_getvalue 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 ]