mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
Merge branch 'master' into ghpull-335
This commit is contained in:
commit
7c68a255c9
@ -1174,6 +1174,8 @@ CHECK_SYMBOL_EXISTS(isinf "math.h" HAVE_DECL_ISINF)
|
||||
CHECK_SYMBOL_EXISTS(signbit "math.h" HAVE_DECL_SIGNBIT)
|
||||
CHECK_SYMBOL_EXISTS(st_blksize "sys/stat.h" HAVE_STRUCT_STAT_ST_BLKSIZE)
|
||||
CHECK_SYMBOL_EXISTS(alloca "alloca.h" HAVE_ALLOCA)
|
||||
CHECK_SYMBOL_EXISTS(snprintf "stdio.h" HAVE_SNPRINTF)
|
||||
CHECK_SYMBOL_EXISTS(vprintf "stdio.h" HAVE_VPRINTF)
|
||||
|
||||
# For historic purposes...
|
||||
SET(HAVE_ST_BLKSIZE ${HAVE_STRUCT_STAT_ST_BLKSIZE})
|
||||
@ -1250,7 +1252,6 @@ ENDIF()
|
||||
CHECK_FUNCTION_EXISTS(fsync HAVE_FSYNC)
|
||||
CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
|
||||
CHECK_FUNCTION_EXISTS(strerror HAVE_STRERROR)
|
||||
CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
|
||||
CHECK_FUNCTION_EXISTS(strchr HAVE_STRCHR)
|
||||
CHECK_FUNCTION_EXISTS(strrchr HAVE_STRRCHR)
|
||||
CHECK_FUNCTION_EXISTS(strcat HAVE_STRCAT)
|
||||
@ -1288,7 +1289,6 @@ IF(ENABLE_MMAP)
|
||||
ENDIF(NOT HAVE_MREMAP)
|
||||
ENDIF(ENABLE_MMAP)
|
||||
|
||||
CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF)
|
||||
#CHECK_FUNCTION_EXISTS(alloca HAVE_ALLOCA)
|
||||
#####
|
||||
# End system inspection checks.
|
||||
|
@ -1,4 +1,51 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#if _MSC_VER>=1900
|
||||
#define STDC99
|
||||
#endif
|
||||
/* Define O_BINARY so that the appropriate flags
|
||||
are set when opening a binary file on Windows. */
|
||||
|
||||
/* Disable a few warnings under Visual Studio, for the
|
||||
time being. */
|
||||
#include <io.h>
|
||||
#pragma warning( disable: 4018 4996 4244 4305 )
|
||||
#define unlink _unlink
|
||||
#define open _open
|
||||
#define close _close
|
||||
#define read _read
|
||||
#define lseek _lseeki64
|
||||
|
||||
#define fstat _fstat64
|
||||
|
||||
#define off_t __int64
|
||||
#define _off_t __int64
|
||||
|
||||
#ifndef _OFF_T_DEFINED
|
||||
#define _OFF_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef strcasecmp
|
||||
#define strcasecmp _stricmp
|
||||
#endif
|
||||
|
||||
#ifndef snprintf
|
||||
#if _MSC_VER<1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#define strdup _strdup
|
||||
#define fdopen _fdopen
|
||||
#define write _write
|
||||
#define strtoll _strtoi64
|
||||
#endif
|
||||
|
||||
/* Define if building universal (internal helper macro) */
|
||||
#cmakedefine AC_APPLE_UNIVERSAL_BUILD 1
|
||||
@ -331,6 +378,7 @@
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#cmakedefine HAVE_UNISTD_H 1
|
||||
#cmakedefine YY_NO_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if the system has the type 'unsigned long long int'. */
|
||||
#cmakedefine HAVE_UNSIGNED_LONG_LONG_INT 1
|
||||
@ -558,8 +606,15 @@
|
||||
|
||||
/* Define strcasecmp, snprintf on Win32 systems. */
|
||||
#ifdef _WIN32
|
||||
#define strcasecmp _stricmp
|
||||
#define snprintf _snprintf
|
||||
#ifndef HAVE_STRCASECMP
|
||||
#define strcasecmp _stricmp
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SNPRINTF
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ncconfigure.h"
|
||||
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
#line 3 "ncgenl.c"
|
||||
#line 3 "lex.ncg.c"
|
||||
|
||||
#define YY_INT_ALIGNED short int
|
||||
|
||||
@ -65,7 +65,6 @@ typedef int16_t flex_int16_t;
|
||||
typedef uint16_t flex_uint16_t;
|
||||
typedef int32_t flex_int32_t;
|
||||
typedef uint32_t flex_uint32_t;
|
||||
typedef uint64_t flex_uint64_t;
|
||||
#else
|
||||
typedef signed char flex_int8_t;
|
||||
typedef short int flex_int16_t;
|
||||
@ -73,7 +72,6 @@ typedef int flex_int32_t;
|
||||
typedef unsigned char flex_uint8_t;
|
||||
typedef unsigned short int flex_uint16_t;
|
||||
typedef unsigned int flex_uint32_t;
|
||||
#endif /* ! C99 */
|
||||
|
||||
/* Limits of integral types. */
|
||||
#ifndef INT8_MIN
|
||||
@ -104,6 +102,8 @@ typedef unsigned int flex_uint32_t;
|
||||
#define UINT32_MAX (4294967295U)
|
||||
#endif
|
||||
|
||||
#endif /* ! C99 */
|
||||
|
||||
#endif /* ! FLEXINT_H */
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -160,7 +160,15 @@ typedef unsigned int flex_uint32_t;
|
||||
|
||||
/* Size of default input buffer. */
|
||||
#ifndef YY_BUF_SIZE
|
||||
#ifdef __ia64__
|
||||
/* On IA-64, the buffer size is 16k, not 8k.
|
||||
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
|
||||
* Ditto for the __ia64__ case accordingly.
|
||||
*/
|
||||
#define YY_BUF_SIZE 32768
|
||||
#else
|
||||
#define YY_BUF_SIZE 16384
|
||||
#endif /* __ia64__ */
|
||||
#endif
|
||||
|
||||
/* The state buf must be large enough to hold one state per character in the main buffer.
|
||||
@ -172,12 +180,7 @@ typedef unsigned int flex_uint32_t;
|
||||
typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
||||
#endif
|
||||
|
||||
#ifndef YY_TYPEDEF_YY_SIZE_T
|
||||
#define YY_TYPEDEF_YY_SIZE_T
|
||||
typedef size_t yy_size_t;
|
||||
#endif
|
||||
|
||||
extern yy_size_t ncgleng;
|
||||
extern int ncgleng;
|
||||
|
||||
extern FILE *ncgin, *ncgout;
|
||||
|
||||
@ -203,6 +206,11 @@ extern FILE *ncgin, *ncgout;
|
||||
|
||||
#define unput(c) yyunput( c, (yytext_ptr) )
|
||||
|
||||
#ifndef YY_TYPEDEF_YY_SIZE_T
|
||||
#define YY_TYPEDEF_YY_SIZE_T
|
||||
typedef size_t yy_size_t;
|
||||
#endif
|
||||
|
||||
#ifndef YY_STRUCT_YY_BUFFER_STATE
|
||||
#define YY_STRUCT_YY_BUFFER_STATE
|
||||
struct yy_buffer_state
|
||||
@ -220,7 +228,7 @@ struct yy_buffer_state
|
||||
/* Number of characters read into yy_ch_buf, not including EOB
|
||||
* characters.
|
||||
*/
|
||||
yy_size_t yy_n_chars;
|
||||
int yy_n_chars;
|
||||
|
||||
/* Whether we "own" the buffer - i.e., we know we created it,
|
||||
* and can realloc() it to grow it, and should free() it to
|
||||
@ -290,8 +298,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
|
||||
|
||||
/* yy_hold_char holds the character lost when ncgtext is formed. */
|
||||
static char yy_hold_char;
|
||||
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
|
||||
yy_size_t ncgleng;
|
||||
static int yy_n_chars; /* number of characters read into yy_ch_buf */
|
||||
int ncgleng;
|
||||
|
||||
/* Points to current character in buffer. */
|
||||
static char *yy_c_buf_p = (char *) 0;
|
||||
@ -319,7 +327,7 @@ static void ncg_init_buffer (YY_BUFFER_STATE b,FILE *file );
|
||||
|
||||
YY_BUFFER_STATE ncg_scan_buffer (char *base,yy_size_t size );
|
||||
YY_BUFFER_STATE ncg_scan_string (yyconst char *yy_str );
|
||||
YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,yy_size_t len );
|
||||
YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,int len );
|
||||
|
||||
void *ncgalloc (yy_size_t );
|
||||
void *ncgrealloc (void *,yy_size_t );
|
||||
@ -374,7 +382,7 @@ static void yy_fatal_error (yyconst char msg[] );
|
||||
*/
|
||||
#define YY_DO_BEFORE_ACTION \
|
||||
(yytext_ptr) = yy_bp; \
|
||||
ncgleng = (yy_size_t) (yy_cp - yy_bp); \
|
||||
ncgleng = (size_t) (yy_cp - yy_bp); \
|
||||
(yy_hold_char) = *yy_cp; \
|
||||
*yy_cp = '\0'; \
|
||||
(yy_c_buf_p) = yy_cp;
|
||||
@ -1320,7 +1328,7 @@ ID ([A-Za-z_]|{UTF8})([A-Z.@#\[\]a-z_0-9+-]|{UTF8})*
|
||||
/* Note: this definition of string will work for utf8 as well,
|
||||
although it is a very relaxed definition
|
||||
*/
|
||||
#line 1324 "ncgenl.c"
|
||||
#line 1332 "lex.ncg.c"
|
||||
|
||||
#define INITIAL 0
|
||||
#define ST_C_COMMENT 1
|
||||
@ -1361,7 +1369,7 @@ FILE *ncgget_out (void );
|
||||
|
||||
void ncgset_out (FILE * out_str );
|
||||
|
||||
yy_size_t ncgget_leng (void );
|
||||
int ncgget_leng (void );
|
||||
|
||||
char *ncgget_text (void );
|
||||
|
||||
@ -1403,7 +1411,12 @@ static int input (void );
|
||||
|
||||
/* Amount of stuff to slurp up with each read. */
|
||||
#ifndef YY_READ_BUF_SIZE
|
||||
#ifdef __ia64__
|
||||
/* On IA-64, the buffer size is 16k, not 8k */
|
||||
#define YY_READ_BUF_SIZE 16384
|
||||
#else
|
||||
#define YY_READ_BUF_SIZE 8192
|
||||
#endif /* __ia64__ */
|
||||
#endif
|
||||
|
||||
/* Copy whatever the last rule matched to the standard output. */
|
||||
@ -1411,7 +1424,7 @@ static int input (void );
|
||||
/* This used to be an fputs(), but since the string might contain NUL's,
|
||||
* we now use fwrite().
|
||||
*/
|
||||
#define ECHO fwrite( ncgtext, ncgleng, 1, ncgout )
|
||||
#define ECHO do { if (fwrite( ncgtext, ncgleng, 1, ncgout )) {} } while (0)
|
||||
#endif
|
||||
|
||||
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
|
||||
@ -1422,7 +1435,7 @@ static int input (void );
|
||||
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
|
||||
{ \
|
||||
int c = '*'; \
|
||||
yy_size_t n; \
|
||||
size_t n; \
|
||||
for ( n = 0; n < max_size && \
|
||||
(c = getc( ncgin )) != EOF && c != '\n'; ++n ) \
|
||||
buf[n] = (char) c; \
|
||||
@ -1506,7 +1519,7 @@ YY_DECL
|
||||
|
||||
#line 217 "ncgen.l"
|
||||
|
||||
#line 1510 "ncgenl.c"
|
||||
#line 1523 "lex.ncg.c"
|
||||
|
||||
if ( !(yy_init) )
|
||||
{
|
||||
@ -2119,7 +2132,7 @@ YY_RULE_SETUP
|
||||
#line 570 "ncgen.l"
|
||||
ECHO;
|
||||
YY_BREAK
|
||||
#line 2123 "ncgenl.c"
|
||||
#line 2136 "lex.ncg.c"
|
||||
case YY_STATE_EOF(INITIAL):
|
||||
case YY_STATE_EOF(TEXT):
|
||||
yyterminate();
|
||||
@ -2306,7 +2319,7 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
else
|
||||
{
|
||||
yy_size_t num_to_read =
|
||||
int num_to_read =
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
|
||||
|
||||
while ( num_to_read <= 0 )
|
||||
@ -2320,7 +2333,7 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
if ( b->yy_is_our_buffer )
|
||||
{
|
||||
yy_size_t new_size = b->yy_buf_size * 2;
|
||||
int new_size = b->yy_buf_size * 2;
|
||||
|
||||
if ( new_size <= 0 )
|
||||
b->yy_buf_size += b->yy_buf_size / 8;
|
||||
@ -2351,7 +2364,7 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
/* Read in more data. */
|
||||
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
|
||||
(yy_n_chars), num_to_read );
|
||||
(yy_n_chars), (size_t) num_to_read );
|
||||
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
|
||||
}
|
||||
@ -2461,7 +2474,7 @@ static int yy_get_next_buffer (void)
|
||||
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
|
||||
{ /* need to shift things up to make room */
|
||||
/* +2 for EOB chars. */
|
||||
register yy_size_t number_to_move = (yy_n_chars) + 2;
|
||||
register int number_to_move = (yy_n_chars) + 2;
|
||||
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
|
||||
register char *source =
|
||||
@ -2510,7 +2523,7 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
else
|
||||
{ /* need more input */
|
||||
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
|
||||
int offset = (yy_c_buf_p) - (yytext_ptr);
|
||||
++(yy_c_buf_p);
|
||||
|
||||
switch ( yy_get_next_buffer( ) )
|
||||
@ -2534,7 +2547,7 @@ static int yy_get_next_buffer (void)
|
||||
case EOB_ACT_END_OF_FILE:
|
||||
{
|
||||
if ( ncgwrap( ) )
|
||||
return 0;
|
||||
return EOF;
|
||||
|
||||
if ( ! (yy_did_buffer_switch_on_eof) )
|
||||
YY_NEW_FILE;
|
||||
@ -2786,7 +2799,7 @@ void ncgpop_buffer_state (void)
|
||||
*/
|
||||
static void ncgensure_buffer_stack (void)
|
||||
{
|
||||
yy_size_t num_to_alloc;
|
||||
int num_to_alloc;
|
||||
|
||||
if (!(yy_buffer_stack)) {
|
||||
|
||||
@ -2878,16 +2891,17 @@ YY_BUFFER_STATE ncg_scan_string (yyconst char * yystr )
|
||||
|
||||
/** Setup the input buffer state to scan the given bytes. The next call to ncglex() will
|
||||
* scan from a @e copy of @a bytes.
|
||||
* @param bytes the byte buffer to scan
|
||||
* @param len the number of bytes in the buffer pointed to by @a bytes.
|
||||
* @param yybytes the byte buffer to scan
|
||||
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
|
||||
*
|
||||
* @return the newly allocated buffer state object.
|
||||
*/
|
||||
YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
|
||||
YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, int _yybytes_len )
|
||||
{
|
||||
YY_BUFFER_STATE b;
|
||||
char *buf;
|
||||
yy_size_t n, i;
|
||||
yy_size_t n;
|
||||
int i;
|
||||
|
||||
/* Get memory for full buffer, including space for trailing EOB's. */
|
||||
n = _yybytes_len + 2;
|
||||
@ -2969,7 +2983,7 @@ FILE *ncgget_out (void)
|
||||
/** Get the length of the current token.
|
||||
*
|
||||
*/
|
||||
yy_size_t ncgget_leng (void)
|
||||
int ncgget_leng (void)
|
||||
{
|
||||
return ncgleng;
|
||||
}
|
||||
|
708
ncgen/ncgeny.c
708
ncgen/ncgeny.c
File diff suppressed because it is too large
Load Diff
@ -1,24 +1,22 @@
|
||||
/* A Bison parser, made by GNU Bison 2.3. */
|
||||
/* A Bison parser, made by GNU Bison 2.4.2. */
|
||||
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
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.
|
||||
|
||||
the Free Software Foundation, either version 3 of the License, 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 program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
@ -29,10 +27,11 @@
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
@ -92,80 +91,33 @@
|
||||
DATASETID = 308
|
||||
};
|
||||
#endif
|
||||
/* Tokens. */
|
||||
#define NC_UNLIMITED_K 258
|
||||
#define CHAR_K 259
|
||||
#define BYTE_K 260
|
||||
#define SHORT_K 261
|
||||
#define INT_K 262
|
||||
#define FLOAT_K 263
|
||||
#define DOUBLE_K 264
|
||||
#define UBYTE_K 265
|
||||
#define USHORT_K 266
|
||||
#define UINT_K 267
|
||||
#define INT64_K 268
|
||||
#define UINT64_K 269
|
||||
#define IDENT 270
|
||||
#define TERMSTRING 271
|
||||
#define CHAR_CONST 272
|
||||
#define BYTE_CONST 273
|
||||
#define SHORT_CONST 274
|
||||
#define INT_CONST 275
|
||||
#define INT64_CONST 276
|
||||
#define UBYTE_CONST 277
|
||||
#define USHORT_CONST 278
|
||||
#define UINT_CONST 279
|
||||
#define UINT64_CONST 280
|
||||
#define FLOAT_CONST 281
|
||||
#define DOUBLE_CONST 282
|
||||
#define DIMENSIONS 283
|
||||
#define VARIABLES 284
|
||||
#define NETCDF 285
|
||||
#define DATA 286
|
||||
#define TYPES 287
|
||||
#define COMPOUND 288
|
||||
#define ENUM 289
|
||||
#define OPAQUE 290
|
||||
#define OPAQUESTRING 291
|
||||
#define GROUP 292
|
||||
#define PATH 293
|
||||
#define FILLMARKER 294
|
||||
#define NIL 295
|
||||
#define _FILLVALUE 296
|
||||
#define _FORMAT 297
|
||||
#define _STORAGE 298
|
||||
#define _CHUNKSIZES 299
|
||||
#define _DEFLATELEVEL 300
|
||||
#define _SHUFFLE 301
|
||||
#define _ENDIANNESS 302
|
||||
#define _NOFILL 303
|
||||
#define _FLETCHER32 304
|
||||
#define _NCPROPS 305
|
||||
#define _ISNETCDF4 306
|
||||
#define _SUPERBLOCK 307
|
||||
#define DATASETID 308
|
||||
|
||||
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
#line 136 "ncgen.y"
|
||||
{
|
||||
|
||||
/* Line 1685 of yacc.c */
|
||||
#line 136 "ncgen.y"
|
||||
|
||||
Symbol* sym;
|
||||
unsigned long size; /* allow for zero size to indicate e.g. UNLIMITED*/
|
||||
long mark; /* track indices into the sequence*/
|
||||
int nctype; /* for tracking attribute list type*/
|
||||
Datalist* datalist;
|
||||
NCConstant constant;
|
||||
}
|
||||
/* Line 1529 of yacc.c. */
|
||||
#line 164 "ncgeny.h"
|
||||
YYSTYPE;
|
||||
|
||||
|
||||
|
||||
/* Line 1685 of yacc.c */
|
||||
#line 115 "ncgen.tab.h"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
extern YYSTYPE ncglval;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user