2018-09-13 22:22:36 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
|
|
|
/*
|
2023-11-09 19:23:00 +01:00
|
|
|
* Copyright the Collabora Online contributors.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*
|
2018-09-13 22:22:36 +02:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
2020-04-18 10:39:50 +02:00
|
|
|
#pragma once
|
2018-09-13 22:22:36 +02:00
|
|
|
|
2019-02-12 12:16:40 +01:00
|
|
|
#if MOBILEAPP
|
2018-09-13 22:22:36 +02:00
|
|
|
|
2018-10-16 22:56:46 +02:00
|
|
|
#include <string>
|
|
|
|
|
2018-09-13 22:22:36 +02:00
|
|
|
#include <poll.h>
|
|
|
|
|
2020-11-17 07:24:18 +01:00
|
|
|
#ifndef __linux__
|
2024-01-27 13:30:22 +01:00
|
|
|
# ifndef SOCK_NONBLOCK
|
|
|
|
# define SOCK_NONBLOCK 0x100
|
|
|
|
# endif
|
|
|
|
# ifndef SOCK_CLOEXEC
|
|
|
|
# define SOCK_CLOEXEC 0x200
|
|
|
|
# endif
|
2018-10-17 21:41:01 +02:00
|
|
|
#endif
|
2018-09-13 22:22:36 +02:00
|
|
|
|
2018-09-16 10:37:56 +02:00
|
|
|
void fakeSocketSetLoggingCallback(void (*)(const std::string&));
|
|
|
|
|
2018-09-15 11:04:05 +02:00
|
|
|
int fakeSocketSocket();
|
2018-09-13 22:22:36 +02:00
|
|
|
|
2018-09-15 11:04:05 +02:00
|
|
|
int fakeSocketPipe2(int pipefd[2]);
|
2018-09-13 22:22:36 +02:00
|
|
|
|
|
|
|
int fakeSocketPoll(struct pollfd *fds, int nfds, int timeout);
|
|
|
|
|
2018-09-15 11:04:05 +02:00
|
|
|
int fakeSocketListen(int fd);
|
2018-09-13 22:22:36 +02:00
|
|
|
|
|
|
|
int fakeSocketConnect(int fd1, int fd2);
|
|
|
|
|
2018-11-01 20:29:40 +01:00
|
|
|
int fakeSocketAccept4(int fd);
|
2018-09-15 11:04:05 +02:00
|
|
|
|
|
|
|
int fakeSocketPeer(int fd);
|
2018-09-13 22:22:36 +02:00
|
|
|
|
2018-09-14 09:49:58 +02:00
|
|
|
ssize_t fakeSocketAvailableDataLength(int fd);
|
|
|
|
|
2018-09-13 22:22:36 +02:00
|
|
|
ssize_t fakeSocketRead(int fd, void *buf, size_t nbytes);
|
|
|
|
|
|
|
|
ssize_t fakeSocketWrite(int fd, const void *buf, size_t nbytes);
|
|
|
|
|
2018-09-17 19:39:53 +02:00
|
|
|
int fakeSocketShutdown(int fd);
|
|
|
|
|
2018-09-13 22:22:36 +02:00
|
|
|
int fakeSocketClose(int fd);
|
|
|
|
|
2018-10-15 21:41:38 +02:00
|
|
|
void fakeSocketDumpState();
|
|
|
|
|
2018-09-13 22:22:36 +02:00
|
|
|
#endif // MOBILEAPP
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|