1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 14:25:06 +00:00

LibCore: Put all classes in the Core namespace and remove the leading C

I've been wanting to do this for a long time. It's time we start being
consistent about how this stuff works.

The new convention is:

- "LibFoo" is a userspace library that provides the "Foo" namespace.

That's it :^) This was pretty tedious to convert and I didn't even
start on LibGUI yet. But it's coming up next.
This commit is contained in:
Andreas Kling 2020-02-02 12:34:39 +01:00
parent b7e3810b5c
commit 2d39da5405
265 changed files with 1380 additions and 1167 deletions

View file

@ -25,32 +25,36 @@
*/
#include <LibCore/CTCPSocket.h>
#include <sys/socket.h>
#include <errno.h>
#include <sys/socket.h>
CTCPSocket::CTCPSocket(int fd, CObject* parent)
: CSocket(CSocket::Type::TCP, parent)
namespace Core {
TCPSocket::TCPSocket(int fd, Object* parent)
: Socket(Socket::Type::TCP, parent)
{
// NOTE: This constructor is used by CTCPServer::accept(), so the socket is already connected.
m_connected = true;
set_fd(fd);
set_mode(CIODevice::ReadWrite);
set_mode(IODevice::ReadWrite);
set_error(0);
}
CTCPSocket::CTCPSocket(CObject* parent)
: CSocket(CSocket::Type::TCP, parent)
TCPSocket::TCPSocket(Object* parent)
: Socket(Socket::Type::TCP, parent)
{
int fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
if (fd < 0) {
set_error(errno);
} else {
set_fd(fd);
set_mode(CIODevice::ReadWrite);
set_mode(IODevice::ReadWrite);
set_error(0);
}
}
CTCPSocket::~CTCPSocket()
TCPSocket::~TCPSocket()
{
}
}