Diffusion C API
6.7.9
|
Miscellaneous utility functions that don't fit anywhere else. More...
Functions | |
char * | uint32_to_str (uint32_t val) |
Safely convert an unsigned integer to a NULL-terminated string. More... | |
char * | int_to_str (int val) |
Safely convert a signed integer to a NULL-terminated string. More... | |
char * | double_to_str (double val) |
Safely convert a signed double to a NULL-terminated string. More... | |
uint32_t | float_to_uint32 (float f) |
Encode an ieee754 float as a uint32_t (4 bytes). More... | |
float | uint32_to_float (uint32_t i) |
Decocde an ieee754 float from a 4-byte unsigned int. More... | |
char * | selector_get_prefix (const char *selector) |
Returns the largest non-regexp part of a topic selector. More... | |
char * | diffusion_escape (const char *string) |
Escapes special characters in a string that is to be used within a topic property or a session filter. More... | |
SET_T * | diffusion_string_to_roles (const char *string) |
Utility method which converts a string of the format required by the $Roles session property into a mutable set of strings. More... | |
char * | diffusion_roles_to_string (const SET_T *roles) |
Utility method which converts a set of authorisation roles to the string format required by the $Roles session property. More... | |
bool | string_ends_with (const char *string, const char *suffix) |
Determines if str terminates with suffix . | |
bool | string_starts_with (const char *string, const char *prefix) |
Determines if str starts with prefix . | |
Miscellaneous utility functions that don't fit anywhere else.
Copyright © 2014, 2021 Push Technology Ltd., All Rights Reserved.
Use is subject to license terms.
NOTICE: All information contained herein is, and remains the property of Push Technology. The intellectual and technical concepts contained herein are proprietary to Push Technology and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret or copyright law.
char* diffusion_escape | ( | const char * | string | ) |
Escapes special characters in a string that is to be used within a topic property or a session filter.
This is a convenience method which inserts an escape character '\' before any of the special characters ' " or .
string | the string to be escaped. If NULL, then NULL will be returned |
char* diffusion_roles_to_string | ( | const SET_T * | roles | ) |
Utility method which converts a set of authorisation roles to the string format required by the $Roles
session property.
roles | A set of roles. If NULL, then NULL will be returned from this function. |
$Roles
session property SET_T* diffusion_string_to_roles | ( | const char * | string | ) |
Utility method which converts a string of the format required by the $Roles
session property into a mutable set of strings.
string | The string with quoted roles separated by whitespace or commas. If NULL, then NULL will be returned from this function. |
char* double_to_str | ( | double | val | ) |
Safely convert a signed double to a NULL-terminated string.
The "float" format specifier is used. The caller should free the return value after use.
val | The signed double to convert. |
uint32_t float_to_uint32 | ( | float | f | ) |
Encode an ieee754 float as a uint32_t (4 bytes).
f | Float to encode |
char* int_to_str | ( | int | val | ) |
Safely convert a signed integer to a NULL-terminated string.
The caller should free the return value after use.
val | The signed integer to convert. |
char* selector_get_prefix | ( | const char * | selector | ) |
Returns the largest non-regexp part of a topic selector.
selector | The topic selector to analyse. |
float uint32_to_float | ( | uint32_t | i | ) |
Decocde an ieee754 float from a 4-byte unsigned int.
i | uint32_t containing IEEE754-encoded data. |
char* uint32_to_str | ( | uint32_t | val | ) |
Safely convert an unsigned integer to a NULL-terminated string.
The caller should free the return value after use.
val | The unsigned integer to convert. |
A | NULL-terminated string or NULL if the conversion failed. |