pidgin/pidgin

zephyr: Delete unused error message code.

2019-11-10, Elliott Sales de Andrade
6bb197792c6d
Parents 360997c25b1a
Children 811f82db29dd
zephyr: Delete unused error message code.
--- a/libpurple/protocols/zephyr/ZInit.c Wed Nov 06 04:54:32 2019 +0000
+++ b/libpurple/protocols/zephyr/ZInit.c Sun Nov 10 04:58:08 2019 -0500
@@ -44,12 +44,8 @@
char *krealm = NULL;
int krbval;
char d1[ANAME_SZ], d2[INST_SZ];
-
- /* initialize_krb_error_table(); */
#endif
- initialize_zeph_error_table();
-
(void) memset((char *)&__HM_addr, 0, sizeof(__HM_addr));
__HM_addr.sin_family = AF_INET;
--- a/libpurple/protocols/zephyr/com_err.h Wed Nov 06 04:54:32 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
- * Header file for common error description library.
- *
- * Copyright 1988, Student Information Processing Board of the
- * Massachusetts Institute of Technology.
- *
- * For copyright and distribution info, see the documentation supplied
- * with this package.
- */
-
-#ifndef PURPLE_ZEPHYR_COM_ERR_H
-#define PURPLE_ZEPHYR_COM_ERR_H
-
-#define COM_ERR_BUF_LEN 25
-
-#include <stdarg.h>
-
-typedef void (*error_handler_t)(const char *, long, const char *, va_list);
-extern error_handler_t com_err_hook;
-void com_err(const char *, long, const char *, ...);
-const char *error_message(long);
-const char *error_message_r(long, char *);
-error_handler_t set_com_err_hook(error_handler_t);
-error_handler_t reset_com_err_hook(void);
-
-#endif /* PURPLE_ZEPHYR_COM_ERR_H */
--- a/libpurple/protocols/zephyr/error_message.c Wed Nov 06 04:54:32 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright 1987 by the Student Information Processing Board
- * of the Massachusetts Institute of Technology
- *
- * For copyright info, see "mit-sipb-copyright.h".
- */
-
-#include "error_table.h"
-#include "com_err.h"
-#include <sysdep.h>
-
-char *error_table_name_r(int, char *);
-
-struct et_list * _et_list = (struct et_list *) NULL;
-
-const char * error_message (code)
-long code;
-{
- static char buf[COM_ERR_BUF_LEN];
-
- return(error_message_r(code, buf));
-}
-
-const char * error_message_r (code, buf)
-long code;
-char *buf;
-{
- int offset;
- struct et_list *et;
- int table_num;
- int started = 0;
- char *cp, namebuf[6];
-
- offset = code & ((1<<ERRCODE_RANGE)-1);
- table_num = code - offset;
- if (!table_num)
- return strerror(offset);
- for (et = _et_list; et; et = et->next) {
- if (et->table->base == table_num) {
- /* This is the right table */
- if (et->table->n_msgs <= offset)
- break;
- return(et->table->msgs[offset]);
- }
- }
-
- strcpy (buf, "Unknown code ");
- strcat (buf, error_table_name_r (table_num, namebuf));
- strcat (buf, " ");
- for (cp = buf; *cp; cp++)
- ;
- if (offset >= 100) {
- *cp++ = '0' + offset / 100;
- offset %= 100;
- started++;
- }
- if (started || offset >= 10) {
- *cp++ = '0' + offset / 10;
- offset %= 10;
- }
- *cp++ = '0' + offset;
- *cp = '\0';
- return(buf);
-}
--- a/libpurple/protocols/zephyr/error_table.h Wed Nov 06 04:54:32 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
- * Copyright 1988 by the Student Information Processing Board of the
- * Massachusetts Institute of Technology.
- *
- * For copyright info, see mit-sipb-copyright.h.
- */
-
-#ifndef PURPLE_ZEPHYR_ERROR_TABLE_H
-#define PURPLE_ZEPHYR_ERROR_TABLE_H
-
-struct error_table {
- char const * const * msgs;
- long base;
- int n_msgs;
-};
-struct et_list {
- struct et_list *next;
- const struct error_table *table;
-};
-extern struct et_list * _et_list;
-
-#define ERRCODE_RANGE 8 /* # of bits to shift table number */
-#define BITS_PER_CHAR 6 /* # bits to shift per character in name */
-
-const char *error_table_name(void);
-
-#endif /* PURPLE_ZEPHYR_ERROR_TABLE_H */
--- a/libpurple/protocols/zephyr/et_name.c Wed Nov 06 04:54:32 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright 1987 by MIT Student Information Processing Board
- *
- * For copyright info, see mit-sipb-copyright.h.
- */
-
-#include <sysdep.h>
-
-
-#define ERRCODE_RANGE 8 /* # of bits to shift table number */
-#define BITS_PER_CHAR 6 /* # bits to shift per character in name */
-
-
-static const char char_set[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
-
-/* Prototypes for -Wmissing-prototypes */
-const char * error_table_name(int num);
-const char * error_table_name_r(int num, char *buf);
-
-const char * error_table_name_r(int num, char *buf)
-{
- int ch;
- int i;
- char *p;
-
- /* num = aa aaa abb bbb bcc ccc cdd ddd d?? ??? ??? */
- p = buf;
- num >>= ERRCODE_RANGE;
- /* num = ?? ??? ??? aaa aaa bbb bbb ccc ccc ddd ddd */
- num &= 077777777;
- /* num = 00 000 000 aaa aaa bbb bbb ccc ccc ddd ddd */
- for (i = 4; i >= 0; i--) {
- ch = (num >> BITS_PER_CHAR * i) & ((1 << BITS_PER_CHAR) - 1);
- if (ch != 0)
- *p++ = char_set[ch-1];
- }
- *p = '\0';
- return(buf);
-}
-
-const char * error_table_name(int num)
-{
- static char buf[6];
-
- return(error_table_name_r(num, buf));
-}
-
--- a/libpurple/protocols/zephyr/init_et.c Wed Nov 06 04:54:32 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-/*
- * Copyright 1986, 1987, 1988 by MIT Information Systems and
- * the MIT Student Information Processing Board.
- *
- * For copyright info, see mit-sipb-copyright.h.
- */
-
-#include <sysdep.h>
-
-extern struct et_list * _et_list;
-
--- a/libpurple/protocols/zephyr/meson.build Wed Nov 06 04:54:32 2019 +0000
+++ b/libpurple/protocols/zephyr/meson.build Sun Nov 10 04:58:08 2019 -0500
@@ -44,16 +44,10 @@
'ZWait4Not.c',
'ZhmStat.c',
'Zinternal.c',
- 'com_err.h',
- 'error_message.c',
- 'error_table.h',
- 'et_name.c',
- 'init_et.c',
'internal.h',
'mit-copyright.h',
'mit-sipb-copyright.h',
'sysdep.h',
- 'zephyr_err.c',
'zephyr_err.h',
'zephyr_internal.h',
'zephyr.c',
--- a/libpurple/protocols/zephyr/sysdep.h Wed Nov 06 04:54:32 2019 +0000
+++ b/libpurple/protocols/zephyr/sysdep.h Sun Nov 10 04:58:08 2019 -0500
@@ -76,14 +76,8 @@
# include <krb.h>
# ifndef WIN32
# include <krb_err.h>
-# ifndef HAVE_KRB_GET_ERR_TEXT
-# define krb_get_err_text(n) krb_err_txt[n]
-# endif
# endif /* WIN32 */
# include <des.h>
-# ifndef HAVE_KRB_LOG
-# define krb_log log
-# endif
#endif /* ZEPHYR_USES_KERBEROS */
#ifdef HAVE_SYS_SELECT_H
--- a/libpurple/protocols/zephyr/zephyr_err.c Wed Nov 06 04:54:32 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-#include "zephyr_err.h"
-
-static const char * const text[] = {
- "Packet too long or buffer too small",
- "Notice header too large",
- "Illegal value in notice",
- "Can't get host manager port",
- "Can't assign port",
- "Bad packet format",
- "Incompatible version numbers",
- "No port opened",
- "No notices match criteria",
- "Input queue too long",
- "Hostmanager not responding",
- "Internal error",
- "No previous call to ZLocateUser",
- "No more locations available",
- "Field too long for buffer",
- "Improperly formatted field",
- "SERVNAK received",
- "Server could not verify authentication",
- "Not logged-in",
- "No previous call to ZRetrieveSubscriptions",
- "No more subscriptions available",
- "Too many subscriptions to transmit",
- "End of file detected during read",
- 0
-};
-
-struct error_table {
- char const * const * msgs;
- long base;
- int n_msgs;
-};
-struct et_list {
- struct et_list *next;
- const struct error_table * table;
-};
-extern struct et_list *_et_list;
-
-static const struct error_table et = { text, -772103680L, 23 };
-
-static struct et_list link = { 0, 0 };
-
-void
-initialize_zeph_error_table(void)
-{
- if (!link.table) {
- link.next = _et_list;
- link.table = &et;
- _et_list = &link;
- }
-}
--- a/libpurple/protocols/zephyr/zephyr_err.h Wed Nov 06 04:54:32 2019 +0000
+++ b/libpurple/protocols/zephyr/zephyr_err.h Sun Nov 10 04:58:08 2019 -0500
@@ -25,9 +25,4 @@
#define ZERR_NOMORESUBSCRIPTIONS (-772103660L)
#define ZERR_TOOMANYSUBS (-772103659L)
#define ZERR_EOF (-772103658L)
-void initialize_zeph_error_table (void);
#define ERROR_TABLE_BASE_zeph (-772103680L)
-
-/* for compatibility with older versions... */
-#define init_zeph_err_tbl initialize_zeph_error_table
-#define zeph_err_base ERROR_TABLE_BASE_zeph