MCPcopy
hub / github.com/google/brotli / initState

Function initState

js/decode.ts:143–163  ·  view source on GitHub ↗
(s: State)

Source from the content-addressed store, hash-verified

141 return 0;
142}
143function initState(s: State): number {
144 if (s.runningState !== 0) {
145 return makeError(s, -26);
146 }
147 s.blockTrees = new Int32Array(3091);
148 s.blockTrees[0] = 7;
149 s.distRbIdx = 3;
150 let result: number = calculateDistanceAlphabetLimit(s, 0x7FFFFFFC, 3, 120);
151 if (result < 0) {
152 return result;
153 }
154 const maxDistanceAlphabetLimit: number = result;
155 s.distExtraBits = new Int8Array(maxDistanceAlphabetLimit);
156 s.distOffset = new Int32Array(maxDistanceAlphabetLimit);
157 result = initBitReader(s);
158 if (result < 0) {
159 return result;
160 }
161 s.runningState = 1;
162 return 0;
163}
164function close(s: State): number {
165 if (s.runningState === 0) {
166 return makeError(s, -25);

Callers 1

brotliDecodeFunction · 0.70

Calls 3

makeErrorFunction · 0.70
initBitReaderFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…