From: Paul Eggert Date: Thu, 14 Apr 2011 06:48:41 +0000 (-0700) Subject: Don't publish debugger-only interfaces to other modules. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~293 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e3b27b31a8379663f047e53c29e938018d7dd6b7;p=emacs.git Don't publish debugger-only interfaces to other modules. * lisp.h (safe_debug_print, debug_output_compilation_hack): (verify_bytepos, count_markers): Move decls to the only modules that need them. * region-cache.h (pp_cache): Likewise. * window.h (check_all_windows): Likewise. * marker.c, print.c, region-cache.c, window.c: Decls moved here. --- diff --git a/src/ChangeLog b/src/ChangeLog index 70b976e2558..8b566b0d95e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2011-04-14 Paul Eggert + Don't publish debugger-only interfaces to other modules. + * lisp.h (safe_debug_print, debug_output_compilation_hack): + (verify_bytepos, count_markers): Move decls to the only modules + that need them. + * region-cache.h (pp_cache): Likewise. + * window.h (check_all_windows): Likewise. + * marker.c, print.c, region-cache.c, window.c: Decls moved here. + * sysdep.c (croak): Now static, if defined TIOCNOTTY || defined USG5 || defined CYGWIN. * syssignal.h (croak): Declare only if not static. diff --git a/src/lisp.h b/src/lisp.h index 4c7c5b50c89..d629c40198a 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2743,7 +2743,6 @@ extern void syms_of_chartab (void); /* Defined in print.c */ extern Lisp_Object Vprin1_to_string_buffer; extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE; -extern void safe_debug_print (Lisp_Object) EXTERNALLY_VISIBLE; EXFUN (Fprin1, 2); EXFUN (Fprin1_to_string, 2); EXFUN (Fterpri, 1); @@ -2751,7 +2750,6 @@ EXFUN (Fprint, 2); EXFUN (Ferror_message_string, 1); extern Lisp_Object Qstandard_output; extern Lisp_Object Qexternal_debugging_output; -extern void debug_output_compilation_hack (int) EXTERNALLY_VISIBLE; extern void temp_output_buffer_setup (const char *); extern int print_level; extern Lisp_Object Qprint_escape_newlines; @@ -2967,14 +2965,12 @@ extern EMACS_INT marker_byte_position (Lisp_Object); extern void clear_charpos_cache (struct buffer *); extern EMACS_INT charpos_to_bytepos (EMACS_INT); extern EMACS_INT buf_charpos_to_bytepos (struct buffer *, EMACS_INT); -extern EMACS_INT verify_bytepos (EMACS_INT charpos) EXTERNALLY_VISIBLE; extern EMACS_INT buf_bytepos_to_charpos (struct buffer *, EMACS_INT); extern void unchain_marker (struct Lisp_Marker *marker); extern Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object); extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, EMACS_INT, EMACS_INT); extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object, EMACS_INT, EMACS_INT); -extern int count_markers (struct buffer *) EXTERNALLY_VISIBLE; extern void syms_of_marker (void); /* Defined in fileio.c */ diff --git a/src/marker.c b/src/marker.c index 7d461099140..675bbc5ad73 100644 --- a/src/marker.c +++ b/src/marker.c @@ -242,6 +242,7 @@ buf_charpos_to_bytepos (struct buffer *b, EMACS_INT charpos) /* Used for debugging: recompute the bytepos corresponding to CHARPOS in the simplest, most reliable way. */ +extern EMACS_INT verify_bytepos (EMACS_INT charpos) EXTERNALLY_VISIBLE; EMACS_INT verify_bytepos (EMACS_INT charpos) { @@ -864,6 +865,7 @@ DEFUN ("buffer-has-markers-at", Fbuffer_has_markers_at, Sbuffer_has_markers_at, /* For debugging -- count the markers in buffer BUF. */ +extern int count_markers (struct buffer *) EXTERNALLY_VISIBLE; int count_markers (struct buffer *buf) { diff --git a/src/print.c b/src/print.c index 42c5df86783..617ee662e79 100644 --- a/src/print.c +++ b/src/print.c @@ -738,6 +738,7 @@ to make it write to the debugging output. */) /* This function is never called. Its purpose is to prevent print_output_debug_flag from being optimized away. */ +exterr void debug_output_compilation_hack (int) EXTERNALLY_VISIBLE; void debug_output_compilation_hack (int x) { @@ -798,6 +799,7 @@ debug_print (Lisp_Object arg) fprintf (stderr, "\r\n"); } +void safe_debug_print (Lisp_Object) EXTERNALLY_VISIBLE; void safe_debug_print (Lisp_Object arg) { diff --git a/src/region-cache.c b/src/region-cache.c index 53ce0e9d802..a0b85039e74 100644 --- a/src/region-cache.c +++ b/src/region-cache.c @@ -781,6 +781,7 @@ int region_cache_backward (struct buffer *buf, struct region_cache *c, /* Debugging: pretty-print a cache to the standard error output. */ +void pp_cache (struct region_cache *) EXTERNALLY_VISIBLE; void pp_cache (struct region_cache *c) { diff --git a/src/region-cache.h b/src/region-cache.h index 255b517f17a..ea767ed0dc3 100644 --- a/src/region-cache.h +++ b/src/region-cache.h @@ -110,6 +110,3 @@ extern int region_cache_backward (struct buffer *BUF, struct region_cache *CACHE, EMACS_INT POS, EMACS_INT *NEXT); - -/* For debugging. */ -void pp_cache (struct region_cache *) EXTERNALLY_VISIBLE; diff --git a/src/window.c b/src/window.c index eef783268ee..9ee35025d32 100644 --- a/src/window.c +++ b/src/window.c @@ -2338,6 +2338,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame /* Used for debugging. Abort if any window has a dead buffer. */ +extern void check_all_windows (void) EXTERNALLY_VISIBLE; void check_all_windows (void) { diff --git a/src/window.h b/src/window.h index 4b32edd2149..65d554a5501 100644 --- a/src/window.h +++ b/src/window.h @@ -776,7 +776,6 @@ extern void freeze_window_starts (struct frame *, int); extern void grow_mini_window (struct window *, int); extern void shrink_mini_window (struct window *); extern int window_relative_x_coord (struct window *, enum window_part, int); -extern void check_all_windows (void) EXTERNALLY_VISIBLE; void run_window_configuration_change_hook (struct frame *f);