src/common.h : Add function psf_isprint() a replacement for the standard C isprint() function which ignores any locale settings and treats all input as ASCII.

This commit is contained in:
Erik de Castro Lopo 2009-07-29 11:26:35 +10:00
parent adda2b0117
commit 03282a0c10
2 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2009-07-29 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/common.h
Add function psf_isprint() a replacement for the standard C isprint()
function which ignores any locale settings and treats all input as ASCII.
2009-07-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/command.c

View File

@ -219,6 +219,15 @@ make_size_t (int x)
{ return (size_t) x ;
} /* size_t_of_int */
/*
** This version of isprint specifically ignore any locale info. Its used for
** determining which characters can be printed in things like hexdumps.
*/
static inline int
psf_isprint (int ch)
{ return (ch >= ' ' && ch <= '~') ;
} /* psf_isprint */
/*=======================================================================================
** SF_PRIVATE stuct - a pointer to this struct is passed back to the caller of the
** sf_open_XXXX functions. The caller however has no knowledge of the struct's