add MIT license

This commit is contained in:
2026-03-16 15:33:00 +02:00
parent 55b4ef7d5b
commit 03b9462a0c
16 changed files with 69 additions and 3 deletions
+21
View File
@@ -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
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#include "client.h" #include "client.h"
#include "file_p.h" #include "file_p.h"
#include "main.h" #include "main.h"
+3
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#ifndef CLIENT_H #ifndef CLIENT_H
#define CLIENT_H #define CLIENT_H
+3
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#include "db.h" #include "db.h"
#include "main.h" #include "main.h"
#include <endian.h> #include <endian.h>
+3
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#ifndef DB_H #ifndef DB_H
#define DB_H #define DB_H
#include "main.h" #include "main.h"
+3
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#include "file_p.h" #include "file_p.h"
#include "db.h" #include "db.h"
#include "main.h" #include "main.h"
+3
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#ifndef FILEP_H #ifndef FILEP_H
#define FILEP_H #define FILEP_H
#include "main.h" #include "main.h"
+3
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#include "main.h" #include "main.h"
#include "server.h" #include "server.h"
#include "db.h" #include "db.h"
+3
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#ifndef MAIN_H #ifndef MAIN_H
#define MAIN_H #define MAIN_H
#include <stddef.h> #include <stddef.h>
+3
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#include "main.h" #include "main.h"
#include "session.h" #include "session.h"
#include "user.h" #include "user.h"
+5 -2
View File
@@ -1,8 +1,11 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#ifndef SERVER_H #ifndef SERVER_H
#define SERVER_H #define SERVER_H
#include "main.h" #include "main.h"
int start_server(); int start_server(void);
char *get_welcome_mes(); char *get_welcome_mes(void);
void server_main_loop(server_data_t *); void server_main_loop(server_data_t *);
void prepare_start(int argc, char *argv[]); void prepare_start(int argc, char *argv[]);
#endif #endif
+3
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#include "session.h" #include "session.h"
#include "client.h" #include "client.h"
#include "db.h" #include "db.h"
+3
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#ifndef SESSION_H #ifndef SESSION_H
#define SESSION_H #define SESSION_H
#include "main.h" #include "main.h"
+3
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#ifndef D_TYPES_H #ifndef D_TYPES_H
#define D_TYPES_H #define D_TYPES_H
+4 -1
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#include "db.h" #include "db.h"
#include "main.h" #include "main.h"
#include "session.h" #include "session.h"
@@ -8,7 +11,7 @@
int32_t create_user(session *sess, char *line) { int32_t create_user(session *sess, char *line) {
i_db_user_create p; i_db_user_create p;
uint32_t privileges; int32_t privileges;
int32_t res; int32_t res;
if (sscanf(line, "register %s %s %s", p.uname, p.pass, p.email) == 3) { if (sscanf(line, "register %s %s %s", p.uname, p.pass, p.email) == 3) {
res = db_user_create(&p); res = db_user_create(&p);
+3
View File
@@ -1,3 +1,6 @@
/* SPDX-License-Identifier: MIT */
/* Copyright (c) 2026 Oleksandr Zhylin */
#ifndef USER_H #ifndef USER_H
#define USER_H #define USER_H