mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:07:44 +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:
parent
b7e3810b5c
commit
2d39da5405
265 changed files with 1380 additions and 1167 deletions
|
@ -41,19 +41,19 @@
|
|||
|
||||
LookupServer::LookupServer()
|
||||
{
|
||||
auto config = CConfigFile::get_for_system("LookupServer");
|
||||
auto config = Core::ConfigFile::get_for_system("LookupServer");
|
||||
dbg() << "Using network config file at " << config->file_name();
|
||||
m_nameserver = config->read_entry("DNS", "Nameserver", "1.1.1.1");
|
||||
|
||||
load_etc_hosts();
|
||||
|
||||
m_local_server = CLocalServer::construct(this);
|
||||
m_local_server = Core::LocalServer::construct(this);
|
||||
m_local_server->on_ready_to_accept = [this]() {
|
||||
auto socket = m_local_server->accept();
|
||||
socket->on_ready_to_read = [this, socket]() {
|
||||
service_client(socket);
|
||||
RefPtr<CLocalSocket> keeper = socket;
|
||||
const_cast<CLocalSocket&>(*socket).on_ready_to_read = [] {};
|
||||
RefPtr<Core::LocalSocket> keeper = socket;
|
||||
const_cast<Core::LocalSocket&>(*socket).on_ready_to_read = [] {};
|
||||
};
|
||||
};
|
||||
bool ok = m_local_server->take_over_from_system_server();
|
||||
|
@ -62,8 +62,8 @@ LookupServer::LookupServer()
|
|||
|
||||
void LookupServer::load_etc_hosts()
|
||||
{
|
||||
auto file = CFile::construct("/etc/hosts");
|
||||
if (!file->open(CIODevice::ReadOnly))
|
||||
auto file = Core::File::construct("/etc/hosts");
|
||||
if (!file->open(Core::IODevice::ReadOnly))
|
||||
return;
|
||||
while (!file->eof()) {
|
||||
auto line = file->read_line(1024);
|
||||
|
@ -96,7 +96,7 @@ void LookupServer::load_etc_hosts()
|
|||
}
|
||||
}
|
||||
|
||||
void LookupServer::service_client(RefPtr<CLocalSocket> socket)
|
||||
void LookupServer::service_client(RefPtr<Core::LocalSocket> socket)
|
||||
{
|
||||
u8 client_buffer[1024];
|
||||
int nrecv = socket->read(client_buffer, sizeof(client_buffer) - 1);
|
||||
|
@ -176,7 +176,7 @@ Vector<String> LookupServer::lookup(const String& hostname, bool& did_timeout, u
|
|||
|
||||
auto buffer = request.to_byte_buffer();
|
||||
|
||||
auto udp_socket = CUdpSocket::construct();
|
||||
auto udp_socket = Core::UdpSocket::construct();
|
||||
udp_socket->set_blocking(true);
|
||||
|
||||
struct timeval timeout {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue