mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* util.h (digitp, hexdigitp): New ctype like macros.
(atoi_1,atoi_2,atoi_4,xtoi_1,xtoi_2): New. * command.c: Removed the conversion macros as they are now in ../common/util.h.
This commit is contained in:
parent
317bccd134
commit
7606e3b33a
6 changed files with 41 additions and 17 deletions
|
@ -58,8 +58,8 @@ int map_assuan_err (int err);
|
|||
/* some macros to replace ctype ones and avoid locale problems */
|
||||
#define digitp(p) (*(p) >= '0' && *(p) <= '9')
|
||||
#define hexdigitp(a) (digitp (a) \
|
||||
|| ((a) >= 'A' && (a) <= 'F') \
|
||||
|| ((a) >= 'a' && (a) <= 'f'))
|
||||
|| (*(a) >= 'A' && *(a) <= 'F') \
|
||||
|| (*(a) >= 'a' && *(a) <= 'f'))
|
||||
/* the atoi macros assume that the buffer has only valid digits */
|
||||
#define atoi_1(p) (*(p) - '0' )
|
||||
#define atoi_2(p) ((atoi_1(p) * 10) + atoi_1((p)+1))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue