libpaf 1.1.13
Loading...
Searching...
No Matches
Functions
paf_value.h File Reference

Pathfinder Property Value API. More...

#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Functions

bool paf_value_is_int64 (const struct paf_value *value)
 
bool paf_value_is_str (const struct paf_value *value)
 
struct paf_value * paf_value_int64_create (int64_t value)
 
int64_t paf_value_int64 (const struct paf_value *value)
 
struct paf_value * paf_value_str_create (const char *value)
 
const char * paf_value_str (const struct paf_value *value)
 
bool paf_value_equal (const struct paf_value *value_a, const struct paf_value *value_b)
 
struct paf_value * paf_value_clone (const struct paf_value *orig)
 
void paf_value_destroy (struct paf_value *value)
 

Detailed Description

Pathfinder Property Value API.

Service properties can be either integer or a string.

Function Documentation

◆ paf_value_is_int64()

bool paf_value_is_int64 ( const struct paf_value *  value)

Checks if the value is an integer.

Returns
Returns true if value is an integer, or false otherwise.

◆ paf_value_is_str()

bool paf_value_is_str ( const struct paf_value *  value)

Checks if the value is a string.

Returns
Returns true if value is a string, or false otherwise.

◆ paf_value_int64_create()

struct paf_value * paf_value_int64_create ( int64_t  value)

Creates an integer value.

Parameters
[in]valueThe 64-bit value used to initialize value.
Returns
Returns a value instance of the integer type.

◆ paf_value_int64()

int64_t paf_value_int64 ( const struct paf_value *  value)

Retrieves the integer value of value.

Parameters
[in]valueA value of type integer.
Returns
Returns the 64-bit signed value of value.

◆ paf_value_str_create()

struct paf_value * paf_value_str_create ( const char *  value)

Creates a string value.

Parameters
[in]valueThe string to be copied and used to initialize value.
Returns
Returns a value instance of the string type.

◆ paf_value_str()

const char * paf_value_str ( const struct paf_value *  value)

Retrieves the string of value.

The returned point should not be written to, and not bee freed by the caller.

Parameters
[in]valueA value of type string.
Returns
Returns a read-only pointer to the string value of value.

◆ paf_value_equal()

bool paf_value_equal ( const struct paf_value *  value_a,
const struct paf_value *  value_b 
)

Compares two values for equality.

The values must be of the same type and have the same value in order to be considered equal.

Parameters
[in]value_aA value.
[in]value_bAnother (or the same) value.
Returns
Returns true if value_a and value_b are equal, false otherwise.

◆ paf_value_clone()

struct paf_value * paf_value_clone ( const struct paf_value *  orig)

Returns a copy of the supplied value.

Parameters
[in]origThe value to be copied.
Returns
Returns a copy of the value.

◆ paf_value_destroy()

void paf_value_destroy ( struct paf_value *  value)

Destroys a value instance.

This function destroys the value instance and frees all the resources associated with it.

Parameters
[in]valueThe value.