Skip to content

Commit

Permalink
Add scodec attribution to code, NOTICE, licence
Browse files Browse the repository at this point in the history
  • Loading branch information
valencik committed Mar 9, 2023
1 parent 3c10061 commit 294a02d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
protosearch
Copyright 2022 CozyDev
Licensed under Apache License 2.0 (see LICENSE)

This software contains portions of code derived from scodec
https://github.com/scodec/scodec
Copyright (c) 2013-2014, Michael Pilquist and Paul Chiusano
Licensed under BSD 3-Clause "New" or "Revised" License (see licenses/LICENSE_scodec)
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import scodec.bits.BitVector
import scala.collection.immutable.ArraySeq
import scala.reflect.ClassTag

// Derived from scodec VectorCodec
// https://github.com/scodec/scodec/blob/series/1.11.x/shared/src/main/scala/scodec/codecs/VectorCodec.scala
private[protosearch] final class ArrayCodec[A: ClassTag](codec: Codec[A], limit: Option[Int] = None)
extends Codec[Array[A]] {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import scodec._
import scodec.bits.BitVector
import scala.reflect.ClassTag

// Derived from scodec VectorCodec
// https://github.com/scodec/scodec/blob/v2.2.1/shared/src/main/scala/scodec/codecs/VectorCodec.scala
private[protosearch] final class ArrayCodec[A: ClassTag](codec: Codec[A], limit: Option[Int] = None)
extends Codec[Array[A]] {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package pink.cozydev.protosearch
import scodec.{Attempt, Codec, Err, codecs}
import scala.reflect.ClassTag

// Derived from scodec vectorOfN
// https://github.com/scodec/scodec/blob/v2.2.1/shared/src/main/scala/scodec/codecs/codecs.scala#L1106
object IndexCodecs {
def arrayOfN[A: ClassTag](countCodec: Codec[Int], valueCodec: Codec[A]): Codec[Array[A]] =
countCodec
Expand Down
10 changes: 10 additions & 0 deletions licenses/LICENSE_scodec
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Copyright (c) 2013-2014, Michael Pilquist and Paul Chiusano
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the scodec team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 comments on commit 294a02d

Please sign in to comment.