Alexandre Lision | 7fd5d3d | 2013-12-04 13:06:40 -0500 | [diff] [blame] | 1 | #ifndef BNPRINT_H |
| 2 | #define BNPRINT_H |
| 3 | |
| 4 | #include <stdio.h> |
| 5 | |
| 6 | #ifdef __cplusplus |
| 7 | extern "C" |
| 8 | { |
| 9 | #endif |
| 10 | |
| 11 | struct BigNum; |
| 12 | |
| 13 | #ifndef SWIG |
| 14 | int bnPrint(FILE *f, char const *prefix, struct BigNum const *bn, |
| 15 | char const *suffix); |
| 16 | #endif |
| 17 | |
| 18 | /** |
| 19 | * Convert an ASCII string into a BigNum. |
| 20 | * |
| 21 | * This function converts an ASCII string into a Big number. If the first |
| 22 | * character of the string is a minus sign the big number is a negative number. |
| 23 | * |
| 24 | * @param X the BigNum that stores the result |
| 25 | * |
| 26 | * @param s the ASCII string in big-endian format (first digit is most significant) |
| 27 | * |
| 28 | * @param radix the function can use radix between 2 and 16 |
| 29 | */ |
| 30 | int bnReadAscii(struct BigNum *X, char *s, int radix); |
| 31 | #ifdef __cplusplus |
| 32 | } |
| 33 | #endif |
| 34 | |
| 35 | #endif /* BNPRINT_H */ |