#include #include #define b64_ntop __b64_ntop #define b64_pton __b64_pton /* There are no header files for these functions. */ int b64_ntop(unsigned char const *src, size_t srclength, char *target, size_t targsize); int b64_pton(char const *src, unsigned char *target, size_t targsize); /* Demonstrate the use of the functions by encoding and decoding the command line arguments. */ #define targsize 0x100 int main (int argc, char ** argv) { int i; char target[targsize]; unsigned char revert[targsize]; for (i = 0; i < argc; i++) { int end; /* Input buffer, input length, output buffer, max output length */ b64_ntop ((unsigned char*) argv[i], strlen (argv[i]), target, targsize); printf ("%s\n", target); /* Input buffer (null terminated), output buffer, max output length. */ end = b64_pton (target, revert, targsize); revert[end] = '\0'; printf ("%s\n", revert); } return 0; }