This commit is contained in:
Anthony Minessale
2016-10-12 18:00:13 -05:00
parent 550d85210c
commit 9b8a5edd3d
32 changed files with 765 additions and 150 deletions
+21
View File
@@ -47,6 +47,25 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_URL_UNSAFE "\r\n #%&+:;<=>?@[\\]^`{|}\""
static inline char *switch_get_hex_bytes(switch_byte_t *buf, switch_size_t datalen, char *new_buf, switch_size_t new_datalen)
{
switch_byte_t *p, *e;
char *pp, *ee;
e = buf + datalen;
ee = new_buf + new_datalen;
pp = new_buf;
for (p = buf; p < e && pp < ee - 4; p++) {
snprintf(pp, 4, "%.2x ", (int)*p);
pp += 3;
}
*(pp-1) = '\0';
return new_buf;
}
static inline uint32_t switch_round_to_step(uint32_t num, uint32_t step)
{
uint32_t r;
@@ -1321,6 +1340,8 @@ typedef struct {
**/
SWITCH_DECLARE(void) switch_getcputime(switch_cputime *t);
SWITCH_DECLARE(char *)switch_html_strip(const char *str);
SWITCH_END_EXTERN_C
#endif
/* For Emacs: