Mercurial > emacs
diff src/menu.c @ 109126:aec1143e8d85
Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C.
* src/atimer.c:
* src/bidi.c:
* src/bytecode.c:
* src/callint.c:
* src/callproc.c:
* src/casefiddle.c:
* src/casetab.c:
* src/category.c:
* src/ccl.c:
* src/character.c:
* src/charset.c:
* src/chartab.c:
* src/cmds.c:
* src/coding.c:
* src/composite.c:
* src/data.c:
* src/dbusbind.c:
* src/dired.c:
* src/dispnew.c:
* src/doc.c:
* src/doprnt.c:
* src/ecrt0.c:
* src/editfns.c:
* src/fileio.c:
* src/filelock.c:
* src/filemode.c:
* src/fns.c:
* src/font.c:
* src/fontset.c:
* src/frame.c:
* src/fringe.c:
* src/ftfont.c:
* src/ftxfont.c:
* src/gtkutil.c:
* src/indent.c:
* src/insdel.c:
* src/intervals.c:
* src/keymap.c:
* src/lread.c:
* src/macros.c:
* src/marker.c:
* src/md5.c:
* src/menu.c:
* src/minibuf.c:
* src/prefix-args.c:
* src/print.c:
* src/ralloc.c:
* src/regex.c:
* src/region-cache.c:
* src/scroll.c:
* src/search.c:
* src/sound.c:
* src/strftime.c:
* src/syntax.c:
* src/sysdep.c:
* src/termcap.c:
* src/terminal.c:
* src/terminfo.c:
* src/textprop.c:
* src/tparam.c:
* src/undo.c:
* src/unexelf.c:
* src/window.c:
* src/xfaces.c:
* src/xfns.c:
* src/xfont.c:
* src/xftfont.c:
* src/xgselect.c:
* src/xmenu.c:
* src/xrdb.c:
* src/xselect.c:
* src/xsettings.c:
* src/xsmfns.c:
* src/xterm.c: Likewise.
| author | Dan Nicolaescu <dann@ics.uci.edu> |
|---|---|
| date | Sun, 04 Jul 2010 00:50:25 -0700 |
| parents | 2bc9a0c04c87 |
| children | 8cfee7d2955f |
line wrap: on
line diff
--- a/src/menu.c Sat Jul 03 23:05:43 2010 -0700 +++ b/src/menu.c Sun Jul 04 00:50:25 2010 -0700 @@ -87,7 +87,7 @@ static int menu_items_submenu_depth; void -init_menu_items () +init_menu_items (void) { if (!NILP (menu_items_inuse)) error ("Trying to use a menu from within a menu-entry"); @@ -107,13 +107,12 @@ /* Call at the end of generating the data in menu_items. */ void -finish_menu_items () +finish_menu_items (void) { } Lisp_Object -unuse_menu_items (dummy) - Lisp_Object dummy; +unuse_menu_items (Lisp_Object dummy) { return menu_items_inuse = Qnil; } @@ -122,7 +121,7 @@ in menu_items. */ void -discard_menu_items () +discard_menu_items (void) { /* Free the structure if it is especially large. Otherwise, hold on to it, to save time. */ @@ -145,8 +144,7 @@ mechanism. */ static Lisp_Object -restore_menu_items (saved) - Lisp_Object saved; +restore_menu_items (Lisp_Object saved) { menu_items = XCAR (saved); menu_items_inuse = (! NILP (menu_items) ? Qt : Qnil); @@ -164,7 +162,7 @@ It will be restored when the specpdl is unwound. */ void -save_menu_items () +save_menu_items (void) { Lisp_Object saved = list4 (!NILP (menu_items_inuse) ? menu_items : Qnil, make_number (menu_items_used), @@ -179,7 +177,7 @@ /* Make the menu_items vector twice as large. */ static void -grow_menu_items () +grow_menu_items (void) { menu_items_allocated *= 2; menu_items = larger_vector (menu_items, menu_items_allocated, Qnil); @@ -188,7 +186,7 @@ /* Begin a submenu. */ static void -push_submenu_start () +push_submenu_start (void) { if (menu_items_used + 1 > menu_items_allocated) grow_menu_items (); @@ -200,7 +198,7 @@ /* End a submenu. */ static void -push_submenu_end () +push_submenu_end (void) { if (menu_items_used + 1 > menu_items_allocated) grow_menu_items (); @@ -212,7 +210,7 @@ /* Indicate boundary between left and right. */ static void -push_left_right_boundary () +push_left_right_boundary (void) { if (menu_items_used + 1 > menu_items_allocated) grow_menu_items (); @@ -224,8 +222,7 @@ NAME is the pane name. PREFIX_VEC is a prefix key for this pane. */ static void -push_menu_pane (name, prefix_vec) - Lisp_Object name, prefix_vec; +push_menu_pane (Lisp_Object name, Lisp_Object prefix_vec) { if (menu_items_used + MENU_ITEMS_PANE_LENGTH > menu_items_allocated) grow_menu_items (); @@ -246,8 +243,7 @@ item, one of nil, `toggle' or `radio'. */ static void -push_menu_item (name, enable, key, def, equiv, type, selected, help) - Lisp_Object name, enable, key, def, equiv, type, selected, help; +push_menu_item (Lisp_Object name, Lisp_Object enable, Lisp_Object key, Lisp_Object def, Lisp_Object equiv, Lisp_Object type, Lisp_Object selected, Lisp_Object help) { if (menu_items_used + MENU_ITEMS_ITEM_LENGTH > menu_items_allocated) grow_menu_items (); @@ -332,9 +328,7 @@ If we encounter submenus deeper than SKP->MAXDEPTH levels, ignore them. */ static void -single_menu_item (key, item, dummy, skp_v) - Lisp_Object key, item, dummy; - void *skp_v; +single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *skp_v) { Lisp_Object map, item_string, enabled; struct gcpro gcpro1, gcpro2; @@ -456,9 +450,7 @@ and generate menu panes for them in menu_items. */ static void -keymap_panes (keymaps, nmaps) - Lisp_Object *keymaps; - int nmaps; +keymap_panes (Lisp_Object *keymaps, int nmaps) { int mapno; @@ -477,8 +469,7 @@ /* Push the items in a single pane defined by the alist PANE. */ static void -list_of_items (pane) - Lisp_Object pane; +list_of_items (Lisp_Object pane) { Lisp_Object tail, item, item1; @@ -505,8 +496,7 @@ alist-of-alists MENU. This handles old-fashioned calls to x-popup-menu. */ void -list_of_panes (menu) - Lisp_Object menu; +list_of_panes (Lisp_Object menu) { Lisp_Object tail; @@ -531,8 +521,7 @@ whose event type is ITEM_KEY (with string ITEM_NAME) and whose contents come from the list of keymaps MAPS. */ int -parse_single_submenu (item_key, item_name, maps) - Lisp_Object item_key, item_name, maps; +parse_single_submenu (Lisp_Object item_key, Lisp_Object item_name, Lisp_Object maps) { Lisp_Object length; int len; @@ -583,7 +572,7 @@ /* Allocate a widget_value, blocking input. */ widget_value * -xmalloc_widget_value () +xmalloc_widget_value (void) { widget_value *value; @@ -600,8 +589,7 @@ must be left alone. */ void -free_menubar_widget_value_tree (wv) - widget_value *wv; +free_menubar_widget_value_tree (widget_value *wv) { if (! wv) return; @@ -627,8 +615,7 @@ in menu_items starting at index START, up to index END. */ widget_value * -digest_single_submenu (start, end, top_level_items) - int start, end, top_level_items; +digest_single_submenu (int start, int end, int top_level_items) { widget_value *wv, *prev_wv, *save_wv, *first_wv; int i; @@ -856,8 +843,7 @@ tree is constructed, and small strings are relocated. So we must wait until no GC can happen before storing pointers into lisp values. */ void -update_submenu_strings (first_wv) - widget_value *first_wv; +update_submenu_strings (widget_value *first_wv) { widget_value *wv; @@ -891,11 +877,7 @@ VECTOR is an array of menu events for the whole menu. */ void -find_and_call_menu_selection (f, menu_bar_items_used, vector, client_data) - FRAME_PTR f; - int menu_bar_items_used; - Lisp_Object vector; - void *client_data; +find_and_call_menu_selection (FRAME_PTR f, int menu_bar_items_used, Lisp_Object vector, void *client_data) { Lisp_Object prefix, entry; Lisp_Object *subprefix_stack; @@ -1368,7 +1350,7 @@ } void -syms_of_menu () +syms_of_menu (void) { staticpro (&menu_items); menu_items = Qnil;
