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?
This commit is contained in:
Viktor Szakats
2010-01-16 11:21:38 +00:00
parent 6f328f5600
commit d0741bbb40
3 changed files with 20 additions and 35 deletions

View File

@@ -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.

View File

@@ -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 \

View File

@@ -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 <modalsist@yahoo.com.br>
* 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 ], "" )