From: tomo Date: Fri, 24 Jun 2005 17:48:07 +0000 (+0000) Subject: (read_from_c_string): New function. X-Git-Tag: r21-4-15-chise-0_22-1^2~51 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ea600b0840239c38e4b4014c6e5f4249042843d;p=chise%2Fxemacs-chise.git- (read_from_c_string): New function. --- diff --git a/src/lread.c b/src/lread.c index 3e71469..0d6b06c 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1632,6 +1632,26 @@ START and END optionally delimit a substring of STRING from which to read; return tem; } +Lisp_Object +read_from_c_string (const unsigned char* str, size_t size) +{ + Lisp_Object tem; + Lisp_Object lispstream = Qnil; + struct gcpro gcpro1; + +#ifdef COMPILED_FUNCTION_ANNOTATION_HACK + Vcurrent_compiled_function_annotation = Qnil; +#endif + GCPRO1 (lispstream); + lispstream = make_fixed_buffer_input_stream (str, size); + + Vread_objects = Qnil; + + tem = read0 (lispstream); + Lstream_delete (XLSTREAM (lispstream)); + UNGCPRO; + return tem; +} #ifdef LISP_BACKQUOTES