[Pkg-privacy-commits] [irssi-plugin-otr] 172/267: Fix: cleanup headers and syntax

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:26:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository irssi-plugin-otr.

commit 7fabcef0aba15645dbe6b54cd85dd52eeb423c5a
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Sun Dec 2 01:01:43 2012 -0500

    Fix: cleanup headers and syntax
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/cmd.c       |  3 ++-
 src/cmd.h       | 10 +++++++++-
 src/irssi_otr.h | 26 +++++++++++++++++---------
 src/key.c       | 26 ++++++++++++++------------
 src/key.h       |  8 ++++++++
 src/module.c    | 16 ++++------------
 src/module.h    |  2 ++
 src/otr.c       |  4 ++--
 src/otr.h       | 35 +++++++++++++++--------------------
 src/utils.c     | 20 ++++++++++----------
 10 files changed, 83 insertions(+), 67 deletions(-)

diff --git a/src/cmd.c b/src/cmd.c
index cdc3633..5f6e233 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -1,7 +1,8 @@
 /*
  * Off-the-Record Messaging (OTR) modules for IRC
  *
- * Copyright (C) 2008  Uli Meis <a.sporto+bee at gmail.com>
+ * Copyright (C) 2008 - Uli Meis <a.sporto+bee at gmail.com>
+ *               2012 - David Goulet <dgoulet at ev0ke.net>
  *
  * 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
diff --git a/src/cmd.h b/src/cmd.h
index 3180017..5d8c3ae 100644
--- a/src/cmd.h
+++ b/src/cmd.h
@@ -1,7 +1,8 @@
 /*
  * Off-the-Record Messaging (OTR) modules for IRC
  *
- * Copyright (C) 2008  Uli Meis <a.sporto+bee at gmail.com>
+ * Copyright (C) 2008 - Uli Meis <a.sporto+bee at gmail.com>
+ *               2012 - David Goulet <dgoulet at ev0ke.net>
  *
  * 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
@@ -23,12 +24,19 @@
 
 #include "otr.h"
 
+/*
+ * The /otr commands structure.
+ */
 struct irssi_commands {
 	const char *name;
 	void (*func)(struct otr_user_state *ustate, SERVER_REC *irssi,
 			const char *target, const void *data);
 };
 
+/*
+ * This is called once the command is received and then dispatch to the correct
+ * func() of the right irssi_commands.
+ */
 void cmd_generic(struct otr_user_state *ustate, SERVER_REC *irssi,
 		const char *target, char *cmd, const void *data);
 
diff --git a/src/irssi_otr.h b/src/irssi_otr.h
index 71b568e..0823294 100644
--- a/src/irssi_otr.h
+++ b/src/irssi_otr.h
@@ -19,6 +19,9 @@
  * Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
  */
 
+#ifndef IRSSI_IRSSI_OTR_H
+#define IRSSI_IRSSI_OTR_H
+
 #define UOFF_T_LONG_LONG 1
 
 #include <src/common.h>
@@ -38,38 +41,43 @@
 #include <src/irc/core/irc-servers.h>
 #include <src/fe-text/statusbar-item.h>
 
-#define get_client_config_dir get_irssi_dir
+/* Ease our life a bit. */
+#define get_client_config_dir	get_irssi_dir
+
+#define IRSSI_CONN_ADDR(i)		i->connrec->address
+#define IRSSI_NICK(i)			i->nick
 
-#define IRSSI_CONN_ADDR(i) i->connrec->address
-#define IRSSI_NICK(i) i->nick
+#define OTR_IRSSI_MSG_PREFIX	"%9OTR%9: "
 
 /*
  * Irssi macros for printing text to console.
  */
 #define IRSSI_MSG(fmt, ...)                                                 \
 	do {                                                                    \
-		printtext(NULL, NULL, MSGLEVEL_MSGS, "%9OTR%9: " fmt,               \
+		printtext(NULL, NULL, MSGLEVEL_MSGS, OTR_IRSSI_MSG_PREFIX fmt,      \
 						## __VA_ARGS__);                                    \
 	} while (0)
 #define IRSSI_INFO(irssi, username, fmt, ...)                               \
 	do {                                                                    \
-		printtext(irssi, username, MSGLEVEL_CRAP, "%9OTR%9: " fmt,          \
+		printtext(irssi, username, MSGLEVEL_CRAP, OTR_IRSSI_MSG_PREFIX fmt, \
 						## __VA_ARGS__);                                    \
 	} while (0)
 #define IRSSI_NOTICE(irssi, username, fmt, ...)                             \
 	do {                                                                    \
-		printtext(irssi, username, MSGLEVEL_MSGS, "%9OTR%9: " fmt,          \
+		printtext(irssi, username, MSGLEVEL_MSGS, OTR_IRSSI_MSG_PREFIX fmt, \
 						## __VA_ARGS__);                                    \
 	} while (0)
 #define IRSSI_WARN(irssi, username, fmt, ...)                               \
 	do {                                                                    \
-		printtext(irssi, username, MSGLEVEL_HILIGHT, "%9OTR%9: " fmt,       \
-						## __VA_ARGS__);                                    \
+		printtext(irssi, username, MSGLEVEL_HILIGHT,                        \
+				OTR_IRSSI_MSG_PREFIX fmt, ## __VA_ARGS__);                  \
 	} while (0)
 #define IRSSI_DEBUG(fmt, ...) \
 	do {                                                                    \
 		if (debug) {                                                        \
-			printtext(NULL, NULL, MSGLEVEL_MSGS, "%9OTR%9: " fmt,           \
+			printtext(NULL, NULL, MSGLEVEL_MSGS, OTR_IRSSI_MSG_PREFIX fmt,  \
 						## __VA_ARGS__);                                    \
 		}                                                                   \
 	} while (0)
+
+#endif /* IRSSI_IRSSI_OTR_H */
diff --git a/src/key.c b/src/key.c
index 45f8aa4..75a58d4 100644
--- a/src/key.c
+++ b/src/key.c
@@ -1,20 +1,22 @@
 /*
  * Off-the-Record Messaging (OTR) modules for IRC
- * Copyright (C) 2008  Uli Meis <a.sporto+bee at gmail.com>
  *
- * 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.
+ * Copyright (C) 2008 - Uli Meis <a.sporto+bee at gmail.com>
+ *               2012 - David Goulet <dgoulet at ev0ke.net>
  *
- * 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.
+ * 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.
  *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
+ * 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.
+ *
+ * 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., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
  */
 
 #define _GNU_SOURCE
diff --git a/src/key.h b/src/key.h
index ff3762c..5bf771e 100644
--- a/src/key.h
+++ b/src/key.h
@@ -1,4 +1,6 @@
 /*
+ * Off-the-Record Messaging (OTR) modules for IRC
+ *
  * Copyright (C) 2012 - David Goulet <dgoulet at ev0ke.net>
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -21,6 +23,9 @@
 
 #include "otr.h"
 
+/*
+ * Status of key generation.
+ */
 enum key_gen_status {
 	KEY_GEN_IDLE		= 0,
 	KEY_GEN_RUNNING		= 1,
@@ -28,6 +33,9 @@ enum key_gen_status {
 	KEY_GEN_ERROR		= 3,
 };
 
+/*
+ * Data of the state of key generation.
+ */
 struct key_gen_data {
 	struct otr_user_state *ustate;
 	char *account_name;
diff --git a/src/module.c b/src/module.c
index b61b4af..b9846e8 100644
--- a/src/module.c
+++ b/src/module.c
@@ -47,7 +47,7 @@ int debug = FALSE;
 void perl_signal_register(const char *signal, const char **args);
 
 /*
- * Global state for the user.
+ * Global state for the user. Init when the module loads.
  */
 struct otr_user_state *user_state_global;
 
@@ -246,11 +246,9 @@ static void otr_statusbar(struct SBAR_ITEM_REC *item, int get_size_only)
 			formatnum ? otr_formats[formatnum].def : "", " ", FALSE);
 }
 
-static void read_settings(void)
-{
-	return;
-}
-
+/*
+ * Create otr module directory if none exists.
+ */
 static int create_module_dir(void)
 {
 	int ret;
@@ -322,10 +320,6 @@ void otr_init(void)
 	command_bind_first("quit", NULL, (SIGNAL_FUNC) cmd_quit);
 	command_bind_irc_first("me", NULL, (SIGNAL_FUNC) cmd_me);
 
-	read_settings();
-
-	signal_add("setup changed", (SIGNAL_FUNC) read_settings);
-
 	statusbar_item_register("otr", NULL, otr_statusbar);
 	statusbar_items_redraw("window");
 
@@ -345,8 +339,6 @@ void otr_deinit(void)
 	command_unbind("quit", (SIGNAL_FUNC) cmd_quit);
 	command_unbind("me", (SIGNAL_FUNC) cmd_me);
 
-	signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
-
 	statusbar_item_unregister("otr");
 
 	otr_finishall(user_state_global);
diff --git a/src/module.h b/src/module.h
index 4ae8d4c..32e7e39 100644
--- a/src/module.h
+++ b/src/module.h
@@ -1,4 +1,6 @@
 /*
+ * Off-the-Record Messaging (OTR) module for the irssi IRC client
+ *
  * Copyright (C) 2012 - David Goulet <dgoulet at ev0ke.net>
  *
  * This program is free software; you can redistribute it and/or modify it
diff --git a/src/otr.c b/src/otr.c
index 0d248ba..faf232d 100644
--- a/src/otr.c
+++ b/src/otr.c
@@ -1,8 +1,8 @@
 /*
  * Off-the-Record Messaging (OTR) modules for IRC
  *
- * Copyright (C) 2008  Uli Meis <a.sporto+bee at gmail.com>
- *               2012  David Goulet <dgoulet at ev0ke.net>
+ * Copyright (C) 2008 - Uli Meis <a.sporto+bee at gmail.com>
+ *               2012 - David Goulet <dgoulet at ev0ke.net>
  *
  * 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
diff --git a/src/otr.h b/src/otr.h
index 6085665..7601a08 100644
--- a/src/otr.h
+++ b/src/otr.h
@@ -1,20 +1,22 @@
 /*
  * Off-the-Record Messaging (OTR) modules for IRC
- * Copyright (C) 2008  Uli Meis <a.sporto+bee at gmail.com>
  *
- * 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.
+ * Copyright (C) 2008 - Uli Meis <a.sporto+bee at gmail.com>
+ *               2012 - David Goulet <dgoulet at ev0ke.net>
  *
- * 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.
+ * 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.
  *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
+ * 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.
+ *
+ * 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., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
  */
 
 #ifndef IRSSI_OTR_OTR_H
@@ -30,7 +32,7 @@
 #include "utils.h"
 
 /* irssi module name */
-#define MODULE_NAME "otr"
+#define MODULE_NAME                   "otr"
 
 /*
  * XXX: Maybe this should be configurable?
@@ -90,13 +92,6 @@ enum otr_status_event {
 	OTR_STATUS_CTX_UPDATE
 };
 
-/* policy list generated from /set otr_policy */
-
-struct plistentry {
-	GPatternSpec *namepat;
-	OtrlPolicy policy;
-};
-
 /* there can be only one */
 extern struct otr_user_state *user_state_global;
 
diff --git a/src/utils.c b/src/utils.c
index 06ddab7..ac77d69 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -4,18 +4,18 @@
  * Copyright (C) 2012 - David Goulet <dgoulet at ev0ke.net>
  *
  * 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.
+ * 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
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * 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.
  *
- * 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.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
+ * 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., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
  */
 
 #include <assert.h>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/irssi-plugin-otr.git



More information about the Pkg-privacy-commits mailing list