4 Copyright (C) 2006-2009 Jonathan Zarate
14 static const char webMsgFile
[] = "/tmp/.webmsg";
17 void setWebMsg(const char *s
)
21 if ((f
= fopen(webMsgFile
, "w")) != NULL
) {
31 void getWebMsg(char *s
, int max
)
36 if ((f
= fopen(webMsgFile
, "r")) != NULL
) {
37 n
= fread(s
, 1, max
- 1, f
);
48 return ((stat(webMsgFile
, &st
) == 0) && (st
.st_size
> 0));
51 void asp_webmsg(int argc
, char **argv
)
56 getWebMsg(s
, sizeof(s
));
58 if (argc
== 0) return;
61 if ((argc
>= 2) && (argv
[1][0] == '1')) web_putj(msg
);