Annotation of GNUtools/cc/rtf2ascii.h, revision 1.1

1.1     ! root        1: 
        !             2: // rtf2ascii.h
        !             3: 
        !             4: #import <string.h>
        !             5: #import <streams/streams.h>
        !             6: 
        !             7: #define RTF_HEADER     "{\\rtf0\\ansi"
        !             8: #define RTF_HEADER_LEN 11
        !             9: 
        !            10: 
        !            11: // A predicate to quickly check a region of possibly-rich memory (starting
        !            12: // at rtfText and going for length len) to see if it is convertible by the
        !            13: // following routines.
        !            14: 
        !            15: static inline int isRTFText(const char * rtfText, int len) 
        !            16: {
        !            17:    return (rtfText 
        !            18:           && (len > RTF_HEADER_LEN) 
        !            19:           && !strncmp(rtfText, RTF_HEADER, RTF_HEADER_LEN));
        !            20: }
        !            21: 
        !            22: 
        !            23: // A memory-buffer-based conversion that reads one buffer pointed to by 
        !            24: // rtfTextPtr and converts, for length rtfTextLen, RTF to ASCII.  A pointer
        !            25: // to a newly allocated buffer of memory is returned (caller owns this 
        !            26: // memory).  Additionally, asciiTextLen is set to the length of the
        !            27: // null-terminated ascii character buffer.
        !            28: 
        !            29: extern const char * rtfToAscii( const char *rtfTextPtr, 
        !            30:                                int rtfTextLen, 
        !            31:                                int * asciiTextLen );
        !            32: 
        !            33: 
        !            34: // A streams-based converter which takes an NXStream and either returns back 
        !            35: // a new memory stream that has been converted to straight ASCII (the caller
        !            36: // should free this with NXCloseMemory()).
        !            37: 
        !            38: extern NXStream * rtfToAsciiStream(NXStream * possiblyRichStream);
        !            39: 

unix.superglobalmegacorp.com

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