TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: JARI LAAKSONEN
date: 1997-03-28 21:57:00
subject: 04/16 Comment utilities

========== CSplit: Version 2.0 ==========
========== CSplit: Begin part 4/16 ==========
        ATTR_ARCHIVED  = FILE_ARCHIVED
#else
        ATTR_NORMAL    = _A_NORMAL,
        ATTR_READONLY  = _A_RDONLY,
        ATTR_HIDDEN    = _A_HIDDEN,
        ATTR_SYSTEM    = _A_SYSTEM,
        ATTR_DIRECTORY = _A_SUBDIR,
        ATTR_ARCHIVED  = _A_ARCH
#endif
    };
#ifdef __OS2__
    FFbuff() : handle (0xFFFF), count (1) { }
#endif
    int             FindFirst (char *filename, unsigned int attr);
    int             FindNext();
    int             FindClose();
    void            SetHandle (unsigned long h)
    {
#ifdef __OS2__
        handle = (HDIR) h;
#else
        h = h;
#endif
    }
    char           *GetName();
    char            GetName0();
    unsigned short  GetAttr();
    unsigned long   GetSize();
    unsigned long   SizeOfBuff() { return sizeof (buff); }
    FIND_BUFF      *PtrToBuff()  { return &buff; }
protected:
private:
    FIND_BUFF       buff;
#ifdef __OS2__
    HDIR            handle;
#ifdef __32BIT__
    ULONG           count;
#else
    USHORT          count;
#endif
#endif
};
#endif // _FFBUFF_H_
========== CSplit: End file FFBUFF.H ==========
========== CSplit: Begin file C2HTML.CPP ==========
/*
 * C2HTML.CPP
 * Implementation of C/C++ to HTML converter.
 *
 * ver 1.0, 28 Mar 1997
 *
 * Public domain by:
 *   Jari Laaksonen
 *   Arkkitehdinkatu 30 A 2
 *   FIN-33720 Tampere
 *   FINLAND
 *
 *   Fidonet : 2:221/360.20
 *   Internet: jla@to.icl.fi
 */
#include 
#include "c2html.h"
static const char * const STR_VERSION = "1.0";
// Output chars and convert various HTML-specific characters.
void C2Html::checkHtmlChar()
{
    switch (getReadChar())
    {
    case '"); break;
    case '>'  : print ("<"); break;
    case '&'  : print ("&"); break;
    case '\"' : print ("""); break;
    default   : printChar();
    }
}
void C2Html::processActions (Event theEvent)
{
    int rc = 1;
    // This flag is needed when comment starting is continued in next \
\
line:
    //   /\
    //   * comment */
    // The BeginComment state is still on after InsideEscape state and
    // without flag the slash would be printed twice.
    static int SlashPrinted = 0;
    static int backsl = 0;
    static int nl = 0;
    switch (itsState)
    {
    case NormalInput:
        if (theEvent == FOUND_SLASH)
        {
            rc = 0;                     // Don't print it yet...
        }
        break;
    case InsideEscape:
        if (itsPrevState == BeginComment && theEvent == FOUND_NL)
        {
            rc = 0;                     // Don't print it yet...
            nl = 1;
        }
        break;
    case BeginComment:
        switch (theEvent)
        {
        case FOUND_SLASH:               // Yes, it's a C++ comment.
        case FOUND_STAR:                // Yes, it's a C comment.
            if (! SlashPrinted)
            {
                print ("/");
                if (backsl)
                {
                    print ('\\');       // Print the previous backslash.
                    backsl = 0;
                }
                if (nl)
                {
                    print ('\n');       // Print the previous newline.
                    nl = 0;
                }
                checkHtmlChar();
                rc = 0;
                SlashPrinted = 1;
            }
========== CSplit: End part 4/16 crc: 6af5 ==========
        // Albert                      email: jla@to.icl.fi
--- GoldED/2 2.50+
---------------
* Origin: Albert's Point/2 in Finland, Europe (2:221/360.20)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.