Compare commits

..

3 commits

Author SHA1 Message Date
132f4887ed
Update Makefile 2024-10-22 01:14:19 +01:00
8c01acb72f
Update Makefile 2024-10-22 01:13:33 +01:00
42751778ac
Remove file from marked after remove 2024-10-11 20:03:31 +01:00
4 changed files with 13 additions and 10 deletions

View file

@ -1,7 +1,6 @@
.POSIX:
.SUFFIXES:
CC = cc
VERSION = 1.0
TARGET = ccc
MANPAGE = $(TARGET).1
@ -10,9 +9,9 @@ PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
# Flags
LDFLAGS = $(shell pkg-config --libs ncursesw)
CFLAGS = -O3 -march=native -mtune=native -pipe -s -flto -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 $(shell pkg-config --cflags ncursesw)
LDFLAGS != pkg-config --libs ncursesw
INCFLAGS != pkg-config --cflags ncursesw
CFLAGS = -O3 -march=native -mtune=native -pipe -s -flto -std=c99 -pedantic -Wall $(INCFLAGS)
SRC = ccc.c util.c file.c icons.c
@ -35,11 +34,11 @@ install: $(TARGET)
chmod 644 $(DESTDIR)$(MANDIR)/$(MANPAGE)
uninstall:
$(RM) $(DESTDIR)$(BINDIR)/$(TARGET)
$(RM) $(DESTDIR)$(MANDIR)/$(MANPAGE)
rm $(DESTDIR)$(BINDIR)/$(TARGET)
rm $(DESTDIR)$(MANDIR)/$(MANPAGE)
clean:
$(RM) $(TARGET)
rm $(TARGET)
all: $(TARGET)

3
ccc.c
View file

@ -1075,6 +1075,9 @@ void delete_files()
change_dir(cwd, 0, 0);
}
}
for (int i = 0; i < marked->length; i++) {
arraylist_remove(marked, 0);
}
} else {
wpprintw("TODO: implement hard delete");
}

View file

@ -19,10 +19,10 @@ In COLS:
0 will make them equal (at the center),
15 will make files bigger
-15 will make preview bigger */
#define WINDOW_OFFSET 0
#define WINDOW_OFFSET -20
/* Options */
#define DRAW_BORDERS true /* draw borders around windows */
#define DRAW_BORDERS false /* draw borders around windows */
#define DRAW_PREVIEW true /* draw file preview */
#define SHOW_HIDDEN true /* show hidden files/dotfiles at startup */

3
file.c
View file

@ -60,12 +60,13 @@ void arraylist_remove(ArrayList *list, long index)
if (index >= list->length)
return;
/* marked stuff doesn't work with this
free(list->items[index].name);
free(list->items[index].path);
free(list->items[index].type);
free(list->items[index].stats);
free(list->items[index].icon);
*/
for (long i = index; i < list->length - 1; i++)
list->items[i] = list->items[i + 1];