[go: up one dir, main page]

File: misc.h

package info (click to toggle)
cmus 2.10.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,040 kB
  • sloc: ansic: 38,844; sh: 1,578; makefile: 257; python: 157
file content (54 lines) | stat: -rw-r--r-- 1,768 bytes parent folder | download | duplicates (4)
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
/*
 * 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;

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