eudora-mac/concentrator.c

1 line
54 KiB
C
Raw Permalink Normal View History

2018-05-23 09:59:15 +00:00
/* Copyright (c) 2017, Computer History Museum All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Computer History Museum nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "concentrator.h" #define FILE_NUM 146 ConConProH ConConProfiles; /************************************************************************ * Local functions ************************************************************************/ OSErr ConConMessParse(ConConMessPrsPtr context); OSErr ConConMessOutput(MessHandle messH, ConConElmH cceh, StackHandle stack, short baseQuote, PETEHandle pte,ConConOutFilterProcPtr filter,void *userData); void ConConElmSetHeader(ConConElmH cceh,PStr headerName); Boolean ConConParaAdvance(ConConMessPrsPtr context); uLong HandleFindChar(UHandle h, uLong offset, uLong terminal, Byte cToFind); ConConElmH ConConElmFind(ConConMessElmPtr me, ConConElmH cceh); short ConConElmMatch(ConConMessElmPtr me, ConConElmH cceh); OSErr ConConElmOutput(ConConMessElmPtr me,MessHandle messH,ConConElmH cceh,PETEHandle pte,StackHandle stack,ConConOutFilterProcPtr filter,void *userData); void ConConFixTrimOffsets(UHandle text,long *start,long *stop); OSErr ConConCopy(PETEHandle fromPTE, PETEHandle toPTE, long start, long stop, Boolean flatten); Boolean ConConFixTruncOffsets(UHandle text,long start,long goalSize,long *stop,PStr ellipsis,ConConMessElmPtr oldME,StackHandle stack); OSErr PeteParaInfoCopy(PETEHandle fromPTE,uLong fromOffset,PETEHandle toPTE,uLong toOffset,Boolean breakBefore); PStr ConConTextSnipLo(PStr s,short sizeOfS,UHandle h,uLong start,uLong stop); #define ConConTextSnip(s,h,start,stop) ConConTextSnipLo(s,sizeof(s),h,start,stop) OSErr ConConInsertCRIfNeeded(ConConMessElmPtr lastME,ConConMessElmPtr me,ConConElmH cceh,PETEHandle fromPTE,PETEHandle toPTE); #ifdef DEBUG void PeteUpdate14(PETEHandle pte); void PeteUpdate14(PETEHandle pte) {if (BUG14) PeteUpdate(pte);} #else #define PeteUpdate14(pte) #endif Boolean ConConFixTruncByWord(UPtr start, UPtr *spotP, UPtr end,short *quoteChars); Boolean ConConFixTruncByPara(UPtr start, UPtr *spotP, UPtr end); Boolean ConConIsParaAttribution(ConConMessPrsPtr context); Boolean ConConIsParaForwardOn(ConConMessPrsPtr context); Boolean ConConIsParaForwardOff(ConConMessPrsPtr context); Boolean ConConIsParaQuoteOn(ConConMessPrsPtr context); Boolean ConConIsParaQuoteOff(ConConMessPrsPtr context); Boolean ConConIsParaSigIntro(ConConMessPrsPtr context); Boolean ConConIsAttachment(ConConMessPrsPtr context); Boolean ConConMightAttribution(PStr s); Boolean ConConMightForwardOn(PStr s,ConConMessPrsPtr context); Boolean ConConMightForw