X-Git-Url: https://code.delx.au/pulseaudio/blobdiff_plain/11cc072a1eef2c8b26e9e642b8bf64c63da8b8ec..4a40aed9c0aa0d07450bb3334a435064466e94df:/src/pulsecore/core-util.h diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h index c9e307f5..0ba33f31 100644 --- a/src/pulsecore/core-util.h +++ b/src/pulsecore/core-util.h @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef HAVE_SYS_RESOURCE_H #include @@ -35,6 +36,10 @@ #include #include +#ifndef PACKAGE +#error "Please include config.h before including this file!" +#endif + struct timeval; /* These resource limits are pretty new on Linux, let's define them @@ -92,6 +97,10 @@ static inline const char *pa_strempty(const char *x) { return x ? x : ""; } +static inline const char *pa_strna(const char *x) { + return x ? x : "n/a"; +} + char *pa_split(const char *c, const char*delimiters, const char **state); char *pa_split_spaces(const char *c, const char **state); @@ -132,6 +141,8 @@ size_t pa_vsnprintf(char *str, size_t size, const char *format, va_list ap); char *pa_truncate_utf8(char *c, size_t l); +int pa_match(const char *expr, const char *v); + char *pa_getcwd(void); char *pa_make_path_absolute(const char *p); pa_bool_t pa_is_path_absolute(const char *p); @@ -191,5 +202,25 @@ pa_bool_t pa_in_system_mode(void); #define pa_streq(a,b) (!strcmp((a),(b))) char *pa_machine_id(void); +char *pa_uname_string(void); + +#ifdef HAVE_VALGRIND_MEMCHECK_H +pa_bool_t pa_in_valgrind(void); +#else +static inline pa_bool_t pa_in_valgrind(void) { + return FALSE; +} +#endif + +unsigned pa_gcd(unsigned a, unsigned b); +void pa_reduce(unsigned *num, unsigned *den); + +unsigned pa_ncpus(void); + +char *pa_replace(const char*s, const char*a, const char *b); + +char *pa_unescape(char *p); + +char *pa_realpath(const char *path); #endif