1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/bin/sh
if test $# != 3; then
echo "Usage: $0 source_file filename output.m" 1>&2
exit 1
fi
exec 1>$3
cat <<EOF
#include <stddef.h>
#include <stdint.h>
#ifdef OF_COMPILING_OBJFW
# import "OFEmbeddedURIHandler.h"
#else
# import <ObjFW/OFEmbeddedURIHandler.h>
#endif
static const uint8_t bytes[] = {
EOF
od -vtx1 $1 | sed -e '/^[^ ][^ ]*$/d;s/ */ /g' -e 's/ $//g;s/^[^ ][^ ]* //' -e 's/ /, 0x/g' -e 's/^/ 0x/' -e 's/$/,/'
cat <<EOF
};
|
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/bin/sh
if test $# != 3; then
echo "Usage: $0 source_file filename output.m" 1>&2
exit 1
fi
exec 1>$3
cat <<EOF
#include <stddef.h>
#include <stdint.h>
#ifdef OF_COMPILING_OBJFW
# import "OFEmbeddedIRIHandler.h"
#else
# import <ObjFW/OFEmbeddedIRIHandler.h>
#endif
static const uint8_t bytes[] = {
EOF
od -vtx1 $1 | sed -e '/^[^ ][^ ]*$/d;s/ */ /g' -e 's/ $//g;s/^[^ ][^ ]* //' -e 's/ /, 0x/g' -e 's/^/ 0x/' -e 's/$/,/'
cat <<EOF
};
|