|
|
1.1 root 1:
2: // rtf2asciiStream.c
3:
4: #import "rtf2ascii.h"
5:
6: NXStream * rtfToAsciiStream(NXStream * possiblyRichStream)
7: {
8: const char * rtfText = NULL;
9: int len, maxLen, asciiTextLen;
10: NXStream * asciiStream = NULL;
11:
12: NXGetMemoryBuffer( possiblyRichStream, &rtfText, &len, &maxLen );
13:
14: if (isRTFText(rtfText, len)) {
15: const char * asciiText = rtfToAscii(rtfText, len, &asciiTextLen);
16: if (asciiText) {
17: asciiStream = NXOpenMemory(asciiText, asciiTextLen, NX_READONLY);
18: }
19: }
20: return asciiStream;
21: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.