Ripples 1.0
High Performant Software Architecture For Transaction Processing
Loading...
Searching...
No Matches
utils.h File Reference
#include <arpa/inet.h>
#include <assert.h>
#include <ctype.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/socket.h>
#include <time.h>
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEBUG_TEST   0
 
#define TIME_RFC3339_STRLEN   31
 
#define debug()
 
#define debug_print(str)
 
#define debug_printf(fmt, ...)
 
#define ARRAY_COUNT(a)   sizeof(a) / sizeof(a[0])
 
#define CHECK_MALLOC(a)
 
#define INCREMENT(a)   a += 1
 
#define DECREMENT(a)   a -= 1
 

Functions

int utl_ip_port_from_ss (char *ip, size_t ip_len, uint16_t *port, struct sockaddr_storage *ss)
 
double utl_diff_timespec_as_double (const struct timespec *t1, const struct timespec *t2)
 
void utl_diff_timespec (struct timespec *dst, const struct timespec *t1, const struct timespec *t2)
 
void char_to_lc (char *c)
 
void str_to_lc (uint8_t *str, size_t str_len)
 
bool str_is_numeric (uint8_t *str, size_t str_len)
 
int str_to_unsigned_long (unsigned long *dst, char *str)
 
int str_to_bool (bool *dst, char *str)
 
int parse_csv_to_ul_array (size_t *ul_array, size_t ul_array_len, char *str)
 
int sockaddr_storage_to_string (char *buf, size_t buf_len, struct sockaddr_storage *ss)
 
int utl_readall (int fd, size_t size, void **buf, char *err, size_t err_len)
 
int utl_writeall (int fd, void *buf, size_t buf_len, char *err, size_t err_len)
 
int utl_timespec_to_rfc3339nano (struct timespec *ts, char *buf)
 
void utl_clock_gettime_rt_fatal (struct timespec *tp)
 

Detailed Description

Author
Faruk Grozdanic

Copyright (c) 2025 Faruk Grozdanic

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.