2018-09-13 15:22:36 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
|
|
|
/*
|
2023-11-09 12:23:00 -06:00
|
|
|
* Copyright the Collabora Online contributors.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*
|
2018-09-13 15:22:36 -05: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 03:39:50 -05:00
|
|
|
#pragma once
|
2018-09-13 15:22:36 -05:00
|
|
|
|
2019-02-12 05:16:40 -06:00
|
|
|
#if MOBILEAPP
|
2018-09-13 15:22:36 -05:00
|
|
|
|
2018-10-16 15:56:46 -05:00
|
|
|
#include <string>
|
|
|
|
|
2018-09-13 15:22:36 -05:00
|
|
|
#include <poll.h>
|
|
|
|
|
2020-11-17 00:24:18 -06:00
|
|
|
#ifndef __linux__
|
2018-09-13 15:22:36 -05:00
|
|
|
#ifndef SOCK_NONBLOCK
|
|
|
|
#define SOCK_NONBLOCK 0x100
|
|
|
|
#endif
|
2018-10-17 14:41:01 -05:00
|
|
|
#endif
|
2018-09-13 15:22:36 -05:00
|
|
|
|
2018-09-16 03:37:56 -05:00
|
|
|
void fakeSocketSetLoggingCallback(void (*)(const std::string&));
|
|
|
|
|
2018-09-15 04:04:05 -05:00
|
|
|
int fakeSocketSocket();
|
2018-09-13 15:22:36 -05:00
|
|
|
|
2018-09-15 04:04:05 -05:00
|
|
|
int fakeSocketPipe2(int pipefd[2]);
|
2018-09-13 15:22:36 -05:00
|
|
|
|
|
|
|
int fakeSocketPoll(struct pollfd *fds, int nfds, int timeout);
|
|
|
|
|
2018-09-15 04:04:05 -05:00
|
|
|
int fakeSocketListen(int fd);
|
2018-09-13 15:22:36 -05:00
|
|
|
|
|
|
|
int fakeSocketConnect(int fd1, int fd2);
|
|
|
|
|
2018-11-01 14:29:40 -05:00
|
|
|
int fakeSocketAccept4(int fd);
|
2018-09-15 04:04:05 -05:00
|
|
|
|
|
|
|
int fakeSocketPeer(int fd);
|
2018-09-13 15:22:36 -05:00
|
|
|
|
2018-09-14 02:49:58 -05:00
|
|
|
ssize_t fakeSocketAvailableDataLength(int fd);
|
|
|
|
|
2018-09-13 15:22:36 -05: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 12:39:53 -05:00
|
|
|
int fakeSocketShutdown(int fd);
|
|
|
|
|
2018-09-13 15:22:36 -05:00
|
|
|
int fakeSocketClose(int fd);
|
|
|
|
|
2018-10-15 14:41:38 -05:00
|
|
|
void fakeSocketDumpState();
|
|
|
|
|
2018-09-13 15:22:36 -05:00
|
|
|
#endif // MOBILEAPP
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|