Files
harbour-core/harbour/extras/hbapollo/tools.c
Przemyslaw Czerpak f44b40c3ef 2012-08-24 15:01 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* harbour/doc/locks.txt
  * harbour/extras/hbapollo/ttable.prg
  * harbour/extras/hbapollo/use.c
  * harbour/extras/hbapollo/tindex.prg
  * harbour/extras/hbapollo/tools.c
  * harbour/extras/hbapollo/ttag.prg
  * harbour/extras/hbapollo/unsix.ch
  * harbour/extras/hbxlsxml/hbxlsxml.hbp
  * harbour/extras/hbxlsxml/xlsxml.prg
  * harbour/extras/hbxlsxml/xlsxml_s.prg
  * harbour/extras/hbxlsxml/tests/example.prg
  * harbour/extras/hbxlsxml/tests/example2.prg
  * harbour/extras/hbxlsxml/tests/example3.prg
  * harbour/extras/hbxlsxml/tests/hbmk.hbm
  * harbour/extras/hbxlsxml/xlsxml_y.prg
  * harbour/bin/3rdpatch.hb
  * harbour/contrib/hbxbp/tests/xbpqtc.prg
  * harbour/contrib/hbxbp/crt.prg
  * harbour/contrib/make.hb
  * harbour/contrib/gtwvg/genrc.prg
  * harbour/contrib/hbqt/tests/cls_dbstruct.prg
  * harbour/contrib/hbqt/tests/browarray.prg
  * harbour/contrib/hbqt/tests/ideui.hbp
  * harbour/contrib/hbqt/tests/dbfbrowserclass.prg
  * harbour/contrib/hbqt/tests/dbstruct.prg
  * harbour/contrib/hbqt/tests/dbfbrowser.prg
  * harbour/contrib/hbqt/qtsvg/hbqt_init.cpp
  * harbour/contrib/hbqt/qtsvg/hbqtsvg.hbm
  * harbour/contrib/hbqt/qtsvg/hbqtsvg.hbp
  * harbour/contrib/hbqt/qtsvg/hbqtsvg.ch
  * harbour/contrib/hbqt/qtsvg/hbqtsvg.hbc
  * harbour/contrib/hbqt/qtsvg/hbqtsvgs.hbp
  * harbour/contrib/hbqt/qtsvg/qth/filelist.hbm
  * harbour/contrib/hbqt/qtsvg/hbqtsvg.hbx
  * harbour/contrib/hbqt/gtqtc.hbc
  * harbour/contrib/hbqt/gtqtc/gtqtc.hbm
  * harbour/contrib/hbqt/gtqtc/gtqtc.h
  * harbour/contrib/hbqt/gtqtc/gtqtc.hbp
  * harbour/contrib/hbqt/gtqtc/gtqtc.hbc
  * harbour/contrib/hbqt/gtqtc/gtqtcs.hbp
  * harbour/contrib/hbqt/gtqtc/gtqtc.cpp
  * harbour/contrib/hbide/console.prg
  * harbour/contrib/hbide/uisrcmanager.prg
  * harbour/contrib/hbide/changelog.prg
    ! fixed hardcoded CRLF EOLs
    ! set svn:eol-style to native
    ! set svn:keywords to Author Date Id Revision
2012-08-24 13:03:57 +00:00

105 lines
2.7 KiB
C

/*
* $Id$
*/
/*
* SixAPI Project source code:
*
* Copyright 2010 Andi Jahja <xharbour@telkom.net.id>
*
* 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)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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/).
*/
#include "sxapi.h"
const char * _sx_CheckFileExt( const char * szFileName )
{
static char s_szFileName[ HB_PATH_MAX ]; /* TOFIX */
PHB_FNAME pFileName = hb_fsFNameSplit( szFileName );
memset( s_szFileName, 0, HB_PATH_MAX );
if( ! pFileName->szExtension )
{
pFileName->szExtension = ".dbf";
hb_fsFNameMerge( s_szFileName, pFileName );
}
else
hb_xstrcpy( s_szFileName, szFileName, 0 );
hb_xfree( pFileName );
return s_szFileName;
}
double sx_GetPrivateProfileDouble( LPSTR lpSectionName, LPSTR lpEntryName,
LPSTR lpDefault, LPSTR lpIniFileName )
{
BYTE bBuffer[ 1024 ];
GetPrivateProfileString( lpSectionName, /* Section */
lpEntryName, /* Entry */
lpDefault, /* Default */
( char * ) bBuffer, /* Destination Buffer */
sizeof( bBuffer ) - 1, lpIniFileName ); /* Inifile Name */
if( ! ( *bBuffer ) )
{
return atof( ( char * ) lpDefault );
}
return atof( ( char * ) bBuffer );
}
static void hb_objProcessMessage( PHB_ITEM pObj, PHB_DYNS pDyns, ULONG ulArg, ... )
{
hb_vmPushSymbol( hb_dynsymSymbol( pDyns ) );
hb_vmPush( pObj );
if( ulArg )
{
ULONG i;
va_list ap;
va_start( ap, ulArg );
for( i = 0; i < ulArg; i++ )
{
hb_vmPush( va_arg( ap, PHB_ITEM ) );
}
va_end( ap );
}
hb_vmSend( ( HB_USHORT ) ulArg );
}
PHB_ITEM _sx_GetAlias( void )
{
PHB_ITEM pResult;
static PHB_DYNS s_pFunc = NULL;
if( ! s_pFunc )
s_pFunc = hb_dynsymFind( "CALIAS" );
hb_objProcessMessage( hb_stackSelfItem(), s_pFunc, 0 );
pResult = hb_itemNew( NULL );
hb_itemCopy( pResult, hb_stackReturnItem() );
return pResult;
}