mess822x 1.23
mess822x
Loading...
Searching...
No Matches
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
8void nomem()
9{
10 logmsg(WHO,111,FATAL,"out of memory");
11}
12
13stralloc quoted = {0};
14stralloc addr = {0};
15char *comment = 0;
16
17int 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();
34
35 if (!stralloc_append(&quoted,"\n")) nomem();
36
37 buffer_putflush(buffer_1,quoted.s,quoted.len);
38
39 _exit(0);
40}
char * comment
Definition: quote.c:15
stralloc quoted
Definition: quote.c:13
void nomem()
Definition: quote.c:8
stralloc addr
Definition: quote.c:14
#define WHO
Definition: quote.c:6
int main()
Definition: 822print.c:351
int mess822_quote(stralloc *, char *, char *)