path: root/iminternal.h
diff options
authorRainer Gerhards <>2007-08-03 14:58:24 +0000
committerRainer Gerhards <>2007-08-03 14:58:24 +0000
commit51971302280a9789b794e6c0c534a6e02767a39e (patch)
tree39234fe7dab5a0ac5ff51f0d55b5e1a19e159c43 /iminternal.h
parentadbf55ece666c71e882c370a74efa0bbf3239226 (diff)
- I found out that we finally have problems with the (somewhat recursive)
call to logerror() that many of the modules do. I have not tried it, but I think things will become wild when we compile without pthread support. Threading prevents full recursion, so we have not seen any bad effects so far. However, the problems that I experienced in ommysl (that caused me to re-structure startWorker()) are actually rooted in this issue. I first thought to fix it via a module interace, but I now came to the conclusion that it is not more effort and much cleaner to do an internal error buffering class. This is implemented in errbuf.c/h. - I just noticed that this is not actually an error buf, but the core of an input module for all internal messages. As such, I implement it now as iminternal.c/h. Of course, there is no input module interface yet designed, but that doesn't matter. Worst-case, I need to re-write the im, best case I can use the im (at least partly) to define the interface. - added a few functions to the linkedlist class - error messages during startup are now buffered - so we do no longer need to think about how emergency logging might work. Actually, these are logged to whatever is instatiated in the log file. This enhances the chance that we will be able to drop the error message somewhere it is seen.
Diffstat (limited to 'iminternal.h')
1 files changed, 48 insertions, 0 deletions
diff --git a/iminternal.h b/iminternal.h
new file mode 100644
index 0000000..0677f81
--- /dev/null
+++ b/iminternal.h
@@ -0,0 +1,48 @@
+/* Definition of the internal messages input module.
+ *
+ * Note: we currently do not have an input module spec, but
+ * we will have one in the future. This module needs then to be
+ * adapted.
+ *
+ * Copyright 2007 Rainer Gerhards and Adiscon GmbH.
+ *
+ * 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 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * A copy of the GPL can be found in the file "COPYING" in this distribution.
+ */
+#include "template.h"
+/* this is a single entry for a parse routine. It describes exactly
+ * one entry point/handler.
+ * The short name is cslch (Configfile SysLine CommandHandler)
+ */
+struct iminternal_s { /* config file sysline parse entry */
+ int pri;
+ msg_t *pMsg; /* the message (in all its glory) */
+ int flags;
+typedef struct iminternal_s iminternal_t;
+/* prototypes */
+rsRetVal modInitIminternal(void);
+rsRetVal modExitIminternal(void);
+rsRetVal iminternalAddMsg(int pri, msg_t *pMsg, int flags);
+rsRetVal iminternalHaveMsgReady(int* pbHaveOne);
+rsRetVal iminternalRemoveMsg(int *pPri, msg_t **ppMsg, int *pFlags);
+#endif /* #ifndef IMINTERNAL_H_INCLUDED */