motu: implement block async functions since they are ultimately required when dealing...
[ffado.git] / libffado / src / ffadotypes.h
blobc409d72252dc853d8e59f46de4e17b0c41d2d53a
1 /*
2 * Copyright (C) 2005-2008 by Daniel Wagner
3 * (C) 2009-2009 by Arnold Krille
5 * This file is part of FFADO
6 * FFADO = Free Firewire (pro-)audio drivers for linux
8 * FFADO is based upon FreeBoB.
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 2 of the License, or
13 * (at your option) version 3 of the License.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #ifndef FFADOTYPES_H
26 #define FFADOTYPES_H
28 #ifndef __STDC_FORMAT_MACROS
29 #define __STDC_FORMAT_MACROS
30 #endif
31 #include <inttypes.h>
33 #include <libraw1394/raw1394.h>
35 #define INVALID_NODE_ID 0xFF
37 typedef quadlet_t fb_quadlet_t;
38 typedef byte_t fb_byte_t;
39 typedef octlet_t fb_octlet_t;
40 typedef nodeid_t fb_nodeid_t;
41 typedef nodeaddr_t fb_nodeaddr_t;
43 #define FORMAT_FB_OCTLET_T "0x%016" PRIX64
44 #define FORMAT_FB_NODEID_T "0x%016" PRIX64
45 #define FORMAT_FB_NODEADDR_T "0x%016" PRIX64
47 class DeviceManager;
49 struct ffado_handle {
50 DeviceManager* m_deviceManager;
54 #include <vector>
55 #include <string>
57 class stringlist : public std::vector<std::string>
59 public:
60 static stringlist splitString(std::string in, std::string delimiter) {
61 stringlist result;
62 size_type start = 0, end = 0;
63 while ( start < in.size() ) {
64 end = std::min(in.size(), in.find(delimiter, start));
65 result.push_back(in.substr(start, end-start));
66 start = end+delimiter.size();
68 return result;
71 std::string join(std::string joiner ="") {
72 std::string result;
73 for ( stringlist::iterator it=begin(); it!=end(); ) {
74 result += *it;
75 it++;
76 if ( it!=end() ) {
77 result += joiner;
80 return result;
84 #endif