mess822x
1.23
mess822x
Loading...
Searching...
No Matches
mess822x-1.23
src
quote.c
Go to the documentation of this file.
1
#include "
mess822.h
"
2
#include "buffer.h"
3
#include "logmsg.h"
4
#include "exit.h"
5
6
#define WHO "quote"
7
8
void
nomem
()
9
{
10
logmsg(
WHO
,111,FATAL,
"out of memory"
);
11
}
12
13
stralloc
quoted
= {0};
14
stralloc
addr
= {0};
15
char
*
comment
= 0;
16
17
int
main
(
int
argc,
char
**argv)
18
{
19
if
(!stralloc_copys(&
addr
,
"@"
))
nomem
();
20
21
if
(argv[1]) {
22
if
(!stralloc_copys(&
addr
,argv[1]))
nomem
();
23
if
(!stralloc_cats(&
addr
,
"@"
))
nomem
();
24
25
if
(argv[2]) {
26
if
(!stralloc_cats(&
addr
,argv[2]))
nomem
();
27
28
comment
= argv[3];
29
}
30
}
31
32
if
(!stralloc_0(&
addr
))
nomem
();
33
if
(!
mess822_quote
(&
quoted
,
addr
.s,
comment
))
nomem
();
34
35
if
(!stralloc_append(&
quoted
,
"\n"
))
nomem
();
36
37
buffer_putflush(buffer_1,
quoted
.s,
quoted
.len);
38
39
_exit(0);
40
}
comment
char * comment
Definition:
quote.c:15
quoted
stralloc quoted
Definition:
quote.c:13
nomem
void nomem()
Definition:
quote.c:8
addr
stralloc addr
Definition:
quote.c:14
WHO
#define WHO
Definition:
quote.c:6
main
int main()
Definition:
822print.c:351
mess822.h
mess822_quote
int mess822_quote(stralloc *, char *, char *)
Definition:
mess822_quote.c:102
Generated on Mon Mar 3 2025 20:48:08 for mess822x by
1.9.6