]> jfr.im git - irc/thales.git/commitdiff
Changed roadmap. No use to write yet-another-irc-bot. So focus on
authorDmitry Bogatov <redacted>
Sat, 1 Dec 2012 22:18:13 +0000 (02:18 +0400)
committerDmitry Bogatov <redacted>
Sat, 1 Dec 2012 22:18:13 +0000 (02:18 +0400)
statistics collecting.

src/log_worker.c [deleted file]
src/log_worker.h [deleted file]
src/worker.h [deleted file]

diff --git a/src/log_worker.c b/src/log_worker.c
deleted file mode 100644 (file)
index 4b119aa..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*  Log worker of GNU Thales.  Copyright (C)
-2012 Free Software Foundation, Inc.  This file is part of GNU Thales.
-
-GNU Thales 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.
-
-GNU Make 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.
-
-You should have received a copy of the GNU General Public License along with
-this program.  If not, see <http://www.gnu.org/licenses/>.  */
-#include "log_worker.h"
-#include <stdlib.h>
-
-#include "xalloc.h"
-
-struct log_worker {
-  struct worker worker;
-  FILE  *out_stream;
-};
-
-static char *
-log_worker_process_message(const char *msg, struct irc_meta *meta,
-                           struct worker *embed, const char *name)
-{
-  struct log_worker *logger = worker_entry(embed, struct log_worker, worker);
-  FILE *stream = logger->out_stream ? logger->out_stream : stdout;
-
-  fprintf(stream, "[%s]: %s\n", name, msg);
-  return NULL;
-}
-
-static void
-log_worker_free_worker(struct worker *embed)
-{
-  struct log_worker *logger = worker_entry(embed, struct log_worker, worker);
-
-  if (logger->out_stream)
-    fclose(logger->out_stream);
-  free(logger);
-}
-
-struct worker*
-create_log_worker(const struct envz *env)
-{
-  struct log_worker *logger;
-  const char *output_filename = envz_get(env->envz, env->envz_len, "output");
-  FILE *out_stream = NULL;
-  if (output_filename && !(out_stream = fopen(output_filename, "a"))) {
-    fprintf(stderr, "log worker:  specified file `%s' can not be appended\n",
-            output_filename);
-    return NULL;
-  }
-
-  logger = xmalloc(sizeof *logger);
-  logger->out_stream = out_stream;
-  return &logger->worker;
-}
diff --git a/src/log_worker.h b/src/log_worker.h
deleted file mode 100644 (file)
index 3bda9da..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*  Log worker of GNU Thales.  Copyright (C)
-2012 Free Software Foundation, Inc.  This file is part of GNU Thales.
-
-GNU Thales 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.
-
-GNU Thales 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.
-
-You should have received a copy of the GNU General Public License along with
-this program.  If not, see <http://www.gnu.org/licenses/>.  */
-#ifndef LOG_WORKER_H
-#define LOG_WORKER_H
-#include "worker.h"
-#include "conf.h"
-
-struct worker *create_log_worker(const struct envz *env);
-
-
-#endif
diff --git a/src/worker.h b/src/worker.h
deleted file mode 100644 (file)
index 6f16388..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*  Main modules interface of GNU Thales.  Copyright (C)
-2012 Free Software Foundation, Inc.  This file is part of GNU Thales.
-
-GNU Thales 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.
-
-GNU Thales 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.
-
-You should have received a copy of the GNU General Public License along with
-this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#ifndef MODULES_H
-#define MODULES_H
-#include <stddef.h>
-#include <envz.h>
-#include <argz.h>
-
-#include "list.h"
-struct irc_meta {
-  int silent_compiler;
-};
-
-#define worker_entry(ptr,type,name) (type*)((char *)ptr - offsetof(type,name))
-struct worker {
-  char *name;
-  char *(*process_command)(const char *msg, struct irc_meta *meta,
-                           struct worker *self, char *name);
-  void (*free_worker)(struct worker *self);
-  struct list_head list;
-};
-
-#endif