adds MIT license
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Oleksandr Zhylin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -3,7 +3,7 @@
|
||||
## Current:
|
||||
- [ ] PageUp/PageDown key functionality in lists
|
||||
- [ ] File upload multiline description (window)
|
||||
- [ ] Permission checkboxes for file upload/edit
|
||||
- [x] Permission checkboxes for file upload/edit
|
||||
- [ ] Check file upload
|
||||
- [ ] More intuitive navigation between nested groups (by pressing left and right buttons)
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include "main.h"
|
||||
#include <widget.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef CONNECTION_H
|
||||
#define CONNECTION_H
|
||||
#include "main.h"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include <modals.h>
|
||||
#include <widget.h>
|
||||
#include "main.h"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef DRAW_MODAL_H
|
||||
#define DRAW_MODAL_H
|
||||
#include <widget.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <fcntl.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef FILE_PROCESSOR_H
|
||||
#define FILE_PROCESSOR_H
|
||||
#include "main.h"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef LOC_FS_H
|
||||
#define LOC_FS_H
|
||||
|
||||
|
||||
+4
-1
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <ncursesw/ncurses.h>
|
||||
#include <netinet/in.h>
|
||||
@@ -9,12 +12,12 @@
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <widget.h>
|
||||
#include <modals.h>
|
||||
|
||||
#include "connection.h"
|
||||
#include "file_list.h"
|
||||
#include "main.h"
|
||||
#include "query.h"
|
||||
#include <modals.h>
|
||||
|
||||
uint32_t m_id = 0;
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef MAIN_H
|
||||
#define MAIN_H
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <widget.h>
|
||||
#include <utils.h>
|
||||
|
||||
void upload_props_dialogue_modal_cb(callback_args_t *args) {
|
||||
callback_args_t d_args;
|
||||
@@ -23,10 +24,12 @@ void upload_props_dialogue_modal_cb(callback_args_t *args) {
|
||||
checkbox_t *reg_cbx = (checkbox_t *)d->g_content->elements[0].element;
|
||||
checkbox_t *anon_cbx = (checkbox_t *)d->g_content->elements[1].element;
|
||||
checkbox_t *comp_cbx = (checkbox_t *)d->g_content->elements[2].element;
|
||||
|
||||
int32_t privileges = 0;
|
||||
if (anon_cbx->value == true) privileges |= 1;
|
||||
if (reg_cbx->value == true) privileges |= 2;
|
||||
if (comp_cbx->value == true) privileges |= 4;
|
||||
|
||||
switch (d_args.resp_data.val.val.num) {
|
||||
case 1:
|
||||
query_len =
|
||||
@@ -41,12 +44,9 @@ void upload_props_dialogue_modal_cb(callback_args_t *args) {
|
||||
write(app->query_args->sd, query, query_len);
|
||||
break;
|
||||
case 2:
|
||||
if (app->query_args->file->name != NULL)
|
||||
free(app->query_args->file->name);
|
||||
if (app->query_args->file->path != NULL)
|
||||
free(app->query_args->file->path);
|
||||
free(app->query_args->file);
|
||||
app->query_args->file = NULL;
|
||||
FREE_MLC(app->query_args->file->name);
|
||||
FREE_MLC(app->query_args->file->path)
|
||||
FREE_MLC(app->query_args->file);
|
||||
app->query_args->state = S_WAIT_SERVER;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <fcntl.h>
|
||||
#include <ncursesw/ncurses.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef QUERY_H
|
||||
#define QUERY_H
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include "dialogue.h"
|
||||
#include "main.h"
|
||||
#include <modals.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef SERVER_H
|
||||
#define SERVER_H
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef D_TYPES_H
|
||||
#define D_TYPES_H
|
||||
|
||||
|
||||
@@ -2,4 +2,11 @@
|
||||
#define D_UTILS_H
|
||||
#include "d_array.h"
|
||||
#include "utf8.h"
|
||||
|
||||
/* Free if not null and assign NULL */
|
||||
#define FREE_MLC(arg) \
|
||||
if (arg != NULL) { \
|
||||
free(arg); \
|
||||
arg = NULL; \
|
||||
}
|
||||
#endif
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include "app.h"
|
||||
#include <locale.h>
|
||||
#include <ncursesw/ncurses.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef N_APP_H
|
||||
#define N_APP_H
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include <ncursesw/ncurses.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef BUTTON_H
|
||||
#define BUTTON_H
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include <ncursesw/ncurses.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef CHECKBOX_H
|
||||
#define CHECKBOX_H
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include <ncursesw/ncurses.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef DIALOGUE_H
|
||||
#define DIALOGUE_H
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include "file_list.h"
|
||||
#include "../file_processor.h"
|
||||
#include "../fs.h"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef FILE_LIST_H
|
||||
#define FILE_LIST_H
|
||||
#include <bstrlib.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <ncursesw/ncurses.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef FS_FILE_LIST_H
|
||||
#define FS_FILE_LIST_H
|
||||
#include <widget_core.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include "group.h"
|
||||
#include "button.h"
|
||||
#include "checkbox.h"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef GROUP_H
|
||||
#define GROUP_H
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include <ncursesw/ncurses.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef INPUT_H
|
||||
#define INPUT_H
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include "progress_bar.h"
|
||||
#include "app.h"
|
||||
#include <ncursesw/ncurses.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef PROGRESS_BAR_H
|
||||
#define PROGRESS_BAR_H
|
||||
#include <widget_core.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef WIDGET_H
|
||||
#define WIDGET_H
|
||||
#include "app.h"
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#include "widget_core.h"
|
||||
#include "../main.h"
|
||||
#include <ncursesw/ncurses.h>
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2026 Oleksandr Zhylin */
|
||||
|
||||
#ifndef WIDGET_CORE_H
|
||||
#define WIDGET_CORE_H
|
||||
|
||||
|
||||
Reference in New Issue
Block a user