aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.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/coding.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/coding.c')
-rw-r--r--src/coding.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/coding.c b/src/coding.c
index 711ada59c85..13fcb7fb8a5 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -7991,7 +7991,7 @@ preferred_coding_system (void)
7991#ifdef emacs 7991#ifdef emacs
7992/*** 8. Emacs Lisp library functions ***/ 7992/*** 8. Emacs Lisp library functions ***/
7993 7993
7994DEFUN ("coding-system-p", Fcoding_system_p, Scoding_system_p, 1, 1, 0, 7994DEFUE ("coding-system-p", Fcoding_system_p, Scoding_system_p, 1, 1, 0,
7995 doc: /* Return t if OBJECT is nil or a coding-system. 7995 doc: /* Return t if OBJECT is nil or a coding-system.
7996See the documentation of `define-coding-system' for information 7996See the documentation of `define-coding-system' for information
7997about coding-system objects. */) 7997about coding-system objects. */)
@@ -8006,7 +8006,7 @@ about coding-system objects. */)
8006 return Qt; 8006 return Qt;
8007} 8007}
8008 8008
8009DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system, 8009DEFUE ("read-non-nil-coding-system", Fread_non_nil_coding_system,
8010 Sread_non_nil_coding_system, 1, 1, 0, 8010 Sread_non_nil_coding_system, 1, 1, 0,
8011 doc: /* Read a coding system from the minibuffer, prompting with string PROMPT. */) 8011 doc: /* Read a coding system from the minibuffer, prompting with string PROMPT. */)
8012 (Lisp_Object prompt) 8012 (Lisp_Object prompt)
@@ -8021,7 +8021,7 @@ DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system,
8021 return (Fintern (val, Qnil)); 8021 return (Fintern (val, Qnil));
8022} 8022}
8023 8023
8024DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0, 8024DEFUE ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0,
8025 doc: /* Read a coding system from the minibuffer, prompting with string PROMPT. 8025 doc: /* Read a coding system from the minibuffer, prompting with string PROMPT.
8026If the user enters null input, return second argument DEFAULT-CODING-SYSTEM. 8026If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.
8027Ignores case when completing coding systems (all Emacs coding systems 8027Ignores case when completing coding systems (all Emacs coding systems
@@ -8041,7 +8041,7 @@ are lower-case). */)
8041 return (SCHARS (val) == 0 ? Qnil : Fintern (val, Qnil)); 8041 return (SCHARS (val) == 0 ? Qnil : Fintern (val, Qnil));
8042} 8042}
8043 8043
8044DEFUN ("check-coding-system", Fcheck_coding_system, Scheck_coding_system, 8044DEFUE ("check-coding-system", Fcheck_coding_system, Scheck_coding_system,
8045 1, 1, 0, 8045 1, 1, 0,
8046 doc: /* Check validity of CODING-SYSTEM. 8046 doc: /* Check validity of CODING-SYSTEM.
8047If valid, return CODING-SYSTEM, else signal a `coding-system-error' error. 8047If valid, return CODING-SYSTEM, else signal a `coding-system-error' error.
@@ -8976,7 +8976,7 @@ code_convert_string_norecord (Lisp_Object string, Lisp_Object coding_system,
8976} 8976}
8977 8977
8978 8978
8979DEFUN ("decode-coding-string", Fdecode_coding_string, Sdecode_coding_string, 8979DEFUE ("decode-coding-string", Fdecode_coding_string, Sdecode_coding_string,
8980 2, 4, 0, 8980 2, 4, 0,
8981 doc: /* Decode STRING which is encoded in CODING-SYSTEM, and return the result. 8981 doc: /* Decode STRING which is encoded in CODING-SYSTEM, and return the result.
8982 8982
@@ -9250,7 +9250,7 @@ DEFUN ("keyboard-coding-system",
9250} 9250}
9251 9251
9252 9252
9253DEFUN ("find-operation-coding-system", Ffind_operation_coding_system, 9253DEFUE ("find-operation-coding-system", Ffind_operation_coding_system,
9254 Sfind_operation_coding_system, 1, MANY, 0, 9254 Sfind_operation_coding_system, 1, MANY, 0,
9255 doc: /* Choose a coding system for an operation based on the target name. 9255 doc: /* Choose a coding system for an operation based on the target name.
9256The value names a pair of coding systems: (DECODING-SYSTEM . ENCODING-SYSTEM). 9256The value names a pair of coding systems: (DECODING-SYSTEM . ENCODING-SYSTEM).
@@ -10093,7 +10093,7 @@ DEFUN ("define-coding-system-alias", Fdefine_coding_system_alias,
10093 return Qnil; 10093 return Qnil;
10094} 10094}
10095 10095
10096DEFUN ("coding-system-base", Fcoding_system_base, Scoding_system_base, 10096DEFUE ("coding-system-base", Fcoding_system_base, Scoding_system_base,
10097 1, 1, 0, 10097 1, 1, 0,
10098 doc: /* Return the base of CODING-SYSTEM. 10098 doc: /* Return the base of CODING-SYSTEM.
10099Any alias or subsidiary coding system is not a base coding system. */) 10099Any alias or subsidiary coding system is not a base coding system. */)
@@ -10136,7 +10136,7 @@ DEFUN ("coding-system-aliases", Fcoding_system_aliases, Scoding_system_aliases,
10136 return AREF (spec, 1); 10136 return AREF (spec, 1);
10137} 10137}
10138 10138
10139DEFUN ("coding-system-eol-type", Fcoding_system_eol_type, 10139DEFUE ("coding-system-eol-type", Fcoding_system_eol_type,
10140 Scoding_system_eol_type, 1, 1, 0, 10140 Scoding_system_eol_type, 1, 1, 0,
10141 doc: /* Return eol-type of CODING-SYSTEM. 10141 doc: /* Return eol-type of CODING-SYSTEM.
10142An eol-type is an integer 0, 1, 2, or a vector of coding systems. 10142An eol-type is an integer 0, 1, 2, or a vector of coding systems.