|
@@ -21,6 +21,7 @@
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
|
#include <string.h>
|
|
#include <string.h>
|
|
|
|
|
+#include <sys/times.h>
|
|
|
|
|
|
|
|
#include <vcc/vcc.h>
|
|
#include <vcc/vcc.h>
|
|
|
#include <vcc/version.h>
|
|
#include <vcc/version.h>
|
|
@@ -51,6 +52,12 @@ struct theme theme_def = {
|
|
|
.bg = BG_BLACK,
|
|
.bg = BG_BLACK,
|
|
|
.mode = MODE_HIGHLIGHT
|
|
.mode = MODE_HIGHLIGHT
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ .time = {
|
|
|
|
|
+ .fg = FG_YELLOW,
|
|
|
|
|
+ .bg = BG_BLACK,
|
|
|
|
|
+ .mode = MODE_HIGHLIGHT
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
.errmsg = {
|
|
.errmsg = {
|
|
|
.fg = FG_RED,
|
|
.fg = FG_RED,
|
|
@@ -77,6 +84,7 @@ struct theme *current_theme = &theme_def;
|
|
|
#define curr_sysusername (¤t_theme->sysusername)
|
|
#define curr_sysusername (¤t_theme->sysusername)
|
|
|
#define curr_msg (¤t_theme->msg)
|
|
#define curr_msg (¤t_theme->msg)
|
|
|
#define curr_sysmsg (¤t_theme->sysmsg)
|
|
#define curr_sysmsg (¤t_theme->sysmsg)
|
|
|
|
|
+#define curr_time (¤t_theme->time)
|
|
|
#define curr_errmsg (¤t_theme->errmsg)
|
|
#define curr_errmsg (¤t_theme->errmsg)
|
|
|
#define curr_helpcmd (¤t_theme->helpcmd)
|
|
#define curr_helpcmd (¤t_theme->helpcmd)
|
|
|
#define curr_helpmsg (¤t_theme->helpmsg)
|
|
#define curr_helpmsg (¤t_theme->helpmsg)
|
|
@@ -85,14 +93,17 @@ struct theme *current_theme = &theme_def;
|
|
|
int pretty_new_msg(char *usrname, char *buf) {
|
|
int pretty_new_msg(char *usrname, char *buf) {
|
|
|
ansi_csi_st(stdout, MODE_HIGHLIGHT, FG_BLACK, BG_BLACK);
|
|
ansi_csi_st(stdout, MODE_HIGHLIGHT, FG_BLACK, BG_BLACK);
|
|
|
|
|
|
|
|
|
|
+ setcolor(stdout, curr_time);
|
|
|
|
|
+ printf("\r[%ld] ", times(NULL));
|
|
|
|
|
+
|
|
|
if (unlikely(!strcmp(usrname, "system"))) {
|
|
if (unlikely(!strcmp(usrname, "system"))) {
|
|
|
setcolor(stdout, curr_sysusername);
|
|
setcolor(stdout, curr_sysusername);
|
|
|
- printf("\rsystem");
|
|
|
|
|
|
|
+ printf("system");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
else {
|
|
|
setcolor(stdout, curr_usrname);
|
|
setcolor(stdout, curr_usrname);
|
|
|
- printf("\r%s", usrname);
|
|
|
|
|
|
|
+ printf("%s", usrname);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ansi_csi_ed(stdout);
|
|
ansi_csi_ed(stdout);
|