2 * Copyright (C) 2017 Andy Spencer <andy753421@gmail.com>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
38 chat_log = log_buf.data;
41 // Append some lines */
42 chat_send("Copyright (C) 2017 Andy Spencer <andy753421@gmail.com>");
43 chat_send("This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.");
44 chat_send("This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.");
45 chat_send("You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.");
48 void chat_send(const char *msg)
50 append(&log_buf, NULL, sizeof(log_t));
51 chat_log = log_buf.data;
53 log_t *log = &chat_log[chat_len];
54 log->when = time(NULL);
57 log->msg = strcopy(msg);
64 for (int i = 0; i < chat_len; i++)
65 free((void*)chat_log[i].msg);