diff options
author | Dan Nicolaescu <dann@ics.uci.edu> | 2010-07-03 22:47:55 -0700 |
---|---|---|
committer | Dan Nicolaescu <dann@ics.uci.edu> | 2010-07-03 22:47:55 -0700 |
commit | c3174d16e2a91d19313afd8109c31ad8695a87c6 (patch) | |
tree | c838fd350746e27be63a92caa1cb5ce452d8a755 /lwlib/lwlib.c | |
parent | 1c027a2427524def8a03ee4ad3e48fefa352a9b0 (diff) |
Convert function definitions in lwlib files to standard C.
* lwlib/lwlib-Xaw.c: Convert function definitions to standard C.
* lwlib/lwlib-Xlw.c:
* lwlib/lwlib-utils.c:
* lwlib/lwlib.c:
* lwlib/lwlib.h:
* lwlib/xlwmenu.c: Likewise.
Diffstat (limited to 'lwlib/lwlib.c')
-rw-r--r-- | lwlib/lwlib.c | 141 |
1 files changed, 40 insertions, 101 deletions
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c index f4fe69a28f..cc72116760 100644 --- a/lwlib/lwlib.c +++ b/lwlib/lwlib.c @@ -106,10 +106,7 @@ static Boolean get_one_value (widget_instance *, widget_value *); static void show_one_widget_busy (Widget, Boolean); void -lwlib_memset (address, value, length) - char *address; - int value; - size_t length; +lwlib_memset (char *address, int value, size_t length) { int i; @@ -118,10 +115,7 @@ lwlib_memset (address, value, length) } void -lwlib_bcopy (from, to, length) - char *from; - char *to; - int length; +lwlib_bcopy (char *from, char *to, int length) { int i; @@ -130,8 +124,7 @@ lwlib_bcopy (from, to, length) } /* utility functions for widget_instance and widget_info */ char * -safe_strdup (s) - const char *s; +safe_strdup (const char *s) { char *result; if (! s) return 0; @@ -145,8 +138,7 @@ safe_strdup (s) /* Like strcmp but ignore differences in case. */ static int -my_strcasecmp (s1, s2) - char *s1, *s2; +my_strcasecmp (char *s1, char *s2) { while (1) { @@ -164,8 +156,7 @@ my_strcasecmp (s1, s2) } static void -safe_free_str (s) - char *s; +safe_free_str (char *s) { free (s); } @@ -174,7 +165,7 @@ static widget_value *widget_value_free_list = 0; static int malloc_cpt = 0; widget_value * -malloc_widget_value () +malloc_widget_value (void) { widget_value *wv; if (widget_value_free_list) @@ -196,8 +187,7 @@ malloc_widget_value () by malloc_widget_value(), and no substructures. */ void -free_widget_value (wv) - widget_value *wv; +free_widget_value (widget_value *wv) { if (wv->free_list) abort (); @@ -217,8 +207,7 @@ free_widget_value (wv) } static void -free_widget_value_tree (wv) - widget_value *wv; +free_widget_value_tree (widget_value *wv) { if (!wv) return; @@ -249,9 +238,7 @@ free_widget_value_tree (wv) } static widget_value * -copy_widget_value_tree (val, change) - widget_value* val; - change_type change; +copy_widget_value_tree (widget_value *val, change_type change) { widget_value* copy; @@ -310,8 +297,7 @@ allocate_widget_info (type, name, id, val, pre_activate_cb, } static void -free_widget_info (info) - widget_info* info; +free_widget_info (widget_info *info) { safe_free_str (info->type); safe_free_str (info->name); @@ -321,10 +307,7 @@ free_widget_info (info) } static void -mark_widget_destroyed (widget, closure, call_data) - Widget widget; - XtPointer closure; - XtPointer call_data; +mark_widget_destroyed (Widget widget, XtPointer closure, XtPointer call_data) { widget_instance* instance = (widget_instance*)closure; @@ -363,8 +346,7 @@ allocate_widget_instance (info, parent, pop_up_p) } static void -free_widget_instance (instance) - widget_instance* instance; +free_widget_instance (widget_instance *instance) { lwlib_memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance)); free (instance); @@ -401,8 +383,7 @@ get_widget_info (id, remove_p) /* Internal function used by the library dependent implementation to get the widget_value for a given widget in an instance */ widget_info * -lw_get_widget_info (id) - LWLIB_ID id; +lw_get_widget_info (LWLIB_ID id) { return get_widget_info (id, 0); } @@ -441,8 +422,7 @@ get_widget_instance (widget, remove_p) WIDGET, or null if WIDGET is not a lwlib widget. */ widget_instance * -lw_get_widget_instance (widget) - Widget widget; +lw_get_widget_instance (Widget widget) { return get_widget_instance (widget, False); } @@ -471,9 +451,7 @@ find_instance (id, parent, pop_up_p) /* utility function for widget_value */ static Boolean -safe_strcmp (s1, s2) - char* s1; - char* s2; +safe_strcmp (char *s1, char *s2) { if (!!s1 ^ !!s2) return True; return (s1 && s2) ? strcmp (s1, s2) : s1 ? False : !!s2; @@ -500,11 +478,7 @@ safe_strcmp (s1, s2) static widget_value * -merge_widget_value (val1, val2, level, change_p) - widget_value* val1; - widget_value* val2; - int level; - int *change_p; +merge_widget_value (widget_value *val1, widget_value *val2, int level, int *change_p) { change_type change, this_one_change; widget_value* merged_next; @@ -658,9 +632,7 @@ merge_widget_value (val1, val2, level, change_p) /* modifying the widgets */ static Widget -name_to_widget (instance, name) - widget_instance* instance; - char* name; +name_to_widget (widget_instance *instance, char *name) { Widget widget = NULL; @@ -814,8 +786,7 @@ lw_modify_all_widgets (id, val, deep_p) /* creating the widgets */ static void -initialize_widget_instance (instance) - widget_instance* instance; +initialize_widget_instance (widget_instance *instance) { widget_value* val; @@ -830,9 +801,7 @@ initialize_widget_instance (instance) static widget_creation_function -find_in_table (type, table) - char* type; - widget_creation_entry* table; +find_in_table (char *type, widget_creation_entry *table) { widget_creation_entry* cur; for (cur = table; cur->type; cur++) @@ -842,8 +811,7 @@ find_in_table (type, table) } static Boolean -dialog_spec_p (name) - char* name; +dialog_spec_p (char *name) { /* return True if name matches [EILPQeilpq][1-9][Bb] or [EILPQeilpq][1-9][Bb][Rr][1-9] */ @@ -876,8 +844,7 @@ dialog_spec_p (name) } static void -instantiate_widget_instance (instance) - widget_instance* instance; +instantiate_widget_instance (widget_instance *instance) { widget_creation_function function = NULL; @@ -1016,8 +983,7 @@ lw_create_widget (type, name, id, val, parent, pop_up_p, pre_activate_cb, /* destroying the widgets */ static void -destroy_one_instance (instance) - widget_instance* instance; +destroy_one_instance (widget_instance *instance) { /* Remove the destroy callback on the widget; that callback will try to dereference the instance object (to set its widget slot to 0, since the @@ -1059,8 +1025,7 @@ destroy_one_instance (instance) } void -lw_destroy_widget (w) - Widget w; +lw_destroy_widget (Widget w) { widget_instance* instance = get_widget_instance (w, True); @@ -1076,8 +1041,7 @@ lw_destroy_widget (w) } void -lw_destroy_all_widgets (id) - LWLIB_ID id; +lw_destroy_all_widgets (LWLIB_ID id) { widget_info* info = get_widget_info (id, True); widget_instance* instance; @@ -1096,14 +1060,14 @@ lw_destroy_all_widgets (id) } void -lw_destroy_everything () +lw_destroy_everything (void) { while (all_widget_info) lw_destroy_all_widgets (all_widget_info->id); } void -lw_destroy_all_pop_ups () +lw_destroy_all_pop_ups (void) { widget_info* info; widget_info* next; @@ -1123,7 +1087,7 @@ extern Widget first_child (/* Widget */); /* garbage */ #endif Widget -lw_raise_all_pop_up_widgets () +lw_raise_all_pop_up_widgets (void) { widget_info* info; widget_instance* instance; @@ -1197,23 +1161,19 @@ lw_pop_all_widgets (id, up) } void -lw_pop_up_all_widgets (id) - LWLIB_ID id; +lw_pop_up_all_widgets (LWLIB_ID id) { lw_pop_all_widgets (id, True); } void -lw_pop_down_all_widgets (id) - LWLIB_ID id; +lw_pop_down_all_widgets (LWLIB_ID id) { lw_pop_all_widgets (id, False); } void -lw_popup_menu (widget, event) - Widget widget; - XEvent *event; +lw_popup_menu (Widget widget, XEvent *event) { #if defined (USE_LUCID) if (lw_lucid_widget_p (widget)) @@ -1231,9 +1191,7 @@ lw_popup_menu (widget, event) /* get the values back */ static Boolean -get_one_value (instance, val) - widget_instance* instance; - widget_value* val; +get_one_value (widget_instance *instance, widget_value *val) { Widget widget = name_to_widget (instance, val->name); @@ -1258,9 +1216,7 @@ get_one_value (instance, val) } Boolean -lw_get_some_values (id, val_out) - LWLIB_ID id; - widget_value* val_out; +lw_get_some_values (LWLIB_ID id, widget_value *val_out) { widget_info* info = get_widget_info (id, False); widget_instance* instance; @@ -1282,8 +1238,7 @@ lw_get_some_values (id, val_out) } widget_value* -lw_get_all_values (id) - LWLIB_ID id; +lw_get_all_values (LWLIB_ID id) { widget_info* info = get_widget_info (id, False); widget_value* val = info->val; @@ -1296,9 +1251,7 @@ lw_get_all_values (id) /* internal function used by the library dependent implementation to get the widget_value for a given widget in an instance */ widget_value* -lw_get_widget_value_for_widget (instance, w) - widget_instance* instance; - Widget w; +lw_get_widget_value_for_widget (widget_instance *instance, Widget w) { char* name = XtName (w); widget_value* cur; @@ -1317,10 +1270,7 @@ static Boolean lwlib_updating; modified to update other instances of the widgets. Closure should be the widget_instance. */ void -lw_internal_update_other_instances (widget, closure, call_data) - Widget widget; - XtPointer closure; - XtPointer call_data; +lw_internal_update_other_instances (Widget widget, XtPointer closure, XtPointer call_data) { widget_instance* instance = (widget_instance*)closure; char* name = XtName (widget); @@ -1357,8 +1307,7 @@ lw_internal_update_other_instances (widget, closure, call_data) /* get the id */ LWLIB_ID -lw_get_widget_id (w) - Widget w; +lw_get_widget_id (Widget w) { widget_instance* instance = get_widget_instance (w, False); @@ -1367,9 +1316,7 @@ lw_get_widget_id (w) /* set the keyboard focus */ void -lw_set_keyboard_focus (parent, w) - Widget parent; - Widget w; +lw_set_keyboard_focus (Widget parent, Widget w) { #if defined (USE_MOTIF) xm_set_keyboard_focus (parent, w); @@ -1455,9 +1402,7 @@ lw_refigure_widget (w, doit) /* Toolkit independent way of determining if an event window is in the menubar. */ Boolean -lw_window_is_in_menubar (win, menubar_widget) - Window win; - Widget menubar_widget; +lw_window_is_in_menubar (Window win, Widget menubar_widget) { return menubar_widget #if defined (USE_LUCID) @@ -1473,10 +1418,7 @@ lw_window_is_in_menubar (win, menubar_widget) /* Motif hack to set the main window areas. */ void -lw_set_main_areas (parent, menubar, work_area) - Widget parent; - Widget menubar; - Widget work_area; +lw_set_main_areas (Widget parent, Widget menubar, Widget work_area) { #if defined (USE_MOTIF) xm_set_main_areas (parent, menubar, work_area); @@ -1506,10 +1448,7 @@ lw_allow_resizing (w, flag) to similar ones that are supported. */ int -lw_separator_p (label, type, motif_p) - char *label; - enum menu_separator *type; - int motif_p; +lw_separator_p (char *label, enum menu_separator *type, int motif_p) { int separator_p = 0; |