Skip to content

Commit

Permalink
更新sl
Browse files Browse the repository at this point in the history
  • Loading branch information
lmliheng committed Jun 19, 2024
1 parent e212516 commit 7a5144c
Show file tree
Hide file tree
Showing 7 changed files with 516 additions and 7 deletions.
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
CC = gcc
CFLAGS = -I./includes -Wall -fPIC
OBJFILES = objs/bootstrap.o objs/cmd_utils.o objs/install_utils.o objs/shell_utils.o objs/ExamAll.o objs/FileInfo.o objs/updata_utils.o objs/Version.o
OBJFILES = objs/bootstrap.o objs/cmd_utils.o objs/install_utils.o objs/shell_utils.o objs/ExamAll.o objs/FileInfo.o objs/updata_utils.o objs/Version.o objs/sl.o
TARGET = cil
LIBTARGET = lib/libprintcolor.a
LIBOBJS = objs/PrintColor.o



all: $(TARGET)

objs:
Expand Down Expand Up @@ -41,8 +43,13 @@ objs/updata_utils.o: src/Utils/updata_utils.c objs
objs/Version.o: src/Utils/Version.c objs
$(CC) $(CFLAGS) -c $< -o $@

$(TARGET): $(OBJFILES) $(LIBTARGET)
$(CC) $(CFLAGS) -pie $(OBJFILES) -o $(TARGET) -L./lib -lprintcolor
objs/sl.o: src/game/sl.c objs
$(CC) $(CFLAGS) -c $< -o $@



$(TARGET): $(OBJFILES) $(LIBTARGET)
$(CC) $(CFLAGS) -pie $(OBJFILES) -o $(TARGET) -L./lib -lprintcolor -lncurses

clean:
rm -f $(OBJFILES) $(TARGET) $(LIBTARGET)
rm -f $(OBJFILES) $(TARGET) $(LIBTARGET)
Binary file added cil
Binary file not shown.
167 changes: 167 additions & 0 deletions includes/sl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
/*========================================
* sl.h: SL version 5.02
* Copyright 1993,2002,2014
* Toyoda Masashi
* ([email protected])
* Last Modified: 2014/06/03
*========================================
*/

#ifndef SL_H
#define SL_H

#define D51HEIGHT 10
#define D51FUNNEL 7
#define D51LENGTH 83
#define D51PATTERNS 6


#define D51STR1 " ==== ________ ___________ "
#define D51STR2 " _D _| |_______/ \\__I_I_____===__|_________| "
#define D51STR3 " |(_)--- | H\\________/ | | =|___ ___| "
#define D51STR4 " / | | H | | | | ||_| |_|| "
#define D51STR5 " | | | H |__--------------------| [___] | "
#define D51STR6 " | ________|___H__/__|_____/[][]~\\_______| | "
#define D51STR7 " |/ | |-----------I_____I [][] [] D |=======|__ "

#define D51WHL11 "__/ =| o |=-~~\\ /~~\\ /~~\\ /~~\\ ____Y___________|__ "
#define D51WHL12 " |/-=|___|= || || || |_____/~\\___/ "
#define D51WHL13 " \\_/ \\O=====O=====O=====O_/ \\_/ "

#define D51WHL21 "__/ =| o |=-~~\\ /~~\\ /~~\\ /~~\\ ____Y___________|__ "
#define D51WHL22 " |/-=|___|=O=====O=====O=====O |_____/~\\___/ "
#define D51WHL23 " \\_/ \\__/ \\__/ \\__/ \\__/ \\_/ "

#define D51WHL31 "__/ =| o |=-O=====O=====O=====O \\ ____Y___________|__ "
#define D51WHL32 " |/-=|___|= || || || |_____/~\\___/ "
#define D51WHL33 " \\_/ \\__/ \\__/ \\__/ \\__/ \\_/ "

#define D51WHL41 "__/ =| o |=-~O=====O=====O=====O\\ ____Y___________|__ "
#define D51WHL42 " |/-=|___|= || || || |_____/~\\___/ "
#define D51WHL43 " \\_/ \\__/ \\__/ \\__/ \\__/ \\_/ "

#define D51WHL51 "__/ =| o |=-~~\\ /~~\\ /~~\\ /~~\\ ____Y___________|__ "
#define D51WHL52 " |/-=|___|= O=====O=====O=====O|_____/~\\___/ "
#define D51WHL53 " \\_/ \\__/ \\__/ \\__/ \\__/ \\_/ "

#define D51WHL61 "__/ =| o |=-~~\\ /~~\\ /~~\\ /~~\\ ____Y___________|__ "
#define D51WHL62 " |/-=|___|= || || || |_____/~\\___/ "
#define D51WHL63 " \\_/ \\_O=====O=====O=====O/ \\_/ "

#define D51DEL " "

#define COAL01 " "
#define COAL02 " "
#define COAL03 " _________________ "
#define COAL04 " _| \\_____A "
#define COAL05 " =| | "
#define COAL06 " -| | "
#define COAL07 "__|________________________|_ "
#define COAL08 "|__________________________|_ "
#define COAL09 " |_D__D__D_| |_D__D__D_| "
#define COAL10 " \\_/ \\_/ \\_/ \\_/ "

#define COALDEL " "

#define LOGOHEIGHT 6
#define LOGOFUNNEL 4
#define LOGOLENGTH 84
#define LOGOPATTERNS 6

#define LOGO1 " ++ +------ "
#define LOGO2 " || |+-+ | "
#define LOGO3 " /---------|| | | "
#define LOGO4 " + ======== +-+ | "

#define LWHL11 " _|--O========O~\\-+ "
#define LWHL12 "//// \\_/ \\_/ "

#define LWHL21 " _|--/O========O\\-+ "
#define LWHL22 "//// \\_/ \\_/ "

#define LWHL31 " _|--/~O========O-+ "
#define LWHL32 "//// \\_/ \\_/ "

#define LWHL41 " _|--/~\\------/~\\-+ "
#define LWHL42 "//// \\_O========O "

#define LWHL51 " _|--/~\\------/~\\-+ "
#define LWHL52 "//// \\O========O/ "

#define LWHL61 " _|--/~\\------/~\\-+ "
#define LWHL62 "//// O========O_/ "

#define LCOAL1 "____ "
#define LCOAL2 "| \\@@@@@@@@@@@ "
#define LCOAL3 "| \\@@@@@@@@@@@@@_ "
#define LCOAL4 "| | "
#define LCOAL5 "|__________________| "
#define LCOAL6 " (O) (O) "

#define LCAR1 "____________________ "
#define LCAR2 "| ___ ___ ___ ___ | "
#define LCAR3 "| |_| |_| |_| |_| | "
#define LCAR4 "|__________________| "
#define LCAR5 "|__________________| "
#define LCAR6 " (O) (O) "

#define DELLN " "

#define C51HEIGHT 11
#define C51FUNNEL 7
#define C51LENGTH 87
#define C51PATTERNS 6

#define C51DEL " "

#define C51STR1 " ___ "
#define C51STR2 " _|_|_ _ __ __ ___________"
#define C51STR3 " D__/ \\_(_)___| |__H__| |_____I_Ii_()|_________|"
#define C51STR4 " | `---' |:: `--' H `--' | |___ ___| "
#define C51STR5 " +|~~~~~~~~++::~~~~~~~H~~+=====+~~~~~~|~~||_| |_|| "
#define C51STR6 " || | :: H +=====+ | |:: ...| "
#define C51STR7 "| | _______|_::-----------------[][]-----| | "

#define C51WH61 "| /~~ || |-----/~~~~\\ /[I_____I][][] --|||_______|__"
#define C51WH62 "------'|oOo|==[]=- || || | ||=======_|__"
#define C51WH63 "/~\\____|___|/~\\_| O=======O=======O |__|+-/~\\_| "
#define C51WH64 "\\_/ \\_/ \\____/ \\____/ \\____/ \\_/ "

#define C51WH51 "| /~~ || |-----/~~~~\\ /[I_____I][][] --|||_______|__"
#define C51WH52 "------'|oOo|===[]=- || || | ||=======_|__"
#define C51WH53 "/~\\____|___|/~\\_| O=======O=======O |__|+-/~\\_| "
#define C51WH54 "\\_/ \\_/ \\____/ \\____/ \\____/ \\_/ "

#define C51WH41 "| /~~ || |-----/~~~~\\ /[I_____I][][] --|||_______|__"
#define C51WH42 "------'|oOo|===[]=- O=======O=======O | ||=======_|__"
#define C51WH43 "/~\\____|___|/~\\_| || || |__|+-/~\\_| "
#define C51WH44 "\\_/ \\_/ \\____/ \\____/ \\____/ \\_/ "

#define C51WH31 "| /~~ || |-----/~~~~\\ /[I_____I][][] --|||_______|__"
#define C51WH32 "------'|oOo|==[]=- O=======O=======O | ||=======_|__"
#define C51WH33 "/~\\____|___|/~\\_| || || |__|+-/~\\_| "
#define C51WH34 "\\_/ \\_/ \\____/ \\____/ \\____/ \\_/ "

#define C51WH21 "| /~~ || |-----/~~~~\\ /[I_____I][][] --|||_______|__"
#define C51WH22 "------'|oOo|=[]=- O=======O=======O | ||=======_|__"
#define C51WH23 "/~\\____|___|/~\\_| || || |__|+-/~\\_| "
#define C51WH24 "\\_/ \\_/ \\____/ \\____/ \\____/ \\_/ "

#define C51WH11 "| /~~ || |-----/~~~~\\ /[I_____I][][] --|||_______|__"
#define C51WH12 "------'|oOo|=[]=- || || | ||=======_|__"
#define C51WH13 "/~\\____|___|/~\\_| O=======O=======O |__|+-/~\\_| "
#define C51WH14 "\\_/ \\_/ \\____/ \\____/ \\____/ \\_/ "



void sl_bootstrap(const char *script);
void add_smoke(int y, int x);
void add_man(int y, int x);
int add_C51(int x);
int add_D51(int x);
int add_sl(int x);
void option(char *str);
int my_mvaddstr(int y, int x, char *str);


#endif // SL_H
2 changes: 2 additions & 0 deletions src/Utils/cmd_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ void show_command_usage(const char *command) {

}else if (strcmp(command, "updata") == 0) { // 增加的updata命令
}else if (strcmp(command, "version") == 0) { // 增加的updata命令
}else if (strcmp(command, "sl") == 0) { // 增加的sl命令

}else {
color_printf(cyan,"CmdUtils的提示功能暂不支持命令\n");
}
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/install_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ void install_scripts(const char *script){
}else if (strcmp(script, "cloc") == 0) {
system("sudo yum install epel-release -y && sudo yum install cloc -y");
}else if (strcmp(script, "gcc") == 0) {
system("sudo yum groupinstall \"Development Tools\"");
system("sudo yum groupinstall \"Development Tools\" -y");
system("gcc -v");
}else if(strcmp(script,"git") == 0){
system("sudo yum install git");
system("sudo yum install git -y");
system("git --version");
}else {
color_printf(red,"CmdUtils的安装功能暂不支持该软件\n");
Expand Down
11 changes: 10 additions & 1 deletion src/bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "../includes/FileInfo.h"
#include "../includes/updata_utils.h"
#include "../includes/Version.h"
#include "../includes/sl.h"



Expand All @@ -24,7 +25,7 @@ int main(int argc, char *argv[]) {
color_printf(cyan,"用法:cil (<参数>) <命令名>\n");
color_printf(cyan,"例如:cil i nginx 安装中间件Nginx\n");
color_printf(cyan,"cil version/updata :检查当前版本以及版本更新\n");
color_printf(cyan,"cil * :支持nginx,psql(PostgreSQL),pro(进程检查命令),exe(可执行文件操作),base(基础linux检查),——————提示以及更新功能\n");
color_printf(cyan,"cil * :支持nginx,psql(PostgreSQL),pro(进程检查命令),exe(可执行文件操作),base(基础linux检查),sl——————提示以及更新功能\n");
color_printf(cyan,"cil i * :支持nginx,psql,nvm,cloc,gcc,git——————安装功能\n");
color_printf(cyan,"cil s * :支持cil,env,banner,exam,cpu,free,system——————shell功能\n");
color_printf(cyan,"cil f * :支持exam(目录检查),info(目录下所有文件检查),nginx,psql——————文件类型检查功能\n");
Expand All @@ -35,9 +36,17 @@ int main(int argc, char *argv[]) {
}

if (argc == 2) { // argc参数为2时


updata_scripts(argv[1]); // 更新至最新版功能
print_version(argv[1]); // 版本打印功能
show_command_usage(argv[1]); // 提示功能
sl_bootstrap(argv[1]); // 需要使用第三方库#include <curses.h>

//
//安装:sudo yum install ncurses-devel
//查找:ls /usr/include/ | grep curses.h
//

return 1;

Expand Down
Loading

0 comments on commit 7a5144c

Please sign in to comment.