<?Pub UDT _bookmark _target?><?Pub EntList bsol dash hellip gt lt minus?><?Pub CX solbook(book(title()bookinfo()chapter()?><chapter id="lbuilder-1"><title>Label Builder APIs</title><highlights><para><indexterm><primary>APIs</primary><secondary>Label Builder</secondary></indexterm><indexterm><primary>label APIs</primary><secondary>Label Builder</secondary></indexterm><indexterm><primary>GUIs</primary><secondary>Label Builder</secondary></indexterm>Solaris Trusted Extensions provides a set of Motif based APIs. You can use these interfaces to create an interactive GUI to build valid sensitivity labels or clearances from user input. These interfaces are called the <firstterm>Label Builder APIs</firstterm>. These APIs are most often called from within administrative applications.</para><para>The Label Builder GUIs are used in a system that is configured with Solaris Trusted Extensions. The <olink targetdoc="trssug" remap="external"><citetitle remap="book">Solaris Trusted Extensions User&rsquo;s Guide</citetitle></olink> describes these interfaces from the end user's point of view, as well as the functionality that is provided by the Label Builder library routines.</para><para>For examples of how the Trusted Extensions APIs are used in the Solaris OS, see the Solaris source code. Go to the <ulink url="http://opensolaris.org/" type="text_url">Open Solaris web site</ulink> and click Source Browser in the left navigation bar. Use the Source Browser to search through the Solaris source code.</para><itemizedlist><para>This chapter covers the following topics:</para><listitem><para><olink targetptr="lbuilder-5" remap="internal">APIs for Label Builder GUIs</olink></para>
</listitem><listitem><para><olink targetptr="lbuilder-6" remap="internal">Creating an Interactive User Interface</olink></para>
</listitem><listitem><para><olink targetptr="lbuilder-18" remap="internal">Online Help for Label Builder</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="lbuilder-5"><title>APIs for Label Builder GUIs</title><indexterm><primary>Label Builder</primary><secondary>APIs</secondary>
</indexterm><indexterm><primary><function>tsol_lbuild_destroy</function> routine</primary><secondary>declaration</secondary>
</indexterm><indexterm><primary><function>tsol_lbuild_create</function> routine</primary><secondary>declaration</secondary>
</indexterm><indexterm><primary>Label Builder</primary><secondary>declarations</secondary>
</indexterm><indexterm><primary><function>tsol_lbuild_set</function> routine</primary><secondary>declaration</secondary>
</indexterm><indexterm><primary><function>tsol_lbuild_get</function> routine</primary><secondary>declaration</secondary>
</indexterm><indexterm><primary>library routines</primary><secondary><function>tsol_lbuild_create</function></secondary>
</indexterm><indexterm><primary>library routines</primary><secondary><function>tsol_lbuild_destroy</function></secondary>
</indexterm><indexterm><primary>library routines</primary><secondary><function>tsol_lbuild_get</function></secondary>
</indexterm><indexterm><primary>library routines</primary><secondary><function>tsol_lbuild_set</function></secondary>
</indexterm><indexterm><primary>Label Builder</primary><secondary>libraries</secondary>
</indexterm><indexterm><primary>Label Builder</primary><secondary>header files</secondary>
</indexterm><indexterm><primary>compile</primary><secondary>Label Builder libraries</secondary>
</indexterm><indexterm><primary>libraries, compile</primary><secondary>Label Builder APIs</secondary>
</indexterm><indexterm><primary>header files</primary><secondary>Label Builder APIs</secondary>
</indexterm><para>To use the APIs that are described in this section, you need to include the following header file:</para><screen>#include &lt;Dt/ModLabel.h&gt;</screen><para>The Label Builder examples compile with the <option>lDtTsol</option> and <option>ltsol</option> library options.</para><para>The following APIs are available for building label GUIs. The data types and parameter lists are described in <olink targetptr="lbuilder-6" remap="internal">Creating an Interactive User Interface</olink>.</para><variablelist termlength="wholeline"><varlistentry><term><literal>ModLabelData *tsol_lbuild_create(Widget widget, void (*event_handler)() ok_callback, lbuild_attributes extended_operation, ..., NULL);</literal></term><listitem><para>The <function>tsol_lbuild_create</function> routine creates the GUI and returns a pointer variable of type <structname>ModLabeldata</structname>, which contains information about the user interface. This information is a combination of values passed in the <function>tsol_lbuild_create</function> input parameter list, default values for information not provided, and information about the widgets that the Label Builder uses to create the user interface.</para><para>The <constant>LBUILD_WORK_SL</constant> and <constant>LBUILD_WORK_CLR</constant> operation values are not valid for <function>tsol_lbuild_create</function> because these values are set from input that is supplied by the user.</para><para>You can use the <function>tsol_lbuild_get</function> and <function>tsol_lbuild_set</function> routines to obtain and set extended operations and values. However, these routines cannot be used for widget information, which is accessed directly by referencing fields in the <structname>ModLabelData</structname> structure. See the <olink targetdoc="refman" targetptr="labelbuilder-3tsol" remap="external"><citerefentry><refentrytitle>labelbuilder</refentrytitle><manvolnum>3TSOL</manvolnum></citerefentry></olink> man page.</para>
</listitem>
</varlistentry><varlistentry><term><literal>void tsol_lbuild_destroy(ModLabelData *lbdata);</literal></term><listitem><para>The <function>tsol_lbuild_destroy</function> routine destroys the <structname>ModLabelData</structname> structure that is returned by the <function>tsol_lbuild_create</function> routine.</para>
</listitem>
</varlistentry><varlistentry><term><literal>void *tsol_lbuild_get(ModLabelData *lbdata, lbuild_attributes extended_operation);</literal></term><listitem><para>The <function>tsol_lbuild_get</function> routine accesses the user interface information that is created by <function>tsol_lbuild_create</function> and stored in the <structname>ModLabelData</structname> structure.</para>
</listitem>
</varlistentry><varlistentry><term><literal>void tsol_lbuild_set(ModLabelData *lbdata, lbuild_attributes extended_operation, ..., NULL);</literal></term><listitem><para>The <function>tsol_lbuild_set</function> routine changes the user interface information that is created by <function>tsol_lbuild_create</function> and stored in the <structname>ModLabelData</structname> structure. The <constant>LBUILD_WORK_SL</constant> and <constant>LBUILD_WORK_CLR</constant> operation values are not valid for <function>tsol_lbuild_set</function> because these values are set from input that is supplied by the user.</para>
</listitem>
</varlistentry>
</variablelist>
</sect1><sect1 id="lbuilder-6"><title>Creating an Interactive User Interface</title><para>The following figure shows a GUI similar to the one created by the code that follows the figure. The <literal>main</literal> program creates a parent form (<replaceable>form</replaceable>) with one button (<replaceable>display</replaceable>). The button callback shows the Label Builder dialog box that is created by the call to the <function>tsol_lbuild_create</function> routine. See the <olink targetdoc="refman" targetptr="tsol-lbuild-create-3tsol" remap="external"><citerefentry><refentrytitle>tsol_lbuild_create</refentrytitle><manvolnum>3TSOL</manvolnum></citerefentry></olink> man page.</para><figure id="lbuilder-fig-1"><title>Label Building Interface</title><mediaobject><imageobject><imagedata entityref="labelbld.tiff" width="100"/>
</imageobject><textobject><simpara>Window shows the parts of a Label Builder. Callouts show dialog box title, user field, label build field, and  OK button callback function.</simpara>
</textobject>
</mediaobject>
</figure><para><indexterm><primary>code examples</primary><secondary>Label Builder</secondary></indexterm><indexterm><primary><function>tsol_lbuild_set</function> routine</primary><secondary>code example</secondary></indexterm><indexterm><primary><function>tsol_lbuild_create</function> routine</primary><secondary>code example</secondary></indexterm><indexterm><primary><function>tsol_lbuild_get</function> routine</primary><secondary>code example</secondary></indexterm>The Label Builder dialog box appears when you click the Show button in the parent form. The callouts indicate where the parameters passed to the <function>tsol_lbuild_create</function> routine appear in the Label Builder dialog box. See the <olink targetdoc="refman" targetptr="tsol-lbuild-create-3tsol" remap="external"><citerefentry><refentrytitle>tsol_lbuild_create</refentrytitle><manvolnum>3TSOL</manvolnum></citerefentry></olink> man page.</para><para>The following code creates a GUI something like that shown by the figure.</para><programlisting>#include &lt;X11/Intrinsic.h&gt;
#include &lt;X11/StringDefs.h&gt;
#include &lt;Xm/Xm.h&gt;
#include &lt;Xm/PushB.h&gt;
#include &lt;Xm/Form.h&gt;
#include &lt;Dt/ModLabel.h&gt;

ModLabelData *data;

/* Callback passed to tsol_lbuild_create() */
void callback_function()
{ 
	char *title, *userval;
	char *string = (char *)0;
	char *string1 = (char *)0;
	int mode, view;
	Boolean show;
	m_label_t *sl_label, *work_sl_label;
	Position x, y;

/* Your application-specific implementation goes here */
	printf("OK button called\n"); 

/* Query settings */
	mode = (int)tsol_lbuild_get(data, LBUILD_MODE);
	title = (String)tsol_lbuild_get(data, LBUILD_TITLE);
	sl_label = (m_label_t*) tsol_lbuild_get(data, LBUILD_VALUE_SL);
	work_sl_label = (m_label_t*) tsol_lbuild_get(data, LBUILD_WORK_SL);
	view = (int)tsol_lbuild_get(data, LBUILD_VIEW);
	x = (Position ) tsol_lbuild_get(data, LBUILD_X);
	y = (Position ) tsol_lbuild_get(data, LBUILD_Y);
	userval = (char *)tsol_lbuild_get(data, LBUILD_USERFIELD);
	show = (Boolean )tsol_lbuild_get(data, LBUILD_SHOW);

	label_to_str(sl_label, &amp;string, M_LABEL, LONG_NAMES);
	label_to_str(work_sl_label, &amp;string1, M_LABEL, LONG_NAMES);
	printf("Mode = %d, Title = %s, SL = %s, WorkSL = %s, View = %d, ",
		mode, title, string, string1, view);
	printf("X = %d, Y = %d, Userval = %s, Show = %d\n",
		x, y, userval, show);

}

/* Callback to display dialog box upon button press */
void Show(Widget display, caddr_t client_data, caddr_t call_data)
{
	tsol_lbuild_set(data, LBUILD_SHOW, TRUE, NULL);
}

main(int argc, char **argv)
{
	Widget 	form, topLevel, display;
	Arg args[9];
	int i = 0, error, retval;
	char *sl_string = "CNF";
	m_label_t * sl_label;

	topLevel = XtInitialize(argv[0], "XMcmds1", NULL, 0, &amp;argc, argv);
	form = XtCreateManagedWidget("form",
		xmFormWidgetClass, topLevel, NULL, 0);

	retval = str_to_label(sl_string, &amp;sl_label, MAC_LABEL, L_NO_CORRECTION, NULL);
	printf("Retval = %d\n", retval);

	data = tsol_lbuild_create( form, callback_function,
		LBUILD_MODE, LBUILD_MODE_SL,
		LBUILD_TITLE, "Building Sensitivity Label",
		LBUILD_VALUE_SL, sl_label,
		LBUILD_VIEW, LBUILD_VIEW_EXTERNAL,
		LBUILD_X, 200,
		LBUILD_Y, 200,
		LBUILD_USERFIELD, "/export/home/zelda",
		LBUILD_SHOW, FALSE,
		NULL);

	i = 0;
	XtSetArg(args[i], XmNtopAttachment, XmATTACH_FORM); i++;
	XtSetArg(args[i], XmNleftAttachment, XmATTACH_FORM); i++;
	XtSetArg(args[i], XmNrightAttachment, XmATTACH_FORM); i++;
	XtSetArg(args[i], XmNbottomAttachment, XmATTACH_FORM); i++;
	display = XtCreateManagedWidget("Show",
		xmPushButtonWidgetClass, form, args, i);
	XtAddCallback(display, XmNactivateCallback, Show,0);
	XtRealizeWidget(topLevel);

	XtMainLoop();

	tsol_lbuild_destroy(data);

}</programlisting><para>When run, the program produces the following output:</para><screen>OK button called  
Mode = 12, Title = Building Sensitivity label, 
Label = CNF, WorkSL = SECRET, 
View = 1, X = 200, Y = 200, 
Userval = /export/home/zelda, 
Show = 1</screen><itemizedlist><para>The following sections cover these topics:</para><listitem><para>Label Builder behavior</para>
</listitem><listitem><para>Application-specific functionality for Label Builder</para>
</listitem><listitem><para>Privileged operations and Label Builder</para>
</listitem><listitem><para><function>tsol_lbuild_create</function> routine</para>
</listitem><listitem><para>Extended Label Builder operations</para>
</listitem><listitem><para><structname>ModLabelData</structname> structure</para>
</listitem>
</itemizedlist><sect2 id="lbuilder-7"><title>Label Builder Behavior</title><indexterm><primary>Label Builder</primary><secondary>functionality</secondary>
</indexterm><indexterm><primary><filename>label_encodings</filename> file</primary><secondary>Label Builder</secondary>
</indexterm><para>The Label Builder dialog box prompts the end user for information and generates a valid sensitivity label from the input. Label Builder ensures that a valid label or clearance is built. The labels and clearances are defined in the <filename>label_encodings</filename> file for the system.</para><para><indexterm><primary>Label Builder</primary><secondary>Update button</secondary></indexterm>Label Builder provides default behavior for the OK, Reset, Cancel, and Update buttons. The callback passed to the <function>tsol_lbuild_create</function> routine is mapped to the OK button to provide application-specific behavior.</para><sect3 id="lbuilder-8"><title>Keyboard Entry and Update Button</title><para>The Update button takes the text the user types in the Update With field and checks that the string is a valid label or clearance as defined in the <filename>label_encodings</filename> file.</para><itemizedlist><listitem><para>If the input is not valid, Label Builder generates an error for the user.</para>
</listitem><listitem><para>If the input is valid, Label Builder updates the text in the Label field and stores the value in the appropriate working label field of the <literal>ModLabelData</literal> variable that is returned by the <function>tsol_lbuild_create</function> routine. See <olink targetptr="lbuilder-20" remap="internal">ModLabelData Structure</olink>.</para>
</listitem>
</itemizedlist><para>When the user clicks OK, the user-built value is handled according to the OK button callback implementation.</para>
</sect3><sect3 id="lbuilder-24"><title>Radio Button Options</title><para>The Label Settings radio button options enable you to build a sensitivity label or clearance from classifications and compartments. These options also enable you to build an information label from classifications, compartments, and markings. Depending on the mode, one of these buttons might be grayed out. This approach is independent of the keyboard entry and Update button method described in the previous section.</para><para><indexterm><primary>Label Builder</primary><secondary>label radio buttons</secondary></indexterm>The information about the classifications, compartments, and markings is specified in the <filename>label_encodings</filename> file for the system. The combinations and constraints that are specified in the <filename>label_encodings</filename> file are enforced by graying out invalid combinations. The Label field is updated and the value is stored in the appropriate working label field of the <literal>ModLabelData</literal> variable that is returned by the <function>tsol_lbuild_create</function> routine when the user chooses options. The user can build a sensitivity label or a clearance by selecting radio buttons in the classification (CLASS) and compartment (COMPS) lists.</para><para>When the user clicks OK, the user-built value is handled according to the OK button callback implementation.</para>
</sect3><sect3 id="lbuilder-2"><title>Reset Button</title><para><indexterm><primary>Label Builder</primary><secondary>Reset button</secondary></indexterm>The Reset button sets the text in the Label field to what its value was when the application started.</para>
</sect3><sect3 id="lbuilder-3"><title>Cancel Button</title><para><indexterm><primary>Label Builder</primary><secondary>Cancel button</secondary></indexterm>The Cancel button exits the application without saving any changes.</para>
</sect3>
</sect2><sect2 id="lbuilder-27"><title>Application-Specific Functionality for Label Builder</title><para>The Label Builder GUI generates a valid label or clearance. You must also add application-specific callbacks, error handling, and other functionality that is associated with that label or clearance.</para>
</sect2><sect2 id="lbuilder-28"><title>Privileged Operations and Label Builder</title><indexterm><primary>Label Builder</primary><secondary>authorizations</secondary>
</indexterm><indexterm><primary>Label Builder</primary><secondary>privileged tasks</secondary>
</indexterm><indexterm><primary>authorizations</primary><secondary>Label Builder</secondary>
</indexterm><indexterm><primary>privileged tasks</primary><secondary>Label Builder</secondary>
</indexterm><indexterm><primary><constant>sys_trans_label</constant> privilege</primary>
</indexterm><indexterm><primary>privileges</primary><secondary><constant>sys_trans_label</constant></secondary>
</indexterm><para>Label Builder shows the user only those classifications and related compartments that are dominated by the workspace sensitivity label. If the executable has the <constant>sys_trans_label</constant> privilege in its effective set, more classifications and compartments might be shown.</para><para>Your application-specific implementation for the OK button callback might require privileges.</para><para>If the user does not have the authorization to upgrade or downgrade labels, the OK and Reset buttons are grayed out. The same is true if the user-built label is out of the user's range. The grayed-out buttons prevent the user from completing the task. No privileges can override these restrictions.</para>
</sect2><sect2 id="lbuilder-26"><title><function>tsol_lbuild_create</function> Routine</title><indexterm><primary>Label Builder</primary><secondary><function>tsol_lbuild_create</function> routine</secondary>
</indexterm><indexterm><primary>data types</primary><secondary>Label Builder APIs</secondary><tertiary><function>tsol_lbuild_create</function> routine</tertiary>
</indexterm><indexterm><primary><function>tsol_lbuild_create</function> routine</primary><secondary>description of</secondary>
</indexterm><para>The <function>tsol_lbuild_create</function> routine accepts any widget, a callback function, and a null-terminated series of name and value pairs. The name represents an operation. The routine returns a variable of type <literal>ModLabelData</literal>.</para><itemizedlist><para>The following describes the information accepted by the <function>tsol_lbuild_create</function> routine:</para><listitem><para><emphasis role="strong">Widget &ndash;</emphasis> Label Builder can build the dialog box from any widget.</para>
</listitem><listitem><para><emphasis role="strong">Callback function &ndash;</emphasis> The callback function activates when the OK button is clicked. This callback function provides application-specific behavior.</para>
</listitem><listitem><para><emphasis role="strong">Name and value pairs &ndash;</emphasis> The name (left) side of the pair specifies an extended operation (see <olink targetptr="lbuilder-22" remap="internal">Extended Label Builder Operations</olink>) and the value (right) side specifies the value. In some cases, the value is an enumerated constant. In other cases, you provide a value. The pairs can be specified in any order, but every operation you specify requires a valid value.</para><para>The return value is a data structure that contains information about the dialog box that was just created. The information comes from the <function>tsol_lbuild_create</function> input parameters and user activities during execution. Label Builder provides default values for some fields where no values have been specified.</para><para>Use the <function>tsol_lbuild_get</function> routine and the <function>tsol_lbuild_set</function> routine to programmatically access and change the information in these name and value pairs. The data structure is described in <olink targetptr="lbuilder-20" remap="internal">ModLabelData Structure</olink>.</para><para>The following shows a sample call to the <function>tsol_lbuild_create</function> routine:</para><programlisting>data= tsol_lbuild_create(form, callback_function,
	LBUILD_MODE, LBUILD_MODE_SL,
	LBUILD_TITLE, "Building a Label",
	LBUILD_VALUE_SL, sl_label,
	LBUILD_VIEW, LBUILD_VIEW_EXTERNAL,
	LBUILD_X, 200,
	LBUILD_Y, 200,
	LBUILD_USERFIELD &ldquo;/export/home/zelda&rdquo;,
	LBUILD_SHOW, FALSE,
	NULL);</programlisting>
</listitem>
</itemizedlist>
</sect2><sect2 id="lbuilder-22"><title>Extended Label Builder Operations</title><indexterm><primary>extended operations</primary>
</indexterm><indexterm><primary>operations, extended</primary><see><literal>LBUILD_CHECK_AR</literal> operation</see>
</indexterm><para>This section describes the extended operations and valid values that you can pass to the <function>tsol_lbuild_create</function>, <function>tsol_lbuild_get</function>, and <function>tsol_lbuild_set</function> routines. The values that are passed to <function>tsol_lbuild_create</function> are stored in its return value. The return value is of type <literal>ModLabelData</literal>. The values returned in the parameters can be accessed by calls to <function>tsol_lbuild_get</function> and <function>tsol_lbuild_set</function>. The <literal>ModLabelData</literal> structure is described in <olink targetptr="lbuilder-20" remap="internal">ModLabelData Structure</olink>. See the <olink targetdoc="refman" targetptr="tsol-lbuild-create-3tsol" remap="external"><citerefentry><refentrytitle>tsol_lbuild_create</refentrytitle><manvolnum>3TSOL</manvolnum></citerefentry></olink>, <olink targetdoc="refman" targetptr="tsol-lbuild-get-3tsol" remap="external"><citerefentry><refentrytitle>tsol_lbuild_get</refentrytitle><manvolnum>3TSOL</manvolnum></citerefentry></olink>, and <olink targetdoc="refman" targetptr="tsol-lbuild-set-3tsol" remap="external"><citerefentry><refentrytitle>tsol_lbuild_set</refentrytitle><manvolnum>3TSOL</manvolnum></citerefentry></olink> man pages.</para><itemizedlist><para>All extended operations are valid to pass to <function>tsol_lbuild_get</function>. However, the <literal>LBUILD_WORK_SL</literal> and <literal>LBUILD_WORK_CLR</literal> operations are not valid to pass to <function>tsol_lbuild_set</function> or <function>tsol_lbuild_create</function> because these values are set by Label Builder based on user input. These exceptions are noted in the following operation descriptions:</para><listitem><para><indexterm><primary><literal>LBUILD_MODE</literal> operation</primary></indexterm><literal>LBUILD_MODE</literal> <emphasis role="strong">&ndash;</emphasis> You can instruct <function>tsol_lbuild_create</function> to create a user interface to build sensitivity labels or clearances. The default value is <literal>LBUILD_MODE_SL</literal>.</para><itemizedlist><listitem><para><indexterm><primary><literal>LBUILD_MODE_SL</literal> value</primary></indexterm><literal>LBUILD_MODE_SL</literal> <emphasis role="strong">&ndash;</emphasis> Builds a sensitivity label.</para>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_MODE_CLR</literal> value</primary></indexterm><literal>LBUILD_MODE_CLR</literal> <emphasis role="strong">&ndash;</emphasis> Builds a clearance.</para>
</listitem>
</itemizedlist>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_VALUE_SL</literal> operation</primary></indexterm><literal>LBUILD_VALUE_SL</literal> <emphasis role="strong">&ndash;</emphasis> The starting sensitivity label that is shown in the Label field when the mode is <literal>LBUILD_MODE_SL</literal>. The default value is <constant>ADMIN_LOW</constant>.</para>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_VALUE_CLR</literal> operation</primary></indexterm><literal>LBUILD_VALUE_CLR</literal> <emphasis role="strong">&ndash;</emphasis> The starting clearance that is shown in the Label field when the mode is <literal>LBUILD_MODE_CLR</literal>. The default value is <constant>ADMIN_LOW</constant>.</para>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_USERFIELD</literal> operation</primary></indexterm><literal>LBUILD_USERFIELD</literal> <emphasis role="strong">&ndash;</emphasis> A character string prompt that appears at the top of the Label Builder dialog box. The default value is <literal>NULL</literal>.</para>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_SHOW</literal> operation</primary></indexterm><literal>LBUILD_SHOW</literal> <emphasis role="strong">&ndash;</emphasis> Shows or hides the Label Builder dialog box. The default value is <literal>FALSE</literal>.</para><itemizedlist><listitem><para><literal>TRUE</literal> <emphasis role="strong">&ndash;</emphasis> Shows the Label Builder dialog box.</para>
</listitem><listitem><para><literal>FALSE</literal> <emphasis role="strong">&ndash;</emphasis> Hides the Label Builder dialog box.</para>
</listitem>
</itemizedlist>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_TITLE</literal> operation</primary></indexterm><literal>LBUILD_TITLE</literal> <emphasis role="strong">&ndash;</emphasis> A character string title that appears at the top of the Label Builder dialog box. The default value is <literal>NULL</literal>.</para>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_WORK_SL</literal> operation</primary></indexterm><literal>LBUILD_WORK_SL</literal> <emphasis role="strong">&ndash;</emphasis> The sensitivity label that the user is building. This value is updated based on the user's input when the user selects the Update button or interactively chooses an option. The default value is <constant>ADMIN_LOW</constant> and is not a valid extended operation for <function>tsol_lbuild_set</function> or <function>tsol_lbuild_create</function>.</para>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_WORK_CLR</literal> operation</primary></indexterm><literal>LBUILD_WORK_CLR</literal> <emphasis role="strong">&ndash;</emphasis> The clearance that the user is building. This value is updated based on the user's input when the user selects the Update button or interactively chooses an option. The default value is <constant>ADMIN_LOW</constant> and is not a valid extended operation for <function>tsol_lbuild_set</function> or <function>tsol_lbuild_create</function>.</para>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_X</literal> operation</primary></indexterm><literal>LBUILD_X</literal> <emphasis role="strong">&ndash;</emphasis> The X offset in pixels from the upper left corner of the Label Builder dialog box in relation to the upper left corner of the screen. By default, the Label Builder dialog box is positioned in the middle of the screen.</para>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_Y</literal> operation</primary></indexterm><literal>LBUILD_Y</literal> <emphasis role="strong">&ndash;</emphasis> The Y offset in pixels from the upper left corner of the Label Builder dialog box in relation to the upper left corner of the screen. By default, the Label Builder dialog box is positioned in the middle of the screen.</para>
</listitem><listitem><para><indexterm><primary>privileges</primary><secondary><constant>sys_trans_label</constant></secondary></indexterm><indexterm><primary><literal>LBUILD_UPPER_BOUND</literal> operation</primary></indexterm><literal>LBUILD_UPPER_BOUND</literal> <emphasis role="strong">&ndash;</emphasis> The highest classification, and related compartments and markings, that are available to the user as radio buttons. These buttons are used to interactively build a label or a clearance. A value you supply must be within the user's range. If no value is supplied, this value is the user's workspace sensitivity label. Or, if the executable has the <constant>sys_trans_label</constant> privilege, this value is the user's clearance.</para>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_LOWER_BOUND</literal> operation</primary></indexterm><literal>LBUILD_LOWER_BOUND</literal> <emphasis role="strong">&ndash;</emphasis> The lowest classification, and related compartments and markings, that are available to the user as radio buttons. These buttons are used to interactively build a label or a clearance. This value is the user's minimum label. If no value is specified, the value is based on the default specified by the user's attributes.</para>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_CHECK_AR</literal> operation</primary></indexterm><literal>LBUILD_CHECK_AR</literal> <emphasis role="strong">&ndash;</emphasis> Checks whether the user-built label is within the user's range. A value of 1 means &ldquo;check,&rdquo; and a value of 0 means &ldquo;do not check.&rdquo; If the label is out of range, an error message is displayed to the user. The default value is 1.</para>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_VIEW</literal> operation</primary></indexterm><literal>LBUILD_VIEW</literal> <emphasis role="strong">&ndash;</emphasis> Determines whether to use the internal or the external label representation. The default value is <literal>LBUILD_VIEW_EXTERNAL</literal>.</para><itemizedlist><listitem><para><indexterm><primary><literal>LBUILD_VIEW_INTERNAL</literal> value</primary></indexterm><literal>LBUILD_VIEW_INTERNAL</literal> <emphasis role="strong">&ndash;</emphasis> Uses the internal names for the highest and lowest labels in the system, <constant>ADMIN_HIGH</constant> and <constant>ADMIN_LOW</constant>.</para>
</listitem><listitem><para><indexterm><primary><literal>LBUILD_VIEW_EXTERNAL</literal> value</primary></indexterm><literal>LBUILD_VIEW_EXTERNAL</literal> <emphasis role="strong">&ndash;</emphasis> Promotes an <constant>ADMIN_LOW</constant> label to the next lowest label and demotes an <constant>ADMIN_HIGH</constant> label to the next highest label.</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</sect2><sect2 id="lbuilder-20"><title><literal>ModLabelData</literal> Structure</title><indexterm><primary>Label Builder</primary><secondary><literal>ModLabelData</literal> structure</secondary>
</indexterm><indexterm><primary>data types</primary><secondary>Label Builder APIs</secondary><tertiary><literal>ModLabelData</literal> structure</tertiary>
</indexterm><indexterm><primary><literal>ModLabelData</literal> structure</primary>
</indexterm><indexterm><primary>Motif application</primary><secondary>Label Builder widgets</secondary>
</indexterm><para>The <literal>ModLabelData</literal> structure contains information about the state of the Label Builder interface that is created by the call to the <function>tsol_lbuild_create</function> routine. The following table describes the <literal>ModLabelData</literal> fields. All fields, except for the widgets and the callbacks, are accessible by specifying the associated extended operation and a valid value in a call to <function>tsol_lbuild_set</function> or <function>tsol_lbuild_get</function>. For descriptions of the extended operations, see <olink targetptr="lbuilder-22" remap="internal">Extended Label Builder Operations</olink>.</para><table frame="topbot" pgwide="1" id="lbuilder-23"><title><literal>ModLabelData</literal> Structure</title><tgroup cols="4" colsep="0" rowsep="0"><colspec colnum="1" colname="column1" colwidth="4*"/><colspec colnum="2" colname="column2" colwidth="2*"/><colspec colnum="3" colname="column3" colwidth="3*"/><colspec colnum="4" colname="column4" colwidth="4*"/><thead><row><entry colname="column1" rowsep="1"><para>Extended Operation or Description</para>
</entry><entry colname="column2" rowsep="1"><para>Data Type</para>
</entry><entry colname="column3" rowsep="1"><para>Field</para>
</entry><entry colname="column4" rowsep="1"><para>Comments</para>
</entry>
</row>
</thead><tbody><row><entry><para><literal>LBUILD_CHECK_AR</literal></para>
</entry><entry><para><literal>int</literal></para>
</entry><entry><para><literal>check_ar</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para><literal>LBUILD_MODE</literal></para>
</entry><entry><para><literal>int</literal></para>
</entry><entry><para><literal>mode</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para><literal>LBUILD_SHOW</literal></para>
</entry><entry><para><literal>Bool</literal></para>
</entry><entry><para><literal>show</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para><literal>LBUILD_TITLE</literal></para>
</entry><entry><para><literal>char</literal></para>
</entry><entry><para><literal>*lbuild_title</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para><literal>LBUILD_UPPER_BOUND</literal>, <literal>LBUILD_LOWER_BOUND</literal></para>
</entry><entry><para><literal>brange_t</literal></para>
</entry><entry><para><literal>range</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para><literal>LBUILD_USERFIELD</literal></para>
</entry><entry><para><literal>char</literal></para>
</entry><entry><para><literal>*userfield</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para><literal>LBUILD_VALUE_CLR</literal></para>
</entry><entry><para><literal>bclear_t</literal></para>
</entry><entry><para><literal>*clr</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para><literal>LBUILD_VALUE_SL</literal></para>
</entry><entry><para><literal>m_label_t</literal></para>
</entry><entry><para><literal>*sl</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para><literal>LBUILD_VIEW</literal></para>
</entry><entry><para><literal>int</literal></para>
</entry><entry><para><literal>view</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para><literal>LBUILD_WORK_CLR</literal></para>
</entry><entry><para><literal>bclear_t</literal></para>
</entry><entry><para><literal>*clr_work</literal></para>
</entry><entry><para>Not valid for <function>tsol_lbuild_set</function> or <function>tsol_lbuild_create</function></para>
</entry>
</row><row><entry><para><literal>LBUILD_WORK_SL</literal></para>
</entry><entry><para><literal>m_label_t</literal></para>
</entry><entry><para><literal>*sl_work</literal></para>
</entry><entry><para>Not valid for <function>tsol_lbuild_set</function> or <function>tsol_lbuild_create</function></para>
</entry>
</row><row><entry><para><literal>LBUILD_X</literal></para>
</entry><entry><para><literal>Position</literal></para>
</entry><entry><para><literal>x</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para><literal>LBUILD_Y</literal></para>
</entry><entry><para><literal>Position</literal></para>
</entry><entry><para><literal>y</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>Callback passed to <function>tsol_lbuild_create</function></para>
</entry><entry><para><literal>void</literal></para>
</entry><entry><para><function>(*event_handler)</function></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>Cancel button</para>
</entry><entry><para><literal>Widget</literal></para>
</entry><entry><para><literal>cancel</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>Help button</para>
</entry><entry><para><literal>Widget</literal></para>
</entry><entry><para><literal>help</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>Label Builder dialog box</para>
</entry><entry><para><literal>Widget</literal></para>
</entry><entry><para><literal>lbuild_dialog</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>OK button</para>
</entry><entry><para><literal>Widget</literal></para>
</entry><entry><para><literal>ok</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>Reset button</para>
</entry><entry><para><literal>Widget</literal></para>
</entry><entry><para><literal>reset</literal></para>
</entry><entry><para></para>
</entry>
</row><row><entry><para>Update button</para>
</entry><entry><para><literal>Widget</literal></para>
</entry><entry><para><literal>update</literal></para>
</entry><entry><para></para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</sect2>
</sect1><sect1 id="lbuilder-18"><title>Online Help for Label Builder</title><indexterm><primary>Motif application</primary><secondary>online help</secondary>
</indexterm><indexterm><primary>online help</primary><secondary>Label Builder</secondary>
</indexterm><indexterm><primary>Label Builder</primary><secondary>online help</secondary>
</indexterm><para>The Help button and other widgets that are used in the user interface can be accessed directly from your application code through the <literal>lbl_shell</literal> field in the <structname>ModLabelData</structname> structure. To add online help to your application, follow the procedures and guidelines in the <citetitle>Common Desktop Environment: Help System Author's and Programmer's Guide</citetitle>.</para>
</sect1>
</chapter>