Skip to content

Commit

Permalink
Add filesystem-textfile.c, a standardized way to read a filehandle as…
Browse files Browse the repository at this point in the history
… multiple lines separated by newlines.
  • Loading branch information
mywave82 committed Mar 29, 2024
1 parent f7a901c commit 930a25a
Show file tree
Hide file tree
Showing 6 changed files with 502 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ filesel/filesystem-bzip2-test
filesel/filesystem-filehandle-cache-test
filesel/filesystem-gzip-test
filesel/filesystem-tar-test
filesel/filesystem-textfile-test
filesel/mdb-test
goodies/helpc/ocphhc
goodies/helpc/Makefile
Expand Down
27 changes: 24 additions & 3 deletions filesel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ TOPDIR=../
include $(TOPDIR)Rules.make
include Makefile-static


ifeq ($(STATIC_CORE),1)
all: $(cdrom_so) $(pfilesel_so)
else
all: $(CDROM_SO) pfilesel$(LIB_SUFFIX)
endif
$(MAKE) -C cdfs TOPDIR=../$(TOPDIR)

test: adbmeta-test$(EXE_SUFFIX) dirdb-test$(EXE_SUFFIX) filesystem-bzip2-test$(EXE_SUFFIX) filesystem-filehandle-cache-test$(EXE_SUFFIX) filesystem-gzip-test$(EXE_SUFFIX) filesystem-tar-test$(EXE_SUFFIX) mdb-test$(EXE_SUFFIX)
test: adbmeta-test$(EXE_SUFFIX) dirdb-test$(EXE_SUFFIX) filesystem-bzip2-test$(EXE_SUFFIX) filesystem-filehandle-cache-test$(EXE_SUFFIX) filesystem-gzip-test$(EXE_SUFFIX) filesystem-tar-test$(EXE_SUFFIX) filesystem-textfile-test$(EXE_SUFFIX) mdb-test$(EXE_SUFFIX)
@echo "" && echo "adbmeta-test:" && ./adbmeta-test
@echo "" && echo "dirdb-test:" && ./dirdb-test
@echo "" && echo "filesystem-bzip2-test:" && ./filesystem-bzip2-test
@echo "" && echo "filesystem-filehandle-cache-test:" && ./filesystem-filehandle-cache-test
@echo "" && echo "filesystem-gzip-test:" && ./filesystem-gzip-test
@echo "" && echo "filesystem-tar-test:" && ./filesystem-tar-test
@echo "" && echo "filesystem-textfile-test:" && ./filesystem-textfile-test
@echo "" && echo "mdb-test:" && ./mdb-test

cdrom$(LIB_SUFFIX): $(cdrom_so)
Expand All @@ -27,7 +27,7 @@ pfilesel$(LIB_SUFFIX): $(pfilesel_so)

clean:
$(MAKE) -C cdfs TOPDIR=../$(TOPDIR) clean
rm -f *.o *$(LIB_SUFFIX) adbmeta-test$(EXE_SUFFIX) dirdb-test$(EXE_SUFFIX) filesystem-bzip2-test$(EXE_SUFFIX) filesystem-filehandle-cache-test$(EXE_SUFFIX) filesystem-gzip-test$(EXE_SUFFIX) filesystem-tar-test$(EXE_SUFFIX) mdb-test$(EXE_SUFFIX)
rm -f *.o *$(LIB_SUFFIX) adbmeta-test$(EXE_SUFFIX) dirdb-test$(EXE_SUFFIX) filesystem-bzip2-test$(EXE_SUFFIX) filesystem-filehandle-cache-test$(EXE_SUFFIX) filesystem-gzip-test$(EXE_SUFFIX) filesystem-tar-test$(EXE_SUFFIX) filesystem-textfile-test$(EXE_SUFFIX) mdb-test$(EXE_SUFFIX)

ifeq ($(STATIC_CORE),1)
install:
Expand Down Expand Up @@ -328,6 +328,27 @@ filesystem-tar-test$(EXE_SUFFIX): filesystem-tar-test.c \
filesystem-file-mem-nocache.o
$(CC) $< filesystem-dir-mem-nocache.o filesystem-file-mem-nocache.o -o $@

filesystem-textfile.o: filesystem-textfile.c \
../config.h \
../types.h \
dirdb.h \
filesystem.h \
filesystem-textfile.h
$(CC) $< -o $@ -c

filesystem-textfile-test$(EXE_SUFFIX): filesystem-textfile-test.c \
filesystem-textfile.c \
../config.h \
../types.h \
dirdb.h \
filesystem.h \
filesystem-textfile.h \
filesystem-dir-mem.h \
filesystem-file-mem.h \
filesystem-dir-mem-nocache.o \
filesystem-file-mem-nocache.o
$(CC) $< filesystem-dir-mem-nocache.o filesystem-file-mem-nocache.o -o $@

filesystem-unix.o: filesystem-unix.c \
../config.h \
../types.h \
Expand Down
1 change: 1 addition & 0 deletions filesel/Makefile-static
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ filesystem-playlist-pls.o \
filesystem-setup.o \
filesystem-rpg.o \
filesystem-tar.o \
filesystem-textfile.o \
filesystem-z.o \
filesystem-zip.o \
fsptype.o \
Expand Down
Loading

0 comments on commit 930a25a

Please sign in to comment.