mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2025-09-13 14:09:33 +02:00

# Conflicts: # .gitignore # 3ds/gfx/gfx.t3s # Makefile # README.md # include/ftpServer.h # include/ftpSession.h # include/licenses.h # source/3ds/imgui_citro3d.cpp # source/3ds/imgui_citro3d.h # source/3ds/imgui_ctru.cpp # source/3ds/imgui_ctru.h # source/3ds/platform.cpp # source/3ds/vshader.v.pica # source/fs.cpp # source/ftpConfig.cpp # source/ftpServer.cpp # source/ftpSession.cpp # source/licenses.cpp # source/linux/platform.cpp # source/log.cpp # source/main.cpp # source/mdns.cpp # source/nds/platform.cpp # source/posix/collate.c # source/posix/collate.h # source/posix/collcmp.c # source/posix/glob.c # source/sockAddr.cpp # source/switch/imgui_deko3d.cpp # source/switch/imgui_deko3d.h # source/switch/imgui_fsh.glsl # source/switch/imgui_nx.cpp # source/switch/imgui_nx.h # source/switch/imgui_vsh.glsl # source/switch/init.c # source/switch/platform.cpp
85 lines
1.9 KiB
C++
85 lines
1.9 KiB
C++
// ftpd is a server implementation based on the following:
|
|
// - RFC 959 (https://tools.ietf.org/html/rfc959)
|
|
// - RFC 3659 (https://tools.ietf.org/html/rfc3659)
|
|
// - suggested implementation details from https://cr.yp.to/ftp/filesystem.html
|
|
// - Deflate transmission mode for FTP
|
|
// (https://tools.ietf.org/html/draft-preston-ftpext-deflate-04)
|
|
//
|
|
// Copyright (C) 2024 Michael Theall
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
#include "platform.h"
|
|
|
|
#include "ftpServer.h"
|
|
#include "log.h"
|
|
#ifndef __WIIU__
|
|
#include "imgui.h"
|
|
#endif
|
|
|
|
#ifndef CLASSIC
|
|
#include <imgui.h>
|
|
|
|
#include <curl/curl.h>
|
|
#endif
|
|
|
|
#include <cstdio>
|
|
#include <cstdlib>
|
|
|
|
int main ()
|
|
{
|
|
#ifndef CLASSIC
|
|
curl_global_init (CURL_GLOBAL_ALL);
|
|
IMGUI_CHECKVERSION ();
|
|
ImGui::CreateContext ();
|
|
#endif
|
|
|
|
if (!platform::init ())
|
|
{
|
|
#ifndef CLASSIC
|
|
ImGui::DestroyContext ();
|
|
#endif
|
|
return EXIT_FAILURE;
|
|
}
|
|
|
|
#ifndef CLASSIC
|
|
auto &style = ImGui::GetStyle ();
|
|
|
|
// turn off window rounding
|
|
style.WindowRounding = 0.0f;
|
|
#endif
|
|
|
|
auto server = FtpServer::create ();
|
|
|
|
while (!server->quit () && platform::loop ())
|
|
{
|
|
#ifndef NO_CONSOLE
|
|
server->draw ();
|
|
platform::render ();
|
|
#else
|
|
drawLog ();
|
|
#endif
|
|
}
|
|
|
|
// clean up resources before exiting switch/3ds services
|
|
server.reset ();
|
|
|
|
platform::exit ();
|
|
|
|
#ifndef CLASSIC
|
|
ImGui::DestroyContext ();
|
|
curl_global_cleanup ();
|
|
#endif
|
|
}
|