-
Notifications
You must be signed in to change notification settings - Fork 25
/
iin_probe.c
82 lines (75 loc) · 2.44 KB
/
iin_probe.c
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* iin_probe.c
* $Id: iin_probe.c,v 1.9 2006/09/01 17:24:01 bobi Exp $
*
* Copyright 2004 Bobi B., [email protected]
*
* This file is part of hdl_dump.
*
* hdl_dump 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.
*
* hdl_dump 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 hdl_dump; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "iin.h"
#include "iin_optical.h"
#include "iin_spti.h"
#include "iin_aspi.h"
#include "iin_nero.h"
#include "iin_cdrwin.h"
#include "iin_gi.h"
#include "iin_iso.h"
#include "iin_iml.h"
#include "iin_hio.h"
#include "dict.h"
#include "config.h"
#include "retcodes.h"
#if defined(USE_THREADED_IIN)
#include "thd_iin.h"
#endif
int iin_probe(const dict_t *config,
const char *path,
iin_t **iin)
{
int result = RET_NOT_COMPAT;
/* prefix-driven inputs first */
if (result == RET_NOT_COMPAT)
result = iin_hio_probe_path(config, path, iin);
if (result == RET_NOT_COMPAT)
result = iin_optical_probe_path(path, iin);
#if defined(_BUILD_WIN32)
if (result == RET_NOT_COMPAT)
result = iin_spti_probe_path(path, iin);
/* assume ASPI support enabled */
if (result == RET_NOT_COMPAT)
result = iin_aspi_probe_path(path, iin);
#endif
/* file-driven inputs next, ordered by accuracy */
if (result == RET_NOT_COMPAT)
result = iin_nero_probe_path(path, iin);
if (result == RET_NOT_COMPAT)
result = iin_cdrwin_probe_path(path, iin);
if (result == RET_NOT_COMPAT)
result = iin_gi_probe_path(path, iin);
if (result == RET_NOT_COMPAT)
result = iin_iml_probe_path(path, iin);
if (result == RET_NOT_COMPAT)
result = iin_iso_probe_path(path, iin);
#if defined(USE_THREADED_IIN)
if (result == RET_OK) { /* wrap in threaded delegate */
iin_t *tmp = thd_create(*iin);
if (tmp != NULL)
*iin = tmp;
}
#endif /* _BUILD_WIN32 defined? */
return (result);
}