Skip to content

Commit

Permalink
libast: cleanup: remove unused astcopy function
Browse files Browse the repository at this point in the history
It has been unused in the entire history of the ast-open-archive
repo as well as ours.

Also stop generating the public ast_mmap.h header, which is also
unused (it's a copy of FEATURE/mmap which is used internally by
libast).
  • Loading branch information
McDutchie committed Jan 15, 2025
1 parent 23a6ba0 commit fb3fc47
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 125 deletions.
15 changes: 1 addition & 14 deletions src/lib/libast/Mamfile
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@ make install virtual
prev FEATURE/lib
exec - cp -f %{<} %{@}
done
make ast_mmap.h
prev FEATURE/mmap
exec - cp -f %{<} %{@}
done
make ast_fs.h
prev FEATURE/fs
exec - cp -f %{<} %{@}
Expand Down Expand Up @@ -4295,15 +4291,6 @@ make install virtual
exec - compile %{<}
done

make astcopy.o
make port/astcopy.c
prev include/ls.h
prev ast_mmap.h
prev include/ast.h
done
exec - compile %{<}
done

make astconf.o
make port/astconf.c
prev FEATURE/libpath
Expand Down Expand Up @@ -4480,7 +4467,7 @@ make install virtual
done
done
note * ...generated headers
loop HDR ast_release ast_standards ast_common ast_lib ast_sys lc align sig tmx tv ast_api ast_ccode ast_fcntl ast_float ast_fs ast_map ast_mmap ast_mode ast_ndbm ast_param ast_random ast_time ast_tty ast_limits ast_sizeof ast_dirent ast_iconv ast_nl_types ast_stdio ast_wchar ast_wctype
loop HDR ast_release ast_standards ast_common ast_lib ast_sys lc align sig tmx tv ast_api ast_ccode ast_fcntl ast_float ast_fs ast_map ast_mode ast_ndbm ast_param ast_random ast_time ast_tty ast_limits ast_sizeof ast_dirent ast_iconv ast_nl_types ast_stdio ast_wchar ast_wctype
make %{INCLUDE_AST}/%{HDR}.h
prev %{HDR}.h
exec - cp -f %{<} %{@}
Expand Down
1 change: 0 additions & 1 deletion src/lib/libast/include/ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ extern char* astgetconf(const char*, const char*, const char*, int, Error_f);
extern char* astconf(const char*, const char*, const char*);
extern Ast_confdisc_f astconfdisc(Ast_confdisc_f);
extern void astconflist(Sfio_t*, const char*, int, const char*);
extern off_t astcopy(int, int, off_t);
extern int astquery(int, const char*, ...);
extern void astwinsize(int, int*, int*);
#if _lib_sysconf
Expand Down
24 changes: 0 additions & 24 deletions src/lib/libast/man/ast.3
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ long astconf_long(\fIarg\fP);
unsigned long astconf_ulong(\fIarg\fP);
Ast_confdisc_t astconfdisc(Ast_confdisc_t new_notify);
void astconflist(Sfio_t* stream, const char* path, int flags);
off_t astcopy(int \fIrfd\fP, int \fIwfd\fP, off_t \fIn\fP);
int astquery(int \fIfd\fP, const char* \fIformat\fP , ...);
.EE
.SH DESCRIPTION
Expand Down Expand Up @@ -223,29 +222,6 @@ snarfed for input to the
.IR getconf (1)
command.
.PP
.L astcopy
efficiently copies up to
.I n
bytes from the file descriptor
.I rfd
to the file descriptor
.IR wfd .
The actual number of bytes copied is returned; \-1 is returned on error.
If
.I n
is 0 then an optimal number of bytes (with respect to both
.I rfd
and
.IR wfd )
is copied.
.PP
If possible
.IR mmap (2)
is used to do the transfer.
Some implementations may bypass user buffer copies usually required by the
.IR read (2)- write (2)
paradigm.
.PP
.L astquery
outputs an
.IR sfprintf (3)
Expand Down
86 changes: 0 additions & 86 deletions src/lib/libast/port/astcopy.c

This file was deleted.

0 comments on commit fb3fc47

Please sign in to comment.