Преглед на файлове

vcc: remove libreadline

intirain преди 4 години
родител
ревизия
f561065b4b
променени са 4 файла, в които са добавени 13 реда и са изтрити 15 реда
  1. 3 3
      Makefile
  2. 2 2
      include/vcc/version.h
  3. 8 7
      main.c
  4. 0 3
      pretty.c

+ 3 - 3
Makefile

@@ -1,6 +1,6 @@
 VCC_MAJOR 		= 1
 VCC_MINOR 		= 10
-VCC_PATCH 		= 1
+VCC_PATCH 		= 2
 VCC_STR 		= -rc 
 
 VCC_COMPILE_TIME 	= $(shell date)
@@ -10,8 +10,8 @@ VCC_SEMVER 		= vcc $(VCC_MAJOR).$(VCC_MINOR).$(VCC_PATCH)$(VCC_STR)
 srcs 			= main.c vcc.c pretty.c cmd.c crypt.c klist.c 
 objs 			= main.o vcc.o pretty.o cmd.o crypt.o klist.o
 target 			= vcc 
-libgcrypt_cargs 	= $(shell libgcrypt-config --libs)
-CFLAGS 			= -std=gnu11 -Wall -Wextra -Werror -Iinclude -g $(libgcrypt_cargs) -lreadline -lncurses 
+libgcrypt_cflags 	= $(shell libgcrypt-config --libs)
+CFLAGS 			= -std=gnu11 -Wall -Wextra -Werror -Iinclude -g $(libgcrypt_cflags) 
 MAKEFLAGS 		= --no-print-directory
 
 VCC_VERSION 		= VCC $(VCC_MAJOR).$(VCC_MINOR).$(VCC_PATCH) \

+ 2 - 2
include/vcc/version.h

@@ -1,2 +1,2 @@
-#define VCC_VERSION "VCC 1.10.1 Fri Apr  8 20:50:19 CST 2022 root"
-#define VCC_SEMVER "vcc 1.10.1-rc "
+#define VCC_VERSION "VCC 1.10.2 Sat Apr 16 20:07:12 CST 2022 root"
+#define VCC_SEMVER "vcc 1.10.2-rc "

+ 8 - 7
main.c

@@ -35,14 +35,14 @@
 #include <poll.h>
 #include <signal.h>
 
-#include <readline/readline.h>
-#include <readline/history.h>
-
 #include <klist.h>
 #include <vcc/vcc.h>
 #include <vcc/version.h>
 #include <vcc/pretty.h>
 
+/* we tried to use libreadline, but after using that, we feel strange 
+ * because... because of what? i don't know. */
+
 #define DEFAULT_RATE 	1000
 
 
@@ -149,8 +149,6 @@ int parse_args(char **argv, int *port, char **ip) {
 }
 
 int do_handle_command(char *buf) {
-	add_history(buf);
-
 	if (*buf == '-') 
 		do_cmd(buf);
 
@@ -243,8 +241,11 @@ int main(int argc, char **argv) {
 			continue;
 		}
 
-		if (fds[0].revents & POLLIN) 
-			rl_callback_read_char();
+		if (fds[0].revents & POLLIN) {
+			read(0, buf, MSG_SIZE);
+
+			do_handle_command(buf);
+		}
 
 		if (fds[1].revents & POLLIN) {
 			size = read(fd, req, REQ_SIZE);

+ 0 - 3
pretty.c

@@ -23,7 +23,6 @@
 #include <string.h>
 #include <time.h>
 #include <sys/times.h>
-#include <readline/readline.h>
 
 #include <vcc/vcc.h>
 #include <vcc/version.h>
@@ -178,8 +177,6 @@ int pretty_prompt(char *usrname) {
 	ansi_csi_ed(stderr);
 	fprintf(stderr, "$: ");
 
-	rl_callback_handler_install("", do_handle_command);
-
 	return 0;
 }