ftp.nice.ch/pub/next/developer/nextsources/cc.s.tar.gz#/cc/cc/rtf2asciiStream.c

This is rtf2asciiStream.c in view mode; [Download] [Up]

// 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;
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.