libsnobol4 1.0.2
High-performance SNOBOL4-style pattern matching library
Loading...
Searching...
No Matches
snobol_match_result Struct Reference

Result from the one-shot snobol_match() convenience API. More...

#include <snobol.h>

Public Attributes

bool success
char * error
char * output
size_t output_len
char ** captures
size_t * capture_lens
int capture_count

Detailed Description

Result from the one-shot snobol_match() convenience API.

Unlike the opaque snobol_match_t (which is used by the multi-step API), this struct is non-opaque so callers can directly read the fields.

Definition at line 841 of file snobol.h.

Member Data Documentation

◆ capture_count

int snobol_match_result::capture_count

Number of populated captures.

Definition at line 854 of file snobol.h.

◆ capture_lens

size_t* snobol_match_result::capture_lens

Byte lengths of each capture string.

Definition at line 853 of file snobol.h.

◆ captures

char** snobol_match_result::captures

Captured variable values (index 0 = variable "1", etc.). Each entry is a malloc'd NUL-terminated string (or NULL if not set). Freed by snobol_match_result_free().

Definition at line 852 of file snobol.h.

◆ error

char* snobol_match_result::error

Malloc'd error message (NULL on success); caller must free via snobol_match_result_free().

Definition at line 843 of file snobol.h.

◆ output

char* snobol_match_result::output

Output buffer from OP_EMIT_* instructions (owned, freed by snobol_match_result_free()).

Definition at line 845 of file snobol.h.

◆ output_len

size_t snobol_match_result::output_len

Byte length of output (0 if no output).

Definition at line 847 of file snobol.h.

◆ success

bool snobol_match_result::success

Whether the pattern matched

Definition at line 842 of file snobol.h.


The documentation for this struct was generated from the following file: