1 module pulse.util;
2 
3 version(linux):
4 
5 import core.stdc.config;
6 
7 extern (C):
8 
9 /***
10   This file is part of PulseAudio.
11 
12   Copyright 2004-2006 Lennart Poettering
13   Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
14 
15   PulseAudio is free software; you can redistribute it and/or modify
16   it under the terms of the GNU Lesser General Public License as
17   published by the Free Software Foundation; either version 2.1 of the
18   License, or (at your option) any later version.
19 
20   PulseAudio is distributed in the hope that it will be useful, but
21   WITHOUT ANY WARRANTY; without even the implied warranty of
22   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23   Lesser General Public License for more details.
24 
25   You should have received a copy of the GNU Lesser General Public
26   License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
27 ***/
28 
29 /** \file
30  * Assorted utility functions */
31 
32 /** Return the current username in the specified string buffer. */
33 char* pa_get_user_name (char* s, size_t l);
34 
35 /** Return the current hostname in the specified buffer. */
36 char* pa_get_host_name (char* s, size_t l);
37 
38 /** Return the fully qualified domain name in s */
39 char* pa_get_fqdn (char* s, size_t l);
40 
41 /** Return the home directory of the current user */
42 char* pa_get_home_dir (char* s, size_t l);
43 
44 /** Return the binary file name of the current process. This is not
45  * supported on all architectures, in which case NULL is returned. */
46 char* pa_get_binary_name (char* s, size_t l);
47 
48 /** Return a pointer to the filename inside a path (which is the last
49  * component). If passed NULL will return NULL. */
50 char* pa_path_get_filename (const(char)* p);
51 
52 /** Wait t milliseconds */
53 int pa_msleep (c_ulong t);
54 
55 /** Make the calling thread realtime if we can. On Linux, this uses RealTimeKit
56  * if available and POSIX APIs otherwise (the latter applies to other UNIX
57  * variants as well). This is also implemented for macOS and Windows.
58  * \since 13.0 */
59 int pa_thread_make_realtime (int rtprio);
60