home *** CD-ROM | disk | FTP | other *** search
-
- // rtf2asciiStream.c
-
- #import "rtf2ascii.h"
-
- NXStream * rtfToAsciiStream(NXStream * possiblyRichStream)
- {
- const char * rtfText = NULL;
- int len, maxLen, asciiTextLen;
- NXStream * asciiStream = NULL;
-
- NXGetMemoryBuffer( possiblyRichStream, &rtfText, &len, &maxLen );
-
- if (isRTFText(rtfText, len)) {
- const char * asciiText = rtfToAscii(rtfText, len, &asciiTextLen);
- if (asciiText) {
- asciiStream = NXOpenMemory(asciiText, asciiTextLen, NX_READONLY);
- }
- }
- return asciiStream;
- }
-