2003-10-29 16:05:03 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
void print(const char *format, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_start(ap, format);
|
|
|
|
if (vprintf(format, ap) < 0) abort();
|
|
|
|
va_end(ap);
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char * * argv)
|
|
|
|
{
|
|
|
|
int c;
|
|
|
|
if (argc != 2) abort();
|
2010-02-18 13:16:59 +00:00
|
|
|
print("static unsigned char %s[] = { ", argv[1]);
|
2003-10-29 16:05:03 +00:00
|
|
|
while ((c = getchar()) != EOF) {
|
|
|
|
print("0x%02x, ", (unsigned char) c);
|
|
|
|
}
|
2010-02-18 13:16:59 +00:00
|
|
|
print("0 };\n");
|
2003-10-29 16:05:03 +00:00
|
|
|
return 0;
|
|
|
|
}
|