Commit b782e2d7 authored by Dan Nicolaescu's avatar Dan Nicolaescu

Convert function definitions in oldXMenu to standard C.

* oldXMenu/Activate.c: Convert function definitions to standard C.
* oldXMenu/AddPane.c:
* oldXMenu/AddSel.c:
* oldXMenu/ChgPane.c:
* oldXMenu/ChgSel.c:
* oldXMenu/Create.c:
* oldXMenu/DelPane.c:
* oldXMenu/DelSel.c:
* oldXMenu/Destroy.c:
* oldXMenu/Error.c:
* oldXMenu/EvHand.c:
* oldXMenu/FindPane.c:
* oldXMenu/FindSel.c:
* oldXMenu/InsPane.c:
* oldXMenu/InsSel.c:
* oldXMenu/Internal.c:
* oldXMenu/Locate.c:
* oldXMenu/Post.c:
* oldXMenu/Recomp.c:
* oldXMenu/SetAEQ.c:
* oldXMenu/SetFrz.c:
* oldXMenu/SetPane.c:
* oldXMenu/SetSel.c:
* oldXMenu/X10.h:
* oldXMenu/XCrAssoc.c:
* oldXMenu/XDelAssoc.c:
* oldXMenu/XDestAssoc.c:
* oldXMenu/XLookAssoc.c:
* oldXMenu/XMakeAssoc.c:
* oldXMenu/XMenu.h:
* oldXMenu/XMenuInt.h:
* oldXMenu/insque.c: Likewise.
parent c3174d16
......@@ -103,32 +103,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* For debug, set this to 0 to not grab the keyboard on menu popup */
int x_menu_grab_keyboard = 1;
typedef void (*Wait_func)();
static Wait_func wait_func;
static void* wait_data;
void
XMenuActivateSetWaitFunction (func, data)
Wait_func func;
void *data;
XMenuActivateSetWaitFunction (Wait_func func, void *data)
{
wait_func = func;
wait_data = data;
}
int
XMenuActivate(display, menu, p_num, s_num, x_pos, y_pos, event_mask, data,
help_callback)
register Display *display; /* Display to put menu on. */
register XMenu *menu; /* Menu to activate. */
int *p_num; /* Pane number selected. */
int *s_num; /* Selection number selected. */
int x_pos; /* X coordinate of menu position. */
int y_pos; /* Y coordinate of menu position. */
unsigned int event_mask; /* Mouse button event mask. */
char **data; /* Pointer to return data value. */
void (* help_callback) (); /* Help callback. */
XMenuActivate(
register Display *display, /* Display to put menu on. */
register XMenu *menu, /* Menu to activate. */
int *p_num, /* Pane number selected. */
int *s_num, /* Selection number selected. */
int x_pos, /* X coordinate of menu position. */
int y_pos, /* Y coordinate of menu position. */
unsigned int event_mask, /* Mouse button event mask. */
char **data, /* Pointer to return data value. */
void (* help_callback) (char *, int, int)) /* Help callback. */
{
int status; /* X routine call status. */
int orig_x; /* Upper left menu origin X coord. */
......
......@@ -16,11 +16,11 @@
#include "XMenuInt.h"
int
XMenuAddPane(display, menu, label, active)
Display *display;
register XMenu *menu; /* Menu object to be modified. */
register char *label; /* Selection label. */
int active; /* Make selection active? */
XMenuAddPane(Display *display, register XMenu *menu, register char *label, int active)
/* Menu object to be modified. */
/* Selection label. */
/* Make selection active? */
{
register XMPane *pane; /* Newly created pane. */
register XMSelect *select; /* Initial selection for the new pane. */
......
......@@ -17,14 +17,14 @@
#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 *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. */
......
2010-07-04 Dan Nicolaescu <dann@ics.uci.edu>
* Activate.c: Convert function definitions to standard C.
* AddPane.c:
* AddSel.c:
* ChgPane.c:
* ChgSel.c:
* Create.c:
* DelPane.c:
* DelSel.c:
* Destroy.c:
* Error.c:
* EvHand.c:
* FindPane.c:
* FindSel.c:
* InsPane.c:
* InsSel.c:
* Internal.c:
* Locate.c:
* Post.c:
* Recomp.c:
* SetAEQ.c:
* SetFrz.c:
* SetPane.c:
* SetSel.c:
* X10.h:
* XCrAssoc.c:
* XDelAssoc.c:
* XDestAssoc.c:
* XLookAssoc.c:
* XMakeAssoc.c:
* XMenu.h:
* XMenuInt.h:
* insque.c: Likewise.
2010-05-07 Chong Yidong <cyd@stupidchicken.com>
* Version 23.2 released.
......
......@@ -17,10 +17,10 @@
#include "XMenuInt.h"
int
XMenuChangePane(menu, p_num, label)
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be modified. */
char *label; /* Selection label. */
XMenuChangePane(register XMenu *menu, register int p_num, char *label)
/* Menu object to be modified. */
/* Pane number to be modified. */
/* Selection label. */
{
register XMPane *p_ptr; /* XMPane pointer. */
......
......@@ -17,15 +17,15 @@
#include "XMenuInt.h"
int
XMenuChangeSelection(display, menu, p_num, s_num, data, data_sw, label, label_sw)
Display *display; /* previously opened display. */
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be modified. */
register int s_num; /* Selection number to modified. */
char *data; /* Data value. */
int data_sw; /* Change to new data value? */
char *label; /* Selection label. */
int label_sw; /* Change to new label? */
XMenuChangeSelection(Display *display, register XMenu *menu, register int p_num, register int s_num, char *data, int data_sw, char *label, int label_sw)
/* previously opened display. */
/* Menu object to be modified. */
/* Pane number to be modified. */
/* Selection number to modified. */
/* Data value. */
/* Change to new data value? */
/* Selection label. */
/* Change to new label? */
{
register XMPane *p_ptr; /* XMPane pointer. */
register XMSelect *s_ptr; /* XMSelect pointer. */
......
......@@ -91,19 +91,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define TILE_BUF_SIZE 5
int atoi();
double atof();
char *x_get_resource_string ();
int atoi(const char *);
double atof(const char *);
char *x_get_resource_string (char *attribute, char *class);
static Status
XAllocDisplayColor(display, map, colorName, color, junk)
Display *display;
Colormap map;
char *colorName;
XColor *color;
XColor *junk;
XAllocDisplayColor(Display *display, Colormap map, char *colorName, XColor *color, XColor *junk)
{
return (colorName!=0 &&
XParseColor(display, map, colorName, color) &&
......@@ -112,10 +107,10 @@ XAllocDisplayColor(display, map, colorName, color, junk)
XMenu *
XMenuCreate(display, parent, def_env)
Display *display; /* ID of previously opened display */
Window parent; /* Window ID of the menu's parent window. */
register char *def_env; /* X Defaults program environment name. */
XMenuCreate(Display *display, Window parent, register char *def_env)
/* ID of previously opened display */
/* Window ID of the menu's parent window. */
/* X Defaults program environment name. */
{
register int i; /* Loop counter. */
register int j; /* Loop counter. */
......
......@@ -16,10 +16,10 @@
#include "XMenuInt.h"
int
XMenuDeletePane(display, menu, p_num)
register Display *display; /* Previously opened display */
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be deleted. */
XMenuDeletePane(register Display *display, register XMenu *menu, register int p_num)
/* Previously opened display */
/* Menu object to be modified. */
/* Pane number to be deleted. */
{
register XMPane *p_ptr; /* Pointer to pane being deleted. */
register XMSelect *s_ptr; /* Pointer to selections being deleted. */
......
......@@ -16,11 +16,11 @@
#include "XMenuInt.h"
int
XMenuDeleteSelection(display, menu, p_num, s_num)
register Display *display; /* Previously opened display. */
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be deleted. */
register int s_num; /* Selection number to be deleted. */
XMenuDeleteSelection(register Display *display, register XMenu *menu, register int p_num, register int s_num)
/* Previously opened display. */
/* Menu object to be modified. */
/* Pane number to be deleted. */
/* Selection number to be deleted. */
{
register XMPane *p_ptr; /* Pointer to pane being deleted. */
register XMSelect *s_ptr; /* Pointer to selections being deleted. */
......
......@@ -15,9 +15,9 @@
#include "XMenuInt.h"
XMenuDestroy(display, menu)
Display *display;
register XMenu *menu; /* Menu object to destroy. */
XMenuDestroy(Display *display, register XMenu *menu)
/* Menu object to destroy. */
{
register XMPane *p_ptr; /* Pointer to the current pane. */
register XMPane *p_next; /* Pointer to the next pane. */
......
......@@ -17,7 +17,7 @@
#include "XMenuInt.h"
char *
XMenuError()
XMenuError(void)
{
static char message[128]; /* Error message buffer. */
......
......@@ -15,8 +15,7 @@
#include "XMenuInt.h"
XMenuEventHandler(handler)
int (*handler)();
XMenuEventHandler(int (*handler) (XEvent*))
{
/*
* Set the global event handler variable.
......
......@@ -17,9 +17,7 @@
#include "XMenuInt.h"
int
XMenuFindPane(menu, label)
register XMenu *menu;
register char *label;
XMenuFindPane(register XMenu *menu, register char *label)
{
register XMPane *p_ptr;
register int i = 0;
......
......@@ -34,10 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "XMenuInt.h"
int
XMenuFindSelection(menu, p_num, label)
register XMenu *menu;
int p_num;
register char *label;
XMenuFindSelection(register XMenu *menu, int p_num, register char *label)
{
register XMPane *p_ptr;
register XMSelect *s_ptr;
......
......@@ -18,11 +18,11 @@
#include "XMenuInt.h"
int
XMenuInsertPane(menu, p_num, label, active)
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number of new pane. */
char *label; /* Selection label. */
int active; /* Make selection active? */
XMenuInsertPane(register XMenu *menu, register int p_num, char *label, int active)
/* Menu object to be modified. */
/* Pane number of new pane. */
/* Selection label. */
/* Make selection active? */
{
register XMPane *p_ptr; /* XMPane pointer. */
register XMPane *pane; /* Newly created pane. */
......
......@@ -17,13 +17,13 @@
#include "XMenuInt.h"
int
XMenuInsertSelection(menu, p_num, s_num, data, label, active)
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be modified. */
register int s_num; /* Selection number of new selection. */
char *data; /* Data value. */
char *label; /* Selection label. */
int active; /* Make selection active? */
XMenuInsertSelection(register XMenu *menu, register int p_num, register int s_num, char *data, char *label, int active)
/* Menu object to be modified. */
/* Pane number to be modified. */
/* Selection number of new selection. */
/* Data value. */
/* Selection label. */
/* Make selection active? */
{
register XMPane *p_ptr; /* XMPane pointer. */
register XMSelect *s_ptr; /* XMSelect pointer. */
......
......@@ -96,7 +96,7 @@ _XMErrorList[XME_CODE_COUNT] = {
/*
* _XMEventHandler - Internal event handler variable.
*/
int (*_XMEventHandler)() = NULL;
int (*_XMEventHandler)(XEvent*) = NULL;
......@@ -104,7 +104,7 @@ int (*_XMEventHandler)() = NULL;
* _XMWinQueInit - Internal routine to initialize the window
* queue.
*/
_XMWinQueInit()
_XMWinQueInit(void)
{
/*
* If the queue is not initialized initialize it.
......@@ -138,10 +138,10 @@ _XMWinQueInit()
* window queue.
*/
int
_XMWinQueAddPane(display, menu, p_ptr)
register Display *display;
register XMenu *menu; /* Menu being manipulated. */
register XMPane *p_ptr; /* XMPane being queued. */
_XMWinQueAddPane(register Display *display, register XMenu *menu, register XMPane *p_ptr)
/* Menu being manipulated. */
/* XMPane being queued. */
{
/*
* If the queue is currently full then flush it.
......@@ -172,10 +172,10 @@ _XMWinQueAddPane(display, menu, p_ptr)
* the selection window queue.
*/
int
_XMWinQueAddSelection(display, menu, s_ptr)
register Display *display;
register XMenu *menu; /* Menu being manipulated. */
register XMSelect *s_ptr; /* XMSelection being queued. */
_XMWinQueAddSelection(register Display *display, register XMenu *menu, register XMSelect *s_ptr)
/* Menu being manipulated. */
/* XMSelection being queued. */
{
/*
* If this entry will overflow the queue then flush it.
......@@ -206,10 +206,10 @@ _XMWinQueAddSelection(display, menu, s_ptr)
* selection window queues.
*/
int
_XMWinQueFlush(display, menu, pane, select)
register Display *display;
register XMenu *menu; /* Menu being manipulated. */
register XMPane *pane; /* Current pane. */
_XMWinQueFlush(register Display *display, register XMenu *menu, register XMPane *pane, XMSelect *select)
/* Menu being manipulated. */
/* Current pane. */
{
register int pq_index; /* Pane queue index. */
register int sq_index; /* Selection queue index. */
......@@ -346,9 +346,9 @@ _XMWinQueFlush(display, menu, pane, select)
* a pane pointer that points to the indexed pane.
*/
XMPane *
_XMGetPanePtr(menu, p_num)
register XMenu *menu; /* Menu to find the pane in. */
register int p_num; /* Index number of pane to find. */
_XMGetPanePtr(register XMenu *menu, register int p_num)
/* Menu to find the pane in. */
/* Index number of pane to find. */
{
register XMPane *p_ptr; /* Pane pointer to be returned. */
register int i; /* Loop counter. */
......@@ -382,9 +382,9 @@ _XMGetPanePtr(menu, p_num)
* indexed selection.
*/
XMSelect *
_XMGetSelectionPtr(p_ptr, s_num)
register XMPane *p_ptr; /* Pane to find the selection in. */
register int s_num; /* Index number of the selection to find. */
_XMGetSelectionPtr(register XMPane *p_ptr, register int s_num)
/* Pane to find the selection in. */
/* Index number of the selection to find. */
{
register XMSelect *s_ptr; /* Selection pointer to be returned. */
register int i; /* Loop counter. */
......@@ -416,9 +416,9 @@ _XMGetSelectionPtr(p_ptr, s_num)
* _XMRecomputeGlobals - Internal subroutine to recompute menu wide
* global values.
*/
_XMRecomputeGlobals(display, menu)
register Display *display; /*X11 display variable. */
register XMenu *menu; /* Menu object to compute from. */
_XMRecomputeGlobals(register Display *display, register XMenu *menu)
/*X11 display variable. */
/* Menu object to compute from. */
{
register XMPane *p_ptr; /* Pane pointer. */
register XMSelect *s_ptr; /* Selection pointer. */
......@@ -531,11 +531,11 @@ _XMRecomputeGlobals(display, menu)
* window dependencies.
*/
int
_XMRecomputePane(display, menu, p_ptr, p_num)
register Display *display; /* Standard X display variable. */
register XMenu *menu; /* Menu object being recomputed. */
register XMPane *p_ptr; /* Pane pointer. */
register int p_num; /* Pane sequence number. */
_XMRecomputePane(register Display *display, register XMenu *menu, register XMPane *p_ptr, register int p_num)
/* Standard X display variable. */
/* Menu object being recomputed. */
/* Pane pointer. */
/* Pane sequence number. */
{
register int window_x; /* Recomputed window X coordinate. */
register int window_y; /* Recomputed window Y coordinate. */
......@@ -681,11 +681,11 @@ _XMRecomputePane(display, menu, p_ptr, p_num)
* selection window dependencies.
*/
int
_XMRecomputeSelection(display, menu, s_ptr, s_num)
register Display *display;
register XMenu *menu; /* Menu object being recomputed. */
register XMSelect *s_ptr; /* Selection pointer. */
register int s_num; /* Selection sequence number. */
_XMRecomputeSelection(register Display *display, register XMenu *menu, register XMSelect *s_ptr, register int s_num)
/* Menu object being recomputed. */
/* Selection pointer. */
/* Selection sequence number. */
{
register Bool config_s = False; /* Reconfigure selection window? */
XWindowChanges *changes; /* Values to change in configure. */
......@@ -811,15 +811,15 @@ _XMRecomputeSelection(display, menu, s_ptr, s_num)
* recomputed before calling this routine or
* unpredictable results will follow.
*/
_XMTransToOrigin(display, menu, p_ptr, s_ptr, x_pos, y_pos, orig_x, orig_y)
Display *display; /* Not used. Included for consistency. */
register XMenu *menu; /* Menu being computed against. */
register XMPane *p_ptr; /* Current pane pointer. */
register XMSelect *s_ptr; /* Current selection pointer. */
int x_pos; /* X coordinate of point to translate. */
int y_pos; /* Y coordinate of point to translate. */
int *orig_x; /* Return value X coord. of the menu origin. */
int *orig_y; /* Return value Y coord. of the menu origin. */
_XMTransToOrigin(Display *display, register XMenu *menu, register XMPane *p_ptr, register XMSelect *s_ptr, int x_pos, int y_pos, int *orig_x, int *orig_y)
/* Not used. Included for consistency. */
/* Menu being computed against. */
/* Current pane pointer. */
/* Current selection pointer. */
/* X coordinate of point to translate. */
/* Y coordinate of point to translate. */
/* Return value X coord. of the menu origin. */
/* Return value Y coord. of the menu origin. */
{
register int l_orig_x; /* Local X coordinate of the menu origin. */
register int l_orig_y; /* Local Y coordinate of the menu origin. */
......@@ -871,10 +871,7 @@ _XMTransToOrigin(display, menu, p_ptr, s_ptr, x_pos, y_pos, orig_x, orig_y)
* _XMRefreshPane - Internal subroutine to completely refresh
* the contents of a pane.
*/
_XMRefreshPane(display, menu, pane)
register Display *display;
register XMenu *menu;
register XMPane *pane;
_XMRefreshPane(register Display *display, register XMenu *menu, register XMPane *pane)
{
register XMSelect *s_list = pane->s_list;
register XMSelect *s_ptr;
......@@ -941,10 +938,7 @@ _XMRefreshPane(display, menu, pane)
* _XMRefreshSelection - Internal subroutine that refreshes
* a single selection window.
*/
_XMRefreshSelection(display, menu, select)
register Display *display;
register XMenu *menu;
register XMSelect *select;
_XMRefreshSelection(register Display *display, register XMenu *menu, register XMSelect *select)
{
register int width = select->window_w;
register int height = select->window_h;
......
......@@ -17,17 +17,17 @@
#include "XMenuInt.h"
int
XMenuLocate(display, menu, p_num, s_num, x_pos, y_pos, ul_x, ul_y, width, height)
register Display *display; /* Previously opened display. */
register XMenu *menu; /* Menu object being located. */
int p_num; /* Active pane number. */
int s_num; /* Active selection number. */
int x_pos; /* X coordinate of mouse active position. */
int y_pos; /* Y coordinate of mouse active position. */
int *ul_x; /* Returned upper left menu X coordinate. */
int *ul_y; /* Returned upper left menu Y coordinate. */
int *width; /* Returned menu width. */
int *height; /* Returned menu height. */
XMenuLocate(register Display *display, register XMenu *menu, int p_num, int s_num, int x_pos, int y_pos, int *ul_x, int *ul_y, int *width, int *height)
/* Previously opened display. */
/* Menu object being located. */
/* Active pane number. */
/* Active selection number. */
/* X coordinate of mouse active position. */
/* Y coordinate of mouse active position. */
/* Returned upper left menu X coordinate. */
/* Returned upper left menu Y coordinate. */
/* Returned menu width. */
/* Returned menu height. */
{
register XMPane *p_ptr; /* XMPane pointer. */
register XMSelect *s_ptr; /* XMSelect pointer. */
......
......@@ -39,14 +39,14 @@
#include "XMenuInt.h"
char *
XMenuPost(display, menu, p_num, s_num, x_pos, y_pos, event_mask)
register Display *display; /* Previously opened display. */
register XMenu *menu; /* Menu to post. */
register int *p_num; /* Pane number selected. */
register int *s_num; /* Selection number selected. */
register int x_pos; /* X coordinate of menu position. */
register int y_pos; /* Y coordinate of menu position. */
int event_mask; /* Mouse button event mask. */
XMenuPost(register Display *display, register XMenu *menu, register int *p_num, register int *s_num, register int x_pos, register int y_pos, int event_mask)
/* Previously opened display. */
/* Menu to post. */
/* Pane number selected. */
/* Selection number selected. */
/* X coordinate of menu position. */
/* Y coordinate of menu position. */
/* Mouse button event mask. */
{
register int stat; /* Routine call return status. */
char *data; /* Return data. */
......
......@@ -16,9 +16,9 @@
#include "XMenuInt.h"
int
XMenuRecompute(display, menu)
Display *display;
register XMenu *menu; /* Menu object to be recomputed. */
XMenuRecompute(Display *display, register XMenu *menu)
/* Menu object to be recomputed. */
{
register XMPane *p_ptr; /* Pane pointer. */
register XMSelect *s_ptr; /* Selection pointer. */
......
......@@ -18,9 +18,9 @@
#include "XMenuInt.h"
XMenuSetAEQ(menu, aeq)
register XMenu *menu; /* Menu object to be modified. */
register int aeq; /* AEQ mode? */
XMenuSetAEQ(register XMenu *menu, register int aeq)
/* Menu object to be modified. */
/* AEQ mode? */
{
/*
* Set the AEQ mode switch.
......
......@@ -17,9 +17,9 @@
#include "XMenuInt.h"
XMenuSetFreeze(menu, freeze)
register XMenu *menu; /* Menu object to be modified. */
register int freeze; /* Freeze mode? */
XMenuSetFreeze(register XMenu *menu, register int freeze)
/* Menu object to be modified. */
/* Freeze mode? */
{
/*
* Set the freeze mode switch.
......
......@@ -16,10 +16,10 @@
#include "XMenuInt.h"
int
XMenuSetPane(menu, p_num, active)
register XMenu *menu; /* Menu object to be modified. */
register int p_num; /* Pane number to be modified. */
register int active; /* Make selection active? */