Function

FwupdPluginstrtobool

Declaration [src]

gboolean
fu_strtobool (
  const gchar* str,
  gboolean* value,
  GError** error
)

Description [src]

Converts a string value to a boolean. Only true and false are accepted values.

Available since:1.8.2

Parameters

str const gchar*
 

A string, e.g. true

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
value gboolean*
 

Parsed value.

 The argument will be set by the function.
 The argument can be set to NULL.
 The called function takes ownership of the data, and is responsible for freeing it.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gboolean
 

TRUE if the value was parsed correctly, or FALSE for error.