|
a/src/utils/base64.cpp |
|
b/src/utils/base64.cpp |
|
... |
|
... |
18 |
|
18 |
|
19 |
#include <sys/types.h>
|
19 |
#include <sys/types.h>
|
20 |
#include <cstring>
|
20 |
#include <cstring>
|
21 |
#include <string>
|
21 |
#include <string>
|
22 |
|
22 |
|
23 |
#ifndef NO_NAMESPACES
|
|
|
24 |
using std::string;
|
23 |
using std::string;
|
25 |
#endif /* NO_NAMESPACES */
|
|
|
26 |
|
24 |
|
27 |
#undef DEBUG_BASE64
|
25 |
#undef DEBUG_BASE64
|
28 |
#ifdef DEBUG_BASE64
|
26 |
#ifdef DEBUG_BASE64
|
29 |
#define DPRINT(X) fprintf X
|
27 |
#define DPRINT(X) fprintf X
|
30 |
#else
|
28 |
#else
|
|
... |
|
... |
268 |
}
|
266 |
}
|
269 |
|
267 |
|
270 |
#ifdef TEST_BASE64
|
268 |
#ifdef TEST_BASE64
|
271 |
#include <stdio.h>
|
269 |
#include <stdio.h>
|
272 |
#include <stdlib.h>
|
270 |
#include <stdlib.h>
|
273 |
#include <unistd.h>
|
|
|
274 |
|
271 |
|
275 |
#include "readfile.h"
|
272 |
#include "readfile.h"
|
276 |
|
273 |
|
277 |
const char *thisprog;
|
274 |
const char *thisprog;
|
278 |
static char usage [] = "testfile\n\n"
|
275 |
static char usage [] = "testfile\n\n"
|
|
... |
|
... |
356 |
string odata;
|
353 |
string odata;
|
357 |
if (!base64_decode(idata, odata)) {
|
354 |
if (!base64_decode(idata, odata)) {
|
358 |
fprintf(stderr, "Decoding failed\n");
|
355 |
fprintf(stderr, "Decoding failed\n");
|
359 |
exit(1);
|
356 |
exit(1);
|
360 |
}
|
357 |
}
|
361 |
::write(1, odata.c_str(),
|
358 |
fwrite(odata.c_str(), 1,
|
362 |
odata.size() * sizeof(string::value_type));
|
359 |
odata.size() * sizeof(string::value_type), stdout);
|
363 |
exit(0);
|
360 |
exit(0);
|
364 |
}
|
361 |
}
|
365 |
}
|
362 |
}
|
366 |
#endif
|
363 |
#endif
|