2007-11-12 19:22 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
+ harbour/include/hbassert.h
* harbour/include/hb_io.h
* harbour/source/rtl/gtstd/gtstd.c
* harbour/source/rtl/gtpca/gtpca.c
* harbour/source/rtl/fssize.c
* harbour/source/rtl/hbinet.c
* harbour/source/rtl/filesys.c
* harbour/source/compiler/hbfix.c
* harbour/source/compiler/hbpcode.c
* harbour/source/compiler/hbdead.c
* harbour/source/compiler/genc.c
* harbour/source/compiler/hbopt.c
* harbour/source/compiler/gencc.c
* harbour/source/compiler/hblbl.c
* harbour/source/compiler/hbstripl.c
* harbour/utils/hbver/hbverfix.c
* harbour/utils/hbpp/hbppcore.c
* removed dependences to unsupported by new MSVC header files
most of this modifications can be enabled also for standard Win32
builds
* harbour/source/common/hbwince.c
* do not create dummy LocalLock() and LocalUnlock() function in MSVC
WinCE builds
* harbour/source/rtl/gtwin/gtwin.c
+ added HB_WINCE_USE_POCKET_CONSOLE macro which enable
console support in WINCE builds (macro suggested by Marek Paliwoda)
* harbour/source/rtl/gtwvt/gtwvt.h
* harbour/source/rtl/gtwvt/gtwvt.c
* changed default window and font size on WinCE to values suggested
by Marek Paliwoda
Marek if you have a while please make test with MSVC WinCE/PocketPC
builds and current SVN code.
This commit is contained in:
@@ -8,6 +8,44 @@
|
||||
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2007-11-12 19:22 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
+ harbour/include/hbassert.h
|
||||
* harbour/include/hb_io.h
|
||||
* harbour/source/rtl/gtstd/gtstd.c
|
||||
* harbour/source/rtl/gtpca/gtpca.c
|
||||
* harbour/source/rtl/fssize.c
|
||||
* harbour/source/rtl/hbinet.c
|
||||
* harbour/source/rtl/filesys.c
|
||||
* harbour/source/compiler/hbfix.c
|
||||
* harbour/source/compiler/hbpcode.c
|
||||
* harbour/source/compiler/hbdead.c
|
||||
* harbour/source/compiler/genc.c
|
||||
* harbour/source/compiler/hbopt.c
|
||||
* harbour/source/compiler/gencc.c
|
||||
* harbour/source/compiler/hblbl.c
|
||||
* harbour/source/compiler/hbstripl.c
|
||||
* harbour/utils/hbver/hbverfix.c
|
||||
* harbour/utils/hbpp/hbppcore.c
|
||||
* removed dependences to unsupported by new MSVC header files
|
||||
most of this modifications can be enabled also for standard Win32
|
||||
builds
|
||||
|
||||
* harbour/source/common/hbwince.c
|
||||
* do not create dummy LocalLock() and LocalUnlock() function in MSVC
|
||||
WinCE builds
|
||||
|
||||
* harbour/source/rtl/gtwin/gtwin.c
|
||||
+ added HB_WINCE_USE_POCKET_CONSOLE macro which enable
|
||||
console support in WINCE builds (macro suggested by Marek Paliwoda)
|
||||
|
||||
* harbour/source/rtl/gtwvt/gtwvt.h
|
||||
* harbour/source/rtl/gtwvt/gtwvt.c
|
||||
* changed default window and font size on WinCE to values suggested
|
||||
by Marek Paliwoda
|
||||
|
||||
Marek if you have a while please make test with MSVC WinCE/PocketPC
|
||||
builds and current SVN code.
|
||||
|
||||
2007-11-12 16:09 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/include/hbapifs.h
|
||||
* harbour/source/common/hbfsapi.c
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
#if defined(__DJGPP__) || defined(__CYGWIN__) || defined(__EMX__)
|
||||
#include <io.h>
|
||||
#endif
|
||||
#else
|
||||
#elif !defined(HB_WINCE)
|
||||
#include <io.h>
|
||||
#endif
|
||||
#if defined(HB_OS_DOS) && !defined(__RSX32__)
|
||||
|
||||
66
harbour/include/hbassert.h
Normal file
66
harbour/include/hbassert.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* assert() wrapper
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
* 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)
|
||||
* 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/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HB_ASSERT_H_
|
||||
#define HB_ASSERT_H_
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
#if defined( HB_WINCE ) && defined( _MSC_VER )
|
||||
#ifndef assert
|
||||
#define assert(exp) ((void)0)
|
||||
#endif
|
||||
#else
|
||||
#include <assert.h>
|
||||
#endif /* HB_WINCE */
|
||||
|
||||
#endif /* HB_ASSERT_H_ */
|
||||
@@ -653,6 +653,7 @@ BOOL WINAPI SetKeyboardState( PBYTE p )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifndef _MSC_VER
|
||||
PVOID WINAPI LocalLock( HLOCAL h )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( h );
|
||||
@@ -666,6 +667,7 @@ BOOL WINAPI LocalUnlock( HLOCAL h )
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#endif /* UNICODE */
|
||||
|
||||
|
||||
@@ -26,10 +26,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "hbcomp.h"
|
||||
#include "hbdate.h"
|
||||
#include "hbassert.h"
|
||||
|
||||
static void hb_compGenCReadable( HB_COMP_DECL, PFUNCTION pFunc, FILE * yyc );
|
||||
static void hb_compGenCCompact( PFUNCTION pFunc, FILE * yyc );
|
||||
|
||||
@@ -26,10 +26,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "hbcomp.h"
|
||||
#include "hbdate.h"
|
||||
#include "hbassert.h"
|
||||
|
||||
#define HB_GENC_FUNC( func ) HB_PCODE_FUNC( func, PHB_LABEL_INFO )
|
||||
typedef HB_GENC_FUNC( HB_GENC_FUNC_ );
|
||||
|
||||
@@ -50,10 +50,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "hbcomp.h"
|
||||
|
||||
#include "hbassert.h"
|
||||
|
||||
/* helper structure to pass information */
|
||||
typedef struct _HB_CODETRACE_INFO
|
||||
|
||||
@@ -49,10 +49,9 @@
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
#include <assert.h>
|
||||
|
||||
#include "hbcomp.h"
|
||||
|
||||
#include "hbassert.h"
|
||||
|
||||
/* helper structure to pass information */
|
||||
typedef struct HB_stru_fix_info
|
||||
|
||||
@@ -50,9 +50,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "hbcomp.h"
|
||||
#include "hbassert.h"
|
||||
|
||||
#define HB_LABEL_FUNC( func ) HB_PCODE_FUNC( func, PHB_LABEL_INFO )
|
||||
typedef HB_LABEL_FUNC( HB_LABEL_FUNC_ );
|
||||
|
||||
@@ -49,9 +49,9 @@
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
#include <assert.h>
|
||||
|
||||
#include "hbcomp.h"
|
||||
#include "hbassert.h"
|
||||
|
||||
typedef struct HB_stru_opt_info
|
||||
{
|
||||
|
||||
@@ -37,9 +37,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "hbcomp.h"
|
||||
#include "hbassert.h"
|
||||
|
||||
#define HB_PSIZE_FUNC( func ) HB_PCODE_FUNC( func, HB_VOID_PTR )
|
||||
|
||||
|
||||
@@ -50,9 +50,9 @@
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
#include <assert.h>
|
||||
|
||||
#include "hbcomp.h"
|
||||
#include "hbassert.h"
|
||||
|
||||
typedef void HB_STRIP_INFO, * PHB_STRIP_INFO;
|
||||
|
||||
|
||||
@@ -118,17 +118,17 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ( defined(__DMC__) || defined(__BORLANDC__) || defined(__IBMCPP__) || defined(_MSC_VER) || \
|
||||
defined(__MINGW32__) || defined(__WATCOMC__) ) && !defined( HB_OS_UNIX )
|
||||
#if ( defined(__DMC__) || defined(__BORLANDC__) || \
|
||||
defined(__IBMCPP__) || defined(_MSC_VER) || \
|
||||
defined(__MINGW32__) || defined(__WATCOMC__) ) && \
|
||||
!defined( HB_OS_UNIX ) && !defined( HB_WINCE )
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <process.h>
|
||||
#if !defined( __POCC__ ) && !defined( __XCC__ )
|
||||
#include <share.h>
|
||||
#endif
|
||||
#if !defined(__MINGW32CE__)
|
||||
#include <direct.h>
|
||||
#endif
|
||||
#include <direct.h>
|
||||
#if defined(__BORLANDC__)
|
||||
#include <dir.h>
|
||||
#include <dos.h>
|
||||
@@ -261,7 +261,7 @@ static BOOL s_fUseWaitLocks = TRUE;
|
||||
|
||||
#if defined(HB_WIN32_IO)
|
||||
|
||||
#if defined( __LCC__ )
|
||||
#if defined( __LCC__ ) || ( defined( _MSC_VER ) && defined( HB_WINCE ) )
|
||||
__inline void * LongToHandle( const long h )
|
||||
{
|
||||
return((void *) (INT_PTR) h );
|
||||
|
||||
@@ -58,8 +58,10 @@
|
||||
#include "hbapi.h"
|
||||
#include "hbapifs.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#if !defined(HB_WINCE)
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
HB_FOFFSET hb_fsFSize( BYTE * pszFileName, BOOL bUseDirEntry )
|
||||
{
|
||||
|
||||
@@ -61,11 +61,11 @@
|
||||
|
||||
#include "hbgtcore.h"
|
||||
#include "hbinit.h"
|
||||
#include "hbapifs.h"
|
||||
#include "hbapicdp.h"
|
||||
#include "hbapiitm.h"
|
||||
#include "hbdate.h"
|
||||
#include "hb_io.h"
|
||||
#include "hbset.h"
|
||||
#include "inkey.ch"
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -84,8 +84,7 @@
|
||||
#if defined( HB_WIN32_IO )
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#if defined( _MSC_VER ) || defined( __MINGW32__ )
|
||||
#include <io.h>
|
||||
#if defined( _MSC_VER ) && !defined( HB_WINCE )
|
||||
#include <conio.h>
|
||||
#endif
|
||||
#endif
|
||||
@@ -668,7 +667,7 @@ static int hb_gt_pca_ReadKey( int iEventMask )
|
||||
case 396: /* Alt + F12 */
|
||||
ch = 349 - ch;
|
||||
}
|
||||
#elif defined( _MSC_VER )
|
||||
#elif defined( _MSC_VER ) && !defined( HB_WINCE )
|
||||
if( s_bStdinConsole )
|
||||
{
|
||||
if( _kbhit() ) ch = _getch();
|
||||
@@ -696,9 +695,9 @@ static int hb_gt_pca_ReadKey( int iEventMask )
|
||||
ch = s_keyTransTbl[ bChar ];
|
||||
}
|
||||
#else
|
||||
|
||||
/* TODO: */
|
||||
|
||||
{
|
||||
int TODO; /* TODO: */
|
||||
}
|
||||
#endif
|
||||
|
||||
return ch;
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
#if defined( HB_WIN32_IO )
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#if defined( _MSC_VER ) || defined( __MINGW32__ )
|
||||
#if defined( _MSC_VER ) && !defined( HB_WINCE )
|
||||
#include <conio.h>
|
||||
#endif
|
||||
#endif
|
||||
@@ -285,7 +285,7 @@ static int hb_gt_std_ReadKey( int iEventMask )
|
||||
|
||||
HB_SYMBOL_UNUSED( iEventMask );
|
||||
|
||||
#if defined( _MSC_VER )
|
||||
#if defined( _MSC_VER ) && !defined( HB_WINCE )
|
||||
if( s_bStdinConsole )
|
||||
{
|
||||
if( _kbhit() ) ch = _getch();
|
||||
@@ -322,9 +322,9 @@ static int hb_gt_std_ReadKey( int iEventMask )
|
||||
ch = s_keyTransTbl[ bChar ];
|
||||
}
|
||||
#else
|
||||
|
||||
/* TODO: */
|
||||
|
||||
{
|
||||
int TODO; /* TODO: */
|
||||
}
|
||||
#endif
|
||||
|
||||
return ch;
|
||||
|
||||
@@ -88,7 +88,8 @@
|
||||
# include "hbapicdp.h"
|
||||
#endif
|
||||
|
||||
#if !defined( HB_NO_WIN_CONSOLE ) && defined( HB_WINCE )
|
||||
#if !defined( HB_NO_WIN_CONSOLE ) && defined( HB_WINCE ) && \
|
||||
!defined( HB_WINCE_USE_POCKET_CONSOLE )
|
||||
# define HB_NO_WIN_CONSOLE
|
||||
#endif
|
||||
|
||||
|
||||
@@ -145,8 +145,8 @@ static void hb_gt_wvt_InitStatics( void )
|
||||
/* THEESE are the default font parameters, if not changed by user */
|
||||
_s.PTEXTSIZE.x = 8;
|
||||
_s.PTEXTSIZE.y = 12;
|
||||
_s.fontHeight = 20;
|
||||
_s.fontWidth = 10;
|
||||
_s.fontHeight = WVT_DEFAULT_FONT_HEIGHT;
|
||||
_s.fontWidth = WVT_DEFAULT_FONT_WIDTH;
|
||||
_s.fontWeight = FW_NORMAL;
|
||||
_s.fontQuality = DEFAULT_QUALITY;
|
||||
hb_strncpy( _s.fontFace, "Courier New", sizeof( _s.fontFace ) - 1 );
|
||||
@@ -168,7 +168,7 @@ static BOOL hb_gt_wvt_SetWindowSize( int iRow, int iCol )
|
||||
_s.COLS = ( USHORT ) iCol;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,8 +77,17 @@
|
||||
#define WVT_CHAR_QUEUE_SIZE 128
|
||||
#define WVT_MAX_ROWS 256
|
||||
#define WVT_MAX_COLS 256
|
||||
#define WVT_DEFAULT_ROWS 25
|
||||
#define WVT_DEFAULT_COLS 80
|
||||
#if defined( HB_WINCE )
|
||||
# define WVT_DEFAULT_ROWS 15
|
||||
# define WVT_DEFAULT_COLS 50
|
||||
# define WVT_DEFAULT_FONT_HEIGHT 12
|
||||
# define WVT_DEFAULT_FONT_WIDTH 8
|
||||
#else
|
||||
# define WVT_DEFAULT_ROWS 25
|
||||
# define WVT_DEFAULT_COLS 80
|
||||
# define WVT_DEFAULT_FONT_HEIGHT 20
|
||||
# define WVT_DEFAULT_FONT_WIDTH 10
|
||||
#endif
|
||||
|
||||
#define BLACK RGB( 0x0 ,0x0 ,0x0 )
|
||||
#define BLUE RGB( 0x0 ,0x0 ,0x85 )
|
||||
|
||||
@@ -170,8 +170,8 @@
|
||||
|
||||
#if !defined( HB_NO_DEFAULT_INET )
|
||||
|
||||
#include <fcntl.h>
|
||||
#if !defined(__MINGW32CE__)
|
||||
#if !defined( HB_WINCE )
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -50,9 +50,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <hbmath.h>
|
||||
#include "hbmath.h"
|
||||
#include "hbdate.h"
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifndef HB_OS_WIN_32
|
||||
#include <float.h>
|
||||
@@ -122,7 +122,7 @@ HB_FUNC( HB_RANDOMINT )
|
||||
|
||||
HB_FUNC( HB_RANDOMSEED )
|
||||
{
|
||||
srand( ISNUM( 1 ) ? ( unsigned ) hb_parni( 1 ) : ( unsigned ) time( NULL ) );
|
||||
srand( ISNUM( 1 ) ? ( unsigned ) hb_parni( 1 ) : ( unsigned ) hb_dateMilliSeconds() );
|
||||
s_fInit = TRUE;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ double hb_random_num()
|
||||
|
||||
if( !s_fInit )
|
||||
{
|
||||
srand( ( unsigned ) time( NULL ) );
|
||||
srand( ( unsigned ) hb_dateMilliSeconds() );
|
||||
s_fInit = TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,14 +75,14 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(__MINGW32CE__) && !( defined( _MSC_VER ) && defined( HB_WINCE ) )
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
#include "hbppdef.h"
|
||||
#include "hbcomp.h"
|
||||
#include "hbdate.h"
|
||||
|
||||
#if !defined(__MINGW32CE__) && !( defined( _MSC_VER ) && defined( HB_WINCE ) )
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
int hb_pp_ParseDefine_( char * ); /* Process #define directive */
|
||||
|
||||
static COMMANDS *AddCommand( char * ); /* Add new #command to an array */
|
||||
|
||||
@@ -64,23 +64,34 @@
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "hbcomp.h"
|
||||
|
||||
#if !defined(__MINGW32CE__) && !( defined( _MSC_VER ) && defined( HB_WINCE ) )
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
#include "hbcomp.h"
|
||||
|
||||
#define MAX_BUF_LEN 4096
|
||||
|
||||
#if defined(__MINGW32CE__)
|
||||
#if defined(HB_WINCE)
|
||||
wchar_t *hb_mbtowc( const char *srcA )
|
||||
{
|
||||
DWORD length;
|
||||
wchar_t *dstW;
|
||||
|
||||
length = MultiByteToWideChar( CP_ACP, 0, srcA, -1, NULL, 0 );
|
||||
dstW = ( wchar_t * ) malloc( ( length + 1 ) * sizeof( wchar_t ) );
|
||||
MultiByteToWideChar( CP_ACP, 0, srcA, -1, dstW, length + 1 );
|
||||
|
||||
return dstW;
|
||||
}
|
||||
|
||||
int remove( const char *filename )
|
||||
{
|
||||
int length, result;
|
||||
wchar_t *wpath;
|
||||
int result;
|
||||
|
||||
length = MultiByteToWideChar( CP_ACP, 0, filename, -1, NULL, 0 );
|
||||
wpath = ( wchar_t * ) malloc( ( length + 1 ) * sizeof( wchar_t ) );
|
||||
MultiByteToWideChar( CP_ACP, 0, filename, -1, wpath, length );
|
||||
wpath = hb_mbtowc( path );
|
||||
result = DeleteFileW( wpath ) ? 0 : -1;
|
||||
free( wpath );
|
||||
|
||||
@@ -91,6 +102,21 @@ void perror( const char *szError )
|
||||
{
|
||||
fprintf( stderr, "error: %s\n", szError );
|
||||
}
|
||||
|
||||
int rename( const char *oldname, const char *newname )
|
||||
{
|
||||
wchar_t wfn1, wfn2;
|
||||
int result;
|
||||
|
||||
wfn1 = hb_mbtowc( fn1 );
|
||||
wfn2 = hb_mbtowc( fn2 );
|
||||
result = MoveFileW( wfn1, wfn2 ) ? 0 : -1;
|
||||
free( wfn1 );
|
||||
free( wfn2 );
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static char * szIncrementNumber( char * szBuffer, size_t stSkipOver )
|
||||
|
||||
Reference in New Issue
Block a user