diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bdd62fa --- /dev/null +++ b/LICENSE @@ -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. \ No newline at end of file diff --git a/src/client.c b/src/client.c index 523a93b..c0b0fc3 100644 --- a/src/client.c +++ b/src/client.c @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #include "client.h" #include "file_p.h" #include "main.h" diff --git a/src/client.h b/src/client.h index 9b515a8..8d49da6 100644 --- a/src/client.h +++ b/src/client.h @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #ifndef CLIENT_H #define CLIENT_H diff --git a/src/db.c b/src/db.c index 4dcb2e6..2df2511 100644 --- a/src/db.c +++ b/src/db.c @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #include "db.h" #include "main.h" #include diff --git a/src/db.h b/src/db.h index 960f09f..b704b38 100644 --- a/src/db.h +++ b/src/db.h @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #ifndef DB_H #define DB_H #include "main.h" diff --git a/src/file_p.c b/src/file_p.c index 5fadf31..5cd23fe 100644 --- a/src/file_p.c +++ b/src/file_p.c @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #include "file_p.h" #include "db.h" #include "main.h" diff --git a/src/file_p.h b/src/file_p.h index 394ab5d..14d3d52 100644 --- a/src/file_p.h +++ b/src/file_p.h @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #ifndef FILEP_H #define FILEP_H #include "main.h" diff --git a/src/main.c b/src/main.c index 9c3adc6..ef1a2c2 100644 --- a/src/main.c +++ b/src/main.c @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #include "main.h" #include "server.h" #include "db.h" diff --git a/src/main.h b/src/main.h index 71e89ca..3b9595d 100644 --- a/src/main.h +++ b/src/main.h @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #ifndef MAIN_H #define MAIN_H #include diff --git a/src/server.c b/src/server.c index 62d8f8f..e065124 100644 --- a/src/server.c +++ b/src/server.c @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #include "main.h" #include "session.h" #include "user.h" diff --git a/src/server.h b/src/server.h index a370e5c..4c759ba 100644 --- a/src/server.h +++ b/src/server.h @@ -1,8 +1,11 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #ifndef SERVER_H #define SERVER_H #include "main.h" -int start_server(); -char *get_welcome_mes(); +int start_server(void); +char *get_welcome_mes(void); void server_main_loop(server_data_t *); void prepare_start(int argc, char *argv[]); #endif \ No newline at end of file diff --git a/src/session.c b/src/session.c index 876fe34..27bc793 100644 --- a/src/session.c +++ b/src/session.c @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #include "session.h" #include "client.h" #include "db.h" diff --git a/src/session.h b/src/session.h index 3e3c55d..f4f2db6 100644 --- a/src/session.h +++ b/src/session.h @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #ifndef SESSION_H #define SESSION_H #include "main.h" diff --git a/src/types.h b/src/types.h index 61eb662..40bbabd 100644 --- a/src/types.h +++ b/src/types.h @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #ifndef D_TYPES_H #define D_TYPES_H diff --git a/src/user.c b/src/user.c index 8895634..809b218 100644 --- a/src/user.c +++ b/src/user.c @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #include "db.h" #include "main.h" #include "session.h" @@ -8,7 +11,7 @@ int32_t create_user(session *sess, char *line) { i_db_user_create p; - uint32_t privileges; + int32_t privileges; int32_t res; if (sscanf(line, "register %s %s %s", p.uname, p.pass, p.email) == 3) { res = db_user_create(&p); diff --git a/src/user.h b/src/user.h index c4dfb9d..33e09bb 100644 --- a/src/user.h +++ b/src/user.h @@ -1,3 +1,6 @@ +/* SPDX-License-Identifier: MIT */ +/* Copyright (c) 2026 Oleksandr Zhylin */ + #ifndef USER_H #define USER_H