⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 util.h

📁 linux环境下用纯c写的RTP协议的通用开发库
💻 H
字号:
/*------------------------------------------------------------------------- * util.h - align, hton24 *------------------------------------------------------------------------- */#ifndef UTIL_H#define UTIL_H#include <time.h>#include <rtp.h>/* thread states */#define THR_NOTRUNNING   0#define THR_INITIALIZING 1#define THR_RUNNING      2#define THR_TERMINATE    3#define UTIL_STOPTHREADDELTA {0, 10000000} /* 10 ms */#define UTIL_STOPTHREADMAXTRIES 15	   /* max signals to send *//* Misc utilities */#define align(val, align) (val + (val % align != 0 ? align - (val % align) : 0))#define hton24(v)            (((v&0xff) << 16) | (v&0xff00) | ((v&0xff0000)>>16))/* Time utilities */struct timespec timesub(struct timespec, struct timespec);struct timespec timeadd(struct timespec, struct timespec);mediatime_t timeflatten(struct timespec, int);struct timespec timeunflatten(mediatime_t, int);int timecmp(struct timespec, struct timespec);/* Thread utilities */int startthread(pthread_t *, void *(*)(void *), void *, pthread_mutex_t *, pthread_cond_t *, int *);int stopthread(pthread_t *, pthread_mutex_t *, pthread_cond_t *, int *);/* signal handler */void nullfcn(int);#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -