aboutsummaryrefslogtreecommitdiff
path: root/src/proone_util.h
blob: 730ed3cd9414ce33228b804da754d7f6b51bb0d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
#include "proone_rnd.h"

#include <stddef.h>
#include <time.h>


#define proone_op_spaceship(a,b) (a==b?0:a<b?-1:1)


#if 0
bool proone_strendsw (const char *str, const char *w) {
    const size_t len_str = strlen(str);
    const size_t len_w = strlen(w);

    if (len_str < len_w) {
        return false;
    }
    return strcmp(str + (len_str - len_w), w) == 0;
}
#endif

void proone_succeed_or_die (const int ret);

void proone_rnd_alphanumeric_str (proone_rnd_engine_t *rnd_engine, char *str, const size_t len);
void proone_empty_func ();

struct timespec proone_sub_timespec (const struct timespec *a, const struct timespec *b);
double proone_real_timespec (const struct timespec *ts);
int proone_cmp_timespec (const struct timespec *a, const struct timespec *b);