4 * Copyright 2002-2003 AVM Computersysteme Vertriebs GmbH
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #define __NO_CAPIUTILS__
27 #include <sys/types.h>
30 #ifdef HAVE_LINUX_CAPI_H
31 # include <linux/capi.h>
36 #include "wine/debug.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(capi
);
41 /*===========================================================================*\
42 \*===========================================================================*/
44 DWORD APIENTRY
wrapCAPI_REGISTER (DWORD MessageBufferSize
, DWORD maxLogicalConnection
, DWORD maxBDataBlocks
, DWORD maxBDataLen
, DWORD
*pApplID
) {
45 #ifdef HAVE_CAPI4LINUX
47 DWORD fret
= capi20_register (maxLogicalConnection
, maxBDataBlocks
, maxBDataLen
, &aid
);
49 TRACE ( "(%lx) -> %lx\n", *pApplID
, fret
);
52 FIXME ( "(), no CAPI4LINUX support compiled into WINE.\n" );
57 /*---------------------------------------------------------------------------*\
58 \*---------------------------------------------------------------------------*/
59 DWORD APIENTRY
wrapCAPI_RELEASE (DWORD ApplID
) {
60 #ifdef HAVE_CAPI4LINUX
61 DWORD fret
= capi20_release (ApplID
);
62 TRACE ("(%lx) -> %lx\n", ApplID
, fret
);
69 /*---------------------------------------------------------------------------*\
70 \*---------------------------------------------------------------------------*/
71 DWORD APIENTRY
wrapCAPI_PUT_MESSAGE (DWORD ApplID
, PVOID pCAPIMessage
) {
72 #ifdef HAVE_CAPI4LINUX
73 DWORD fret
= capi20_put_message (ApplID
, pCAPIMessage
);
74 TRACE ("(%lx) -> %lx\n", ApplID
, fret
);
81 /*---------------------------------------------------------------------------*\
82 \*---------------------------------------------------------------------------*/
83 DWORD APIENTRY
wrapCAPI_GET_MESSAGE (DWORD ApplID
, PVOID
*ppCAPIMessage
) {
84 #ifdef HAVE_CAPI4LINUX
85 DWORD fret
= capi20_get_message (ApplID
, (unsigned char **)ppCAPIMessage
);
86 TRACE ("(%lx) -> %lx\n", ApplID
, fret
);
93 /*---------------------------------------------------------------------------*\
94 \*---------------------------------------------------------------------------*/
95 DWORD APIENTRY
wrapCAPI_WAIT_FOR_SIGNAL (DWORD ApplID
) {
96 #ifdef HAVE_CAPI4LINUX
97 TRACE ("(%lx)\n", ApplID
);
98 return capi20_waitformessage (ApplID
, NULL
);
104 /*---------------------------------------------------------------------------*\
105 \*---------------------------------------------------------------------------*/
106 DWORD APIENTRY
wrapCAPI_GET_MANUFACTURER (char *SzBuffer
) {
107 #ifdef HAVE_CAPI4LINUX
108 DWORD fret
= (capi20_get_manufacturer (0, SzBuffer
) != 0) ? 0 : 0x1108;
109 if (!strncmp (SzBuffer
, "AVM", 3)) {
110 strcpy (SzBuffer
, "AVM-GmbH");
112 TRACE ("(%s) -> %lx\n", SzBuffer
, fret
);
119 /*---------------------------------------------------------------------------*\
120 \*---------------------------------------------------------------------------*/
121 DWORD APIENTRY
wrapCAPI_GET_VERSION (DWORD
*pCAPIMajor
, DWORD
*pCAPIMinor
, DWORD
*pManufacturerMajor
, DWORD
*pManufacturerMinor
) {
122 #ifdef HAVE_CAPI4LINUX
123 unsigned char version
[4 * sizeof (unsigned)];
124 DWORD fret
= (capi20_get_version (0, version
) != 0) ? 0 : 0x1108;
125 *pCAPIMajor
= *(unsigned *)(version
+ 0 * sizeof (unsigned));
126 *pCAPIMinor
= *(unsigned *)(version
+ 1 * sizeof (unsigned));
127 *pManufacturerMajor
= *(unsigned *)(version
+ 2 * sizeof (unsigned));
128 *pManufacturerMinor
= *(unsigned *)(version
+ 3 * sizeof (unsigned));
129 TRACE ("(%lx.%lx,%lx.%lx) -> %lx\n", *pCAPIMajor
, *pCAPIMinor
, *pManufacturerMajor
,
130 *pManufacturerMinor
, fret
);
137 /*---------------------------------------------------------------------------*\
138 \*---------------------------------------------------------------------------*/
139 DWORD APIENTRY
wrapCAPI_GET_SERIAL_NUMBER (char *SzBuffer
) {
140 #ifdef HAVE_CAPI4LINUX
141 DWORD fret
= (capi20_get_serial_number (0, SzBuffer
) != 0) ? 0 : 0x1108;
142 TRACE ("(%s) -> %lx\n", SzBuffer
, fret
);
149 /*---------------------------------------------------------------------------*\
150 \*---------------------------------------------------------------------------*/
151 DWORD APIENTRY
wrapCAPI_GET_PROFILE (PVOID SzBuffer
, DWORD CtlrNr
) {
152 #ifdef HAVE_CAPI4LINUX
153 DWORD fret
= capi20_get_profile (CtlrNr
, SzBuffer
);
154 TRACE ("(%lx,%x) -> %lx\n", CtlrNr
, *(unsigned short *)SzBuffer
, fret
);
161 /*---------------------------------------------------------------------------*\
162 \*---------------------------------------------------------------------------*/
163 DWORD APIENTRY
wrapCAPI_INSTALLED (void) {
164 #ifdef HAVE_CAPI4LINUX
165 DWORD fret
= capi20_isinstalled();
166 TRACE ("() -> %lx\n", fret
);
173 /*---------------------------------------------------------------------------*\
174 \*---------------------------------------------------------------------------*/
175 DWORD APIENTRY
wrapCAPI_MANUFACTURER (DWORD Class
, DWORD Function
, DWORD Ctlr
, PVOID pParams
, DWORD ParamsLen
) {
176 FIXME ("(), not supported!\n");
180 /*---------------------------------------------------------------------------*\
181 \*---------------------------------------------------------------------------*/