source: roaraudio/include/libroar/vio_ctl.h @ 4530:82135a5e57df

Last change on this file since 4530:82135a5e57df was 4530:82135a5e57df, checked in by phi, 12 years ago

some additional types for use with protocols like HTTP

File size: 8.4 KB
Line 
1//vio_ctl.h:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2010
5 *
6 *  This file is part of libroar a part of RoarAudio,
7 *  a cross-platform sound system for both, home and professional use.
8 *  See README for details.
9 *
10 *  This file is free software; you can redistribute it and/or modify
11 *  it under the terms of the GNU General Public License version 3
12 *  as published by the Free Software Foundation.
13 *
14 *  libroar is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *  GNU General Public License for more details.
18 *
19 *  You should have received a copy of the GNU General Public License
20 *  along with this software; see the file COPYING.  If not, write to
21 *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
22 *  Boston, MA 02110-1301, USA.
23 *
24 *  NOTE for everyone want's to change something and send patches:
25 *  read README and HACKING! There a addition information on
26 *  the license of this document you need to read before you send
27 *  any patches.
28 *
29 *  NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc
30 *  or libpulse*:
31 *  The libs libroaresd, libroararts and libroarpulse link this lib
32 *  and are therefore GPL. Because of this it may be illigal to use
33 *  them with any software that uses libesd, libartsc or libpulse*.
34 */
35
36#ifndef _LIBROARVIO_CTL_H_
37#define _LIBROARVIO_CTL_H_
38
39#include "libroar.h"
40
41// CTLs:
42/*
43 * 0xAAAABBBB
44 * AAAA:
45 *   0x0001 -> Basic stream calls
46 *   0x0002 -> Driver calls
47 *
48 * BBBB:
49 *   0x0XXX -> Client
50 *   0x1XXX -> Server
51 */
52
53#define ROAR_VIO_CTL_GET                  0x1
54#define ROAR_VIO_CTL_SET                  0x2
55
56#define ROAR_VIO_CTL_CLIENT            0x0000
57#define ROAR_VIO_CTL_SERVER            0x1000
58
59#define ROAR_VIO_CTL_GENERIC     (0x0000<<16)
60#define ROAR_VIO_CTL_STREAM      (0x0001<<16)
61#define ROAR_VIO_CTL_DRIVER      (0x0002<<16)
62
63// basic calls:
64#define ROAR_VIO_CTL_GET_NEXT            (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_GET|0x0100)
65#define ROAR_VIO_CTL_SET_NEXT            (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_SET|0x0100)
66#define ROAR_VIO_CTL_GET_FH              (ROAR_VIO_CTL_GENERIC|0x0110)
67#define ROAR_VIO_CTL_GET_READ_FH         (ROAR_VIO_CTL_GENERIC|0x0111)
68#define ROAR_VIO_CTL_GET_WRITE_FH        (ROAR_VIO_CTL_GENERIC|0x0112)
69#define ROAR_VIO_CTL_GET_SELECT_FH       (ROAR_VIO_CTL_GENERIC|0x0113)
70#define ROAR_VIO_CTL_GET_SELECT_READ_FH  (ROAR_VIO_CTL_GENERIC|0x0114)
71#define ROAR_VIO_CTL_GET_SELECT_WRITE_FH (ROAR_VIO_CTL_GENERIC|0x0115)
72#define ROAR_VIO_CTL_SELECT              (ROAR_VIO_CTL_GENERIC|0x0120)
73#define ROAR_VIO_CTL_GET_UMMAP           (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_GET|0x0130) /* Use mmap(), int as bool */
74#define ROAR_VIO_CTL_SET_UMMAP           (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_SET|0x0130) /* ** */
75#define ROAR_VIO_CTL_GET_SHUTDOWN        (ROAR_VIO_CTL_GENERIC|0x0140) /* shutdown(), need specs */
76#define ROAR_VIO_CTL_SET_NOSYNC          (ROAR_VIO_CTL_GENERIC|0x0150) /* delete call of vio sync() from object */
77#define ROAR_VIO_CTL_GET_NAME            (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_GET|0x0160) /* get name of VIO */
78#define ROAR_VIO_CTL_ACCEPT              (ROAR_VIO_CTL_GENERIC|0x0170) /* accept(), vio* */
79#define ROAR_VIO_CTL_SHUTDOWN            (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_SET|0x0174) /* shutdown(), int */
80#define ROAR_VIO_CTL_SYSIO_IOCTL         (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_SET|0x0180) /* ioctl(), */
81                                                                                        /* struct roar_vio_sysio_ioctl* */
82#define ROAR_VIO_CTL_FSTAT               (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_GET|0x0184) /* fstat() */
83
84// more about network based protocols:
85#define ROAR_VIO_CTL_GET_MIMETYPE        (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_GET|0x0190)
86#define ROAR_VIO_CTL_SET_MIMETYPE        (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_SET|0x0190)
87#define ROAR_VIO_CTL_GET_USERPASS        (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_SET|0x0194)
88#define ROAR_VIO_CTL_SET_USERPASS        (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_SET|0x0194)
89
90// get or set data format used for read and write calls, see below
91#define ROAR_VIO_CTL_GET_DATA_FORMAT   (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_GET|0x0170)
92#define ROAR_VIO_CTL_SET_DATA_FORMAT   (ROAR_VIO_CTL_GENERIC|ROAR_VIO_CTL_SET|0x0170)
93
94// stream:
95#define ROAR_VIO_CTL_SET_STREAM    (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_CLIENT|ROAR_VIO_CTL_SET) /* normal streams */
96#define ROAR_VIO_CTL_GET_STREAM    (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_CLIENT|ROAR_VIO_CTL_GET)
97#define ROAR_VIO_CTL_SET_DMXSCHAN  (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_CLIENT|ROAR_VIO_CTL_SET|0x10) /* simple DMX Channel */
98#define ROAR_VIO_CTL_GET_DMXSCHAN  (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_CLIENT|ROAR_VIO_CTL_GET|0x10)
99#define ROAR_VIO_CTL_SET_DMXUNIV   (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_CLIENT|ROAR_VIO_CTL_SET|0x20) /* DMX Universe */
100#define ROAR_VIO_CTL_GET_DMXUNIV   (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_CLIENT|ROAR_VIO_CTL_GET|0x20)
101
102#define ROAR_VIO_CTL_SET_SSTREAM   (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_SERVER|ROAR_VIO_CTL_SET) /* server streams */
103#define ROAR_VIO_CTL_GET_SSTREAM   (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_SERVER|ROAR_VIO_CTL_GET)
104#define ROAR_VIO_CTL_SET_SSTREAMID (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_SERVER|ROAR_VIO_CTL_SET|0x10) /* server streams */
105#define ROAR_VIO_CTL_GET_SSTREAMID (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_SERVER|ROAR_VIO_CTL_GET|0x10)
106
107#define ROAR_VIO_CTL_SET_AUINFO    (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_SET|0x2000) /* set a struct roar_audio_info */
108#define ROAR_VIO_CTL_GET_AUINFO    (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_GET|0x2000) /* get a struct roar_audio_info */
109
110#define ROAR_VIO_CTL_GET_DELAY     (ROAR_VIO_CTL_STREAM|ROAR_VIO_CTL_GET|0x010) /* return in bytes as the vio interface */
111                                              /* does not know anything about streams */
112
113#define ROAR_VIO_CTL_GET_DBLOCKS   (ROAR_VIO_CTL_DRIVER|0x0001) /* get Driver Blocks */
114#define ROAR_VIO_CTL_SET_DBLOCKS   (ROAR_VIO_CTL_DRIVER|0x0002) /* set Driver Blocks */
115#define ROAR_VIO_CTL_GET_DBLKSIZE  (ROAR_VIO_CTL_DRIVER|0x0003) /* get Driver Blocks size (in byte) */
116#define ROAR_VIO_CTL_SET_DBLKSIZE  (ROAR_VIO_CTL_DRIVER|0x0004) /* set Driver Blocks size (in byte) */
117#define ROAR_VIO_CTL_GET_VOLUME    (ROAR_VIO_CTL_DRIVER|ROAR_VIO_CTL_GET|0x10)
118#define ROAR_VIO_CTL_SET_VOLUME    (ROAR_VIO_CTL_DRIVER|ROAR_VIO_CTL_SET|0x10)
119
120// consts for ROAR_VIO_CTL_SHUTDOWN:
121#define ROAR_VIO_SHUTDOWN_READ        0x1
122#define ROAR_VIO_SHUTDOWN_WRITE       0x2
123#define ROAR_VIO_SHUTDOWN_LISTEN      0x4 /* like close() on listen sock but allow padding requests */
124                                          /* to be accept()ed                                       */
125#define ROAR_VIO_SHUTDOWN_RW       (ROAR_VIO_SHUTDOWN_READ|ROAR_VIO_SHUTDOWN_WRITE)
126
127// Data format used for read/write():
128
129// _D_ata _F_ormat _T_ypes:
130// generic types:
131#define ROAR_VIO_DFT_UNKNOWN           -1
132#define ROAR_VIO_DFT_NULL          0x0000
133#define ROAR_VIO_DFT_RAW           0x0001 /* raw bytes, default */
134
135// RoarAudio types:
136#define ROAR_VIO_DFT_RA_MESSAGE    0x0101
137#define ROAR_VIO_DFT_RA_BUFFER     0x0102
138
139// extern types:
140#define ROAR_VIO_DFT_OGG_PAGE      0x0201
141#define ROAR_VIO_DFT_OGG_PACKET    0x0202
142
143struct roar_vio_dataformat {
144 unsigned int type;
145};
146
147struct roar_vio_sysio_ioctl {
148 long long int   cmd;
149 void          * argp;
150};
151
152#if 0
153          struct stat {
154              dev_t     st_dev;     /* ID of device containing file */
155              ino_t     st_ino;     /* inode number */
156            X mode_t    st_mode;    /* protection */
157            X nlink_t   st_nlink;   /* number of hard links */
158            X uid_t     st_uid;     /* user ID of owner */
159            X gid_t     st_gid;     /* group ID of owner */
160              dev_t     st_rdev;    /* device ID (if special file) */
161            X off_t     st_size;    /* total size, in bytes */
162            X blksize_t st_blksize; /* blocksize for filesystem I/O */
163            X blkcnt_t  st_blocks;  /* number of blocks allocated */
164              time_t    st_atime;   /* time of last access */
165              time_t    st_mtime;   /* time of last modification */
166              time_t    st_ctime;   /* time of last status change */
167          };
168#endif
169
170struct roar_vio_stat {
171 mode_t mode;
172 size_t linkc;
173 uid_t  uid;
174 gid_t  gid;
175 size_t size;
176 size_t blksize;
177 size_t blocks;
178};
179
180// struct for userpass:
181struct roar_userpass {
182 int subtype;
183 char * user;
184 char * pass;
185};
186
187#endif
188
189//ll
Note: See TracBrowser for help on using the repository browser.