mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-07-04 11:46:51 +08:00
Added all required dependencies
This commit is contained in:
vendor
github.com
Unknwon
cae
com
LICENSEREADME.mdcmd.goconvert.godir.gofile.gohtml.gohttp.gomath.gopath.goregex.goslice.gostring.gotime.gourl.go
i18n
paginater
bradfitz/gomemcache
go-macaron
binding
cache
captcha
csrf
gzip
i18n
inject
session
toolbox
go-sql-driver/mysql
AUTHORSCHANGELOG.mdCONTRIBUTING.mdISSUE_TEMPLATE.mdLICENSEPULL_REQUEST_TEMPLATE.mdREADME.mdappengine.gobuffer.gocollations.goconnection.goconst.godriver.godsn.goerrors.goinfile.gopackets.goresult.gorows.gostatement.gotransaction.goutils.go
go-xorm
builder
LICENSEREADME.mdbuilder.gobuilder_delete.gobuilder_insert.gobuilder_select.gobuilder_update.gocond.gocond_and.gocond_between.gocond_compare.gocond_eq.gocond_expr.gocond_in.gocond_like.gocond_neq.gocond_not.gocond_notin.gocond_null.gocond_or.godoc.goerror.go
core
LICENSEREADME.mdbenchmark.shcache.gocolumn.goconverstion.godb.godialect.godriver.goerror.gofilter.goilogger.goindex.gomapper.gopk.gorows.goscan.gotable.gotype.go
xorm
CONTRIBUTING.mdLICENSEREADME.mdREADME_CN.mdVERSIONdoc.goengine.goerror.gogen_reserved.shgoracle_driver.gohelpers.gologger.golru_cacher.gomemory_store.gomssql_dialect.gomymysql_driver.gomysql_dialect.gomysql_driver.gooci8_driver.goodbc_driver.gooracle_dialect.gopg_reserved.txtpostgres_dialect.gopq_driver.goprocessors.gorows.gosession.gosqlite3_dialect.gosqlite3_driver.gostatement.gosyslogger.gotypes.goxorm.go
gogits
chardet
2022.goAUTHORSLICENSEREADME.mddetector.goicu-license.htmlmulti_byte.gorecognizer.gosingle_byte.gounicode.goutf8.go
cron
git-module
LICENSEREADME.mdblob.gocommand.gocommit.gocommit_archive.goerror.gogit.gohook.gorepo.gorepo_branch.gorepo_commit.gorepo_hook.gorepo_object.gorepo_pull.gorepo_tag.gorepo_tree.gosha1.gosignature.gosubmodule.gotag.gotree.gotree_blob.gotree_entry.goutlis.go
go-gogs-client
LICENSEREADME.mdadmin_org.goadmin_repo.goadmin_user.gogogs.goissue.goissue_comment.goissue_label.goissue_milestone.gomiscellaneous.goorg.goorg_member.goorg_team.gopull.gorepo.gorepo_branch.gorepo_collaborator.gorepo_file.gorepo_hook.gorepo_key.gouser.gouser_app.gouser_email.gouser_follow.gouser_key.goutils.go
issue9/identicon
jaytaylor/html2text
jtolds/gls
kardianos/minwinsvc
klauspost
compress
LICENSE
flate
copy.gocrc32_amd64.gocrc32_amd64.scrc32_noasm.godeflate.godict_decoder.gogen.gohuffman_bit_writer.gohuffman_code.goinflate.goreverse_bits.gosnappy.gotoken.go
gzip
cpuid
LICENSEREADME.mdcpuid.gocpuid_386.scpuid_amd64.sdetect_intel.godetect_ref.gogenerate.goprivate-gen.go
crc32
lib/pq
CONTRIBUTING.mdLICENSE.mdREADME.mdarray.gobuf.goconn.gocopy.godoc.goencode.goerror.gonotify.go
oid
url.gouser_posix.gouser_windows.gomattn/go-sqlite3
LICENSEREADME.mdbackup.gocallback.godoc.goerror.gosqlite3-binding.csqlite3-binding.hsqlite3.gosqlite3_fts5.gosqlite3_icu.gosqlite3_json1.gosqlite3_libsqlite3.gosqlite3_load_extension.gosqlite3_omit_load_extension.gosqlite3_other.gosqlite3_windows.gosqlite3ext.htracecallback.gotracecallback_noimpl.go
mcuadros/go-version
microcosm-cc/bluemonday
msteinert/pam
nfnt/resize
russross/blackfriday
satori/go.uuid
sergi/go-diff
shurcooL/sanitized_anchor_name
smartystreets
assertions
CONTRIBUTING.mdLICENSE.mdREADME.mdassertions.goconveycollections.godoc.goequality.gofilter.gomessages.gopanic.goquantity.goserializer.gostrings.gotime.gotype.go
internal
go-render
oglematchers
goconvey
urfave/cli
golang.org/x
crypto
LICENSEPATENTS
curve25519
const_amd64.scswap_amd64.scurve25519.godoc.gofreeze_amd64.sladderstep_amd64.smont25519_amd64.gomul_amd64.ssquare_amd64.s
ed25519
ssh
net
text
LICENSEPATENTS
encoding
internal
language
Makefilecommon.gocoverage.gogen_common.gogen_index.gogo1_1.gogo1_2.goindex.golanguage.golookup.gomaketables.gomatch.goparse.gotables.gotags.go
runes
transform
gopkg.in
asn1-ber.v1
bufio.v1
editorconfig/editorconfig-core-go.v1
gomail.v2
CHANGELOG.mdCONTRIBUTING.mdLICENSEREADME.mdauth.godoc.gomessage.gomime.gomime_go14.gosend.gosmtp.gowriteto.go
ini.v1
ldap.v2
LICENSEMakefileREADME.mdadd.gobind.goclient.gocompare.goconn.gocontrol.godebug.godel.godn.godoc.goerror.gofilter.goldap.gomodify.gopasswdmodify.gosearch.go
macaron.v1
LICENSEREADME.mdcontext.gologger.gomacaron.gomacaronlogo.pngrecovery.gorender.goresponse_writer.goreturn_handler.gorouter.gostatic.gotree.go
redis.v2
strk.kbt.io/projects/go/libravatar
184
vendor/github.com/klauspost/compress/flate/dict_decoder.go
generated
vendored
Normal file
184
vendor/github.com/klauspost/compress/flate/dict_decoder.go
generated
vendored
Normal file
@ -0,0 +1,184 @@
|
||||
// Copyright 2016 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package flate
|
||||
|
||||
// dictDecoder implements the LZ77 sliding dictionary as used in decompression.
|
||||
// LZ77 decompresses data through sequences of two forms of commands:
|
||||
//
|
||||
// * Literal insertions: Runs of one or more symbols are inserted into the data
|
||||
// stream as is. This is accomplished through the writeByte method for a
|
||||
// single symbol, or combinations of writeSlice/writeMark for multiple symbols.
|
||||
// Any valid stream must start with a literal insertion if no preset dictionary
|
||||
// is used.
|
||||
//
|
||||
// * Backward copies: Runs of one or more symbols are copied from previously
|
||||
// emitted data. Backward copies come as the tuple (dist, length) where dist
|
||||
// determines how far back in the stream to copy from and length determines how
|
||||
// many bytes to copy. Note that it is valid for the length to be greater than
|
||||
// the distance. Since LZ77 uses forward copies, that situation is used to
|
||||
// perform a form of run-length encoding on repeated runs of symbols.
|
||||
// The writeCopy and tryWriteCopy are used to implement this command.
|
||||
//
|
||||
// For performance reasons, this implementation performs little to no sanity
|
||||
// checks about the arguments. As such, the invariants documented for each
|
||||
// method call must be respected.
|
||||
type dictDecoder struct {
|
||||
hist []byte // Sliding window history
|
||||
|
||||
// Invariant: 0 <= rdPos <= wrPos <= len(hist)
|
||||
wrPos int // Current output position in buffer
|
||||
rdPos int // Have emitted hist[:rdPos] already
|
||||
full bool // Has a full window length been written yet?
|
||||
}
|
||||
|
||||
// init initializes dictDecoder to have a sliding window dictionary of the given
|
||||
// size. If a preset dict is provided, it will initialize the dictionary with
|
||||
// the contents of dict.
|
||||
func (dd *dictDecoder) init(size int, dict []byte) {
|
||||
*dd = dictDecoder{hist: dd.hist}
|
||||
|
||||
if cap(dd.hist) < size {
|
||||
dd.hist = make([]byte, size)
|
||||
}
|
||||
dd.hist = dd.hist[:size]
|
||||
|
||||
if len(dict) > len(dd.hist) {
|
||||
dict = dict[len(dict)-len(dd.hist):]
|
||||
}
|
||||
dd.wrPos = copy(dd.hist, dict)
|
||||
if dd.wrPos == len(dd.hist) {
|
||||
dd.wrPos = 0
|
||||
dd.full = true
|
||||
}
|
||||
dd.rdPos = dd.wrPos
|
||||
}
|
||||
|
||||
// histSize reports the total amount of historical data in the dictionary.
|
||||
func (dd *dictDecoder) histSize() int {
|
||||
if dd.full {
|
||||
return len(dd.hist)
|
||||
}
|
||||
return dd.wrPos
|
||||
}
|
||||
|
||||
// availRead reports the number of bytes that can be flushed by readFlush.
|
||||
func (dd *dictDecoder) availRead() int {
|
||||
return dd.wrPos - dd.rdPos
|
||||
}
|
||||
|
||||
// availWrite reports the available amount of output buffer space.
|
||||
func (dd *dictDecoder) availWrite() int {
|
||||
return len(dd.hist) - dd.wrPos
|
||||
}
|
||||
|
||||
// writeSlice returns a slice of the available buffer to write data to.
|
||||
//
|
||||
// This invariant will be kept: len(s) <= availWrite()
|
||||
func (dd *dictDecoder) writeSlice() []byte {
|
||||
return dd.hist[dd.wrPos:]
|
||||
}
|
||||
|
||||
// writeMark advances the writer pointer by cnt.
|
||||
//
|
||||
// This invariant must be kept: 0 <= cnt <= availWrite()
|
||||
func (dd *dictDecoder) writeMark(cnt int) {
|
||||
dd.wrPos += cnt
|
||||
}
|
||||
|
||||
// writeByte writes a single byte to the dictionary.
|
||||
//
|
||||
// This invariant must be kept: 0 < availWrite()
|
||||
func (dd *dictDecoder) writeByte(c byte) {
|
||||
dd.hist[dd.wrPos] = c
|
||||
dd.wrPos++
|
||||
}
|
||||
|
||||
// writeCopy copies a string at a given (dist, length) to the output.
|
||||
// This returns the number of bytes copied and may be less than the requested
|
||||
// length if the available space in the output buffer is too small.
|
||||
//
|
||||
// This invariant must be kept: 0 < dist <= histSize()
|
||||
func (dd *dictDecoder) writeCopy(dist, length int) int {
|
||||
dstBase := dd.wrPos
|
||||
dstPos := dstBase
|
||||
srcPos := dstPos - dist
|
||||
endPos := dstPos + length
|
||||
if endPos > len(dd.hist) {
|
||||
endPos = len(dd.hist)
|
||||
}
|
||||
|
||||
// Copy non-overlapping section after destination position.
|
||||
//
|
||||
// This section is non-overlapping in that the copy length for this section
|
||||
// is always less than or equal to the backwards distance. This can occur
|
||||
// if a distance refers to data that wraps-around in the buffer.
|
||||
// Thus, a backwards copy is performed here; that is, the exact bytes in
|
||||
// the source prior to the copy is placed in the destination.
|
||||
if srcPos < 0 {
|
||||
srcPos += len(dd.hist)
|
||||
dstPos += copy(dd.hist[dstPos:endPos], dd.hist[srcPos:])
|
||||
srcPos = 0
|
||||
}
|
||||
|
||||
// Copy possibly overlapping section before destination position.
|
||||
//
|
||||
// This section can overlap if the copy length for this section is larger
|
||||
// than the backwards distance. This is allowed by LZ77 so that repeated
|
||||
// strings can be succinctly represented using (dist, length) pairs.
|
||||
// Thus, a forwards copy is performed here; that is, the bytes copied is
|
||||
// possibly dependent on the resulting bytes in the destination as the copy
|
||||
// progresses along. This is functionally equivalent to the following:
|
||||
//
|
||||
// for i := 0; i < endPos-dstPos; i++ {
|
||||
// dd.hist[dstPos+i] = dd.hist[srcPos+i]
|
||||
// }
|
||||
// dstPos = endPos
|
||||
//
|
||||
for dstPos < endPos {
|
||||
dstPos += copy(dd.hist[dstPos:endPos], dd.hist[srcPos:dstPos])
|
||||
}
|
||||
|
||||
dd.wrPos = dstPos
|
||||
return dstPos - dstBase
|
||||
}
|
||||
|
||||
// tryWriteCopy tries to copy a string at a given (distance, length) to the
|
||||
// output. This specialized version is optimized for short distances.
|
||||
//
|
||||
// This method is designed to be inlined for performance reasons.
|
||||
//
|
||||
// This invariant must be kept: 0 < dist <= histSize()
|
||||
func (dd *dictDecoder) tryWriteCopy(dist, length int) int {
|
||||
dstPos := dd.wrPos
|
||||
endPos := dstPos + length
|
||||
if dstPos < dist || endPos > len(dd.hist) {
|
||||
return 0
|
||||
}
|
||||
dstBase := dstPos
|
||||
srcPos := dstPos - dist
|
||||
|
||||
// Copy possibly overlapping section before destination position.
|
||||
loop:
|
||||
dstPos += copy(dd.hist[dstPos:endPos], dd.hist[srcPos:dstPos])
|
||||
if dstPos < endPos {
|
||||
goto loop // Avoid for-loop so that this function can be inlined
|
||||
}
|
||||
|
||||
dd.wrPos = dstPos
|
||||
return dstPos - dstBase
|
||||
}
|
||||
|
||||
// readFlush returns a slice of the historical buffer that is ready to be
|
||||
// emitted to the user. The data returned by readFlush must be fully consumed
|
||||
// before calling any other dictDecoder methods.
|
||||
func (dd *dictDecoder) readFlush() []byte {
|
||||
toRead := dd.hist[dd.rdPos:dd.wrPos]
|
||||
dd.rdPos = dd.wrPos
|
||||
if dd.wrPos == len(dd.hist) {
|
||||
dd.wrPos, dd.rdPos = 0, 0
|
||||
dd.full = true
|
||||
}
|
||||
return toRead
|
||||
}
|
Reference in New Issue
Block a user