diff options
author | René Schümann <white06tiger@gmail.com> | 2015-03-20 12:30:48 +0000 |
---|---|---|
committer | René Schümann <white06tiger@gmail.com> | 2015-03-20 12:30:48 +0000 |
commit | 90171f125f36488dc08f5cfe0b0d4b78d995f08d (patch) | |
tree | e65a38bd8ba391fc800cecc896379a7fb76a0608 /plugins/MirOTR/ekhtml/include | |
parent | 190307ca7aee92d6b862db0bf78cde10acfc95d0 (diff) |
MirOTR: updated ekhtml from 0.3.2 to 0.3.3-pre (Git 0092d9d), this fixes a memory leak and improves attribute parsing
git-svn-id: http://svn.miranda-ng.org/main/trunk@12448 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/ekhtml/include')
-rw-r--r-- | plugins/MirOTR/ekhtml/include/ekhtml.h | 9 | ||||
-rw-r--r-- | plugins/MirOTR/ekhtml/include/ekhtml_config.h | 80 | ||||
-rw-r--r-- | plugins/MirOTR/ekhtml/include/ekhtml_private.h | 2 | ||||
-rw-r--r-- | plugins/MirOTR/ekhtml/include/ekhtml_tables.h | 134 | ||||
-rw-r--r-- | plugins/MirOTR/ekhtml/include/hash.h | 31 |
5 files changed, 172 insertions, 84 deletions
diff --git a/plugins/MirOTR/ekhtml/include/ekhtml.h b/plugins/MirOTR/ekhtml/include/ekhtml.h index 1bed8eaa70..ba4b196649 100644 --- a/plugins/MirOTR/ekhtml/include/ekhtml.h +++ b/plugins/MirOTR/ekhtml/include/ekhtml.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Jon Travis + * Copyright (c) 2002-2004, Jon Travis * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,14 +57,15 @@ typedef struct ekhtml_string_t { * When ekhtml parses tags containing key/value attributes, it will pass * this structure representing those values into the callbacks. Note, for * speed reasons, things such as the 'name' and 'value' fields are not - * terminated with '\0', and therefore have an associated length - * field (namelen, vallen). + * terminated with '\0', the length is in name->len, and val->len */ typedef struct ekhtml_attr_t { ekhtml_string_t name; /**< Name of the attribute */ ekhtml_string_t val; /**< Value of the attribute */ - unsigned int isBoolean; /**< True of the attribute is boolean */ + unsigned int isBoolean; /**< True if the attribute is boolean */ + char quoteChar; /**< The character used to quote 'val'. + If no quoting was used, '\0' */ struct ekhtml_attr_t *next; /**< Pointer to next attribute in the list */ } ekhtml_attr_t; diff --git a/plugins/MirOTR/ekhtml/include/ekhtml_config.h b/plugins/MirOTR/ekhtml/include/ekhtml_config.h index 5ee8a65feb..775b8cb2f2 100644 --- a/plugins/MirOTR/ekhtml/include/ekhtml_config.h +++ b/plugins/MirOTR/ekhtml/include/ekhtml_config.h @@ -1,5 +1,5 @@ -/* include/ekhtml_config.h. Generated automatically by configure. */ -/* config.in. Generated automatically from configure.in by autoheader. */ +/* include/ekhtml_config.h. Generated from config.in by configure. */ +/* config.in. Generated from configure.in by autoheader. */ /* local_template.h This file is in the public domain. @@ -16,7 +16,8 @@ Leave the following blank line there!! Autoheader needs it. */ -#define EKHTML_VER_BUGFIX 2 +#define EKHTML_HASH_BITS 32 +#define EKHTML_VER_BUGFIX 3 #define EKHTML_VER_MAJOR 0 #define EKHTML_VER_MINOR 3 @@ -26,17 +27,80 @@ The entries are in sort -df order: alphabetical, case insensitive, ignoring punctuation (such as underscores). */ -/* Define if you have the <dlfcn.h> header file. */ +/* Define to 1 if you have the <dlfcn.h> header file. */ /* #undef HAVE_DLFCN_H */ +/* Define to 1 if you have the <inttypes.h> header file. */ +/* #undef HAVE_INTTYPES_H */ + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the <strings.h> header file. */ +/* #undef HAVE_STRINGS_H */ + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + /* Name of package */ #define PACKAGE "ekhtml" +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + /* Version number of package */ -#define VERSION "0.3.2" +#define VERSION "0.3.3" +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus #define inline __inline +#endif -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -/* #undef inline */ +/* Miranda NG modifications */ +#define GPGRT_ENABLE_ES_MACROS 1 +#include <string.h> +#define strdup _strdup +#define stricmp _stricmp +#define snprintf _snprintf +#ifdef _WIN64 +# define __x86_64__ 1 +#else +# define __i386__ 1 +#endif diff --git a/plugins/MirOTR/ekhtml/include/ekhtml_private.h b/plugins/MirOTR/ekhtml/include/ekhtml_private.h index 47d31282fa..ea0a99dc34 100644 --- a/plugins/MirOTR/ekhtml/include/ekhtml_private.h +++ b/plugins/MirOTR/ekhtml/include/ekhtml_private.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Jon Travis + * Copyright (c) 2002-2004, Jon Travis * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/MirOTR/ekhtml/include/ekhtml_tables.h b/plugins/MirOTR/ekhtml/include/ekhtml_tables.h index 58f89a2219..4c185703e1 100644 --- a/plugins/MirOTR/ekhtml/include/ekhtml_tables.h +++ b/plugins/MirOTR/ekhtml/include/ekhtml_tables.h @@ -13,10 +13,10 @@ const unsigned int EKCMap_CharMap[256] = { 0x00000002 /* 0x20 */, 0x00000010 /* '!' */, 0x00000000 /* '"' */, 0x00000010 /* '#' */,
0x00000010 /* '$' */, 0x00000010 /* '%' */, 0x00000010 /* '&' */, 0x00000000 /* ''' */,
0x00000010 /* '(' */, 0x00000010 /* ')' */, 0x00000010 /* '*' */, 0x00000010 /* '+' */,
-0x00000000 /* ',' */, 0x00000019 /* '-' */, 0x00000019 /* '.' */, 0x00000010 /* '/' */,
+0x00000010 /* ',' */, 0x00000019 /* '-' */, 0x00000019 /* '.' */, 0x00000010 /* '/' */,
0x00000019 /* '0' */, 0x00000019 /* '1' */, 0x00000019 /* '2' */, 0x00000019 /* '3' */,
0x00000019 /* '4' */, 0x00000019 /* '5' */, 0x00000019 /* '6' */, 0x00000019 /* '7' */,
-0x00000019 /* '8' */, 0x00000019 /* '9' */, 0x00000010 /* ':' */, 0x00000000 /* ';' */,
+0x00000019 /* '8' */, 0x00000019 /* '9' */, 0x00000010 /* ':' */, 0x00000010 /* ';' */,
0x00000000 /* '<' */, 0x00000010 /* '=' */, 0x00000000 /* '>' */, 0x00000010 /* '?' */,
0x00000010 /* '@' */, 0x0000001d /* 'A' */, 0x0000001d /* 'B' */, 0x0000001d /* 'C' */,
0x0000001d /* 'D' */, 0x0000001d /* 'E' */, 0x0000001d /* 'F' */, 0x0000001d /* 'G' */,
@@ -33,39 +33,39 @@ const unsigned int EKCMap_CharMap[256] = { 0x0000001d /* 'p' */, 0x0000001d /* 'q' */, 0x0000001d /* 'r' */, 0x0000001d /* 's' */,
0x0000001d /* 't' */, 0x0000001d /* 'u' */, 0x0000001d /* 'v' */, 0x0000001d /* 'w' */,
0x0000001d /* 'x' */, 0x0000001d /* 'y' */, 0x0000001d /* 'z' */, 0x00000000 /* '{' */,
-0x00000000 /* '|' */, 0x00000000 /* '}' */, 0x00000010 /* '~' */, 0x00000000 /* 0x7f */,
-0x00000000 /* 0x80 */, 0x00000000 /* 0x81 */, 0x00000000 /* 0x82 */, 0x0000001f /* 0x83 */,
-0x0000001f /* 0x84 */, 0x00000000 /* 0x85 */, 0x00000000 /* 0x86 */, 0x0000001f /* 0x87 */,
-0x0000001d /* 0x88 */, 0x00000000 /* 0x89 */, 0x00000000 /* 0x8a */, 0x0000001f /* 0x8b */,
-0x0000001f /* 0x8c */, 0x0000001f /* 0x8d */, 0x0000001d /* 0x8e */, 0x0000001d /* 0x8f */,
-0x0000001d /* 0x90 */, 0x0000001f /* 0x91 */, 0x0000001f /* 0x92 */, 0x0000001f /* 0x93 */,
-0x0000001d /* 0x94 */, 0x0000001f /* 0x95 */, 0x0000001d /* 0x96 */, 0x0000001f /* 0x97 */,
-0x0000001f /* 0x98 */, 0x0000001f /* 0x99 */, 0x0000001d /* 0x9a */, 0x0000001d /* 0x9b */,
-0x0000001d /* 0x9c */, 0x0000001f /* 0x9d */, 0x0000001f /* 0x9e */, 0x0000001f /* 0x9f */,
-0x0000001d /* 0xa0 */, 0x0000001f /* 0xa1 */, 0x0000001d /* 0xa2 */, 0x0000001f /* 0xa3 */,
-0x0000001f /* 0xa4 */, 0x0000001d /* 0xa5 */, 0x0000001d /* 0xa6 */, 0x0000001f /* 0xa7 */,
-0x0000001d /* 0xa8 */, 0x00000000 /* 0xa9 */, 0x00000000 /* 0xaa */, 0x0000001f /* 0xab */,
-0x0000001f /* 0xac */, 0x0000001d /* 0xad */, 0x0000001d /* 0xae */, 0x0000001d /* 0xaf */,
-0x0000001d /* 0xb0 */, 0x0000001f /* 0xb1 */, 0x0000001f /* 0xb2 */, 0x0000001d /* 0xb3 */,
-0x0000001d /* 0xb4 */, 0x0000001f /* 0xb5 */, 0x0000001d /* 0xb6 */, 0x0000001f /* 0xb7 */,
-0x0000001f /* 0xb8 */, 0x0000001f /* 0xb9 */, 0x0000001d /* 0xba */, 0x0000001f /* 0xbb */,
-0x0000001d /* 0xbc */, 0x0000001f /* 0xbd */, 0x0000001f /* 0xbe */, 0x0000001b /* 0xbf */,
-0x0000001d /* 0xc0 */, 0x00000000 /* 0xc1 */, 0x0000001d /* 0xc2 */, 0x0000001f /* 0xc3 */,
-0x0000001f /* 0xc4 */, 0x0000001f /* 0xc5 */, 0x0000001d /* 0xc6 */, 0x0000001f /* 0xc7 */,
-0x0000001d /* 0xc8 */, 0x00000000 /* 0xc9 */, 0x00000000 /* 0xca */, 0x0000001f /* 0xcb */,
-0x0000001f /* 0xcc */, 0x0000001f /* 0xcd */, 0x0000001d /* 0xce */, 0x00000000 /* 0xcf */,
-0x0000001d /* 0xd0 */, 0x0000001f /* 0xd1 */, 0x0000001f /* 0xd2 */, 0x0000001f /* 0xd3 */,
-0x0000001d /* 0xd4 */, 0x0000001f /* 0xd5 */, 0x0000001d /* 0xd6 */, 0x0000001f /* 0xd7 */,
-0x0000001f /* 0xd8 */, 0x00000000 /* 0xd9 */, 0x00000000 /* 0xda */, 0x0000001f /* 0xdb */,
-0x0000001d /* 0xdc */, 0x00000000 /* 0xdd */, 0x00000000 /* 0xde */, 0x0000001f /* 0xdf */,
-0x0000001f /* 0xe0 */, 0x00000000 /* 0xe1 */, 0x00000000 /* 0xe2 */, 0x0000001d /* 0xe3 */,
-0x0000001d /* 0xe4 */, 0x00000000 /* 0xe5 */, 0x00000000 /* 0xe6 */, 0x0000001f /* 0xe7 */,
-0x0000001f /* 0xe8 */, 0x00000000 /* 0xe9 */, 0x00000000 /* 0xea */, 0x0000001f /* 0xeb */,
-0x0000001d /* 0xec */, 0x00000000 /* 0xed */, 0x00000000 /* 0xee */, 0x0000001f /* 0xef */,
-0x0000001f /* 0xf0 */, 0x00000000 /* 0xf1 */, 0x00000000 /* 0xf2 */, 0x0000001f /* 0xf3 */,
-0x0000001d /* 0xf4 */, 0x00000000 /* 0xf5 */, 0x00000000 /* 0xf6 */, 0x0000001f /* 0xf7 */,
-0x0000001f /* 0xf8 */, 0x00000000 /* 0xf9 */, 0x00000000 /* 0xfa */, 0x00000000 /* 0xfb */,
-0x0000001d /* 0xfc */, 0x00000000 /* 0xfd */, 0x00000000 /* 0xfe */, 0x00000000 /* 0xff */,
+0x00000010 /* '|' */, 0x00000000 /* '}' */, 0x00000010 /* '~' */, 0x00000000 /* 0x7f */,
+0x00000000 /* 0x80 */, 0x00000000 /* 0x81 */, 0x00000000 /* 0x82 */, 0x00000000 /* 0x83 */,
+0x00000000 /* 0x84 */, 0x00000000 /* 0x85 */, 0x00000000 /* 0x86 */, 0x00000000 /* 0x87 */,
+0x00000000 /* 0x88 */, 0x00000000 /* 0x89 */, 0x00000000 /* 0x8a */, 0x00000000 /* 0x8b */,
+0x00000000 /* 0x8c */, 0x00000000 /* 0x8d */, 0x00000000 /* 0x8e */, 0x00000000 /* 0x8f */,
+0x00000000 /* 0x90 */, 0x00000000 /* 0x91 */, 0x00000000 /* 0x92 */, 0x00000000 /* 0x93 */,
+0x00000000 /* 0x94 */, 0x00000000 /* 0x95 */, 0x00000000 /* 0x96 */, 0x00000000 /* 0x97 */,
+0x00000000 /* 0x98 */, 0x00000000 /* 0x99 */, 0x00000000 /* 0x9a */, 0x00000000 /* 0x9b */,
+0x00000000 /* 0x9c */, 0x00000000 /* 0x9d */, 0x00000000 /* 0x9e */, 0x00000000 /* 0x9f */,
+0x00000000 /* 0xa0 */, 0x00000000 /* 0xa1 */, 0x00000000 /* 0xa2 */, 0x00000000 /* 0xa3 */,
+0x00000000 /* 0xa4 */, 0x00000000 /* 0xa5 */, 0x00000000 /* 0xa6 */, 0x00000000 /* 0xa7 */,
+0x00000000 /* 0xa8 */, 0x00000000 /* 0xa9 */, 0x00000000 /* 0xaa */, 0x00000000 /* 0xab */,
+0x00000000 /* 0xac */, 0x00000000 /* 0xad */, 0x00000000 /* 0xae */, 0x00000000 /* 0xaf */,
+0x00000000 /* 0xb0 */, 0x00000000 /* 0xb1 */, 0x00000000 /* 0xb2 */, 0x00000000 /* 0xb3 */,
+0x00000000 /* 0xb4 */, 0x00000000 /* 0xb5 */, 0x00000000 /* 0xb6 */, 0x00000000 /* 0xb7 */,
+0x00000000 /* 0xb8 */, 0x00000000 /* 0xb9 */, 0x00000000 /* 0xba */, 0x00000000 /* 0xbb */,
+0x00000000 /* 0xbc */, 0x00000000 /* 0xbd */, 0x00000000 /* 0xbe */, 0x00000000 /* 0xbf */,
+0x00000000 /* 0xc0 */, 0x00000000 /* 0xc1 */, 0x00000000 /* 0xc2 */, 0x00000000 /* 0xc3 */,
+0x00000000 /* 0xc4 */, 0x00000000 /* 0xc5 */, 0x00000000 /* 0xc6 */, 0x00000000 /* 0xc7 */,
+0x00000000 /* 0xc8 */, 0x00000000 /* 0xc9 */, 0x00000000 /* 0xca */, 0x00000000 /* 0xcb */,
+0x00000000 /* 0xcc */, 0x00000000 /* 0xcd */, 0x00000000 /* 0xce */, 0x00000000 /* 0xcf */,
+0x00000000 /* 0xd0 */, 0x00000000 /* 0xd1 */, 0x00000000 /* 0xd2 */, 0x00000000 /* 0xd3 */,
+0x00000000 /* 0xd4 */, 0x00000000 /* 0xd5 */, 0x00000000 /* 0xd6 */, 0x00000000 /* 0xd7 */,
+0x00000000 /* 0xd8 */, 0x00000000 /* 0xd9 */, 0x00000000 /* 0xda */, 0x00000000 /* 0xdb */,
+0x00000000 /* 0xdc */, 0x00000000 /* 0xdd */, 0x00000000 /* 0xde */, 0x00000000 /* 0xdf */,
+0x00000000 /* 0xe0 */, 0x00000000 /* 0xe1 */, 0x00000000 /* 0xe2 */, 0x00000000 /* 0xe3 */,
+0x00000000 /* 0xe4 */, 0x00000000 /* 0xe5 */, 0x00000000 /* 0xe6 */, 0x00000000 /* 0xe7 */,
+0x00000000 /* 0xe8 */, 0x00000000 /* 0xe9 */, 0x00000000 /* 0xea */, 0x00000000 /* 0xeb */,
+0x00000000 /* 0xec */, 0x00000000 /* 0xed */, 0x00000000 /* 0xee */, 0x00000000 /* 0xef */,
+0x00000000 /* 0xf0 */, 0x00000000 /* 0xf1 */, 0x00000000 /* 0xf2 */, 0x00000000 /* 0xf3 */,
+0x00000000 /* 0xf4 */, 0x00000000 /* 0xf5 */, 0x00000000 /* 0xf6 */, 0x00000000 /* 0xf7 */,
+0x00000000 /* 0xf8 */, 0x00000000 /* 0xf9 */, 0x00000000 /* 0xfa */, 0x00000000 /* 0xfb */,
+0x00000000 /* 0xfc */, 0x00000000 /* 0xfd */, 0x00000000 /* 0xfe */, 0x00000000 /* 0xff */,
};
#else
@@ -105,38 +105,38 @@ const unsigned int EKCMap_EKState[256] = { 0x00000003 /* 't' */, 0x00000003 /* 'u' */, 0x00000003 /* 'v' */, 0x00000003 /* 'w' */,
0x00000003 /* 'x' */, 0x00000003 /* 'y' */, 0x00000003 /* 'z' */, 0x00000002 /* '{' */,
0x00000002 /* '|' */, 0x00000002 /* '}' */, 0x00000002 /* '~' */, 0x00000002 /* 0x7f */,
-0x00000002 /* 0x80 */, 0x00000002 /* 0x81 */, 0x00000002 /* 0x82 */, 0x00000003 /* 0x83 */,
-0x00000003 /* 0x84 */, 0x00000002 /* 0x85 */, 0x00000002 /* 0x86 */, 0x00000003 /* 0x87 */,
-0x00000003 /* 0x88 */, 0x00000002 /* 0x89 */, 0x00000002 /* 0x8a */, 0x00000003 /* 0x8b */,
-0x00000003 /* 0x8c */, 0x00000003 /* 0x8d */, 0x00000003 /* 0x8e */, 0x00000003 /* 0x8f */,
-0x00000003 /* 0x90 */, 0x00000003 /* 0x91 */, 0x00000003 /* 0x92 */, 0x00000003 /* 0x93 */,
-0x00000003 /* 0x94 */, 0x00000003 /* 0x95 */, 0x00000003 /* 0x96 */, 0x00000003 /* 0x97 */,
-0x00000003 /* 0x98 */, 0x00000003 /* 0x99 */, 0x00000003 /* 0x9a */, 0x00000003 /* 0x9b */,
-0x00000003 /* 0x9c */, 0x00000003 /* 0x9d */, 0x00000003 /* 0x9e */, 0x00000003 /* 0x9f */,
-0x00000003 /* 0xa0 */, 0x00000003 /* 0xa1 */, 0x00000003 /* 0xa2 */, 0x00000003 /* 0xa3 */,
-0x00000003 /* 0xa4 */, 0x00000003 /* 0xa5 */, 0x00000003 /* 0xa6 */, 0x00000003 /* 0xa7 */,
-0x00000003 /* 0xa8 */, 0x00000002 /* 0xa9 */, 0x00000002 /* 0xaa */, 0x00000003 /* 0xab */,
-0x00000003 /* 0xac */, 0x00000003 /* 0xad */, 0x00000003 /* 0xae */, 0x00000003 /* 0xaf */,
-0x00000003 /* 0xb0 */, 0x00000003 /* 0xb1 */, 0x00000003 /* 0xb2 */, 0x00000003 /* 0xb3 */,
-0x00000003 /* 0xb4 */, 0x00000003 /* 0xb5 */, 0x00000003 /* 0xb6 */, 0x00000003 /* 0xb7 */,
-0x00000003 /* 0xb8 */, 0x00000003 /* 0xb9 */, 0x00000003 /* 0xba */, 0x00000003 /* 0xbb */,
-0x00000003 /* 0xbc */, 0x00000003 /* 0xbd */, 0x00000003 /* 0xbe */, 0x00000002 /* 0xbf */,
-0x00000003 /* 0xc0 */, 0x00000002 /* 0xc1 */, 0x00000003 /* 0xc2 */, 0x00000003 /* 0xc3 */,
-0x00000003 /* 0xc4 */, 0x00000003 /* 0xc5 */, 0x00000003 /* 0xc6 */, 0x00000003 /* 0xc7 */,
-0x00000003 /* 0xc8 */, 0x00000002 /* 0xc9 */, 0x00000002 /* 0xca */, 0x00000003 /* 0xcb */,
-0x00000003 /* 0xcc */, 0x00000003 /* 0xcd */, 0x00000003 /* 0xce */, 0x00000002 /* 0xcf */,
-0x00000003 /* 0xd0 */, 0x00000003 /* 0xd1 */, 0x00000003 /* 0xd2 */, 0x00000003 /* 0xd3 */,
-0x00000003 /* 0xd4 */, 0x00000003 /* 0xd5 */, 0x00000003 /* 0xd6 */, 0x00000003 /* 0xd7 */,
-0x00000003 /* 0xd8 */, 0x00000002 /* 0xd9 */, 0x00000002 /* 0xda */, 0x00000003 /* 0xdb */,
-0x00000003 /* 0xdc */, 0x00000002 /* 0xdd */, 0x00000002 /* 0xde */, 0x00000003 /* 0xdf */,
-0x00000003 /* 0xe0 */, 0x00000002 /* 0xe1 */, 0x00000002 /* 0xe2 */, 0x00000003 /* 0xe3 */,
-0x00000003 /* 0xe4 */, 0x00000002 /* 0xe5 */, 0x00000002 /* 0xe6 */, 0x00000003 /* 0xe7 */,
-0x00000003 /* 0xe8 */, 0x00000002 /* 0xe9 */, 0x00000002 /* 0xea */, 0x00000003 /* 0xeb */,
-0x00000003 /* 0xec */, 0x00000002 /* 0xed */, 0x00000002 /* 0xee */, 0x00000003 /* 0xef */,
-0x00000003 /* 0xf0 */, 0x00000002 /* 0xf1 */, 0x00000002 /* 0xf2 */, 0x00000003 /* 0xf3 */,
-0x00000003 /* 0xf4 */, 0x00000002 /* 0xf5 */, 0x00000002 /* 0xf6 */, 0x00000003 /* 0xf7 */,
-0x00000003 /* 0xf8 */, 0x00000002 /* 0xf9 */, 0x00000002 /* 0xfa */, 0x00000002 /* 0xfb */,
-0x00000003 /* 0xfc */, 0x00000002 /* 0xfd */, 0x00000002 /* 0xfe */, 0x00000002 /* 0xff */,
+0x00000002 /* 0x80 */, 0x00000002 /* 0x81 */, 0x00000002 /* 0x82 */, 0x00000002 /* 0x83 */,
+0x00000002 /* 0x84 */, 0x00000002 /* 0x85 */, 0x00000002 /* 0x86 */, 0x00000002 /* 0x87 */,
+0x00000002 /* 0x88 */, 0x00000002 /* 0x89 */, 0x00000002 /* 0x8a */, 0x00000002 /* 0x8b */,
+0x00000002 /* 0x8c */, 0x00000002 /* 0x8d */, 0x00000002 /* 0x8e */, 0x00000002 /* 0x8f */,
+0x00000002 /* 0x90 */, 0x00000002 /* 0x91 */, 0x00000002 /* 0x92 */, 0x00000002 /* 0x93 */,
+0x00000002 /* 0x94 */, 0x00000002 /* 0x95 */, 0x00000002 /* 0x96 */, 0x00000002 /* 0x97 */,
+0x00000002 /* 0x98 */, 0x00000002 /* 0x99 */, 0x00000002 /* 0x9a */, 0x00000002 /* 0x9b */,
+0x00000002 /* 0x9c */, 0x00000002 /* 0x9d */, 0x00000002 /* 0x9e */, 0x00000002 /* 0x9f */,
+0x00000002 /* 0xa0 */, 0x00000002 /* 0xa1 */, 0x00000002 /* 0xa2 */, 0x00000002 /* 0xa3 */,
+0x00000002 /* 0xa4 */, 0x00000002 /* 0xa5 */, 0x00000002 /* 0xa6 */, 0x00000002 /* 0xa7 */,
+0x00000002 /* 0xa8 */, 0x00000002 /* 0xa9 */, 0x00000002 /* 0xaa */, 0x00000002 /* 0xab */,
+0x00000002 /* 0xac */, 0x00000002 /* 0xad */, 0x00000002 /* 0xae */, 0x00000002 /* 0xaf */,
+0x00000002 /* 0xb0 */, 0x00000002 /* 0xb1 */, 0x00000002 /* 0xb2 */, 0x00000002 /* 0xb3 */,
+0x00000002 /* 0xb4 */, 0x00000002 /* 0xb5 */, 0x00000002 /* 0xb6 */, 0x00000002 /* 0xb7 */,
+0x00000002 /* 0xb8 */, 0x00000002 /* 0xb9 */, 0x00000002 /* 0xba */, 0x00000002 /* 0xbb */,
+0x00000002 /* 0xbc */, 0x00000002 /* 0xbd */, 0x00000002 /* 0xbe */, 0x00000002 /* 0xbf */,
+0x00000002 /* 0xc0 */, 0x00000002 /* 0xc1 */, 0x00000002 /* 0xc2 */, 0x00000002 /* 0xc3 */,
+0x00000002 /* 0xc4 */, 0x00000002 /* 0xc5 */, 0x00000002 /* 0xc6 */, 0x00000002 /* 0xc7 */,
+0x00000002 /* 0xc8 */, 0x00000002 /* 0xc9 */, 0x00000002 /* 0xca */, 0x00000002 /* 0xcb */,
+0x00000002 /* 0xcc */, 0x00000002 /* 0xcd */, 0x00000002 /* 0xce */, 0x00000002 /* 0xcf */,
+0x00000002 /* 0xd0 */, 0x00000002 /* 0xd1 */, 0x00000002 /* 0xd2 */, 0x00000002 /* 0xd3 */,
+0x00000002 /* 0xd4 */, 0x00000002 /* 0xd5 */, 0x00000002 /* 0xd6 */, 0x00000002 /* 0xd7 */,
+0x00000002 /* 0xd8 */, 0x00000002 /* 0xd9 */, 0x00000002 /* 0xda */, 0x00000002 /* 0xdb */,
+0x00000002 /* 0xdc */, 0x00000002 /* 0xdd */, 0x00000002 /* 0xde */, 0x00000002 /* 0xdf */,
+0x00000002 /* 0xe0 */, 0x00000002 /* 0xe1 */, 0x00000002 /* 0xe2 */, 0x00000002 /* 0xe3 */,
+0x00000002 /* 0xe4 */, 0x00000002 /* 0xe5 */, 0x00000002 /* 0xe6 */, 0x00000002 /* 0xe7 */,
+0x00000002 /* 0xe8 */, 0x00000002 /* 0xe9 */, 0x00000002 /* 0xea */, 0x00000002 /* 0xeb */,
+0x00000002 /* 0xec */, 0x00000002 /* 0xed */, 0x00000002 /* 0xee */, 0x00000002 /* 0xef */,
+0x00000002 /* 0xf0 */, 0x00000002 /* 0xf1 */, 0x00000002 /* 0xf2 */, 0x00000002 /* 0xf3 */,
+0x00000002 /* 0xf4 */, 0x00000002 /* 0xf5 */, 0x00000002 /* 0xf6 */, 0x00000002 /* 0xf7 */,
+0x00000002 /* 0xf8 */, 0x00000002 /* 0xf9 */, 0x00000002 /* 0xfa */, 0x00000002 /* 0xfb */,
+0x00000002 /* 0xfc */, 0x00000002 /* 0xfd */, 0x00000002 /* 0xfe */, 0x00000002 /* 0xff */,
};
#else
diff --git a/plugins/MirOTR/ekhtml/include/hash.h b/plugins/MirOTR/ekhtml/include/hash.h index ddb3869477..5b6333e264 100644 --- a/plugins/MirOTR/ekhtml/include/hash.h +++ b/plugins/MirOTR/ekhtml/include/hash.h @@ -14,8 +14,6 @@ * into proprietary software; there is no requirement for such software to * contain a copyright notice related to this source. * - * $Id: hash.h,v 1.1 2002/09/17 02:49:36 jick Exp $ - * $Name: EKHTML_RELEASE_0_3_2 $ */ #ifndef HASH_H @@ -40,8 +38,6 @@ typedef unsigned long hashcount_t; typedef unsigned long hash_val_t; #define HASH_VAL_T_MAX ULONG_MAX -extern int hash_val_t_bit; - #ifndef HASH_VAL_T_BIT #define HASH_VAL_T_BIT ((int) hash_val_t_bit) #endif @@ -233,6 +229,33 @@ extern void hnode_destroy(hnode_t *); #define hnode_put(N, V) ((N)->hash_data = (V)) #endif +/* + * Compute the number of bits in the hash_val_t type. We know that hash_val_t + * is an unsigned integral type. Thus the highest value it can hold is a + * Mersenne number (power of two, less one). We initialize a hash_val_t + * object with this value and then shift bits out one by one while counting. + * Notes: + * 1. HASH_VAL_T_MAX is a Mersenne number---one that is one less than a power + * of two. This means that its binary representation consists of all one + * bits, and hence ``val'' is initialized to all one bits. + * 2. While bits remain in val, we increment the bit count and shift it to the + * right, replacing the topmost bit by zero. + */ + +static int compute_bits(void) +{ + hash_val_t val = HASH_VAL_T_MAX; /* 1 */ + int bits = 0; + + while (val) { /* 2 */ + bits++; + val >>= 1; + } + + return bits; +} + + #ifdef __cplusplus } #endif |