See ChangeLog entry 19990727-16:30 EDT David G. Holm <dholm@jsd-llc.com>
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
19990727-16:30 EDT David G. Holm <dholm@jsd-llc.com>
|
||||
* source/rtl/dir.c
|
||||
+ Added support for IBM Visual Age C++ compiler
|
||||
* source/rtl/gt/gtos2.c
|
||||
! Corrected function declration for gtSetAttribute()
|
||||
* tests/working/dirtest.prg
|
||||
* Changed QOUT() to OUTSTD() to allow the directory listing to be
|
||||
redirected, regardless of whether or not the GT API is linked in
|
||||
|
||||
19990727-22:20 CET Victor Szel <info@szelvesz.hu>
|
||||
+ tests/broken/lnlenli1.prg
|
||||
+ tests/broken/lnlenli2.prg
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
* been requested.
|
||||
*
|
||||
*/
|
||||
#if defined(__IBMCPP__)
|
||||
#define INCL_DOSFILEMGR
|
||||
#define INCL_DOSERRORS
|
||||
#endif
|
||||
|
||||
#include <hbsetup.h>
|
||||
#include <extend.h>
|
||||
@@ -58,6 +62,20 @@
|
||||
#define _chmod chmod
|
||||
#endif
|
||||
|
||||
#if defined(__IBMCPP__)
|
||||
#include <sys/stat.h>
|
||||
// #include <share.h>
|
||||
// #include <fcntl.h>
|
||||
// #include <io.h>
|
||||
// #include <errno.h>
|
||||
// #include <direct.h>
|
||||
#include <time.h>
|
||||
|
||||
#if !defined(HAVE_POSIX_IO)
|
||||
#define HAVE_POSIX_IO
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__BORLANDC__)
|
||||
#include <sys\stat.h>
|
||||
#include <io.h>
|
||||
@@ -133,6 +151,12 @@ HARBOUR HB_DIRECTORY( void )
|
||||
#if defined(_MSC_VER )
|
||||
struct _finddata_t entry;
|
||||
long hFile;
|
||||
#elif defined(__IBMCPP__)
|
||||
FILEFINDBUF3 entry;
|
||||
HDIR hFind = HDIR_CREATE;
|
||||
ULONG fileTypes = FILE_ARCHIVED | FILE_DIRECTORY | FILE_SYSTEM | FILE_HIDDEN | FILE_READONLY;
|
||||
ULONG findSize = sizeof( entry );
|
||||
ULONG findCount = 1;
|
||||
#else
|
||||
struct dirent *entry;
|
||||
DIR * dir;
|
||||
@@ -237,7 +261,14 @@ HARBOUR HB_DIRECTORY( void )
|
||||
do
|
||||
{
|
||||
strcpy(string,entry.name);
|
||||
|
||||
#elif defined(__IBMCPP__)
|
||||
strcpy(string,dirname);
|
||||
strcat(string,pattern);
|
||||
if( DosFindFirst( string, &hFind, fileTypes, &entry, findSize, &findCount, FIL_STANDARD ) == NO_ERROR && findCount > 0 )
|
||||
{
|
||||
do
|
||||
{
|
||||
strcpy(string,entry.achName);
|
||||
#else
|
||||
dir = opendir( dirname );
|
||||
if (NULL == dir)
|
||||
@@ -286,6 +317,8 @@ HARBOUR HB_DIRECTORY( void )
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
strcpy(filename,entry.name);
|
||||
#elif defined(__IBMCPP__)
|
||||
strcpy( filename, entry.achName );
|
||||
#else
|
||||
strcpy(filename,entry->d_name);
|
||||
#endif
|
||||
@@ -339,7 +372,20 @@ HARBOUR HB_DIRECTORY( void )
|
||||
if( S_ISSOCK(statbuf.st_mode) )
|
||||
strcat( aatrib, "K" );
|
||||
#else
|
||||
#ifdef _MSC_VER
|
||||
#if defined(__IBMCPP__)
|
||||
attrib = entry.attrFile;
|
||||
if( attrib & FILE_ARCHIVED )
|
||||
strcat( aatrib, "A" );
|
||||
if( attrib & FILE_DIRECTORY )
|
||||
strcat( aatrib, "D" );
|
||||
if( attrib & FILE_HIDDEN )
|
||||
strcat( aatrib, "H" );
|
||||
if( attrib & FILE_READONLY )
|
||||
strcat( aatrib, "R" );
|
||||
if( attrib & FILE_SYSTEM )
|
||||
strcat( aatrib, "S" );
|
||||
#else
|
||||
#if defined(_MSC_VER)
|
||||
attrib = entry.attrib;
|
||||
#else
|
||||
attrib = _chmod(fullfile,0);
|
||||
@@ -378,7 +424,7 @@ HARBOUR HB_DIRECTORY( void )
|
||||
strcat(aatrib,"O");
|
||||
if (attrib & FA_NOTINDEXED)
|
||||
strcat(aatrib,"X");
|
||||
|
||||
#endif
|
||||
#endif
|
||||
/* TODO: attribute match rtn */
|
||||
pos = string;
|
||||
@@ -421,8 +467,10 @@ HARBOUR HB_DIRECTORY( void )
|
||||
}
|
||||
#if defined(_MSC_VER)
|
||||
while( _findnext( hFile, &entry ) == 0 );
|
||||
|
||||
_findclose( hFile );
|
||||
#elif defined(__IBMCPP__)
|
||||
while( DosFindNext (hFind, &entry, findSize, &findCount) == NO_ERROR && findCount > 0 );
|
||||
DosFindClose( hFind );
|
||||
#else
|
||||
closedir( dir );
|
||||
#endif
|
||||
@@ -431,7 +479,7 @@ HARBOUR HB_DIRECTORY( void )
|
||||
|
||||
hb_itemRelease(pdir);
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) || defined(__IBMCPP__)
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -127,6 +127,6 @@ void gtPutText(char x1, char y1, char x2, char y2, char *srce)
|
||||
}
|
||||
}
|
||||
|
||||
void gtSetAttribute(char x, char y, char attr, char *str, int len)
|
||||
void gtSetAttribute( char x1, char y1, char x2, char y2, char attribute )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -11,12 +11,16 @@ local x := 0
|
||||
adir := asort( directory(filespec,attribs),,, {|x,y|upper(x[1]) < upper(y[1])} )
|
||||
|
||||
for x := 1 to len(adir)
|
||||
qout(padr(adir[x,1], 20), "|", ;
|
||||
padl(adir[x,2], 10), "|", ;
|
||||
padr(adir[x,3], 8), "|", ;
|
||||
padr(adir[x,4], 8), "|", ;
|
||||
adir[x,5])
|
||||
#ifdef __HARBOUR__
|
||||
outstd(chr(10))
|
||||
#else
|
||||
outstd(chr(13)+chr(10))
|
||||
#endif
|
||||
outstd(padr(adir[x,1], 20), "|", ;
|
||||
padl(adir[x,2], 10), "|", ;
|
||||
padr(adir[x,3], 8), "|", ;
|
||||
padr(adir[x,4], 8), "|", ;
|
||||
adir[x,5])
|
||||
next x
|
||||
|
||||
return nil
|
||||
|
||||
|
||||
Reference in New Issue
Block a user