Loading...
Searching...
No Matches
Data Fields | Related Symbols
as_boolean Struct Reference

Detailed Description

Boolean value.

To use the boolean value, you should use one of the two constants:

as_boolean as_true;
as_boolean as_false;

Both as_boolean_init() and as_boolean_new() should be used sparingly.

Definition at line 45 of file as_boolean.h.

#include "as_boolean.h"

+ Inheritance diagram for as_boolean:
+ Collaboration diagram for as_boolean:

Data Fields

bool value
 
- Data Fields inherited from as_val
uint32_t count
 
bool free
 
as_val_t type
 

Related Symbols

(Note that these are not member symbols.)

static void as_boolean_destroy (as_boolean *boolean)
 
static as_booleanas_boolean_fromval (const as_val *v)
 
static bool as_boolean_get (const as_boolean *boolean)
 
static bool as_boolean_getorelse (const as_boolean *boolean, bool fallback)
 
AS_EXTERN as_booleanas_boolean_init (as_boolean *boolean, bool value)
 
AS_EXTERN as_booleanas_boolean_new (bool value)
 
static bool as_boolean_tobool (const as_boolean *boolean)
 
static as_valas_boolean_toval (const as_boolean *boolean)
 

Friends And Related Symbol Documentation

◆ as_boolean_destroy()

static void as_boolean_destroy ( as_boolean * boolean)
related

Destroy the as_boolean and release associated resources.

Parameters
booleanThe as_boolean to destroy.

Definition at line 116 of file as_boolean.h.

References as_val_destroy.

◆ as_boolean_fromval()

static as_boolean * as_boolean_fromval ( const as_val * v)
related

Convert from an as_val.

Definition at line 170 of file as_boolean.h.

References AS_BOOLEAN, and as_util_fromval.

◆ as_boolean_get()

static bool as_boolean_get ( const as_boolean * boolean)
related

Get the bool value.

Definition at line 138 of file as_boolean.h.

References as_boolean_getorelse().

◆ as_boolean_getorelse()

static bool as_boolean_getorelse ( const as_boolean * boolean,
bool fallback )
related

Get the bool value. If boolean is NULL, then return the fallback value.

Definition at line 129 of file as_boolean.h.

◆ as_boolean_init()

AS_EXTERN as_boolean * as_boolean_init ( as_boolean * boolean,
bool value )
related

Initialize a stack allocated as_boolean with the given boolean value.

Parameters
booleanThe as_boolean to initialize.
valueThe bool value.
Returns
On success, the initialized value. Otherwise NULL.

◆ as_boolean_new()

AS_EXTERN as_boolean * as_boolean_new ( bool value)
related

Creates a new heap allocated as_boolean and initializes with the given boolean value.

Parameters
valueThe bool value.
Returns
On success, the newly allocated value. Otherwise NULL.

◆ as_boolean_tobool()

static bool as_boolean_tobool ( const as_boolean * boolean)
related

Get the bool value.

Deprecated
Use as_boolean_get() instead.

Definition at line 148 of file as_boolean.h.

References as_boolean_getorelse().

◆ as_boolean_toval()

static as_val * as_boolean_toval ( const as_boolean * boolean)
related

Convert to an as_val.

Definition at line 161 of file as_boolean.h.

Field Documentation

◆ value

bool as_boolean::value

The boolean value.

Definition at line 57 of file as_boolean.h.


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