native

INI_SetReaders

Syntax

native INI_SetReaders(INIParser:smc, const kvFunc[], const nsFunc[] = "" );

Description

Sets the two main reader functions.

Parameters

handle Handle to an INI Parse structure.
section Name of section in between the [ and ] characters.
invalid_tokens True if invalid tokens were detected in the name.
close_bracket True if a closing bracket was detected, false otherwise.
extra_tokens True if extra tokens were detected on the line.
curtok Contains current token in the line where the section name starts.
You can add to this offset when failing to point to a token.
data Handle or value passed in INI_ParseFile
handle Handle to an INI Parse structure.
key Name of key.
value String containing value (with quotes stripped, if any).
invalid_tokens Whether or not the key contained invalid tokens.
equal_token There was an '=' sign present (in case the value is missing).
quotes Whether value was enclosed in quotes.
curtok Contains the token index of the start of the value string.
This can be changed when returning false.
data Handle or value passed in INI_ParseFile
handle Handle to an INI Parse structure.
kv A KeyValue callback.
ns An optional NewSection callback.

Note

Below is the prototype of callback:
-
NewSection:
Called when the parser finds a new section.

Return

True to keep parsing, false otherwise.
public bool:OnNewSection(INIParser:handle, const section[], bool:invalid_tokens, bool:close_bracket, bool:extra_tokens, curtok, any:data)
KeyValue:
Called when the parser finds a new key/value pair.

Return

True to keep parsing, false otherwise.
public bool:OnKeyValue(INIParser:handle, const key[], const value[], bool:invalid_tokens, bool:equal_token, bool:quotes, curtok, any:data)
-

Return

This function has no return value.