ezmlmx
0.68
ezmlmx
Loading...
Searching...
No Matches
ezmlmx-0.68
src
auto-str.c
Go to the documentation of this file.
1
#include "buffer.h"
2
#include "readwrite.h"
3
#include "exit.h"
4
5
void
subputs
(
const
char
*s)
6
{
7
if
(buffer_puts(buffer_1,s) == -1) _exit(111);
8
}
9
10
int
main
(
int
argc,
char
**argv)
11
{
12
char
*
name
;
13
char
*value;
14
unsigned
char
ch;
15
char
octal[4];
16
17
name
= argv[1];
18
if
(!
name
) _exit(100);
19
value = argv[2];
20
if
(!value) _exit(100);
21
22
subputs
(
"const char "
);
23
subputs
(
name
);
24
subputs
(
"[] = \"\\\n"
);
25
26
while
(ch = *value++) {
27
subputs
(
"\\"
);
28
octal[3] = 0;
29
octal[2] =
'0'
+ (ch & 7); ch >>= 3;
30
octal[1] =
'0'
+ (ch & 7); ch >>= 3;
31
octal[0] =
'0'
+ (ch & 7);
32
subputs
(octal);
33
}
34
35
subputs
(
"\\\n\";\n"
);
36
if
(buffer_flush(buffer_1) == -1) _exit(111);
37
return
0;
38
}
main
int main()
Definition
ezmlm-weed.c:69
name
stralloc name
Definition
ezmlm-split.c:48
subputs
void subputs(const char *s)
Definition
auto-str.c:5
Generated on
for ezmlmx by
1.14.0