diff --git a/harbour/ChangeLog b/harbour/ChangeLog index acb2336d27..67a263b7f2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,15 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-16 12:20 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbct/Makefile + + contrib/hbct/diskhb.prg + - contrib/hbct/diskhb.c + + GETVOLINFO() rewritten in pure .prg code. It means it will + work on all OSes which we have core support for. + This currently means dos and win. OS/2 and other systems + still have this as TODO. Anyone to add them? + 2010-01-16 12:08 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbct/dattime3.c ! Cleaned windows header inclusion. diff --git a/harbour/contrib/hbct/Makefile b/harbour/contrib/hbct/Makefile index 502a3bf4ac..c7f6606251 100644 --- a/harbour/contrib/hbct/Makefile +++ b/harbour/contrib/hbct/Makefile @@ -46,7 +46,6 @@ C_SOURCES := \ dattime3.c \ dbftools.c \ disk.c \ - diskhb.c \ expand.c \ exponent.c \ files.c \ @@ -101,6 +100,7 @@ PRG_SOURCES := \ ctmisc.prg \ ctrand.prg \ cttime.prg \ + diskhb.prg \ fcopy.prg \ getinfo.prg \ getinput.prg \ diff --git a/harbour/contrib/hbct/diskhb.c b/harbour/contrib/hbct/diskhb.prg similarity index 63% rename from harbour/contrib/hbct/diskhb.c rename to harbour/contrib/hbct/diskhb.prg index a28ead7655..a9320935fa 100644 --- a/harbour/contrib/hbct/diskhb.c +++ b/harbour/contrib/hbct/diskhb.prg @@ -3,15 +3,15 @@ */ /* - * xHarbour Project source code: - * GetVolInfo() - Ready. This function is new. + * Harbour Project source code: + * GETVOLINFO() function * - * Copyright 2004-2005 Eduardo Fernandes - * www - http://www.xharbour.org + * Copyright 2010 Viktor Szakats (harbour.01 syenar.hu) + * www - http://www.harbour-project.org * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or ( at your option ) + * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, @@ -22,7 +22,7 @@ * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA ( or visit the web site http://www.gnu.org/ ). + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). * * As a special exception, the Harbour Project gives permission for * additional uses of the text contained in its release of Harbour. @@ -50,33 +50,9 @@ * */ -#define HB_OS_WIN_USED +#include "directry.ch" -#include "hbapi.h" -#include "hbwinuni.h" +FUNCTION GETVOLINFO( cDir ) + LOCAL aFiles := Directory( cDir, "V" ) -/* - * GetVolInfo() is a new function. It returns the volume name of a Floppy, CD, - * Hard-disk or mapped network drive. - * Syntax is: GetVolInfo("X:\") - * Note that the trailing backslash is required. - */ -HB_FUNC( GETVOLINFO ) -{ -#if defined( HB_OS_WIN ) && ! defined( HB_OS_WIN_CE ) - void * hDrive = NULL; - TCHAR lpVolName[ MAX_PATH + 1 ]; - - if( GetVolumeInformation( hb_parclen( 1 ) > 0 ? HB_PARSTR( 1, &hDrive, NULL ) : NULL, - lpVolName, - HB_SIZEOFARRAY( lpVolName ), - NULL, NULL, NULL, NULL, 0 ) ) - HB_RETSTR( lpVolName ); - else - hb_retc_null(); - - hb_strfree( hDrive ); -#else - hb_retc_null(); -#endif -} + RETURN iif( Len( aFiles ) >= 1, aFiles[ 1 ][ F_NAME ], "" )