-
Notifications
You must be signed in to change notification settings - Fork 5
/
utils.h
76 lines (31 loc) · 1.25 KB
/
utils.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef __PS_UTILS_H__
#define __PS_UTILS_H__
#include <stdint.h>
#include <glib.h>
#include <netinet/in.h>
gint64 ps_get_monotonic_time(void);
gint64 ps_get_real_time(void);
char *ps_string_replace(char *message, const char *old_string, const char *new_string) G_GNUC_WARN_UNUSED_RESULT;
gboolean ps_is_true(const char *value);
gboolean ps_strcmp_const_time(const void *str1, const void *str2);
typedef uint32_t ps_flags;
void ps_flags_reset(ps_flags *flags);
void ps_flags_set(ps_flags *flags, uint32_t flag);
void ps_flags_clear(ps_flags *flags, uint32_t flag);
gboolean ps_flags_is_set(ps_flags *flags, uint32_t flag);
int ps_mkdir(const char *dir, mode_t mode);
int ps_get_opus_pt(const char *sdp);
char * ps_get_opus_dir (const char * sdp);
char * ps_get_vp8_dir (const char * sdp);
int ps_get_isac32_pt(const char *sdp);
int ps_get_isac16_pt(const char *sdp);
int ps_get_pcmu_pt(const char *sdp);
int ps_get_pcma_pt(const char *sdp);
int ps_get_vp8_pt(const char *sdp);
int ps_get_vp9_pt(const char *sdp);
int ps_get_h264_pt(const char *sdp);
gboolean ps_is_ip_valid(const char *ip, int *family);
char *ps_address_to_ip(struct sockaddr *address);
int ps_pidfile_create(const char *file);
int ps_pidfile_remove(void);
#endif