1
1
# mulle-c-string-escape
2
2
3
- #### ➿ mulle-c-string-escape turns data into C- strings
3
+ #### ➿ mulle-c-string-escape turns data into C strings
4
4
5
- Non-ASCII characters will be escaped to hex or octal. C-escapes are used for
6
- known C escapes like '\b'. The output is separated into lines of approximately
5
+ Non-ASCII characters will be escaped to hex or octal. C escape sequences are used
6
+ for the predefined sequences like '\b'. The output is separated into lines of approximately
7
7
even length and does not exceed the chosen line length. An example of a
8
8
conversion is [ usage.txt] ( src/usage.txt ) being turned into [ usage.inc] ( src/usage.inc ) .
9
9
You can feed it binary or text files.
10
10
11
- You can ` #include ` the output as string contents, or copy/paste it into your C
12
- program like so:
11
+ You can copy/paste the output as string contents into your C source or ` #include `
12
+ the output like so:
13
13
14
- ```
14
+ ``` c
15
15
static char data[] =
16
16
#include " data.inc"
17
17
;
@@ -29,21 +29,21 @@ See [usage.txt](src/usage.txt) for options.
29
29
## Example
30
30
31
31
Let's use ** mulle-c-string-escape** to create a C string representation of
32
- itself. We use ` cmake ` here, instead of ` mulle-sde craft --release ` , to ease
32
+ itself into a file "x.inc" . We use ` cmake ` here, instead of ` mulle-sde craft --release ` , to ease
33
33
the developer's fear of the unknown:
34
34
35
- ```
35
+ ``` sh
36
36
mkdir -p kitchen/Release
37
37
cmake -B kitchen/Release -DCMAKE_BUILD_TYPE=Release
38
- cmake --build kitchen/Release
38
+ cmake --build kitchen/Release --config Release
39
39
./kitchen/Release/mulle-c-string-escape \
40
40
./kitchen/Release/mulle-c-string-escape \
41
41
x.inc
42
42
```
43
43
44
44
To verify that this has actually worked:
45
45
46
- ```
46
+ ``` sh
47
47
cat << EOF > x.c
48
48
#include <stdio.h>
49
49
@@ -74,7 +74,7 @@ This is a [mulle-sde](https://mulle-sde.github.io/) project.
74
74
It comes with its own virtual environment and list of dependencies.
75
75
To fetch and build everything say:
76
76
77
- ```
77
+ ``` sh
78
78
mulle-sde craft
79
79
```
80
80
0 commit comments