libforensic1394  0.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
forensic1394.h
Go to the documentation of this file.
1 /*
2  This file is part of libforensic1394.
3  Copyright (C) 2010 Freddie Witherden <freddie@witherden.org>
4 
5  libforensic1394 is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as
7  published by the Free Software Foundation, either version 3 of the
8  License, or (at your option) any later version.
9 
10  libforensic1394 is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with libforensic1394. If not, see
17  <http://www.gnu.org/licenses/>.
18 */
19 
120 #ifndef _FORENSIC_1394_H
121 #define _FORENSIC_1394_H
122 
123 #ifdef __cplusplus
124 extern "C"
125 {
126 #endif
127 
128 #if defined(FORENSIC1394_DECL)
129  // No op
130 #elif defined(_MSC_VER)
131 # define FORENSIC1394_DECL __declspec(dllexport)
132 #elif (__GNUC__ >= 3)
133 # define FORENSIC1394_DECL __attribute__((visibility("default")))
134 #else
135 # define FORENSIC1394_DECL
136 #endif
137 
138 #include <stdlib.h>
139 #include <stdint.h>
140 
142 typedef struct _forensic1394_bus forensic1394_bus;
143 
145 typedef struct _forensic1394_dev forensic1394_dev;
146 
157 typedef struct _forensic1394_req
158 {
160  uint64_t addr;
161 
163  size_t len;
164 
166  void *buf;
168 
175 #define FORENSIC1394_CSR_SZ 256
176 
195  forensic1394_dev *dev);
196 
207 typedef enum
208 {
228 
238 
257 
292  int *ndev,
293  forensic1394_device_callback ondestroy);
294 
306 
318 FORENSIC1394_DECL void *
320 
331 
344 
354 
363 
389  uint64_t addr,
390  size_t len,
391  void *buf);
392 
415  forensic1394_req *req,
416  size_t nreq);
417 
438  uint64_t addr,
439  size_t len,
440  void *buf);
441 
456  const forensic1394_req *req,
457  size_t nreq);
458 
471  uint32_t *rom);
472 
482 FORENSIC1394_DECL uint16_t
484 
494 FORENSIC1394_DECL int64_t
496 
507 FORENSIC1394_DECL const char *
509 
520 
531 FORENSIC1394_DECL const char *
533 
544 
560 
572 FORENSIC1394_DECL void *
574 
585 
597 FORENSIC1394_DECL const char *
599 
600 #ifdef __cplusplus
601 }
602 #endif
603 
604 #endif // _FORENSIC_1394_H