Inflate (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
JAL2 (talk | contribs)
Tom (talk | contribs)
No edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:String:Inflate subtitle}}
{{Template:String:Inflate subtitle}}
This function takes a result from <var>[[Deflate (String function)|Deflate]]</var> (a compressed string) and decompresses it using the "inflate" algorithm. The inflate algorithm is described as part of the deflate specification in RFC 1951.
This function takes a result from <var>[[Deflate (String function)|Deflate]]</var> (a compressed string) and decompresses it using the "inflate" algorithm. The inflate algorithm is described as part of the deflate specification in RFC 1951.
==Syntax==
==Syntax==
{{Template:String:Inflate syntax}}
{{Template:String:Inflate syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%outString</th><td>The result decompressed string.</td></tr>
<tr><th>%outString</th>
<td>The resulting decompressed string.</td></tr>
 
<tr><th>string</th>
<tr><th>string</th>
<td>The compressed string to be decompressed.</td></tr>
<td>The compressed string to be decompressed.</td></tr>
<tr><th><var>Software</var></th>
<td>[Introduced in Model 204 version 8.0]
<p><var>Software</var> is an optional, [[Notation conventions for methods#Named parameters|name required]], parameter that is a <var>[[Boolean_enumeration#Using_Boolean_enumerations|Boolean]]</var> value that specifies whether to force the use of software decompression instead of hardware decompression.</p>
<ul>
<li>When <code>software=true</code>, decompression is always performed in software, even if the DFLTCC hardware instruction is available on the processor. This can be useful for diagnostic purposes or when byte-for-byte reproducibility with pre-8.0 behavior is required.</li>
<li>When <code>software=false</code> (the default), hardware decompression is used automatically when DFLTCC is available (IBM z15 and above), falling back to software decompression on older processors.</li>
</ul>
The default value for this argument is <var>False</var>.
</td></tr>
</table>
</table>
==Exceptions==
==Exceptions==
<var>Inflate</var> can throw the following exception:
<var>Inflate</var> can throw the following exception:
Line 16: Line 30:
<dd>This exception indicates that the method object <var class="term">string</var> does not contain a valid <var>[[Deflate (String function)|Deflate]]</var> string compression output.
<dd>This exception indicates that the method object <var class="term">string</var> does not contain a valid <var>[[Deflate (String function)|Deflate]]</var> string compression output.
</dl>
</dl>
 
==Usage notes==
==Usage notes==
<ul>
<ul>
<li>The <var>[[NCMPBUF parameter|NCMPBUF]]</var> parameter must be set to a
<li>The <var>[[NCMPBUF parameter|NCMPBUF]]</var> parameter must be set to a non-zero value during <var class="product">Model 204</var> initialization to allow use of the <var>Inflate</var> function; otherwise, invoking <var>Inflate</var> causes request cancellation.
non-zero value during <var class="product">Model 204</var>initialization to allow
use of the <var>Inflate</var> function; otherise, invoking <var>Inflate</var>
causes request cancellation.
</ul>
</ul>


Line 30: Line 41:
%out = %temp:Inflate
%out = %temp:Inflate
</p>
</p>
The following example forces software decompression:
<p class="code">%out = %temp:Inflate(software=true)
</p>
==See also==
==See also==
<ul>
<ul>
<li><var>[[Deflate (String function)|Deflate]]</var> is used to compress a string using the "deflate" algorithm.
<li><var>[[Deflate (String function)|Deflate]]</var> is used to compress a string using the "deflate" algorithm.
<li>Other related methods:  
<li>Other related methods:
<ul>
<ul>
<li><var>[[Gunzip (String function)|Gunzip]]</var>
<li><var>[[Gunzip (String function)|Gunzip]]</var>
Line 39: Line 55:
<li><var>[[GunzipFilename (String function)|GunzipFilename]]</var>
<li><var>[[GunzipFilename (String function)|GunzipFilename]]</var>
<li><var>[[Gzip (String function)|Gzip]]</var>
<li><var>[[Gzip (String function)|Gzip]]</var>
<li><var>[[Zip (String function)|Zip]]</var>
</ul>
</ul>
</ul>
</ul>


{{Template:String:Inflate footer}}
{{Template:String:Inflate footer}}

Latest revision as of 13:18, 19 May 2026

Decompress a longstring with inflate (String class)

[Introduced in Sirius Mods 7.4]

This function takes a result from Deflate (a compressed string) and decompresses it using the "inflate" algorithm. The inflate algorithm is described as part of the deflate specification in RFC 1951.

Syntax

%outString = string:Inflate Throws InvalidDeflateData

Syntax terms

%outString The resulting decompressed string.
string The compressed string to be decompressed.
Software [Introduced in Model 204 version 8.0]

Software is an optional, name required, parameter that is a Boolean value that specifies whether to force the use of software decompression instead of hardware decompression.

  • When software=true, decompression is always performed in software, even if the DFLTCC hardware instruction is available on the processor. This can be useful for diagnostic purposes or when byte-for-byte reproducibility with pre-8.0 behavior is required.
  • When software=false (the default), hardware decompression is used automatically when DFLTCC is available (IBM z15 and above), falling back to software decompression on older processors.

The default value for this argument is False.

Exceptions

Inflate can throw the following exception:

InvalidDeflateData
This exception indicates that the method object string does not contain a valid Deflate string compression output.

Usage notes

  • The NCMPBUF parameter must be set to a non-zero value during Model 204 initialization to allow use of the Inflate function; otherwise, invoking Inflate causes request cancellation.

Examples

In the following example, %out is set to the original string (How much..chuck):

%temp = 'How much wood could a woodchuck chuck':deflate(fixedCode=true) %out = %temp:Inflate

The following example forces software decompression:

%out = %temp:Inflate(software=true)

See also