"Fossies" - the Fresh Open Source Software Archive 
Member "xorriso-1.5.4/libburn/sg.h" (30 Jan 2021, 2689 Bytes) of package /linux/misc/xorriso-1.5.4.pl02.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "sg.h" see the
Fossies "Dox" file reference documentation.
1 /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
2
3 /* Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+
4 */
5
6 #ifndef __SG
7 #define __SG
8
9
10 #include "os.h"
11
12
13 /* see os.h for name of particular os-*.h where this is defined */
14 BURN_OS_DEFINE_DRIVE_ENUMERATOR_T
15
16
17 struct burn_drive;
18 struct command;
19
20
21 /* ts A60922 ticket 33 */
22 int sg_give_next_adr(burn_drive_enumerator_t *enm_context,
23 char adr[], int adr_size, int initialize);
24 int sg_is_enumerable_adr(char *adr);
25 int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no,
26 int *target_no, int *lun_no);
27
28 int sg_grab(struct burn_drive *);
29 int sg_release(struct burn_drive *);
30 int sg_issue_command(struct burn_drive *, struct command *);
31
32 /* ts A61115 : formerly sg_enumerate();ata_enumerate() */
33 int scsi_enumerate_drives(void);
34
35 int sg_drive_is_open(struct burn_drive * d);
36
37 int burn_os_is_2k_seekrw(char *path, int flag);
38
39 int burn_os_stdio_capacity(char *path, off_t write_start, off_t *bytes);
40
41 /* ts A91227 */
42 /** Returns the id string of the SCSI transport adapter and eventually
43 needed operating system facilities.
44 This call is usable even if sg_initialize() was not called yet. In that
45 case a preliminary constant message might be issued if detailed info is
46 not available yet.
47 @param msg returns id string
48 @param flag unused yet, submit 0
49 @return 1 = success, <=0 = failure
50 */
51 int sg_id_string(char msg[1024], int flag);
52
53 /* ts A91225 */
54 /** Performs global initialization of the SCSI transport adapter and eventually
55 needed operating system facilities. Checks for compatibility supporting
56 software components.
57 @param msg returns ids and/or error messages of eventual helpers
58 @param flag unused yet, submit 0
59 @return 1 = success, <=0 = failure
60 */
61 int sg_initialize(char msg[1024], int flag);
62
63 /* ts A91227 */
64 /** Performs global finalization of the SCSI transport adapter and eventually
65 needed operating system facilities. Releases globally acquired resources.
66 @param flag unused yet, submit 0
67 @return 1 = success, <=0 = failure
68 */
69 int sg_shutdown(int flag);
70
71 /* ts A91227 */
72 /** Finalizes BURN_OS_TRANSPORT_DRIVE_ELEMENTS, the components of
73 struct burn_drive which are defined in os-*.h.
74 The eventual initialization of those components was made underneath
75 scsi_enumerate_drives().
76 This will be called when a burn_drive gets disposed.
77 @param d the drive to be finalized
78 @param flag unused yet, submit 0
79 @return 1 = success, <=0 = failure
80 */
81 int sg_dispose_drive(struct burn_drive *d, int flag);
82
83
84 #endif /* __SG */