+}
+
+/* Buffer used for reading from documentation file. */
+static char *get_doc_string_buffer;
+static int get_doc_string_buffer_size;
+
+static unsigned char *read_bytecode_pointer;
+
+/* readchar in lread.c calls back here to fetch the next byte.
+ If UNREADFLAG is 1, we unread a byte. */
+
+int
+read_bytecode_char (unreadflag)
+ int unreadflag;
+{
+ if (unreadflag)
+ {
+ read_bytecode_pointer--;
+ return 0;
+ }
+ return *read_bytecode_pointer++;
+}
+
+/* Extract a doc string from a file. FILEPOS says where to get it.
+ If it is an integer, use that position in the standard DOC-... file.
+ If it is (FILE . INTEGER), use FILE as the file name
+ and INTEGER as the position in that file.
+ But if INTEGER is negative, make it positive.
+ (A negative integer is used for user variables, so we can distinguish
+ them without actually fetching the doc string.)
+
+ If UNIBYTE is nonzero, always make a unibyte string.
+
+ If DEFINITION is nonzero, assume this is for reading
+ a dynamic function definition; convert the bytestring
+ and the constants vector with appropriate byte handling,
+ and return a cons cell. */
+
+Lisp_Object
+get_doc_string (filepos, unibyte, definition)
+ Lisp_Object filepos;
+ int unibyte, definition;
+{
+ char *from, *to;
+ register int fd;
+ register char *name;
+ register char *p, *p1;
+ int minsize;
+ int offset, position;
+ Lisp_Object file, tem;
+
+ if (INTEGERP (filepos))
+ {
+ file = Vdoc_file_name;
+ position = XINT (filepos);
+ }
+ else if (CONSP (filepos))
+ {
+ file = XCAR (filepos);
+ position = XINT (XCDR (filepos));
+ if (position < 0)
+ position = - position;
+ }
+ else
+ return Qnil;