Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/lib/hex-dec.h @ 6410:e4eb71ae8e96 HEAD
Changed .h ifdef/defines to use <NAME>_H format.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 16 Sep 2007 11:31:27 +0300 |
parents | 599cd2c5d512 |
children | 81806d402514 |
rev | line source |
---|---|
6410
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
3717
diff
changeset
|
1 #ifndef HEX_DEC_H |
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
3717
diff
changeset
|
2 #define HEX_DEC_H |
3717
599cd2c5d512
Added decimal <-> hex string translation functions.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
3 |
599cd2c5d512
Added decimal <-> hex string translation functions.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
4 #define DEC2HEX(hexstr, str) \ |
599cd2c5d512
Added decimal <-> hex string translation functions.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
5 dec2hex(hexstr, str, sizeof(hexstr)) |
599cd2c5d512
Added decimal <-> hex string translation functions.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
6 |
599cd2c5d512
Added decimal <-> hex string translation functions.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
7 /* Decimal -> hex string translation. The result isn't NUL-terminated. */ |
599cd2c5d512
Added decimal <-> hex string translation functions.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
8 void dec2hex(unsigned char *hexstr, uintmax_t dec, unsigned int hexstr_size); |
599cd2c5d512
Added decimal <-> hex string translation functions.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
9 /* Parses hex string and returns its decimal value, or 0 in case of errors */ |
599cd2c5d512
Added decimal <-> hex string translation functions.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
10 uintmax_t hex2dec(const unsigned char *data, unsigned int len); |
599cd2c5d512
Added decimal <-> hex string translation functions.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
11 |
599cd2c5d512
Added decimal <-> hex string translation functions.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
12 #endif |