-
Notifications
You must be signed in to change notification settings - Fork 0
/
misc.h
55 lines (48 loc) · 1.76 KB
/
misc.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
/*
* Copyright 2008-2013 Various Authors
* Copyright 2004 Timo Hirvonen
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CMUS_MISC_H
#define CMUS_MISC_H
#include <stddef.h>
extern const char *cmus_config_dir;
extern const char *cmus_playlist_dir;
extern const char *cmus_socket_path;
extern const char *cmus_data_dir;
extern const char *cmus_lib_dir;
extern const char *home_dir;
extern const char *user_name;
char **get_words(const char *text);
int strptrcmp(const void *a, const void *b);
int strptrcoll(const void *a, const void *b);
int misc_init(void);
const char *escape(const char *str);
const char *unescape(const char *str);
const char *get_filename(const char *path);
/*
* @field contains Replay Gain data format in bit representation
* @gain pointer where to store gain value * 10
*
* Returns 0 if @field doesn't contain a valid gain value,
* 1 for track (= radio) adjustment
* 2 for album (= audiophile) adjustment
*
* http://replaygain.hydrogenaudio.org/rg_data_format.html
*/
int replaygain_decode(unsigned int field, int *gain);
char *expand_filename(const char *name);
void shuffle_array(void *array, size_t n, size_t size);
#endif