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: 14/16 Comment utilities

========== CSplit: Version 2.0 ==========
========== CSplit: Begin part 14/16 ==========
 *
 * Public domain by:
 *   Jari Laaksonen
 *   Arkkitehdinkatu 30 A 2
 *   FIN-33720 Tampere
 *   FINLAND
 *
 *   Fidonet : 2:221/360.20
 *   Internet: jla@to.icl.fi
 */
#ifdef __OS2__
  #define INCL_DOSFILEMGR
  #define INCL_ERRORS
extern "C" {
  #include 
};
#if defined (__WATCOMC__) && defined (__386__)
#ifndef __32BIT__
#define __32BIT__
#endif
#endif
#if defined (__WATCOMC__) && !defined (__32BIT__)
  #define BUFF_NAME(buff)   buff ## . ## name
  #define BUFF_NAME0(buff)  buff ## . ## name[0]
  #define BUFF_ATTR(buff)   buff ## . ## attrib
  #define BUFF_SIZE(buff)   buff ## . ## size
#else
  #define BUFF_NAME(buff)   buff ## . ## achName
  #define BUFF_NAME0(buff)  buff ## . ## achName[0]
  #define BUFF_ATTR(buff)   buff ## . ## attrFile
  #define BUFF_SIZE(buff)   buff ## . ## cbFile
#endif
#else
#ifdef __BORLANDC__
  #define BUFF_NAME(buff)   buff ## . ## ff_name
  #define BUFF_NAME0(buff)  buff ## . ## ff_name[0]
  #define BUFF_ATTR(buff)   buff ## . ## ff_attrib
  #define BUFF_SIZE(buff)   buff ## . ## ff_fsize
#else
  #define BUFF_NAME(buff)   buff ## . ## name
  #define BUFF_NAME0(buff)  buff ## . ## name[0]
  #define BUFF_ATTR(buff)   buff ## . ## attrib
  #define BUFF_SIZE(buff)   buff ## . ## size
#endif
#endif // __OS2__
#include "ffbuff.h"
int FFbuff::FindFirst (char *filename, unsigned int attr)
{
#ifdef __OS2__
#if defined (__WATCOMC__) && !defined (__32BIT__)
    return _dos_findfirst (filename, attr, &buff);
#else
    int rc = DosFindFirst (
        (PSZ) filename,
        &handle,
        attr,
        &buff,
        sizeof (buff),
        &count,
        INFOLEVEL
    );
    if (rc == ERROR_PATH_NOT_FOUND)  /* 3 = path not found */
    {
        DosFindClose (handle);
        rc = -1;
    }
    return rc;
#endif
#else
#ifdef __BORLANDC__
    return findfirst (filename, &buff, attr);
#else
    return _dos_findfirst (filename, attr, &buff);
#endif
#endif
}
int FFbuff::FindNext()
{
#ifdef __OS2__
#if defined (__WATCOMC__) && !defined (__32BIT__)
    return _dos_findnext (&buff);
#else
    return DosFindNext (handle, &buff, sizeof (buff), &count);
#endif
#else
#ifdef __BORLANDC__
    return findnext (&buff);
#else
    return _dos_findnext (&buff);
#endif
#endif
}
int FFbuff::FindClose()
{
#ifdef __OS2__
#if defined (__WATCOMC__) && !defined (__32BIT__)
    return _dos_findclose (&buff);
#else
    return DosFindClose (handle);
#endif
#else
    return 0;
#endif
}
char* FFbuff::GetName()
{
    return BUFF_NAME (buff);
}
char FFbuff::GetName0()
{
    return BUFF_NAME0 (buff);
}
unsigned short FFbuff::GetAttr()
{
    return BUFF_ATTR (buff);
}
unsigned long FFbuff::GetSize()
{
    return BUFF_SIZE (buff);
========== CSplit: End part 14/16 crc: e42c ==========
        // 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™.