aboutsummaryrefslogtreecommitdiffstats
path: root/src/search.c
diff options
context:
space:
mode:
authorPaul Eggert2011-04-10 18:41:15 -0700
committerPaul Eggert2011-04-10 18:41:15 -0700
commit16a97296c05ec9d5bb4ffeae9dce90fc63f578ed (patch)
tree0801b434f760fd8dded7204501ffcdb82460720c /src/search.c
parent785bbd422461295890087ced24bfd87504032d0c (diff)
downloademacs-16a97296c05ec9d5bb4ffeae9dce90fc63f578ed.tar.gz
emacs-16a97296c05ec9d5bb4ffeae9dce90fc63f578ed.zip
Make Emacs functions such as Fatom 'static' by default.
This makes it easier for human readers (and static analyzers) to see whether these functions can be called from other modules. DEFUN now defines a static function. To make the function external so that it can be used in other C modules, use the new macro DEFUE. * lisp.h (DEFINE_FUNC): New macro, with the old contents of DEFUN. (DEFUN): Rewrite in terms of DEFINE_FUNC. It now generates a static function definition. Use DEFUE if you want an extern one. (DEFUE, INFUN): New macros. (Funibyte_char_to_multibyte, Fsyntax_table_p, Finit_image_library): (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer): (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute): (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes): Remove decls, since these functions are now static. (Funintern, Fget_internal_run_time): New decls, since these functions were already external. * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c: * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c: * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c: * fns.c, font.c, fontset.c, frame.c, image.c, indent.c: * keyboard.c, keymap.c, lread.c: * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c: * syntax.c, term.c, terminal.c, textprop.c, undo.c: * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c: Mark functions with DEFUE instead of DEFUN, if they are used in other modules. * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward decls for now-static functions. * buffer.h (Fdelete_overlay): Remove decl. * callproc.c (Fgetenv_internal): Mark as internal. * composite.c (Fremove_list_of_text_properties): Remove decl. (Fcomposition_get_gstring): New forward static decl. * composite.h (Fcomposite_get_gstring): Remove decl. * dired.c (Ffile_attributes): New forward static decl. * doc.c (Fdocumntation_property): New forward static decl. * eval.c (Ffetch_bytecode): New forward static decl. (Funintern): Remove extern decl; now in .h file where it belongs. * fileio.c (Fmake_symbolic_link): New forward static decl. * image.c (Finit_image_library): New forward static decl. * insdel.c (Fcombine_after_change_execute): Make forward decl static. * intervals.h (Fprevious_property_change): (Fremove_list_of_text_properties): Remove decls. * keyboard.c (Fthis_command_keys): Remove decl. (Fcommand_execute): New forward static decl. * keymap.c (Flookup_key): New forward static decl. (Fcopy_keymap): Now static. * keymap.h (Flookup_key): Remove decl. * process.c (Fget_process): New forward static decl. (Fprocess_datagram_address): Mark as internal. * syntax.c (Fsyntax_table_p): New forward static decl. (skip_chars): Remove duplicate decl. * textprop.c (Fprevious_property_change): New forward static decl. * window.c (Fset_window_fringes, Fset_window_scroll_bars): Now internal. (Fset_window_margins, Fset_window_vscroll): New forward static decls. * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/search.c b/src/search.c
index d9be8ca0105..34f02e6cd65 100644
--- a/src/search.c
+++ b/src/search.c
@@ -436,7 +436,7 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, int p
436 return make_number (string_byte_to_char (string, val)); 436 return make_number (string_byte_to_char (string, val));
437} 437}
438 438
439DEFUN ("string-match", Fstring_match, Sstring_match, 2, 3, 0, 439DEFUE ("string-match", Fstring_match, Sstring_match, 2, 3, 0,
440 doc: /* Return index of start of first match for REGEXP in STRING, or nil. 440 doc: /* Return index of start of first match for REGEXP in STRING, or nil.
441Matching ignores case if `case-fold-search' is non-nil. 441Matching ignores case if `case-fold-search' is non-nil.
442If third arg START is non-nil, start search at that index in STRING. 442If third arg START is non-nil, start search at that index in STRING.
@@ -2811,7 +2811,7 @@ match_limit (Lisp_Object num, int beginningp)
2811 : search_regs.end[n])); 2811 : search_regs.end[n]));
2812} 2812}
2813 2813
2814DEFUN ("match-beginning", Fmatch_beginning, Smatch_beginning, 1, 1, 0, 2814DEFUE ("match-beginning", Fmatch_beginning, Smatch_beginning, 1, 1, 0,
2815 doc: /* Return position of start of text matched by last search. 2815 doc: /* Return position of start of text matched by last search.
2816SUBEXP, a number, specifies which parenthesized expression in the last 2816SUBEXP, a number, specifies which parenthesized expression in the last
2817 regexp. 2817 regexp.
@@ -2823,7 +2823,7 @@ Zero means the entire text matched by the whole regexp or whole string. */)
2823 return match_limit (subexp, 1); 2823 return match_limit (subexp, 1);
2824} 2824}
2825 2825
2826DEFUN ("match-end", Fmatch_end, Smatch_end, 1, 1, 0, 2826DEFUE ("match-end", Fmatch_end, Smatch_end, 1, 1, 0,
2827 doc: /* Return position of end of text matched by last search. 2827 doc: /* Return position of end of text matched by last search.
2828SUBEXP, a number, specifies which parenthesized expression in the last 2828SUBEXP, a number, specifies which parenthesized expression in the last
2829 regexp. 2829 regexp.
@@ -2835,7 +2835,7 @@ Zero means the entire text matched by the whole regexp or whole string. */)
2835 return match_limit (subexp, 0); 2835 return match_limit (subexp, 0);
2836} 2836}
2837 2837
2838DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 3, 0, 2838DEFUE ("match-data", Fmatch_data, Smatch_data, 0, 3, 0,
2839 doc: /* Return a list containing all info on what the last search matched. 2839 doc: /* Return a list containing all info on what the last search matched.
2840Element 2N is `(match-beginning N)'; element 2N + 1 is `(match-end N)'. 2840Element 2N is `(match-beginning N)'; element 2N + 1 is `(match-end N)'.
2841All the elements are markers or nil (nil if the Nth pair didn't match) 2841All the elements are markers or nil (nil if the Nth pair didn't match)
@@ -2950,7 +2950,7 @@ Return value is undefined if the last search failed. */)
2950 But it was ill-conceived: those supposedly-internal markers get exposed via 2950 But it was ill-conceived: those supposedly-internal markers get exposed via
2951 the undo-list, so freeing them here is unsafe. */ 2951 the undo-list, so freeing them here is unsafe. */
2952 2952
2953DEFUN ("set-match-data", Fset_match_data, Sset_match_data, 1, 2, 0, 2953DEFUE ("set-match-data", Fset_match_data, Sset_match_data, 1, 2, 0,
2954 doc: /* Set internal data on last search match from elements of LIST. 2954 doc: /* Set internal data on last search match from elements of LIST.
2955LIST should have been created by calling `match-data' previously. 2955LIST should have been created by calling `match-data' previously.
2956 2956