File:  [Apple XNU] / GNUtools / cc / rtf2asciiStream.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:45:38 2018 UTC (8 years, 2 months ago) by root
Branches: MAIN, Apple
CVS tags: HEAD, GNUtools33
GNU tools for NeXTSTEP 3.3


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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.