Debian Codegraph @

src/cfg_intake.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2017 Moritz Grimm <[email protected]>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 #ifndef __CFG_INTAKE_H__
18 #define __CFG_INTAKE_H__
19
20 enum cfg_intake_type {
21 CFG_INTAKE_AUTODETECT = 0,
22 CFG_INTAKE_FILE,
23 CFG_INTAKE_PLAYLIST,
24 CFG_INTAKE_PROGRAM,
25 CFG_INTAKE_STDIN,
26 CFG_INTAKE_MIN = CFG_INTAKE_AUTODETECT,
27 CFG_INTAKE_MAX = CFG_INTAKE_STDIN,
28 };
29
30 typedef struct cfg_intake * cfg_intake_t;
31 typedef struct cfg_intake_list * cfg_intake_list_t;
32
33 cfg_intake_list_t
34 cfg_intake_list_create(void);
35 void cfg_intake_list_destroy(cfg_intake_list_t *);
36 unsigned int
37 cfg_intake_list_nentries(cfg_intake_list_t);
38
39 cfg_intake_t
40 cfg_intake_list_find(cfg_intake_list_t, const char *);
41 cfg_intake_t
42 cfg_intake_list_get(cfg_intake_list_t, const char *);
43 void cfg_intake_list_foreach(cfg_intake_list_t, void (*)(cfg_intake_t,
44 void *), void *);
45
46 cfg_intake_t
47 cfg_intake_create(const char *);
48 void cfg_intake_destroy(cfg_intake_t *);
49
50 int cfg_intake_set_name(cfg_intake_t, cfg_intake_list_t, const char *,
51 const char **);
52 int cfg_intake_set_type(cfg_intake_t, cfg_intake_list_t, const char *,
53 const char **);
54 int cfg_intake_set_filename(cfg_intake_t, cfg_intake_list_t, const char *,
55 const char **);
56 int cfg_intake_set_shuffle(cfg_intake_t, cfg_intake_list_t, const char *,
57 const char **);
58 int cfg_intake_set_stream_once(cfg_intake_t, cfg_intake_list_t,
59 const char *, const char **);
60
61 int cfg_intake_validate(cfg_intake_t, const char **);
62
63 const char *
64 cfg_intake_get_name(cfg_intake_t);
65 enum cfg_intake_type
66 cfg_intake_get_type(cfg_intake_t);
67 const char *
68 cfg_intake_get_type_str(cfg_intake_t);
69 const char *
70 cfg_intake_get_filename(cfg_intake_t);
71 int cfg_intake_get_shuffle(cfg_intake_t);
72 int cfg_intake_get_stream_once(cfg_intake_t);
73
74 #endif /* __CFG_INTAKE_H__ */