Functions#

get_major_version() int#

Returns the major version number of the JavaScriptCore library. (e.g. in JavaScriptCore version 1.8.3 this is 1.)

This function is in the library, so it represents the JavaScriptCore library your code is running against. Contrast with the JSC_MAJOR_VERSION macro, which represents the major version of the JavaScriptCore headers you have included when compiling your code.

Returns:

the major version number of the JavaScriptCore library

get_micro_version() int#

Returns the micro version number of the JavaScriptCore library. (e.g. in JavaScriptCore version 1.8.3 this is 3.)

This function is in the library, so it represents the JavaScriptCore library your code is running against. Contrast with the JSC_MICRO_VERSION macro, which represents the micro version of the JavaScriptCore headers you have included when compiling your code.

Returns:

the micro version number of the JavaScriptCore library

get_minor_version() int#

Returns the minor version number of the JavaScriptCore library. (e.g. in JavaScriptCore version 1.8.3 this is 8.)

This function is in the library, so it represents the JavaScriptCore library your code is running against. Contrast with the JSC_MINOR_VERSION macro, which represents the minor version of the JavaScriptCore headers you have included when compiling your code.

Returns:

the minor version number of the JavaScriptCore library

options_foreach(function: Callable[[str, OptionType, str | None, Any], bool], user_data: Any = None) None#

Iterates all available options calling function for each one. Iteration can stop early if function returns False.

Added in version 2.24.

Parameters:
  • function – a OptionsFunc callback

  • user_data – callback user data

options_get_boolean(option: str) Tuple[bool, bool]#

Get option as a gboolean value.

Added in version 2.24.

Parameters:

option – the option identifier

Returns:

True if value has been set or False if the option doesn’t exist

options_get_double(option: str) Tuple[bool, float]#

Get option as a float value.

Added in version 2.24.

Parameters:

option – the option identifier

Returns:

True if value has been set or False if the option doesn’t exist

options_get_int(option: str) Tuple[bool, int]#

Get option as a int value.

Added in version 2.24.

Parameters:

option – the option identifier

Returns:

True if value has been set or False if the option doesn’t exist

options_get_option_group() OptionGroup#

Create a OptionGroup to handle JSCOptions as command line arguments. The options will be exposed as command line arguments with the form <emphasis>–jsc-wzxhzdk:0optionwzxhzdk:1=wzxhzdk:2valuewzxhzdk:3</emphasis>. Each entry in the returned OptionGroup is configured to apply the corresponding option during command line parsing. Applications only need to pass the returned group to add_group(), and the rest will be taken care for automatically.

Added in version 2.24.

Returns:

a OptionGroup for the JSCOptions

options_get_range_string(option: str) Tuple[bool, str]#

Get option as a range string. The string must be in the format <emphasis>[!]wzxhzdk:0lowwzxhzdk:1[:wzxhzdk:2highwzxhzdk:3]</emphasis> where low and high are int values. Values between low and high (both included) will be considered in the range, unless <emphasis>!</emphasis> is used to invert the range.

Added in version 2.24.

Parameters:

option – the option identifier

Returns:

True if value has been set or False if the option doesn’t exist

options_get_size(option: str) Tuple[bool, int]#

Get option as a gsize value.

Added in version 2.24.

Parameters:

option – the option identifier

Returns:

True if value has been set or False if the option doesn’t exist

options_get_string(option: str) Tuple[bool, str]#

Get option as a string.

Added in version 2.24.

Parameters:

option – the option identifier

Returns:

True if value has been set or False if the option doesn’t exist

options_get_uint(option: str) Tuple[bool, int]#

Get option as a int value.

Added in version 2.24.

Parameters:

option – the option identifier

Returns:

True if value has been set or False if the option doesn’t exist

options_set_boolean(option: str, value: bool) bool#

Set option as a gboolean value.

Added in version 2.24.

Parameters:
  • option – the option identifier

  • value – the value to set

Returns:

True if option was correctly set or False otherwise.

options_set_double(option: str, value: float) bool#

Set option as a float value.

Added in version 2.24.

Parameters:
  • option – the option identifier

  • value – the value to set

Returns:

True if option was correctly set or False otherwise.

options_set_int(option: str, value: int) bool#

Set option as a int value.

Added in version 2.24.

Parameters:
  • option – the option identifier

  • value – the value to set

Returns:

True if option was correctly set or False otherwise.

options_set_range_string(option: str, value: str) bool#

Set option as a range string. The string must be in the format <emphasis>[!]wzxhzdk:0lowwzxhzdk:1[:wzxhzdk:2highwzxhzdk:3]</emphasis> where low and high are int values. Values between low and high (both included) will be considered in the range, unless <emphasis>!</emphasis> is used to invert the range.

Added in version 2.24.

Parameters:
  • option – the option identifier

  • value – the value to set

Returns:

True if option was correctly set or False otherwise.

options_set_size(option: str, value: int) bool#

Set option as a gsize value.

Added in version 2.24.

Parameters:
  • option – the option identifier

  • value – the value to set

Returns:

True if option was correctly set or False otherwise.

options_set_string(option: str, value: str) bool#

Set option as a string.

Added in version 2.24.

Parameters:
  • option – the option identifier

  • value – the value to set

Returns:

True if option was correctly set or False otherwise.

options_set_uint(option: str, value: int) bool#

Set option as a int value.

Added in version 2.24.

Parameters:
  • option – the option identifier

  • value – the value to set

Returns:

True if option was correctly set or False otherwise.