aboutsummaryrefslogtreecommitdiffstats
path: root/src/doc.c
diff options
context:
space:
mode:
authorKenichi Handa2010-07-08 17:09:35 +0900
committerKenichi Handa2010-07-08 17:09:35 +0900
commit80d4189187791916590b6c2b20b54588d432bb75 (patch)
treee59e52ee4a456f3235bff0e7fba4362681dba7dd /src/doc.c
parenta7840ffb291e13c2a2386ccbd58089e1d7461c16 (diff)
parent0216627eb39f77958e30f4750f581714fdfd7faf (diff)
downloademacs-80d4189187791916590b6c2b20b54588d432bb75.tar.gz
emacs-80d4189187791916590b6c2b20b54588d432bb75.zip
merge trunk
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/src/doc.c b/src/doc.c
index 536d22c57a6..ce4c1ddda6a 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -46,7 +46,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
46#include "buildobj.h" 46#include "buildobj.h"
47 47
48#ifdef HAVE_INDEX 48#ifdef HAVE_INDEX
49extern char *index P_ ((const char *, int)); 49extern char *index (const char *, int);
50#endif 50#endif
51 51
52Lisp_Object Vdoc_file_name; 52Lisp_Object Vdoc_file_name;
@@ -65,14 +65,13 @@ static char *get_doc_string_buffer;
65static int get_doc_string_buffer_size; 65static int get_doc_string_buffer_size;
66 66
67static unsigned char *read_bytecode_pointer; 67static unsigned char *read_bytecode_pointer;
68Lisp_Object Fsnarf_documentation P_ ((Lisp_Object)); 68Lisp_Object Fsnarf_documentation (Lisp_Object);
69 69
70/* readchar in lread.c calls back here to fetch the next byte. 70/* readchar in lread.c calls back here to fetch the next byte.
71 If UNREADFLAG is 1, we unread a byte. */ 71 If UNREADFLAG is 1, we unread a byte. */
72 72
73int 73int
74read_bytecode_char (unreadflag) 74read_bytecode_char (int unreadflag)
75 int unreadflag;
76{ 75{
77 if (unreadflag) 76 if (unreadflag)
78 { 77 {
@@ -102,9 +101,7 @@ read_bytecode_char (unreadflag)
102 and return a cons cell. */ 101 and return a cons cell. */
103 102
104Lisp_Object 103Lisp_Object
105get_doc_string (filepos, unibyte, definition) 104get_doc_string (Lisp_Object filepos, int unibyte, int definition)
106 Lisp_Object filepos;
107 int unibyte, definition;
108{ 105{
109 char *from, *to; 106 char *from, *to;
110 register int fd; 107 register int fd;
@@ -311,15 +308,13 @@ get_doc_string (filepos, unibyte, definition)
311 of a compiled function from the .elc file. */ 308 of a compiled function from the .elc file. */
312 309
313Lisp_Object 310Lisp_Object
314read_doc_string (filepos) 311read_doc_string (Lisp_Object filepos)
315 Lisp_Object filepos;
316{ 312{
317 return get_doc_string (filepos, 0, 1); 313 return get_doc_string (filepos, 0, 1);
318} 314}
319 315
320static int 316static int
321reread_doc_file (file) 317reread_doc_file (Lisp_Object file)
322 Lisp_Object file;
323{ 318{
324#if 0 319#if 0
325 Lisp_Object reply, prompt[3]; 320 Lisp_Object reply, prompt[3];
@@ -515,10 +510,8 @@ aren't strings. */)
515/* Scanning the DOC files and placing docstring offsets into functions. */ 510/* Scanning the DOC files and placing docstring offsets into functions. */
516 511
517static void 512static void
518store_function_docstring (fun, offset) 513store_function_docstring (Lisp_Object fun, EMACS_INT offset)
519 Lisp_Object fun; 514/* Use EMACS_INT because we get offset from pointer subtraction. */
520 /* Use EMACS_INT because we get this from pointer subtraction. */
521 EMACS_INT offset;
522{ 515{
523 fun = indirect_function (fun); 516 fun = indirect_function (fun);
524 517
@@ -693,7 +686,7 @@ the same file name is found in the `doc-directory'. */)
693 } 686 }
694 pos += end - buf; 687 pos += end - buf;
695 filled -= end - buf; 688 filled -= end - buf;
696 bcopy (end, buf, filled); 689 memcpy (buf, end, filled);
697 } 690 }
698 emacs_close (fd); 691 emacs_close (fd);
699 return Qnil; 692 return Qnil;
@@ -772,7 +765,7 @@ a new string, without any text properties, is returned. */)
772 if (len == 1) 765 if (len == 1)
773 *bufp = *strp; 766 *bufp = *strp;
774 else 767 else
775 bcopy (strp, bufp, len); 768 memcpy (bufp, strp, len);
776 strp += len; 769 strp += len;
777 bufp += len; 770 bufp += len;
778 nchars++; 771 nchars++;
@@ -824,7 +817,7 @@ a new string, without any text properties, is returned. */)
824 int offset = bufp - buf; 817 int offset = bufp - buf;
825 buf = (unsigned char *) xrealloc (buf, bsize += 4); 818 buf = (unsigned char *) xrealloc (buf, bsize += 4);
826 bufp = buf + offset; 819 bufp = buf + offset;
827 bcopy ("M-x ", bufp, 4); 820 memcpy (bufp, "M-x ", 4);
828 bufp += 4; 821 bufp += 4;
829 nchars += 4; 822 nchars += 4;
830 if (multibyte) 823 if (multibyte)
@@ -918,7 +911,7 @@ a new string, without any text properties, is returned. */)
918 int offset = bufp - buf; 911 int offset = bufp - buf;
919 buf = (unsigned char *) xrealloc (buf, bsize += length_byte); 912 buf = (unsigned char *) xrealloc (buf, bsize += length_byte);
920 bufp = buf + offset; 913 bufp = buf + offset;
921 bcopy (start, bufp, length_byte); 914 memcpy (bufp, start, length_byte);
922 bufp += length_byte; 915 bufp += length_byte;
923 nchars += length; 916 nchars += length;
924 /* Check STRING again in case gc relocated it. */ 917 /* Check STRING again in case gc relocated it. */
@@ -935,7 +928,7 @@ a new string, without any text properties, is returned. */)
935 if (len == 1) 928 if (len == 1)
936 *bufp = *strp; 929 *bufp = *strp;
937 else 930 else
938 bcopy (strp, bufp, len); 931 memcpy (bufp, strp, len);
939 strp += len; 932 strp += len;
940 bufp += len; 933 bufp += len;
941 nchars++; 934 nchars++;
@@ -951,7 +944,7 @@ a new string, without any text properties, is returned. */)
951} 944}
952 945
953void 946void
954syms_of_doc () 947syms_of_doc (void)
955{ 948{
956 Qfunction_documentation = intern_c_string ("function-documentation"); 949 Qfunction_documentation = intern_c_string ("function-documentation");
957 staticpro (&Qfunction_documentation); 950 staticpro (&Qfunction_documentation);