]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] deprecate isc_bitsrting
authorEvan Hunt <each@isc.org>
Thu, 6 Feb 2014 23:36:13 +0000 (15:36 -0800)
committerEvan Hunt <each@isc.org>
Thu, 6 Feb 2014 23:36:13 +0000 (15:36 -0800)
3727. [func] The isc_bitstring API is no longer used and
has been removed from libisc. [RT #35284]

CHANGES
lib/isc/Makefile.in
lib/isc/bitstring.c [deleted file]
lib/isc/include/isc/Makefile.in
lib/isc/include/isc/bitstring.h [deleted file]
lib/isc/include/isc/types.h
lib/isc/win32/libisc.def.in
lib/isc/win32/libisc.dsp.in
lib/isc/win32/libisc.mak.in
lib/isc/win32/libisc.vcxproj.filters.in
lib/isc/win32/libisc.vcxproj.in

diff --git a/CHANGES b/CHANGES
index cbe306ce69ad05708a7f4f7a6a8e80fcefe4a096..9546f0c6dd4772e9a1a6dde7018bc98910b657ca 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3727.  [func]          The isc_bitstring API is no longer used and
+                       has been removed from libisc. [RT #35284]
+
 3726.  [cleanup]       Clarified the error message when attempting
                        to configure more than 32 response-policy zones.
                        [RT #35283]
index 254ae67d3b73893750c0ec9ca59dfcadff18902b..32dd26635514ee529e3600fd768c57b1cea7143a 100644 (file)
@@ -54,7 +54,7 @@ WIN32OBJS =   win32/condition.@O@ win32/dir.@O@ win32/file.@O@ \
 # Alphabetically
 OBJS =         @ISC_EXTRA_OBJS@ \
                assertions.@O@ backtrace.@O@ base32.@O@ base64.@O@ \
-               bind9.@O@ bitstring.@O@ buffer.@O@ bufferlist.@O@ \
+               bind9.@O@ buffer.@O@ bufferlist.@O@ \
                commandline.@O@ crc64.@O@ error.@O@ event.@O@ \
                hash.@O@ heap.@O@ hex.@O@ hmacmd5.@O@ hmacsha.@O@ \
                httpd.@O@ inet_aton.@O@ iterated_hash.@O@ \
@@ -73,7 +73,7 @@ SYMTBLOBJS =  backtrace-emptytbl.@O@
 # Alphabetically
 SRCS =         @ISC_EXTRA_SRCS@ \
                assertions.c backtrace.c base32.c base64.c bind9.c \
-               bitstring.c buffer.c bufferlist.c commandline.c crc64.c \
+               buffer.c bufferlist.c commandline.c crc64.c \
                error.c event.c heap.c hex.c hmacmd5.c hmacsha.c \
                httpd.c inet_aton.c iterated_hash.c \
                lex.c lfsr.c lib.c log.c \
diff --git a/lib/isc/bitstring.c b/lib/isc/bitstring.c
deleted file mode 100644 (file)
index 33c7c1f..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2004, 2005, 2007  Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001  Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: bitstring.c,v 1.17 2007/06/19 23:47:17 tbox Exp $ */
-
-/*! \file */
-
-#include <config.h>
-
-#include <stddef.h>
-
-#include <isc/magic.h>
-#include <isc/bitstring.h>
-#include <isc/util.h>
-
-#define DIV8(x)                        ((x) >> 3)
-#define MOD8(x)                        ((x) & 0x00000007U)
-#define OCTETS(n)              (((n) + 7) >> 3)
-#define PADDED(n)              ((((n) + 7) >> 3) << 3)
-#define BITSET(bs, n)          (((bs)->data[DIV8(n)] & \
-                                (1 << (7 - MOD8(n)))) != 0)
-#define SETBIT(bs, n)          (bs)->data[DIV8(n)] |= (1 << (7 - MOD8(n)))
-#define CLEARBIT(bs, n)                (bs)->data[DIV8(n)] &= ~(1 << (7 - MOD8(n)))
-
-#define BITSTRING_MAGIC                ISC_MAGIC('B', 'S', 't', 'r')
-#define VALID_BITSTRING(b)     ISC_MAGIC_VALID(b, BITSTRING_MAGIC)
-
-void
-isc_bitstring_init(isc_bitstring_t *bitstring, unsigned char *data,
-                  unsigned int length, unsigned int size, isc_boolean_t lsb0)
-{
-       /*
-        * Make 'bitstring' refer to the bitstring of 'size' bits starting
-        * at 'data'.  'length' bits of the bitstring are valid.  If 'lsb0'
-        * is set then, bit 0 refers to the least significant bit of the
-        * bitstring.  Otherwise bit 0 is the most significant bit.
-        */
-
-       REQUIRE(bitstring != NULL);
-       REQUIRE(data != NULL);
-       REQUIRE(length <= size);
-
-       bitstring->magic = BITSTRING_MAGIC;
-       bitstring->data = data;
-       bitstring->length = length;
-       bitstring->size = size;
-       bitstring->lsb0 = lsb0;
-}
-
-void
-isc_bitstring_invalidate(isc_bitstring_t *bitstring) {
-
-       /*
-        * Invalidate 'bitstring'.
-        */
-
-       REQUIRE(VALID_BITSTRING(bitstring));
-
-       bitstring->magic = 0;
-       bitstring->data = NULL;
-       bitstring->length = 0;
-       bitstring->size = 0;
-       bitstring->lsb0 = ISC_FALSE;
-}
-
-void
-isc_bitstring_copy(isc_bitstring_t *source, unsigned int sbitpos,
-                  isc_bitstring_t *target, unsigned int tbitpos,
-                  unsigned int n)
-{
-       unsigned int tlast;
-
-       /*
-        * Starting at bit 'sbitpos', copy 'n' bits from 'source' to
-        * the 'n' bits of 'target' starting at 'tbitpos'.
-        */
-
-       REQUIRE(VALID_BITSTRING(source));
-       REQUIRE(VALID_BITSTRING(target));
-       REQUIRE(source->lsb0 == target->lsb0);
-       if (source->lsb0) {
-               REQUIRE(sbitpos <= source->length);
-               sbitpos = PADDED(source->size) - sbitpos;
-               REQUIRE(sbitpos >= n);
-               sbitpos -= n;
-       } else
-               REQUIRE(sbitpos + n <= source->length);
-       tlast = tbitpos + n;
-       if (target->lsb0) {
-               REQUIRE(tbitpos <= target->length);
-               tbitpos = PADDED(target->size) - tbitpos;
-               REQUIRE(tbitpos >= n);
-               tbitpos -= n;
-       } else
-               REQUIRE(tlast <= target->size);
-
-       if (tlast > target->length)
-               target->length = tlast;
-
-       /*
-        * This is far from optimal...
-        */
-
-       while (n > 0) {
-               if (BITSET(source, sbitpos))
-                       SETBIT(target, tbitpos);
-               else
-                       CLEARBIT(target, tbitpos);
-               sbitpos++;
-               tbitpos++;
-               n--;
-       }
-}
index f8ea3b651190c196ea0b59f7285256a1b79aacba..bc99bd1ac467d9780b1f3003bc8bb6e092bd2246 100644 (file)
@@ -26,8 +26,8 @@ top_srcdir =  @top_srcdir@
 # machine generated.  The latter are handled specially in the
 # install target below.
 #
-HEADERS =      app.h assertions.h base64.h bind9.h bitstring.h boolean.h \
-               buffer.h bufferlist.h commandline.h entropy.h error.h event.h \
+HEADERS =      app.h assertions.h base64.h bind9.h boolean.h buffer.h \
+               bufferlist.h commandline.h entropy.h error.h event.h \
                eventclass.h file.h formatcheck.h fsaccess.h \
                hash.h heap.h hex.h hmacmd5.h hmacsha.h \
                httpd.h \
diff --git a/lib/isc/include/isc/bitstring.h b/lib/isc/include/isc/bitstring.h
deleted file mode 100644 (file)
index 252d111..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1999-2001  Internet Software Consortium.
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* $Id: bitstring.h,v 1.14 2007/06/19 23:47:18 tbox Exp $ */
-
-#ifndef ISC_BITSTRING_H
-#define ISC_BITSTRING_H 1
-
-/*****
- ***** Module Info
- *****/
-
-/*! \file isc/bitstring.h
- *
- * \brief Bitstring manipulation functions.
- *
- * A bitstring is a packed array of bits, stored in a contiguous
- * sequence of octets.  The "most significant bit" (msb) of a bitstring
- * is the high bit of the first octet.  The "least significant bit" of a
- * bitstring is the low bit of the last octet.
- *
- * Two bit numbering schemes are supported, "msb0" and "lsb0".
- *
- * In the "msb0" scheme, bit number 0 designates the most significant bit,
- * and any padding bits required to make the bitstring a multiple of 8 bits
- * long are added to the least significant end of the last octet.
- *
- * In the "lsb0" scheme, bit number 0 designates the least significant bit,
- * and any padding bits required to make the bitstring a multiple of 8 bits
- * long are added to the most significant end of the first octet.
- *
- * E.g., consider the bitstring "11010001111".  This bitstring is 11 bits
- * long and will take two octets.  Let "p" denote a pad bit.  In the msb0
- * encoding, it would be
- *
- * \verbatim
- *             Octet 0           Octet 1
- *                         |
- *         1 1 0 1 0 0 0 1 | 1 1 1 p p p p p
- *         ^               |               ^
- *         |                               |
- *         bit 0                           bit 15
- * \endverbatim
- *
- * In the lsb0 encoding, it would be
- *
- * \verbatim
- *             Octet 0           Octet 1
- *                         |
- *         p p p p p 1 1 0 | 1 0 0 0 1 1 1 1 
- *         ^               |               ^
- *         |                               |
- *         bit 15                          bit 0
- * \endverbatim
- */
-
-/***
- *** Imports
- ***/
-
-#include <isc/lang.h>
-#include <isc/types.h>
-
-ISC_LANG_BEGINDECLS
-
-/***
- *** Types
- ***/
-
-struct isc_bitstring {
-       unsigned int            magic;
-       unsigned char *         data;
-       unsigned int            length;
-       unsigned int            size;
-       isc_boolean_t           lsb0;
-};
-
-/***
- *** Functions
- ***/
-
-void
-isc_bitstring_init(isc_bitstring_t *bitstring, unsigned char *data,
-                  unsigned int length, unsigned int size, isc_boolean_t lsb0);
-/*!<
- * \brief Make 'bitstring' refer to the bitstring of 'size' bits starting
- * at 'data'.  'length' bits of the bitstring are valid.  If 'lsb0'
- * is set then, bit 0 refers to the least significant bit of the
- * bitstring.  Otherwise bit 0 is the most significant bit.
- *
- * Requires:
- *
- *\li  'bitstring' points to a isc_bitstring_t.
- *
- *\li  'data' points to an array of unsigned char large enough to hold
- *     'size' bits.
- *
- *\li  'length' <= 'size'.
- *
- * Ensures:
- *
- *\li  'bitstring' is a valid bitstring.
- */
-
-void
-isc_bitstring_invalidate(isc_bitstring_t *bitstring);
-/*!<
- * \brief Invalidate 'bitstring'.
- *
- * Requires:
- *
- *\li  'bitstring' is a valid bitstring.
- *
- * Ensures:
- *
- *\li  'bitstring' is not a valid bitstring.
- */
-
-void
-isc_bitstring_copy(isc_bitstring_t *source, unsigned int sbitpos,
-                  isc_bitstring_t *target, unsigned int tbitpos,
-                  unsigned int n);
-/*!<
- * \brief Starting at bit 'sbitpos', copy 'n' bits from 'source' to
- * the 'n' bits of 'target' starting at 'tbitpos'.
- *
- * Requires:
- *
- *\li  'source' and target are valid bitstrings with the same lsb0 setting.
- *
- *\li  'sbitpos' + 'n' is less than or equal to the length of 'source'.
- *
- *\li  'tbitpos' + 'n' is less than or equal to the size of 'target'.
- *
- * Ensures:
- *
- *\li  The specified bits have been copied, and the length of 'target'
- *     adjusted (if required).
- */
-
-ISC_LANG_ENDDECLS
-
-#endif /* ISC_BITSTRING_H */
index 011cfd2e3243012a45c64f86117f96066e949221..a32d56130a390d60fb4f300369978241aee840ae 100644 (file)
@@ -44,7 +44,6 @@
 
 typedef struct isc_appctx              isc_appctx_t;           /*%< Application context */
 typedef struct isc_backtrace_symmap    isc_backtrace_symmap_t; /*%< Symbol Table Entry */
-typedef struct isc_bitstring           isc_bitstring_t;        /*%< Bitstring */
 typedef struct isc_buffer              isc_buffer_t;           /*%< Buffer */
 typedef ISC_LIST(isc_buffer_t)         isc_bufferlist_t;       /*%< Buffer List */
 typedef struct isc_constregion         isc_constregion_t;      /*%< Const region */
index d236307e61b245684c9430b3bfb64ab322a19e07..89262fbbab35fb628198a6ed323212d981674701 100644 (file)
@@ -107,9 +107,6 @@ isc_base32hex_totext
 isc_base64_decodestring
 isc_base64_tobuffer
 isc_base64_totext
-isc_bitstring_copy
-isc_bitstring_init
-isc_bitstring_invalidate
 isc_buffer_allocate
 isc_buffer_compact
 isc_buffer_copyregion
index 08fe918c4c0d1acc3515886ec59ff22b02f5722b..ad7a9a8f9f289e46225ab78143b52f6eeb148d49 100644 (file)
@@ -245,10 +245,6 @@ SOURCE=.\include\isc\bindevt.h
 # End Source File
 # Begin Source File
 
-SOURCE=..\include\isc\bitstring.h
-# End Source File
-# Begin Source File
-
 SOURCE=..\include\isc\boolean.h
 # End Source File
 # Begin Source File
@@ -657,10 +653,6 @@ SOURCE=..\bind9.c
 # End Source File
 # Begin Source File
 
-SOURCE=..\bitstring.c
-# End Source File
-# Begin Source File
-
 SOURCE=..\buffer.c
 # End Source File
 # Begin Source File
index 554429a34361169e3a0ef22025f393243341c0de..be5922c1d2e4e88df374053b81d3f7819f3099cc 100644 (file)
@@ -121,7 +121,6 @@ CLEAN :
        -@erase "$(INTDIR)\base32.obj"
        -@erase "$(INTDIR)\base64.obj"
        -@erase "$(INTDIR)\bind9.obj"
-       -@erase "$(INTDIR)\bitstring.obj"
        -@erase "$(INTDIR)\buffer.obj"
        -@erase "$(INTDIR)\bufferlist.obj"
        -@erase "$(INTDIR)\commandline.obj"
@@ -257,7 +256,6 @@ LINK32_OBJS= \
        "$(INTDIR)\base32.obj" \
        "$(INTDIR)\base64.obj" \
        "$(INTDIR)\bind9.obj" \
-       "$(INTDIR)\bitstring.obj" \
        "$(INTDIR)\buffer.obj" \
        "$(INTDIR)\bufferlist.obj" \
        "$(INTDIR)\commandline.obj" \
@@ -341,8 +339,6 @@ CLEAN :
        -@erase "$(INTDIR)\base64.sbr"
        -@erase "$(INTDIR)\bind9.obj"
        -@erase "$(INTDIR)\bind9.sbr"
-       -@erase "$(INTDIR)\bitstring.obj"
-       -@erase "$(INTDIR)\bitstring.sbr"
        -@erase "$(INTDIR)\buffer.obj"
        -@erase "$(INTDIR)\buffer.sbr"
        -@erase "$(INTDIR)\bufferlist.obj"
@@ -548,7 +544,6 @@ BSC32_SBRS= \
        "$(INTDIR)\base32.sbr" \
        "$(INTDIR)\base64.sbr" \
        "$(INTDIR)\bind9.sbr" \
-       "$(INTDIR)\bitstring.sbr" \
        "$(INTDIR)\buffer.sbr" \
        "$(INTDIR)\bufferlist.sbr" \
        "$(INTDIR)\commandline.sbr" \
@@ -646,7 +641,6 @@ LINK32_OBJS= \
        "$(INTDIR)\base32.obj" \
        "$(INTDIR)\base64.obj" \
        "$(INTDIR)\bind9.obj" \
-       "$(INTDIR)\bitstring.obj" \
        "$(INTDIR)\buffer.obj" \
        "$(INTDIR)\bufferlist.obj" \
        "$(INTDIR)\commandline.obj" \
@@ -1254,24 +1248,6 @@ SOURCE=..\bind9.c
        $(CPP) $(CPP_PROJ) $(SOURCE)
 
 
-!ENDIF 
-
-SOURCE=..\bitstring.c
-
-!IF  "$(CFG)" == "libisc - @PLATFORM@ Release"
-
-
-"$(INTDIR)\bitstring.obj" : $(SOURCE) "$(INTDIR)"
-       $(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-!ELSEIF  "$(CFG)" == "libisc - @PLATFORM@ Debug"
-
-
-"$(INTDIR)\bitstring.obj"      "$(INTDIR)\bitstring.sbr" : $(SOURCE) "$(INTDIR)"
-       $(CPP) $(CPP_PROJ) $(SOURCE)
-
-
 !ENDIF 
 
 SOURCE=..\buffer.c
index 8b25ec4534ef1ae8c694fd6ea27f28576b221608..4bbf2dde1aceeea231cd7c72d56d9955c63b022b 100644 (file)
@@ -44,9 +44,6 @@
     <ClInclude Include="..\include\isc\bind9.h">\r
       <Filter>Library Header Files</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="..\include\isc\bitstring.h">\r
-      <Filter>Library Header Files</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="..\include\isc\boolean.h">\r
       <Filter>Library Header Files</Filter>\r
     </ClInclude>\r
     <ClCompile Include="..\bind9.c">\r
       <Filter>Library Source Files</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="..\bitstring.c">\r
-      <Filter>Library Source Files</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="..\buffer.c">\r
       <Filter>Library Source Files</Filter>\r
     </ClCompile>\r
index 84f0db1236c147801727af76a2ad5be9185097ef..15378af1c85a64e050008a00d18b25fd189e0f69 100644 (file)
@@ -265,7 +265,6 @@ copy /Y @VCREDIST_PATH@ ..\Build\Release\
     <ClInclude Include="..\include\isc\base32.h" />\r
     <ClInclude Include="..\include\isc\base64.h" />\r
     <ClInclude Include="..\include\isc\bind9.h" />\r
-    <ClInclude Include="..\include\isc\bitstring.h" />\r
     <ClInclude Include="..\include\isc\boolean.h" />\r
     <ClInclude Include="..\include\isc\buffer.h" />\r
     <ClInclude Include="..\include\isc\bufferlist.h" />\r
@@ -376,7 +375,6 @@ copy /Y @VCREDIST_PATH@ ..\Build\Release\
     <ClCompile Include="..\base32.c" />\r
     <ClCompile Include="..\base64.c" />\r
     <ClCompile Include="..\bind9.c" />\r
-    <ClCompile Include="..\bitstring.c" />\r
     <ClCompile Include="..\buffer.c" />\r
     <ClCompile Include="..\bufferlist.c" />\r
     <ClCompile Include="..\commandline.c" />\r