2 * Copyright (C) 2008 Nokia Corporation
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #define USE_H_IN3 //h_in2 or h_in3
27 #include "nota3/h_in/h_bsdapi.h"
28 typedef int HErrorCode;
32 typedef int HSReceiveMode;
33 typedef int HSSendMode;
36 typedef void HSSockCallback;
37 typedef void HServiceAccessCallback;
38 typedef unsigned char uns8;
39 typedef unsigned short uns16;
41 #define HSSendBlocking MSG_WAITALL
42 #define HSReceiveBlocking HSSendBlocking
43 #define HSReceiveNonBlocking MSG_DONTWAIT
44 #define HSSendNonBlocking HSReceiveNonBlocking
46 #define HErrorNoMemory -4
53 HErrorCode n_read(HSSockID socket, void *buffer, uns32 buffer_len, HSReceiveMode mode);
54 HErrorCode n_send(HSSockID socket, void* buffer, uns32 buffer_len, HSSendMode mode);
55 HErrorCode n_disconnect(HSSockID socket);
56 int n_activate(int sid, void* key, void* callback);
57 // In this version, 'sid' means the listener socket.
58 int n_deactivate(int sid, void* key);
59 // 'to' is SID for H_IN2, socket for H_IN3.
60 // 'param1' is HKey for H_IN2, struct sockaddr for H_IN3
61 // 'param2' is ServiceAccessCallback for H_IN2, socklen_t for H_IN3
62 int n_connect(int sid, void* key, void* callback);
63 int n_accept(int to, void* param1, void* param2);