]> git.rkrishnan.org Git - dttsp.git/blob - jDttSP/win/chan.h
Initial revision
[dttsp.git] / jDttSP / win / chan.h
1 /* chan.h\r
2 \r
3 fast inter-user-process single-reader/single-writer channels\r
4 using a modified version of jack ringbuffers and memory-mapped files.\r
5 \r
6 This file is part of a program that implements a Software-Defined Radio.\r
7 \r
8 Copyright (C) 2004 by Frank Brickle, AB2KT and Bob McGwier, N4HY\r
9 \r
10 This program is free software; you can redistribute it and/or modify\r
11 it under the terms of the GNU General Public License as published by\r
12 the Free Software Foundation; either version 2 of the License, or\r
13 (at your option) any later version.\r
14 \r
15 This program is distributed in the hope that it will be useful,\r
16 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
18 GNU General Public License for more details.\r
19 \r
20 You should have received a copy of the GNU General Public License\r
21 along with this program; if not, write to the Free Software\r
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
23 \r
24 The authors can be reached by email at\r
25 \r
26 ab2kt@arrl.net\r
27 or\r
28 rwmcgwier@comcast.net\r
29 \r
30 or by paper mail at\r
31 \r
32 The DTTS Microwave Society\r
33 6 Kathleen Place\r
34 Bridgewater, NJ 08807\r
35 */\r
36 \r
37 #ifndef _chan_h\r
38 #define _chan_h\r
39 \r
40 #include <sys/types.h>\r
41 #include <stdlib.h>\r
42 #include <banal.h>\r
43 #include <bufvec.h>\r
44 #ifndef _WINDOWS\r
45 #include <values.h>\r
46 #else\r
47 #include <windows.h>\r
48 #endif\r
49 #include <stdio.h>\r
50 #include <ctype.h>\r
51 #include <string.h>\r
52 #include <ringb.h>\r
53 \r
54 \r
55 typedef\r
56 struct _chan {\r
57   struct {\r
58     size_t buf, rib, tot, tru;\r
59   } size;\r
60   struct {\r
61     char *path;\r
62     int desc;\r
63   } file;\r
64   struct {\r
65     char *base;\r
66   } map;\r
67   ringb_t *rb;\r
68 } ChanDesc, *Chan;\r
69 \r
70 extern size_t putChan(Chan c, char *data, size_t size);\r
71 extern size_t getChan(Chan c, char *data, size_t size);\r
72 extern BOOLEAN putChan_nowait(Chan c, char *data, size_t size);\r
73 extern BOOLEAN getChan_nowait(Chan c, char *data, size_t size);\r
74 extern Chan openChan(char *path,size_t want);\r
75 extern void closeChan(Chan c);\r
76 \r
77 #endif\r