psrDeleteParserContext
Create/destroy a content-parser context — the handle every
IPSR __stdcall psrCreateParserContext(PPDF IPDF, TOptimizeFlags Flags, POptimizeParams Parms);
void __stdcall psrDeleteParserContext(IPSR* Ctx);
function psrCreateParserContext(const IPDF: PPDF; Flags: TOptimizeFlags; Parms: POptimizeParams): IPSR; stdcall;
procedure psrDeleteParserContext(var Ctx: IPSR); stdcall;
Purpose. Create/destroy a content-parser context — the handle every other psr* function in this chapter (and the text-search/replace family in Interactive Text Search, Selection & Replacement) operates against.
Description. IPDF, Flags, and Parms are accepted by the ABI but unused — by design: the parser context carries no document-specific or optimize-flag-specific state at creation time; it is associated with a document only later, per-call, when psrParsePage(IPDF, Ctx, ...) is invoked. psrDeleteParserContext takes Ctx by reference and nils it out after freeing, preventing an obvious double-free via the same variable.
Parameters.
| Parameter | Description |
|---|---|
IPDF | *(Create only)* Accepted but unused by design — the context is document-agnostic until psrParsePage. |
Flags, Parms | *(Create only)* Accepted but unused by design. |
Ctx | *(Delete only)* var — set to nil after the context is freed. |
Return value. psrCreateParserContext: a new context handle (never fails). psrDeleteParserContext: none.
See also. psrCreateParserContext workflow (Interactive Text Search, Selection & Replacement's psrParsePage→find/edit→psrWriteToPage cycle).
C# (P/Invoke)
public static extern void psrDeleteParserContext(ref IntPtr Ctx);
Misc
psrDeleteParserContext
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.