diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 4 | ||||
-rw-r--r-- | include/util.h | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index ef59953f4..390eb982b 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2003-06-07 Werner Koch <[email protected]> + + * util.h (hexdigitp,spacep,digitp): New. + 2003-05-21 David Shaw <[email protected]> * cipher.h, i18n.h, iobuf.h, memory.h, mpi.h, types.h, util.h: diff --git a/include/util.h b/include/util.h index 8803f6a84..eb1566712 100644 --- a/include/util.h +++ b/include/util.h @@ -260,6 +260,13 @@ int vasprintf ( char **result, const char *format, va_list args); #define wipememory2(_ptr,_set,_len) do { volatile char *_vptr=(volatile char *)(_ptr); size_t _vlen=(_len); while(_vlen) { *_vptr=(_set); _vptr++; _vlen--; } } while(0) #define wipememory(_ptr,_len) wipememory2(_ptr,0,_len) +/*-- macros to replace ctype ones and avoid locale problems --*/ +#define spacep(p) (*(p) == ' ' || *(p) == '\t') +#define digitp(p) (*(p) >= '0' && *(p) <= '9') +#define hexdigitp(a) (digitp (a) \ + || (*(a) >= 'A' && *(a) <= 'F') \ + || (*(a) >= 'a' && *(a) <= 'f')) + /******* RISC OS stuff ***********/ #ifdef __riscos__ /* needed for strcasecmp() */ |