1
0
mirror of https://github.com/gryf/ADFlib.git synced 2026-07-06 10:56:32 +02:00

automake for regtests

This commit is contained in:
Toni G
2013-02-21 23:34:16 +01:00
parent d8cc5ba3bb
commit 6bd2a93128
45 changed files with 119 additions and 494 deletions
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
+10
View File
@@ -0,0 +1,10 @@
Directory of hd_ffs_intl_dircache:
------rwed <Dir> 10-Jan-99 12:04:19 dir_1
Directory of hd_ffs_intl_dircache:dir_1
------rwed 3330 25-Jan-96 22:08:37 blue2c.gif
Directory of hd_ffs_intl_dircache:
------r-ed 0 07-Sep-97 14:29:35 emptyfile
------rwed <Dir> 10-Jan-99 12:04:34 empty_dir
c-----rwed 145360 07-Sep-97 14:37:37 mod.And.DistantCall
------rwed 12 07-Sep-97 14:35:32 textfile.txt
299 Blocks, 148,702 Bytes used in 6 files
+1
View File
@@ -0,0 +1 @@
transdisk -d trackdisk 1 -h >ffshd.adf
BIN
View File
Binary file not shown.
+102
View File
@@ -0,0 +1,102 @@
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/$(NATIVE_DIR)
bin_PROGRAMS =fl_test fl_test2 dir_test dir_test2 hd_test hd_test2 hd_test3 \
file_test file_test2 file_test3 del_test bootdisk \
rename hardfile rename2 hardfile2 access comment undel readonly \
undel2 dispsect progbar undel3
fl_test_SOURCES = fl_test.c
fl_test_LDADD = $(top_srcdir)/src/libadf.la
fl_test_DEPENDENCIES = $(top_srcdir)/src/libadf.la
fl_test2_SOURCES = fl_test2.c
fl_test2_LDADD = $(top_srcdir)/src/libadf.la
fl_test2_DEPENDENCIES = $(top_srcdir)/src/libadf.la
dir_test_SOURCES = dir_test.c
dir_test_LDADD = $(top_srcdir)/src/libadf.la
dir_test_DEPENDENCIES = $(top_srcdir)/src/libadf.la
dir_test2_SOURCES = dir_test2.c
dir_test2_LDADD = $(top_srcdir)/src/libadf.la
dir_test2_DEPENDENCIES = $(top_srcdir)/src/libadf.la
hd_test_SOURCES = hd_test.c
hd_test_LDADD = $(top_srcdir)/src/libadf.la
hd_test_DEPENDENCIES = $(top_srcdir)/src/libadf.la
hd_test2_SOURCES = hd_test2.c
hd_test2_LDADD = $(top_srcdir)/src/libadf.la
hd_test2_DEPENDENCIES = $(top_srcdir)/src/libadf.la
hd_test3_SOURCES = hd_test3.c
hd_test3_LDADD = $(top_srcdir)/src/libadf.la
hd_test3_DEPENDENCIES = $(top_srcdir)/src/libadf.la
file_test_SOURCES = file_test.c
file_test_LDADD = $(top_srcdir)/src/libadf.la
file_test_DEPENDENCIES = $(top_srcdir)/src/libadf.la
file_test2_SOURCES = file_test2.c
file_test2_LDADD = $(top_srcdir)/src/libadf.la
file_test2_DEPENDENCIES = $(top_srcdir)/src/libadf.la
file_test3_SOURCES = file_test3.c
file_test3_LDADD = $(top_srcdir)/src/libadf.la
file_test3_DEPENDENCIES = $(top_srcdir)/src/libadf.la
del_test_SOURCES = del_test.c
del_test_LDADD = $(top_srcdir)/src/libadf.la
del_test_DEPENDENCIES = $(top_srcdir)/src/libadf.la
bootdisk_SOURCES = bootdisk.c
bootdisk_LDADD = $(top_srcdir)/src/libadf.la
bootdisk_DEPENDENCIES = $(top_srcdir)/src/libadf.la
rename_SOURCES = rename.c
rename_LDADD = $(top_srcdir)/src/libadf.la
rename_DEPENDENCIES = $(top_srcdir)/src/libadf.la
hardfile_SOURCES = hardfile.c
hardfile_LDADD = $(top_srcdir)/src/libadf.la
hardfile_DEPENDENCIES = $(top_srcdir)/src/libadf.la
rename2_SOURCES = rename2.c
rename2_LDADD = $(top_srcdir)/src/libadf.la
rename2_DEPENDENCIES = $(top_srcdir)/src/libadf.la
hardfile2_SOURCES = hardfile2.c
hardfile2_LDADD = $(top_srcdir)/src/libadf.la
hardfile2_DEPENDENCIES = $(top_srcdir)/src/libadf.la
access_SOURCES = access.c
access_LDADD = $(top_srcdir)/src/libadf.la
access_DEPENDENCIES = $(top_srcdir)/src/libadf.la
comment_SOURCES = comment.c
comment_LDADD = $(top_srcdir)/src/libadf.la
comment_DEPENDENCIES = $(top_srcdir)/src/libadf.la
undel_SOURCES = undel.c
undel_LDADD = $(top_srcdir)/src/libadf.la
undel_DEPENDENCIES = $(top_srcdir)/src/libadf.la
readonly_SOURCES = readonly.c
readonly_LDADD = $(top_srcdir)/src/libadf.la
readonly_DEPENDENCIES = $(top_srcdir)/src/libadf.la
undel2_SOURCES = undel2.c
undel2_LDADD = $(top_srcdir)/src/libadf.la
undel2_DEPENDENCIES = $(top_srcdir)/src/libadf.la
dispsect_SOURCES = dispsect.c
dispsect_LDADD = $(top_srcdir)/src/libadf.la
dispsect_DEPENDENCIES = $(top_srcdir)/src/libadf.la
progbar_SOURCES = progbar.c
progbar_LDADD = $(top_srcdir)/src/libadf.la
progbar_DEPENDENCIES = $(top_srcdir)/src/libadf.la
undel3_SOURCES = undel3.c
undel3_LDADD = $(top_srcdir)/src/libadf.la
undel3_DEPENDENCIES = $(top_srcdir)/src/libadf.la
+507
View File
@@ -0,0 +1,507 @@
LIBDIR=../Lib
LIBNAME=libadf.a
DEPEND=makedepend
CFLAGS=-I$(LIBDIR) -O2 -Wall
LDFLAGS=-L$(LIBDIR) -ladf
EXES= fl_test fl_test2 dir_test dir_test2 hd_test hd_test2 hd_test3 \
file_test file_test2 file_test3 del_test bootdisk \
rename hardfile rename2 hardfile2 access comment undel readonly \
undel2 dispsect progbar undel3
CC=gcc
all: $(EXES)
lib:
cd $(LIBDIR) && $(MAKE)
access: lib access.o
$(CC) $(CFLAGS) -o $@ access.o $(LDFLAGS)
dispsect: lib dispsect.o
$(CC) $(CFLAGS) -o $@ dispsect.o $(LDFLAGS)
progbar: lib progbar.o
$(CC) $(CFLAGS) -o $@ progbar.o $(LDFLAGS)
readonly: lib readonly.o
$(CC) $(CFLAGS) -o $@ readonly.o $(LDFLAGS)
undel: lib undel.o
$(CC) $(CFLAGS) -o $@ undel.o $(LDFLAGS)
undel2: lib undel2.o
$(CC) $(CFLAGS) -o $@ undel2.o $(LDFLAGS)
undel3: lib undel3.o
$(CC) $(CFLAGS) -o $@ undel3.o $(LDFLAGS)
comment: lib comment.o
$(CC) $(CFLAGS) -o $@ comment.o $(LDFLAGS)
bootdisk2: lib bootdisk2.o
$(CC) $(CFLAGS) -o $@ bootdisk2.o $(LDFLAGS)
hardfile: lib hardfile.o
$(CC) $(CFLAGS) -o $@ hardfile.o $(LDFLAGS)
hardfile2: lib hardfile2.o
$(CC) $(CFLAGS) -o $@ hardfile2.o $(LDFLAGS)
rename: lib rename.o
$(CC) $(CFLAGS) -o $@ rename.o $(LDFLAGS)
rename2: lib rename2.o
$(CC) $(CFLAGS) -o $@ rename2.o $(LDFLAGS)
bootdisk: lib bootdisk.o
$(CC) $(CFLAGS) -o $@ bootdisk.o $(LDFLAGS)
fl_test: lib fl_test.o
$(CC) $(CFLAGS) -o $@ fl_test.o $(LDFLAGS)
fl_test2: lib fl_test2.o
$(CC) $(CFLAGS) -o $@ fl_test2.o $(LDFLAGS)
dir_test: lib dir_test.o
$(CC) $(CFLAGS) -o $@ dir_test.o $(LDFLAGS)
dir_test2: lib dir_test2.o
$(CC) $(CFLAGS) -o $@ dir_test2.o $(LDFLAGS)
hd_test: lib hd_test.o
$(CC) $(CFLAGS) -o $@ hd_test.o $(LDFLAGS)
hd_test2: lib hd_test2.o
$(CC) $(CFLAGS) -o $@ hd_test2.o $(LDFLAGS)
hd_test3: lib hd_test3.o
$(CC) $(CFLAGS) -o $@ hd_test3.o $(LDFLAGS)
file_test: lib file_test.o
$(CC) $(CFLAGS) -o $@ file_test.o $(LDFLAGS)
file_test2: lib file_test2.o
$(CC) $(CFLAGS) -o $@ file_test2.o $(LDFLAGS)
file_test3: lib file_test3.o
$(CC) $(CFLAGS) -o $@ file_test3.o $(LDFLAGS)
del_test: lib del_test.o
$(CC) $(CFLAGS) -o $@ del_test.o $(LDFLAGS)
dirc: lib dirc.o
$(CC) $(CFLAGS) -o $@ dirc.o $(LDFLAGS)
clean:
rm *.o $(EXES) core newdev
depend:
$(DEPEND) -v -- $(CFLAGS) -- *.[ch]
# DO NOT DELETE THIS LINE -- make depend depends on it.
access.o: /usr/include/stdio.h
# /usr/include/stdio.h includes:
# features.h
# stddef.h
# stdarg.h
# bits/types.h
# libio.h
# bits/stdio_lim.h
access.o: /usr/include/features.h
# /usr/include/features.h includes:
# sys/cdefs.h
# gnu/stubs.h
access.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
access.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
access.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
access.o: /usr/include/bits/types.h
# /usr/include/bits/types.h includes:
# features.h
# stddef.h
access.o: /usr/include/libio.h
# /usr/include/libio.h includes:
# _G_config.h
# stdarg.h
access.o: /usr/include/_G_config.h
# /usr/include/_G_config.h includes:
# bits/types.h
# stddef.h
access.o: /usr/include/bits/stdio_lim.h /usr/include/stdlib.h
# /usr/include/stdlib.h includes:
# features.h
# stddef.h
# sys/types.h
# alloca.h
access.o: /usr/include/sys/types.h
# /usr/include/sys/types.h includes:
# features.h
# bits/types.h
# time.h
# stddef.h
# endian.h
# sys/select.h
# sys/sysmacros.h
access.o: /usr/include/time.h
# /usr/include/time.h includes:
# bits/types.h
access.o: /usr/include/endian.h
# /usr/include/endian.h includes:
# features.h
# bits/endian.h
access.o: /usr/include/bits/endian.h /usr/include/sys/select.h
# /usr/include/sys/select.h includes:
# features.h
# bits/types.h
# bits/select.h
# bits/sigset.h
# time.h
access.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
access.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
# /usr/include/alloca.h includes:
# features.h
# stddef.h
access.o: /usr/include/string.h
# /usr/include/string.h includes:
# features.h
# stddef.h
access.o: ../Lib/adflib.h
# ../Lib/adflib.h includes:
# adf_defs.h
# adf_str.h
access.o: ../Lib/adf_defs.h ../Lib/adf_str.h
# ../Lib/adf_str.h includes:
# stdio.h
# adf_defs.h
# adf_blk.h
# adf_err.h
access.o: ../Lib/adf_blk.h ../Lib/adf_err.h
bootdisk.o: /usr/include/stdio.h /usr/include/features.h
bootdisk.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
bootdisk.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
bootdisk.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
bootdisk.o: /usr/include/bits/types.h /usr/include/libio.h
bootdisk.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
bootdisk.o: /usr/include/stdlib.h /usr/include/sys/types.h
bootdisk.o: /usr/include/time.h /usr/include/endian.h
bootdisk.o: /usr/include/bits/endian.h /usr/include/sys/select.h
bootdisk.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
bootdisk.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
bootdisk.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
bootdisk.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
bootdisk2.o: /usr/include/stdio.h /usr/include/features.h
bootdisk2.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
bootdisk2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
bootdisk2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
bootdisk2.o: /usr/include/bits/types.h /usr/include/libio.h
bootdisk2.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
bootdisk2.o: /usr/include/stdlib.h /usr/include/sys/types.h
bootdisk2.o: /usr/include/time.h /usr/include/endian.h
bootdisk2.o: /usr/include/bits/endian.h /usr/include/sys/select.h
bootdisk2.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
bootdisk2.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
bootdisk2.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
bootdisk2.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
cache_test.o: /usr/include/stdio.h /usr/include/features.h
cache_test.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
cache_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
cache_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
cache_test.o: /usr/include/bits/types.h /usr/include/libio.h
cache_test.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
cache_test.o: /usr/include/stdlib.h /usr/include/sys/types.h
cache_test.o: /usr/include/time.h /usr/include/endian.h
cache_test.o: /usr/include/bits/endian.h /usr/include/sys/select.h
cache_test.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
cache_test.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
cache_test.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
cache_test.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
comment.o: /usr/include/stdio.h /usr/include/features.h
comment.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
comment.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
comment.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
comment.o: /usr/include/bits/types.h /usr/include/libio.h
comment.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
comment.o: /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h
comment.o: /usr/include/endian.h /usr/include/bits/endian.h
comment.o: /usr/include/sys/select.h /usr/include/bits/select.h
comment.o: /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h
comment.o: /usr/include/alloca.h /usr/include/string.h ../Lib/adflib.h
comment.o: ../Lib/adf_defs.h ../Lib/adf_str.h ../Lib/adf_blk.h
comment.o: ../Lib/adf_err.h
del_test.o: /usr/include/stdio.h /usr/include/features.h
del_test.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
del_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
del_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
del_test.o: /usr/include/bits/types.h /usr/include/libio.h
del_test.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
del_test.o: /usr/include/stdlib.h /usr/include/sys/types.h
del_test.o: /usr/include/time.h /usr/include/endian.h
del_test.o: /usr/include/bits/endian.h /usr/include/sys/select.h
del_test.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
del_test.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
del_test.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
del_test.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
dir_test.o: /usr/include/stdio.h /usr/include/features.h
dir_test.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
dir_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
dir_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
dir_test.o: /usr/include/bits/types.h /usr/include/libio.h
dir_test.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
dir_test.o: /usr/include/stdlib.h /usr/include/sys/types.h
dir_test.o: /usr/include/time.h /usr/include/endian.h
dir_test.o: /usr/include/bits/endian.h /usr/include/sys/select.h
dir_test.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
dir_test.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
dir_test.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
dir_test.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
dir_test2.o: /usr/include/stdio.h /usr/include/features.h
dir_test2.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
dir_test2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
dir_test2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
dir_test2.o: /usr/include/bits/types.h /usr/include/libio.h
dir_test2.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
dir_test2.o: /usr/include/stdlib.h /usr/include/sys/types.h
dir_test2.o: /usr/include/time.h /usr/include/endian.h
dir_test2.o: /usr/include/bits/endian.h /usr/include/sys/select.h
dir_test2.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
dir_test2.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
dir_test2.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
dir_test2.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
dirc.o: /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h
dirc.o: /usr/include/gnu/stubs.h
dirc.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
dirc.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
dirc.o: /usr/include/bits/types.h /usr/include/libio.h
dirc.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
dirc.o: /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h
dirc.o: /usr/include/endian.h /usr/include/bits/endian.h
dirc.o: /usr/include/sys/select.h /usr/include/bits/select.h
dirc.o: /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h
dirc.o: /usr/include/alloca.h /usr/include/string.h ../Lib/adflib.h
dirc.o: ../Lib/adf_defs.h ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
dirc_test.o: /usr/include/stdio.h /usr/include/features.h
dirc_test.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
dirc_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
dirc_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
dirc_test.o: /usr/include/bits/types.h /usr/include/libio.h
dirc_test.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
dirc_test.o: /usr/include/stdlib.h /usr/include/sys/types.h
dirc_test.o: /usr/include/time.h /usr/include/endian.h
dirc_test.o: /usr/include/bits/endian.h /usr/include/sys/select.h
dirc_test.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
dirc_test.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
dirc_test.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
dirc_test.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
file_test.o: /usr/include/stdio.h /usr/include/features.h
file_test.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
file_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
file_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
file_test.o: /usr/include/bits/types.h /usr/include/libio.h
file_test.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
file_test.o: /usr/include/stdlib.h /usr/include/sys/types.h
file_test.o: /usr/include/time.h /usr/include/endian.h
file_test.o: /usr/include/bits/endian.h /usr/include/sys/select.h
file_test.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
file_test.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
file_test.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
file_test.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
file_test2.o: /usr/include/stdio.h /usr/include/features.h
file_test2.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
file_test2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
file_test2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
file_test2.o: /usr/include/bits/types.h /usr/include/libio.h
file_test2.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
file_test2.o: /usr/include/stdlib.h /usr/include/sys/types.h
file_test2.o: /usr/include/time.h /usr/include/endian.h
file_test2.o: /usr/include/bits/endian.h /usr/include/sys/select.h
file_test2.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
file_test2.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
file_test2.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
file_test2.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
file_test2a.o: /usr/include/stdio.h /usr/include/features.h
file_test2a.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
file_test2a.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
file_test2a.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
file_test2a.o: /usr/include/bits/types.h /usr/include/libio.h
file_test2a.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
file_test2a.o: /usr/include/stdlib.h /usr/include/sys/types.h
file_test2a.o: /usr/include/time.h /usr/include/endian.h
file_test2a.o: /usr/include/bits/endian.h /usr/include/sys/select.h
file_test2a.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
file_test2a.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
file_test2a.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
file_test2a.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
file_test3.o: /usr/include/stdio.h /usr/include/features.h
file_test3.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
file_test3.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
file_test3.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
file_test3.o: /usr/include/bits/types.h /usr/include/libio.h
file_test3.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
file_test3.o: /usr/include/stdlib.h /usr/include/sys/types.h
file_test3.o: /usr/include/time.h /usr/include/endian.h
file_test3.o: /usr/include/bits/endian.h /usr/include/sys/select.h
file_test3.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
file_test3.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
file_test3.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
file_test3.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
fl_test.o: /usr/include/stdio.h /usr/include/features.h
fl_test.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
fl_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
fl_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
fl_test.o: /usr/include/bits/types.h /usr/include/libio.h
fl_test.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
fl_test.o: /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h
fl_test.o: /usr/include/endian.h /usr/include/bits/endian.h
fl_test.o: /usr/include/sys/select.h /usr/include/bits/select.h
fl_test.o: /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h
fl_test.o: /usr/include/alloca.h /usr/include/string.h ../Lib/adflib.h
fl_test.o: ../Lib/adf_defs.h ../Lib/adf_str.h ../Lib/adf_blk.h
fl_test.o: ../Lib/adf_err.h
fl_test2.o: /usr/include/stdio.h /usr/include/features.h
fl_test2.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
fl_test2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
fl_test2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
fl_test2.o: /usr/include/bits/types.h /usr/include/libio.h
fl_test2.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
fl_test2.o: /usr/include/stdlib.h /usr/include/sys/types.h
fl_test2.o: /usr/include/time.h /usr/include/endian.h
fl_test2.o: /usr/include/bits/endian.h /usr/include/sys/select.h
fl_test2.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
fl_test2.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
fl_test2.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
fl_test2.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
flfile_test.o: /usr/include/stdio.h /usr/include/features.h
flfile_test.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
flfile_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
flfile_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
flfile_test.o: /usr/include/bits/types.h /usr/include/libio.h
flfile_test.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
flfile_test.o: /usr/include/stdlib.h /usr/include/sys/types.h
flfile_test.o: /usr/include/time.h /usr/include/endian.h
flfile_test.o: /usr/include/bits/endian.h /usr/include/sys/select.h
flfile_test.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
flfile_test.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
flfile_test.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
flfile_test.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
hardfile.o: /usr/include/stdio.h /usr/include/features.h
hardfile.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
hardfile.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
hardfile.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
hardfile.o: /usr/include/bits/types.h /usr/include/libio.h
hardfile.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
hardfile.o: /usr/include/stdlib.h /usr/include/sys/types.h
hardfile.o: /usr/include/time.h /usr/include/endian.h
hardfile.o: /usr/include/bits/endian.h /usr/include/sys/select.h
hardfile.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
hardfile.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
hardfile.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
hardfile.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
hardfile2.o: /usr/include/stdio.h /usr/include/features.h
hardfile2.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
hardfile2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
hardfile2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
hardfile2.o: /usr/include/bits/types.h /usr/include/libio.h
hardfile2.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
hardfile2.o: /usr/include/stdlib.h /usr/include/sys/types.h
hardfile2.o: /usr/include/time.h /usr/include/endian.h
hardfile2.o: /usr/include/bits/endian.h /usr/include/sys/select.h
hardfile2.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
hardfile2.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
hardfile2.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
hardfile2.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
hd_test.o: /usr/include/stdio.h /usr/include/features.h
hd_test.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
hd_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
hd_test.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
hd_test.o: /usr/include/bits/types.h /usr/include/libio.h
hd_test.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
hd_test.o: /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h
hd_test.o: /usr/include/endian.h /usr/include/bits/endian.h
hd_test.o: /usr/include/sys/select.h /usr/include/bits/select.h
hd_test.o: /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h
hd_test.o: /usr/include/alloca.h /usr/include/string.h ../Lib/adflib.h
hd_test.o: ../Lib/adf_defs.h ../Lib/adf_str.h ../Lib/adf_blk.h
hd_test.o: ../Lib/adf_err.h
hd_test2.o: /usr/include/stdio.h /usr/include/features.h
hd_test2.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
hd_test2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
hd_test2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
hd_test2.o: /usr/include/bits/types.h /usr/include/libio.h
hd_test2.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
hd_test2.o: /usr/include/stdlib.h /usr/include/sys/types.h
hd_test2.o: /usr/include/time.h /usr/include/endian.h
hd_test2.o: /usr/include/bits/endian.h /usr/include/sys/select.h
hd_test2.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
hd_test2.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
hd_test2.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
hd_test2.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
hd_test3.o: /usr/include/stdio.h /usr/include/features.h
hd_test3.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
hd_test3.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
hd_test3.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
hd_test3.o: /usr/include/bits/types.h /usr/include/libio.h
hd_test3.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
hd_test3.o: /usr/include/stdlib.h /usr/include/sys/types.h
hd_test3.o: /usr/include/time.h /usr/include/endian.h
hd_test3.o: /usr/include/bits/endian.h /usr/include/sys/select.h
hd_test3.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
hd_test3.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
hd_test3.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
hd_test3.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
readonly.o: /usr/include/stdio.h /usr/include/features.h
readonly.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
readonly.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
readonly.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
readonly.o: /usr/include/bits/types.h /usr/include/libio.h
readonly.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
readonly.o: /usr/include/stdlib.h /usr/include/sys/types.h
readonly.o: /usr/include/time.h /usr/include/endian.h
readonly.o: /usr/include/bits/endian.h /usr/include/sys/select.h
readonly.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
readonly.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
readonly.o: /usr/include/string.h ../Lib/adflib.h ../Lib/adf_defs.h
readonly.o: ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
rename.o: /usr/include/stdio.h /usr/include/features.h
rename.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
rename.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
rename.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
rename.o: /usr/include/bits/types.h /usr/include/libio.h
rename.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
rename.o: /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h
rename.o: /usr/include/endian.h /usr/include/bits/endian.h
rename.o: /usr/include/sys/select.h /usr/include/bits/select.h
rename.o: /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h
rename.o: /usr/include/alloca.h /usr/include/string.h ../Lib/adflib.h
rename.o: ../Lib/adf_defs.h ../Lib/adf_str.h ../Lib/adf_blk.h
rename.o: ../Lib/adf_err.h
rename2.o: /usr/include/stdio.h /usr/include/features.h
rename2.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
rename2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
rename2.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
rename2.o: /usr/include/bits/types.h /usr/include/libio.h
rename2.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
rename2.o: /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h
rename2.o: /usr/include/endian.h /usr/include/bits/endian.h
rename2.o: /usr/include/sys/select.h /usr/include/bits/select.h
rename2.o: /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h
rename2.o: /usr/include/alloca.h /usr/include/string.h ../Lib/adflib.h
rename2.o: ../Lib/adf_defs.h ../Lib/adf_str.h ../Lib/adf_blk.h
rename2.o: ../Lib/adf_err.h
undel.o: /usr/include/stdio.h /usr/include/features.h
undel.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
undel.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h
undel.o: /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h
undel.o: /usr/include/bits/types.h /usr/include/libio.h
undel.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
undel.o: /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h
undel.o: /usr/include/endian.h /usr/include/bits/endian.h
undel.o: /usr/include/sys/select.h /usr/include/bits/select.h
undel.o: /usr/include/bits/sigset.h /usr/include/sys/sysmacros.h
undel.o: /usr/include/alloca.h /usr/include/string.h ../Lib/adflib.h
undel.o: ../Lib/adf_defs.h ../Lib/adf_str.h ../Lib/adf_blk.h ../Lib/adf_err.h
+101
View File
@@ -0,0 +1,101 @@
/*
* rename.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct File *fic;
unsigned char buf[1];
struct List *list, *cell;
adfEnvInitDefault();
/* create and mount one device */
hd = adfCreateDumpDevice("newdev", 80, 2, 11);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
if (adfCreateFlop( hd, "empty", FSMASK_FFS|FSMASK_DIRCACHE )!=RC_OK) {
fprintf(stderr, "can't create floppy\n");
adfUnMountDev(hd);
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
fic = adfOpenFile(vol, "file_1a","w");
if (!fic) { adfUnMount(vol); adfUnMountDev(hd); adfEnvCleanUp(); exit(1); }
adfWriteFile(fic,1,buf);
adfCloseFile(fic);
adfVolumeInfo(vol);
adfCreateDir(vol,vol->curDirPtr,"dir_5u");
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfSetEntryAccess(vol, vol->curDirPtr, "dir_5u", 0|ACCMASK_A|ACCMASK_E);
adfSetEntryAccess(vol, vol->curDirPtr, "file_1a", 0|ACCMASK_P|ACCMASK_W);
putchar('\n');
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfSetEntryAccess(vol, vol->curDirPtr, "dir_5u", 0x12 & !ACCMASK_A & !ACCMASK_E);
adfSetEntryAccess(vol, vol->curDirPtr, "file_1a", 0x24 & !ACCMASK_P & !ACCMASK_W );
putchar('\n');
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+26
View File
@@ -0,0 +1,26 @@
#!/bin/sh
#floppy test
DUMPS=../Dumps
FFSDUMP=$DUMPS/testffs.adf
OFSDUMP=$DUMPS/testofs.adf
HDDUMP=$DUMPS/testhd.adf
BOOTDIR=../Boot
BOOTBLK=$BOOTDIR/stdboot3.bbk
CHECK=../Check
hd_test /home/root/hd.adf /home/root/idh2.adf
echo "-----"
hd_test2
rm newdev
echo "-----"
hd_test3
rm newdev
echo "-----"
hardfile /home/root/hardfile.hdf
+72
View File
@@ -0,0 +1,72 @@
/*
* bootdisk.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
FILE* boot;
unsigned char bootcode[1024];
boot=fopen(argv[1],"rb");
if (!boot) {
fprintf(stderr, "can't mount volume\n");
exit(1);
}
fread(bootcode, sizeof(unsigned char), 1024, boot);
fclose(boot);
adfEnvInitDefault();
/* create and mount one device */
hd = adfCreateDumpDevice("newdev", 80, 2, 11);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
if (adfCreateFlop( hd, "empty", FSMASK_FFS|FSMASK_DIRCACHE )!=RC_OK) {
fprintf(stderr, "can't create floppy\n");
adfUnMountDev(hd);
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfInstallBootBlock(vol, bootcode);
adfVolumeInfo(vol);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+63
View File
@@ -0,0 +1,63 @@
/*
* bootdisk.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
FILE* boot;
unsigned char bootcode[1024];
boot=fopen(argv[1],"rb");
if (!boot) {
fprintf(stderr, "can't mount volume\n");
exit(1);
}
fread(bootcode, sizeof(unsigned char), 1024, boot);
fclose(boot);
adfEnvInitDefault();
hd = adfMountDev(argv[2],FALSE);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfInstallBootBlock(vol, bootcode);
adfVolumeInfo(vol);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+106
View File
@@ -0,0 +1,106 @@
/*
* cache_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct File *file;
unsigned char buf[600];
long n;
FILE *in;
long len;
struct List *list;
adfEnvInitDefault();
// adfSetEnvFct(0,0,MyVer,0);
/* mount existing device : FFS */
hd = adfMountDev( "testffs.bak",FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
list = adfGetDirEnt(vol, vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
// adfCreateDir(vol,vol->curDirPtr,"dir_1a");
adfCreateDir(vol,vol->curDirPtr,"dir_1b");
file = adfOpenFile(vol, "newfile","w");
adfCloseFile(file);
file = adfOpenFile(vol, "moon_gif","w");
if (!file) return 1;
in = fopen("Check/MOON.GIF","rb");
if (!in) return 1;
len = 600;
n = fread(buf,sizeof(unsigned char),len,in);
while(!feof(in)) {
adfWriteFile(file, n, buf);
n = fread(buf,sizeof(unsigned char),len,in);
}
if (n>0)
adfWriteFile(file, n, buf);
// adfFlushFile(file);
adfCloseFile(file);
fclose(in);
adfRemoveEntry(vol,vol->curDirPtr, "dir_1b");
list = adfGetDirEnt(vol, vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+104
View File
@@ -0,0 +1,104 @@
/*
* comment.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct File *fic;
unsigned char buf[1];
struct List *list, *cell;
BOOL true = TRUE;
adfEnvInitDefault();
/* create and mount one device */
hd = adfCreateDumpDevice("newdev", 80, 2, 11);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
if (adfCreateFlop( hd, "empty", FSMASK_FFS|FSMASK_DIRCACHE )!=RC_OK) {
fprintf(stderr, "can't create floppy\n");
adfUnMountDev(hd);
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
fic = adfOpenFile(vol, "file_1a","w");
if (!fic) { adfUnMount(vol); adfUnMountDev(hd); adfEnvCleanUp(); exit(1); }
adfWriteFile(fic,1,buf);
adfCloseFile(fic);
adfVolumeInfo(vol);
adfCreateDir(vol,vol->curDirPtr,"dir_5u");
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfSetEntryComment(vol, vol->curDirPtr, "dir_5u", "dir_5u comment");
adfSetEntryComment(vol, vol->curDirPtr, "file_1a", "file_1a very very long comment");
putchar('\n');
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfSetEntryComment(vol, vol->curDirPtr, "dir_5u", "");
adfSetEntryComment(vol, vol->curDirPtr, "file_1a", "new comment" );
putchar('\n');
adfChgEnvProp(PR_USEDIRC, &true);
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+115
View File
@@ -0,0 +1,115 @@
/*
* del_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct List *list;
SECTNUM nSect;
adfEnvInitDefault();
/* mount existing device */
hd = adfMountDev( argv[1],FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
putchar('\n');
/* cd dir_2 */
nSect = adfChangeDir(vol, "same_hash");
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
putchar('\n');
/* not empty */
adfRemoveEntry(vol, vol->curDirPtr, "dir_2");
/* first in same hash linked list */
adfRemoveEntry(vol, vol->curDirPtr, "file_3a");
/* second */
adfRemoveEntry(vol, vol->curDirPtr, "dir_3");
/* last */
adfRemoveEntry(vol, vol->curDirPtr, "dir_1a");
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
putchar('\n');
adfParentDir(vol);
adfRemoveEntry(vol, vol->curDirPtr, "mod.And.DistantCall");
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
putchar('\n');
adfVolumeInfo(vol);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+91
View File
@@ -0,0 +1,91 @@
/*
* dir_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct List *list, *cell;
SECTNUM nSect;
adfEnvInitDefault();
// adfSetEnvFct(0,0,MyVer,0);
/* mount existing device */
/* testffs.adf */
hd = adfMountDev( argv[1],FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
putchar('\n');
/* cd dir_2 */
nSect = adfChangeDir(vol, "dir_2");
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
putchar('\n');
/* cd .. */
adfParentDir(vol);
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+88
View File
@@ -0,0 +1,88 @@
/*
* dir_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct List *list, *cell;
adfEnvInitDefault();
// adfSetEnvFct(0,0,MyVer,0);
/* mount existing device */
hd = adfMountDev( argv[1],FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
putchar('\n');
adfCreateDir(vol,vol->curDirPtr,"dir_1a");
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
putchar('\n');
/* same hash than dir_1a" */
adfCreateDir(vol,vol->curDirPtr,"dir_5u");
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
putchar('\n');
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+85
View File
@@ -0,0 +1,85 @@
/*
* dir_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct List *list, *cell;
BOOL boolPr;
adfEnvInitDefault();
// adfSetEnvFct(0,0,MyVer,0);
/* mount existing device */
hd = adfMountDev( argv[1],FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
putchar('\n');
/* not empty */
adfRemoveEntry(vol, vol->curDirPtr, "dir_2");
/* cd dir_2 */
boolPr = TRUE;
adfChgEnvProp(PR_USEDIRC, (void*)&boolPr);
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
putchar('\n');
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+67
View File
@@ -0,0 +1,67 @@
/*
* dir_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct List *list, *cell;
SECTNUM nSect;
adfEnvInitDefault();
// adfSetEnvFct(0,0,MyVer,0);
/* mount existing device */
hd = adfMountDev( "testdirc.adf",FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
putchar('\n');
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+120
View File
@@ -0,0 +1,120 @@
/*
* dispsect.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct File *fic;
unsigned char buf[1];
struct List *list, *cell;
struct GenBlock *block;
BOOL true = TRUE;
adfEnvInitDefault();
adfChgEnvProp(PR_USEDIRC,&true);
/* display or not the physical / logical blocks and W or R */
adfChgEnvProp(PR_USE_RWACCESS,&true);
/* create and mount one device */
hd = adfCreateDumpDevice("newdev", 80, 2, 11);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
if (adfCreateFlop( hd, "empty", FSMASK_FFS|FSMASK_DIRCACHE )!=RC_OK) {
fprintf(stderr, "can't create floppy\n");
adfUnMountDev(hd);
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
fic = adfOpenFile(vol, "file_1a","w");
if (!fic) { adfUnMount(vol); adfUnMountDev(hd); adfEnvCleanUp(); exit(1); }
adfWriteFile(fic,1,buf);
adfCloseFile(fic);
puts("\ncreate file_1a");
adfVolumeInfo(vol);
adfCreateDir(vol,vol->curDirPtr,"dir_5u");
puts("\ncreate dir_5u");
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
puts("\nremove file_1a");
adfRemoveEntry(vol,vol->curDirPtr,"file_1a");
adfVolumeInfo(vol);
adfRemoveEntry(vol,vol->curDirPtr,"dir_5u");
puts("\nremove dir_5u");
adfVolumeInfo(vol);
cell = list = adfGetDelEnt(vol);
while(cell) {
block =(struct GenBlock*) cell->content;
printf("%s %d %d %ld\n",block->name,block->type,block->secType,
block->sect);
cell = cell->next;
}
adfFreeDelList(list);
adfUndelEntry(vol,vol->curDirPtr,883); // file_1a
puts("\nundel file_1a");
adfVolumeInfo(vol);
adfUndelEntry(vol,vol->curDirPtr,885); // dir_5u
puts("\nundel dir_5u");
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+49
View File
@@ -0,0 +1,49 @@
tests
RENAME
1.
create files with names : file_1a, file_24, dir_1a, dir_5u
two same hashvalue linked lists ($40 and $f8) from the dir block :
$F8 $40
887 file_1a 891 dir_1a
889 file_24 893 dir_5u
887 points to 889, 891 points to 893.
2.
rename dir_5u into file_5u
$F8 $40
887 file_1a 891 dir_1a
889 file_24
893 file_5u
3.
rename file_1a into dir_3
$F8 $40
889 file_24 887 dir_3
893 file_5u 891 dir_1a
4.
create dir_5a, rename dir_1a into toto
$40
887 dir_3
891 dir_1a
895 dir_5u
$40 $F8 $20
887 dir_3 889 file_24 891 toto
895 dir_5u 893 file_5u
+129
View File
@@ -0,0 +1,129 @@
/*
* dir_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct File *file;
unsigned char buf[600];
long n;
FILE *out;
long len;
adfEnvInitDefault();
// adfSetEnvFct(0,0,MyVer,0);
/* mount existing device : FFS */
hd = adfMountDev( argv[1],FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
file = adfOpenFile(vol, "mod.and.distantcall","r");
if (!file) return 1;
out = fopen("mod.distant","wb");
if (!out) return 1;
len = 600;
n = adfReadFile(file, len, buf);
while(!adfEndOfFile(file)) {
fwrite(buf,sizeof(unsigned char),n,out);
n = adfReadFile(file, len, buf);
}
if (n>0)
fwrite(buf,sizeof(unsigned char),n,out);
fclose(out);
adfCloseFile(file);
file = adfOpenFile(vol, "emptyfile", "r");
if (!file) {
adfUnMount(vol); adfUnMountDev(hd);
fprintf(stderr, "can't open file\n");
exit(1);
}
n = adfReadFile(file, 2, buf);
adfCloseFile(file);
adfUnMount(vol);
adfUnMountDev(hd);
/* ofs */
hd = adfMountDev( argv[2],FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
file = adfOpenFile(vol, "moon.gif","r");
if (!file) return 1;
out = fopen("moon_gif","wb");
if (!out) return 1;
len = 300;
n = adfReadFile(file, len, buf);
while(!adfEndOfFile(file)) {
fwrite(buf,sizeof(unsigned char),n,out);
n = adfReadFile(file, len, buf);
}
if (n>0)
fwrite(buf,sizeof(unsigned char),n,out);
fclose(out);
adfCloseFile(file);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+110
View File
@@ -0,0 +1,110 @@
/*
* dir_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct File *file;
unsigned char buf[600];
long n;
FILE *out;
long len;
struct List *list;
adfEnvInitDefault();
// adfSetEnvFct(0,0,MyVer,0);
/* mount existing device : FFS */
hd = adfMountDev( argv[1],FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
/* write one file */
file = adfOpenFile(vol, "moon_gif","w");
if (!file) return 1;
out = fopen( argv[2],"rb");
if (!out) return 1;
len = 600;
n = fread(buf,sizeof(unsigned char),len,out);
while(!feof(out)) {
adfWriteFile(file, n, buf);
n = fread(buf,sizeof(unsigned char),len,out);
}
if (n>0)
adfWriteFile(file, n, buf);
fclose(out);
adfCloseFile(file);
/* the directory */
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
/* re read this file */
file = adfOpenFile(vol, "moon_gif","r");
if (!file) return 1;
out = fopen("moon__gif","wb");
if (!out) return 1;
len = 300;
n = adfReadFile(file, len, buf);
while(!adfEndOfFile(file)) {
fwrite(buf,sizeof(unsigned char),n,out);
n = adfReadFile(file, len, buf);
}
if (n>0)
fwrite(buf,sizeof(unsigned char),n,out);
fclose(out);
adfCloseFile(file);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+111
View File
@@ -0,0 +1,111 @@
/*
* dir_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct File *file;
unsigned char buf[600];
long n;
FILE *out;
long len;
struct List *list;
adfEnvInitDefault();
// adfSetEnvFct(0,0,MyVer,0);
/* mount existing device : FFS */
hd = adfMountDev( "hd.adf",FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
vol = adfMount(hd, 1, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
/* write one file */
file = adfOpenFile(vol, "moon_gif","w");
if (!file) return 1;
out = fopen("Check/MOON.GIF","rb");
if (!out) return 1;
len = 600;
n = fread(buf,sizeof(unsigned char),len,out);
while(!feof(out)) {
adfWriteFile(file, n, buf);
n = fread(buf,sizeof(unsigned char),len,out);
}
if (n>0)
adfWriteFile(file, n, buf);
fclose(out);
adfCloseFile(file);
/* the directory */
/* list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
*/
/* re read this file */
file = adfOpenFile(vol, "moon_gif","r");
if (!file) return 1;
out = fopen("moon__gif","wb");
if (!out) return 1;
len = 300;
n = adfReadFile(file, len, buf);
while(!adfEndOfFile(file)) {
fwrite(buf,sizeof(unsigned char),n,out);
n = adfReadFile(file, len, buf);
}
if (n>0)
fwrite(buf,sizeof(unsigned char),n,out);
fclose(out);
adfCloseFile(file);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+101
View File
@@ -0,0 +1,101 @@
/*
* dir_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct File *file;
unsigned char buf[600];
long n;
FILE *out;
long len;
struct List *list;
adfEnvInitDefault();
// adfSetEnvFct(0,0,MyVer,0);
/* mount existing device : OFS */
hd = adfMountDev( argv[1],FALSE );
vol = adfMount(hd, 0, FALSE);
adfVolumeInfo(vol);
/* write one file */
file = adfOpenFile(vol, "moon_gif","w");
if (!file) return 1;
out = fopen( argv[2],"rb");
if (!out) return 1;
len = 600;
n = fread(buf,sizeof(unsigned char),len,out);
while(!feof(out)) {
adfWriteFile(file, n, buf);
n = fread(buf,sizeof(unsigned char),len,out);
}
if (n>0)
adfWriteFile(file, n, buf);
fclose(out);
adfCloseFile(file);
/* the directory */
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
/* re read this file */
file = adfOpenFile(vol, "moon_gif","r");
if (!file) return 1;
out = fopen("moon__gif","wb");
if (!out) return 1;
len = 300;
n = adfReadFile(file, len, buf);
while(!adfEndOfFile(file)) {
fwrite(buf,sizeof(unsigned char),n,out);
n = adfReadFile(file, len, buf);
}
if (n>0)
fwrite(buf,sizeof(unsigned char),n,out);
fclose(out);
adfCloseFile(file);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+91
View File
@@ -0,0 +1,91 @@
/*
* hd_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
FILE* boot;
unsigned char bootcode[1024];
adfEnvInitDefault();
// adfSetEnvFct(0,0,MyVer,0);
/* mount existing device */
hd = adfMountDev( argv[1],FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
adfUnMount(vol);
adfUnMountDev(hd);
putchar('\n');
/* create and mount one device */
hd = adfCreateDumpDevice("newdev", 80, 2, 11);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
adfCreateFlop( hd, "empty", FSMASK_FFS|FSMASK_DIRCACHE );
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
boot=fopen(argv[2],"rb");
if (!boot) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
fread(bootcode, sizeof(unsigned char), 1024, boot);
adfInstallBootBlock(vol, bootcode);
fclose(boot);
adfVolumeInfo(vol);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+63
View File
@@ -0,0 +1,63 @@
/*
* hd_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct List *list;
adfEnvInitDefault();
// adfSetEnvFct(0,0,MyVer,0);
/* mount existing device */
hd = adfMountDev( argv[1],FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+104
View File
@@ -0,0 +1,104 @@
/*
* hd_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct File *file;
unsigned char buf[600];
long n;
FILE *out;
long len;
struct List *list;
adfEnvInitDefault();
/* create and mount one device */
hd = adfCreateDumpDevice("newdev", 80, 11, 2);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfCreateFlop( hd, "empty", FSMASK_FFS|FSMASK_DIRCACHE );
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
/* the directory */
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
/* write one file */
file = adfOpenFile(vol, "moon_gif","w");
if (!file) return 1;
out = fopen("Check/MOON.GIF","rb");
if (!out) return 1;
len = 600;
n = fread(buf,sizeof(unsigned char),len,out);
while(!feof(out)) {
adfWriteFile(file, n, buf);
n = fread(buf,sizeof(unsigned char),len,out);
}
if (n>0)
adfWriteFile(file, n, buf);
fclose(out);
adfCloseFile(file);
/* the directory */
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+80
View File
@@ -0,0 +1,80 @@
#!/bin/sh
# floppy test
DUMPS=../Dumps
FFSDUMP=$DUMPS/testffs.adf
OFSDUMP=$DUMPS/testofs.adf
HDDUMP=$DUMPS/testhd.adf
BOOTDIR=../Boot
BOOTBLK=$BOOTDIR/stdboot3.bbk
CHECK=../Check
bootdisk $BOOTBLK
rm newdev
echo "-----"
cp $FFSDUMP testffs_adf
del_test testffs_adf
rm testffs_adf
echo "-----"
dir_test $FFSDUMP
echo "-----"
cp $FFSDUMP testffs_adf
dir_test2 testffs_adf
rm testffs_adf
echo "-----"
fl_test $FFSDUMP $BOOTBLK
rm newdev
echo "-----"
fl_test2 $HDDUMP
echo "-----"
file_test $FFSDUMP $OFSDUMP
diff mod.distant $CHECK/mod.And.DistantCall
diff moon_gif $CHECK/MOON.GIF
rm mod.distant moon_gif
echo "-----"
cp $FFSDUMP testffs_adf
file_test2 testffs_adf $CHECK/MOON.GIF
diff moon__gif $CHECK/MOON.GIF
rm moon__gif
rm testffs_adf
echo "-----"
cp $OFSDUMP testofs_adf
file_test3 testofs_adf $CHECK/MOON.GIF
diff moon__gif $CHECK/MOON.GIF
rm moon__gif
rm testofs_adf
echo "-----"
rename
rm newdev
echo "-----"
rename2
rm newdev
undel
rm newdev
echo "-----"
cp $FFSDUMP testffs_adf
undel2 testffs_adf
diff mod.distant $CHECK/mod.And.DistantCall
rm mod.distant testffs_adf
echo "-----"
cp $OFSDUMP testofs_adf
undel3 testofs_adf
diff moon_gif $CHECK/MOON.GIF
rm moon_gif testofs_adf
echo "-----"
+65
View File
@@ -0,0 +1,65 @@
/*
* bootdisk.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct List *list, *cell;
adfEnvInitDefault();
hd = adfMountDev( argv[1],FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
/* mount the 2 partitions */
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
/* unmounts */
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+65
View File
@@ -0,0 +1,65 @@
/*
* bootdisk.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct List *list, *cell;
adfEnvInitDefault();
/* create and mount one device : 4194304 bytes */
hd = adfCreateDumpDevice("newdev", 256, 2, 32);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfCreateHdFile( hd, "empty", FSMASK_FFS|FSMASK_DIRCACHE );
adfDeviceInfo(hd);
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
/* unmounts */
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+85
View File
@@ -0,0 +1,85 @@
/*
* hd_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol, *vol2;
/* initialisation */
adfEnvInitDefault();
/*** a real harddisk ***/
hd = adfMountDev( argv[1],FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
/* mount the 2 partitions */
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
vol2 = adfMount(hd, 1, FALSE);
if (!vol2) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol2);
/* unmounts */
adfUnMount(vol);
adfUnMount(vol2);
adfUnMountDev(hd);
/*** a dump of a zip disk ***/
hd = adfMountDev( argv[2],FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
adfUnMount(vol);
adfUnMountDev(hd);
/* clean up */
adfEnvCleanUp();
return 0;
}
+93
View File
@@ -0,0 +1,93 @@
/*
* hd_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct Partition part1;
struct Partition **partList;
adfEnvInitDefault();
/* a zip disk */
hd = adfCreateDumpDevice("newdev",2891,1,68);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
partList = (struct Partition**)malloc(sizeof(struct Partition*));
if (!partList) exit(1);
part1.startCyl = 2;
part1.lenCyl = 2889;
part1.volName = strdup("zip");
part1.volType = FSMASK_FFS|FSMASK_DIRCACHE;
partList[0] = &part1;
adfCreateHd(hd,1,partList);
free(partList);
free(part1.volName);
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
adfUnMount(vol);
adfUnMountDev(hd);
/* mount the created device */
hd = adfMountDev("newdev",FALSE);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+102
View File
@@ -0,0 +1,102 @@
/*
* hd_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol, *vol2;
struct Partition part1;
struct Partition part2;
struct Partition **partList;
adfEnvInitDefault();
/* an harddisk, "b"=7.5Mb, "h"=74.5mb */
hd = adfCreateDumpDevice("newdev",980,10,17);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
partList = (struct Partition**)malloc(sizeof(struct Partition*)*2);
if (!partList) exit(1);
part1.startCyl =2;
part1.lenCyl = 100;
part1.volName = strdup("b");
part1.volType = FSMASK_FFS|FSMASK_DIRCACHE;
part2.startCyl =101;
part2.lenCyl = 878;
part2.volName = strdup("h");
part2.volType = FSMASK_FFS;
partList[0] = &part1;
partList[1] = &part2;
adfCreateHd(hd,2,partList);
free(partList);
free(part1.volName);
free(part2.volName);
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
vol2 = adfMount(hd, 1, FALSE);
if (!vol2) {
adfUnMount(vol);
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
adfVolumeInfo(vol2);
adfUnMount(vol);
adfUnMount(vol2);
adfUnMountDev(hd);
/* mount the created device */
hd = adfMountDev("newdev",FALSE);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+67
View File
@@ -0,0 +1,67 @@
/*
* dispsect.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
BOOL true = TRUE;
adfEnvInitDefault();
adfChgEnvProp(PR_USEDIRC,&true);
/* use or not the progress bar callback */
adfChgEnvProp(PR_USE_PROGBAR,&true);
/* create and mount one device */
puts("\ncreate dumpdevice");
hd = adfCreateDumpDevice("newdev", 80, 2, 11);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
puts("\ncreate floppy");
if (adfCreateFlop( hd, "empty", FSMASK_FFS|FSMASK_DIRCACHE )!=RC_OK) {
fprintf(stderr, "can't create floppy\n");
adfUnMountDev(hd);
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+116
View File
@@ -0,0 +1,116 @@
/*
* del_test.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct List *list;
SECTNUM nSect;
adfEnvInitDefault();
/* mount existing device */
hd = adfMountDev( argv[1], FALSE );
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
putchar('\n');
adfCreateDir(vol,vol->curDirPtr,"newdir");
/* cd dir_2 */
nSect = adfChangeDir(vol, "same_hash");
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
putchar('\n');
/* not empty */
adfRemoveEntry(vol, vol->curDirPtr, "mon.paradox");
/* first in same hash linked list */
adfRemoveEntry(vol, vol->curDirPtr, "file_3a");
/* second */
adfRemoveEntry(vol, vol->curDirPtr, "dir_3");
/* last */
adfRemoveEntry(vol, vol->curDirPtr, "dir_1a");
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
putchar('\n');
adfParentDir(vol);
adfRemoveEntry(vol, vol->curDirPtr, "mod.And.DistantCall");
list = adfGetDirEnt(vol,vol->curDirPtr);
while(list) {
printEntry(list->content);
adfFreeEntry(list->content);
list = list->next;
}
freeList(list);
putchar('\n');
adfVolumeInfo(vol);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+143
View File
@@ -0,0 +1,143 @@
/*
* rename.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct File *fic;
unsigned char buf[1];
struct List *list, *cell;
adfEnvInitDefault();
/* create and mount one device */
hd = adfCreateDumpDevice("newdev", 80, 2, 11);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
if (adfCreateFlop( hd, "empty", FSMASK_FFS|FSMASK_DIRCACHE )!=RC_OK) {
fprintf(stderr, "can't create floppy\n");
adfUnMountDev(hd);
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfVolumeInfo(vol);
fic = adfOpenFile(vol, "file_1a","w");
if (!fic) { adfUnMount(vol); adfUnMountDev(hd); adfEnvCleanUp(); exit(1); }
adfWriteFile(fic,1,buf);
adfCloseFile(fic);
fic = adfOpenFile(vol, "file_24","w");
if (!fic) { adfUnMount(vol); adfUnMountDev(hd); adfEnvCleanUp(); exit(1); }
adfWriteFile(fic,1,buf);
adfCloseFile(fic);
fic = adfOpenFile(vol, "dir_1a","w");
if (!fic) { adfUnMount(vol); adfUnMountDev(hd); adfEnvCleanUp(); exit(1); }
adfWriteFile(fic,1,buf);
adfCloseFile(fic);
fic = adfOpenFile(vol, "dir_5u","w");
if (!fic) { adfUnMount(vol); adfUnMountDev(hd); adfEnvCleanUp(); exit(1); }
adfWriteFile(fic,1,buf);
adfCloseFile(fic);
puts("Create file_1a, file_24, dir_1a, dir_5u (with this order)");
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
putchar('\n');
puts("Rename dir_5u into file_5u");
adfRenameEntry(vol, vol->curDirPtr, "dir_5u", vol->curDirPtr, "file_5u");
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
putchar('\n');
puts("Rename file_1a into dir_3");
adfRenameEntry(vol, vol->curDirPtr,"file_1a", vol->curDirPtr,"dir_3");
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
puts("Create dir_5u, Rename dir_3 into toto");
/*
fic = adfOpenFile(vol, "dir_5u","w");
if (!fic) { adfUnMount(vol); adfUnMountDev(hd); adfEnvCleanUp(); exit(1); }
adfWriteFile(fic,1,buf);
adfCloseFile(fic);
*/
adfCreateDir(vol,vol->curDirPtr,"dir_5u");
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfRenameEntry(vol, vol->curDirPtr,"dir_1a", vol->curDirPtr,"longfilename");
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+128
View File
@@ -0,0 +1,128 @@
/*
* rename.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct List *list, *cell;
adfEnvInitDefault();
/* create and mount one device */
hd = adfCreateDumpDevice("newdev", 80, 2, 11);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
if (adfCreateFlop( hd, "empty", FSMASK_FFS|FSMASK_DIRCACHE )!=RC_OK) {
fprintf(stderr, "can't create floppy\n");
adfUnMountDev(hd);
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
putchar('\n');
adfCreateDir(vol,vol->curDirPtr,"dir_5u");
adfCreateDir(vol,883,"dir_51");
adfCreateDir(vol,vol->curDirPtr,"toto");
printf("[dir = %ld]\n",vol->curDirPtr);
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
printf("[dir = %ld]\n",883L);
cell = list = adfGetDirEnt(vol,883);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfRenameEntry(vol, 883,"dir_51", vol->curDirPtr,"dir_55");
putchar('\n');
printf("[dir = %ld]\n",vol->curDirPtr);
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
printf("[dir = %ld]\n",883L);
cell = list = adfGetDirEnt(vol,883);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfRenameEntry(vol, vol->curDirPtr,"toto", 883,"moved_dir");
putchar('\n');
printf("[dir = %ld]\n",vol->curDirPtr);
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
printf("[dir = %ld]\n",883L);
cell = list = adfGetDirEnt(vol,883);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+116
View File
@@ -0,0 +1,116 @@
/*
* undel.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct File *fic;
unsigned char buf[1];
struct List *list, *cell;
struct GenBlock *block;
BOOL true = TRUE;
adfEnvInitDefault();
adfChgEnvProp(PR_USEDIRC,&true);
/* create and mount one device */
hd = adfCreateDumpDevice("newdev", 80, 2, 11);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
if (adfCreateFlop( hd, "empty", FSMASK_FFS|FSMASK_DIRCACHE )!=RC_OK) {
fprintf(stderr, "can't create floppy\n");
adfUnMountDev(hd);
adfEnvCleanUp(); exit(1);
}
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
fic = adfOpenFile(vol, "file_1a","w");
if (!fic) { adfUnMount(vol); adfUnMountDev(hd); adfEnvCleanUp(); exit(1); }
adfWriteFile(fic,1,buf);
adfCloseFile(fic);
puts("\ncreate file_1a");
adfVolumeInfo(vol);
adfCreateDir(vol,vol->curDirPtr,"dir_5u");
puts("\ncreate dir_5u");
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
puts("\nremove file_1a");
adfRemoveEntry(vol,vol->curDirPtr,"file_1a");
adfVolumeInfo(vol);
adfRemoveEntry(vol,vol->curDirPtr,"dir_5u");
puts("\nremove dir_5u");
adfVolumeInfo(vol);
cell = list = adfGetDelEnt(vol);
while(cell) {
block =(struct GenBlock*) cell->content;
printf("%s %d %d %ld\n",block->name,block->type,block->secType,
block->sect);
cell = cell->next;
}
adfFreeDelList(list);
adfUndelEntry(vol,vol->curDirPtr,883); // file_1a
puts("\nundel file_1a");
adfVolumeInfo(vol);
adfUndelEntry(vol,vol->curDirPtr,885); // dir_5u
puts("\nundel dir_5u");
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+112
View File
@@ -0,0 +1,112 @@
/*
* undel2.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct List *list, *cell;
struct GenBlock *block;
BOOL true = TRUE;
struct File *file;
unsigned char buf[600];
long n;
FILE *out;
long len;
adfEnvInitDefault();
adfChgEnvProp(PR_USEDIRC,&true);
hd = adfMountDev(argv[1], FALSE);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfVolumeInfo(vol);
puts("\nremove mod.and.distantcall");
adfRemoveEntry(vol,vol->curDirPtr,"mod.and.distantcall");
adfVolumeInfo(vol);
cell = list = adfGetDelEnt(vol);
while(cell) {
block =(struct GenBlock*) cell->content;
printf("%s %d %d %ld\n",block->name,block->type,block->secType,
block->sect);
cell = cell->next;
}
adfFreeDelList(list);
adfCheckEntry(vol,886,0);
adfUndelEntry(vol,vol->curDirPtr,886);
puts("\nundel mod.and.distantcall");
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
file = adfOpenFile(vol, "mod.and.distantcall","r");
if (!file) return 1;
out = fopen("mod.distant","wb");
if (!out) return 1;
len = 600;
n = adfReadFile(file, len, buf);
while(!adfEndOfFile(file)) {
fwrite(buf,sizeof(unsigned char),n,out);
n = adfReadFile(file, len, buf);
}
if (n>0)
fwrite(buf,sizeof(unsigned char),n,out);
fclose(out);
adfCloseFile(file);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}
+112
View File
@@ -0,0 +1,112 @@
/*
* undel3.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include"adflib.h"
void MyVer(char *msg)
{
fprintf(stderr,"Verbose [%s]\n",msg);
}
/*
*
*
*/
int main(int argc, char *argv[])
{
struct Device *hd;
struct Volume *vol;
struct List *list, *cell;
struct GenBlock *block;
BOOL true = TRUE;
struct File *file;
unsigned char buf[600];
long n;
FILE *out;
long len;
adfEnvInitDefault();
adfChgEnvProp(PR_USEDIRC,&true);
hd = adfMountDev(argv[1], FALSE);
if (!hd) {
fprintf(stderr, "can't mount device\n");
adfEnvCleanUp(); exit(1);
}
adfDeviceInfo(hd);
vol = adfMount(hd, 0, FALSE);
if (!vol) {
adfUnMountDev(hd);
fprintf(stderr, "can't mount volume\n");
adfEnvCleanUp(); exit(1);
}
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
adfVolumeInfo(vol);
puts("\nremove MOON.GIF");
adfRemoveEntry(vol,vol->curDirPtr,"MOON.GIF");
adfVolumeInfo(vol);
cell = list = adfGetDelEnt(vol);
while(cell) {
block =(struct GenBlock*) cell->content;
printf("%s %d %d %ld\n",block->name,block->type,block->secType,
block->sect);
cell = cell->next;
}
adfFreeDelList(list);
adfCheckEntry(vol,884,0);
adfUndelEntry(vol,vol->curDirPtr,884);
puts("\nundel MOON.GIF");
adfVolumeInfo(vol);
cell = list = adfGetDirEnt(vol, vol->curDirPtr);
while(cell) {
printEntry(cell->content);
cell = cell->next;
}
adfFreeDirList(list);
file = adfOpenFile(vol, "MOON.GIF","r");
if (!file) return 1;
out = fopen("moon_gif","wb");
if (!out) return 1;
len = 600;
n = adfReadFile(file, len, buf);
while(!adfEndOfFile(file)) {
fwrite(buf,sizeof(unsigned char),n,out);
n = adfReadFile(file, len, buf);
}
if (n>0)
fwrite(buf,sizeof(unsigned char),n,out);
fclose(out);
adfCloseFile(file);
adfUnMount(vol);
adfUnMountDev(hd);
adfEnvCleanUp();
return 0;
}