ppsspp/Common/File/FileDescriptor.h
Henrik Rydgård 4f43cff5ca
Move fileutil, net, image loaders, ui to Common. (#13506)
* Move and rename file_util/fd_util to Common/File/FileUtil and DirListing

Let's also move net while we're at it.

Move the ZIM/PNG loaders over to Common.

Move the UI framework into Common

iOS buildfix

* Buildfix

* Buildfixes

* Apple buildfix

* This typo again..

* UWP buildfix

* Fix build of PPSSPPQt, such as it is (it's not in good condition...)

* Guess what? Another buildfix.
2020-10-04 20:48:47 +02:00

25 lines
622 B
C++

#pragma once
#include <cstring>
#include <string>
namespace fd_util {
// Slow as hell and should only be used for prototyping.
size_t ReadLine(int fd, char *buffer, size_t buf_size);
// Decently fast.
size_t WriteLine(int fd, const char *buffer, size_t buf_size);
size_t WriteLine(int fd, const char *buffer);
size_t Write(int fd, const std::string &str);
// Returns true if the fd became ready, false if it didn't or
// if there was another error.
bool WaitUntilReady(int fd, double timeout, bool for_write = false);
void SetNonBlocking(int fd, bool non_blocking);
std::string GetLocalIP(int sock);
} // fd_util