+/* Copyright Massachusetts Institute of Technology 1985 */
+
#include "copyright.h"
-/* $Header: /cvsroot/emacs/emacs/oldXMenu/AddSel.c,v 1.4 2003/09/01 15:45:47 miles Exp $ */
-/* Copyright Massachusetts Institute of Technology 1985 */
/*
* XMenu: MIT Project Athena, X Window system menu package
#include "XMenuInt.h"
int
-XMenuAddSelection(display, menu, p_num, data, label, active, help)
- Display *display;
- register XMenu *menu; /* Menu object to be modified. */
- register int p_num; /* Pane number to be modified. */
- char *data; /* Data value. */
- char *label; /* Selection label. */
- int active; /* Make selection active? */
- char *help; /* Help string */
+XMenuAddSelection(Display *display, register XMenu *menu, register int p_num, char *data, char *label, int active, char const *help)
+
+ /* Menu object to be modified. */
+ /* Pane number to be modified. */
+ /* Data value. */
+ /* Selection label. */
+ /* Make selection active? */
+ /* Help string */
{
register XMPane *pane; /* Pane containing the new selection. */
- register XMSelect *select; /* Newly created selection. */
+ register XMSelect *sel; /* Newly created selection. */
int label_length; /* Label lenght in characters. */
/*
* Calloc the XMSelect structure.
*/
- select = (XMSelect *)calloc(1, sizeof(XMSelect));
- if (select == NULL) {
+ sel = (XMSelect *)calloc(1, sizeof(XMSelect));
+ if (sel == NULL) {
_XMErrorCode = XME_CALLOC;
return(XM_FAILURE);
}
*/
if (!strcmp (label, "--") || !strcmp (label, "---"))
{
- select->type = SEPARATOR;
- select->active = 0;
+ sel->type = SEPARATOR;
+ sel->active = 0;
}
else
{
- select->type = SELECTION;
- select->active = active;
+ sel->type = SELECTION;
+ sel->active = active;
}
- select->serial = -1;
- select->label = label;
- select->label_width = label_width;
- select->label_length = label_length;
- select->data = data;
- select->parent_p = pane;
- select->help_string = help;
+ sel->serial = -1;
+ sel->label = label;
+ sel->label_width = label_width;
+ sel->label_length = label_length;
+ sel->data = data;
+ sel->parent_p = pane;
+ sel->help_string = help;
/*
* Insert the selection at the end of the selection list.
*/
- emacs_insque(select, pane->s_list->prev);
+ emacs_insque(sel, pane->s_list->prev);
/*
* Update the selection count.
_XMErrorCode = XME_NO_ERROR;
return((pane->s_count - 1));
}
-
-/* arch-tag: 0161f024-c739-440d-9498-050280c6c355
- (do not change this comment) */