xref: /dflybsd-src/contrib/tnftp/src/extern.h (revision 1612048d3f35192eeb39f3a28148604bef0d5b6e)
1*3a184c67SAntonio Huete Jimenez /*	$NetBSD: extern.h,v 1.14 2020/07/04 09:59:07 lukem Exp $	*/
2*3a184c67SAntonio Huete Jimenez /*	from	NetBSD: extern.h,v 1.82 2019/06/22 23:40:53 christos Exp	*/
36cdfca03SJohn Marino 
46cdfca03SJohn Marino /*-
56cdfca03SJohn Marino  * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
66cdfca03SJohn Marino  * All rights reserved.
76cdfca03SJohn Marino  *
86cdfca03SJohn Marino  * This code is derived from software contributed to The NetBSD Foundation
96cdfca03SJohn Marino  * by Luke Mewburn.
106cdfca03SJohn Marino  *
116cdfca03SJohn Marino  * Redistribution and use in source and binary forms, with or without
126cdfca03SJohn Marino  * modification, are permitted provided that the following conditions
136cdfca03SJohn Marino  * are met:
146cdfca03SJohn Marino  * 1. Redistributions of source code must retain the above copyright
156cdfca03SJohn Marino  *    notice, this list of conditions and the following disclaimer.
166cdfca03SJohn Marino  * 2. Redistributions in binary form must reproduce the above copyright
176cdfca03SJohn Marino  *    notice, this list of conditions and the following disclaimer in the
186cdfca03SJohn Marino  *    documentation and/or other materials provided with the distribution.
196cdfca03SJohn Marino  *
206cdfca03SJohn Marino  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
216cdfca03SJohn Marino  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
226cdfca03SJohn Marino  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
236cdfca03SJohn Marino  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
246cdfca03SJohn Marino  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
256cdfca03SJohn Marino  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
266cdfca03SJohn Marino  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
276cdfca03SJohn Marino  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
286cdfca03SJohn Marino  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
296cdfca03SJohn Marino  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
306cdfca03SJohn Marino  * POSSIBILITY OF SUCH DAMAGE.
316cdfca03SJohn Marino  */
326cdfca03SJohn Marino 
336cdfca03SJohn Marino /*-
346cdfca03SJohn Marino  * Copyright (c) 1994 The Regents of the University of California.
356cdfca03SJohn Marino  * All rights reserved.
366cdfca03SJohn Marino  *
376cdfca03SJohn Marino  * Redistribution and use in source and binary forms, with or without
386cdfca03SJohn Marino  * modification, are permitted provided that the following conditions
396cdfca03SJohn Marino  * are met:
406cdfca03SJohn Marino  * 1. Redistributions of source code must retain the above copyright
416cdfca03SJohn Marino  *    notice, this list of conditions and the following disclaimer.
426cdfca03SJohn Marino  * 2. Redistributions in binary form must reproduce the above copyright
436cdfca03SJohn Marino  *    notice, this list of conditions and the following disclaimer in the
446cdfca03SJohn Marino  *    documentation and/or other materials provided with the distribution.
456cdfca03SJohn Marino  * 3. Neither the name of the University nor the names of its contributors
466cdfca03SJohn Marino  *    may be used to endorse or promote products derived from this software
476cdfca03SJohn Marino  *    without specific prior written permission.
486cdfca03SJohn Marino  *
496cdfca03SJohn Marino  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
506cdfca03SJohn Marino  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
516cdfca03SJohn Marino  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
526cdfca03SJohn Marino  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
536cdfca03SJohn Marino  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
546cdfca03SJohn Marino  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
556cdfca03SJohn Marino  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
566cdfca03SJohn Marino  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
576cdfca03SJohn Marino  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
586cdfca03SJohn Marino  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
596cdfca03SJohn Marino  * SUCH DAMAGE.
606cdfca03SJohn Marino  *
616cdfca03SJohn Marino  *	@(#)extern.h	8.3 (Berkeley) 10/9/94
626cdfca03SJohn Marino  */
636cdfca03SJohn Marino 
646cdfca03SJohn Marino /*
656cdfca03SJohn Marino  * Copyright (C) 1997 and 1998 WIDE Project.
666cdfca03SJohn Marino  * All rights reserved.
676cdfca03SJohn Marino  *
686cdfca03SJohn Marino  * Redistribution and use in source and binary forms, with or without
696cdfca03SJohn Marino  * modification, are permitted provided that the following conditions
706cdfca03SJohn Marino  * are met:
716cdfca03SJohn Marino  * 1. Redistributions of source code must retain the above copyright
726cdfca03SJohn Marino  *    notice, this list of conditions and the following disclaimer.
736cdfca03SJohn Marino  * 2. Redistributions in binary form must reproduce the above copyright
746cdfca03SJohn Marino  *    notice, this list of conditions and the following disclaimer in the
756cdfca03SJohn Marino  *    documentation and/or other materials provided with the distribution.
766cdfca03SJohn Marino  * 3. Neither the name of the project nor the names of its contributors
776cdfca03SJohn Marino  *    may be used to endorse or promote products derived from this software
786cdfca03SJohn Marino  *    without specific prior written permission.
796cdfca03SJohn Marino  *
806cdfca03SJohn Marino  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
816cdfca03SJohn Marino  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
826cdfca03SJohn Marino  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
836cdfca03SJohn Marino  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
846cdfca03SJohn Marino  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
856cdfca03SJohn Marino  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
866cdfca03SJohn Marino  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
876cdfca03SJohn Marino  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
886cdfca03SJohn Marino  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
896cdfca03SJohn Marino  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
906cdfca03SJohn Marino  * SUCH DAMAGE.
916cdfca03SJohn Marino  */
926cdfca03SJohn Marino 
936cdfca03SJohn Marino struct sockaddr;
946cdfca03SJohn Marino struct tm;
956cdfca03SJohn Marino struct addrinfo;
966cdfca03SJohn Marino 
976cdfca03SJohn Marino void	abort_remote(FILE *);
986cdfca03SJohn Marino void	account(int, char **);
996cdfca03SJohn Marino void	ai_unmapped(struct addrinfo *);
1006cdfca03SJohn Marino int	another(int *, char ***, const char *);
1016cdfca03SJohn Marino int	auto_fetch(int, char **);
1026cdfca03SJohn Marino int	auto_put(int, char **, const char *);
1036cdfca03SJohn Marino void	blkfree(char **);
1046cdfca03SJohn Marino void	cd(int, char **);
1056cdfca03SJohn Marino void	cdup(int, char **);
1066cdfca03SJohn Marino void	changetype(int, int);
1076cdfca03SJohn Marino void	cleanuppeer(void);
1086cdfca03SJohn Marino void	cmdabort(int);
1096cdfca03SJohn Marino void	cmdtimeout(int);
1106cdfca03SJohn Marino void	cmdscanner(void);
1116cdfca03SJohn Marino int	command(const char *, ...)
1126cdfca03SJohn Marino      ;
1136cdfca03SJohn Marino #ifndef NO_EDITCOMPLETE
1146cdfca03SJohn Marino unsigned char complete(EditLine *, int);
1156cdfca03SJohn Marino void	controlediting(void);
1166cdfca03SJohn Marino #endif /* !NO_EDITCOMPLETE */
1176cdfca03SJohn Marino void	crankrate(int);
1186cdfca03SJohn Marino FILE   *dataconn(const char *);
1196cdfca03SJohn Marino void	delete(int, char **);
1206cdfca03SJohn Marino void	disconnect(int, char **);
1216cdfca03SJohn Marino void	do_chmod(int, char **);
1226cdfca03SJohn Marino void	do_umask(int, char **);
1236cdfca03SJohn Marino void	domacro(int, char **);
1246cdfca03SJohn Marino void	doproxy(int, char **);
1256cdfca03SJohn Marino void	feat(int, char **);
1266cdfca03SJohn Marino void	fget(int, char **);
1276cdfca03SJohn Marino int	fileindir(const char *, const char *);
1286cdfca03SJohn Marino int	foregroundproc(void);
1296cdfca03SJohn Marino void	formatbuf(char *, size_t, const char *);
1306cdfca03SJohn Marino void	ftpvis(char *, size_t, const char *, size_t);
1316cdfca03SJohn Marino int	ftp_login(const char *, const char *, const char *);
1326cdfca03SJohn Marino void	get(int, char **);
1336cdfca03SJohn Marino struct cmd *getcmd(const char *);
1346cdfca03SJohn Marino int	getit(int, char **, int, const char *);
1356cdfca03SJohn Marino int	get_line(FILE *, char *, size_t, const char **);
1366cdfca03SJohn Marino struct option *getoption(const char *);
1376cdfca03SJohn Marino char   *getoptionvalue(const char *);
1386cdfca03SJohn Marino void	getremoteinfo(void);
1396cdfca03SJohn Marino int	getreply(int);
1406cdfca03SJohn Marino char   *globulize(const char *);
1416cdfca03SJohn Marino char   *gunique(const char *);
1426cdfca03SJohn Marino void	help(int, char **);
1436cdfca03SJohn Marino char   *hookup(const char *, const char *);
1446cdfca03SJohn Marino void	idlecmd(int, char **);
1456cdfca03SJohn Marino int	initconn(void);
1466cdfca03SJohn Marino __dead void	intr(int);
1476cdfca03SJohn Marino int	isipv6addr(const char *);
1486cdfca03SJohn Marino void	list_vertical(StringList *);
1496cdfca03SJohn Marino void	lcd(int, char **);
1506cdfca03SJohn Marino void	lostpeer(int);
1516cdfca03SJohn Marino void	lpage(int, char **);
1526cdfca03SJohn Marino void	lpwd(int, char **);
1536cdfca03SJohn Marino void	ls(int, char **);
1546cdfca03SJohn Marino void	macdef(int, char **);
1556cdfca03SJohn Marino void	makeargv(void);
1566cdfca03SJohn Marino void	makedir(int, char **);
1576cdfca03SJohn Marino void	mdelete(int, char **);
1586cdfca03SJohn Marino void	mget(int, char **);
1596cdfca03SJohn Marino void	mls(int, char **);
1606cdfca03SJohn Marino void	mlst(int, char **);
1616cdfca03SJohn Marino void	modtime(int, char **);
1626cdfca03SJohn Marino void	mput(int, char **);
1636cdfca03SJohn Marino const char *onoff(int);
1646cdfca03SJohn Marino void	opts(int, char **);
1656cdfca03SJohn Marino void	newer(int, char **);
1666cdfca03SJohn Marino void	page(int, char **);
1676cdfca03SJohn Marino const char *parse_rfc2616time(struct tm *, const char *);
1686cdfca03SJohn Marino int	parserate(int, char **, int);
1696cdfca03SJohn Marino char   *prompt(void);
1706cdfca03SJohn Marino __dead void	proxabort(int);
1716cdfca03SJohn Marino void	proxtrans(const char *, const char *, const char *);
1726cdfca03SJohn Marino void	psabort(int);
1736cdfca03SJohn Marino void	pswitch(int);
1746cdfca03SJohn Marino void	put(int, char **);
1756cdfca03SJohn Marino void	pwd(int, char **);
1766cdfca03SJohn Marino void	quit(int, char **);
177*3a184c67SAntonio Huete Jimenez void	justquit(void) __dead;
1786cdfca03SJohn Marino void	quote(int, char **);
1796cdfca03SJohn Marino void	quote1(const char *, int, char **);
1806cdfca03SJohn Marino void	recvrequest(const char *, const char *, const char *,
1816cdfca03SJohn Marino 	    const char *, int, int);
1826cdfca03SJohn Marino void	reget(int, char **);
1836cdfca03SJohn Marino char   *remglob(char **, int, const char **);
1846cdfca03SJohn Marino time_t	remotemodtime(const char *, int);
1856cdfca03SJohn Marino off_t	remotesize(const char *, int);
1866cdfca03SJohn Marino void	removedir(int, char **);
1876cdfca03SJohn Marino void	renamefile(int, char **);
1886cdfca03SJohn Marino void	reset(int, char **);
1896cdfca03SJohn Marino void	restart(int, char **);
1906cdfca03SJohn Marino const char *rfc2822time(const struct tm *);
1916cdfca03SJohn Marino void	rmthelp(int, char **);
1926cdfca03SJohn Marino void	rmtstatus(int, char **);
1936cdfca03SJohn Marino char   *rprompt(void);
1946cdfca03SJohn Marino int	ruserpass(const char *, char **, char **, char **);
1956cdfca03SJohn Marino void	sendrequest(const char *, const char *, const char *, int);
1966cdfca03SJohn Marino void	setascii(int, char **);
1976cdfca03SJohn Marino void	setbell(int, char **);
1986cdfca03SJohn Marino void	setbinary(int, char **);
1996cdfca03SJohn Marino void	setcase(int, char **);
2006cdfca03SJohn Marino void	setcr(int, char **);
2016cdfca03SJohn Marino void	setdebug(int, char **);
2026cdfca03SJohn Marino void	setedit(int, char **);
2036cdfca03SJohn Marino void	setepsv4(int, char **);
2046cdfca03SJohn Marino void	setepsv6(int, char **);
2056cdfca03SJohn Marino void	setepsv(int, char **);
2066cdfca03SJohn Marino void	setform(int, char **);
2076cdfca03SJohn Marino void	setftmode(int, char **);
2086cdfca03SJohn Marino void	setgate(int, char **);
2096cdfca03SJohn Marino void	setglob(int, char **);
2106cdfca03SJohn Marino void	sethash(int, char **);
2116cdfca03SJohn Marino void	setnmap(int, char **);
2126cdfca03SJohn Marino void	setntrans(int, char **);
2136cdfca03SJohn Marino void	setoption(int, char **);
2146cdfca03SJohn Marino void	setpassive(int, char **);
2156cdfca03SJohn Marino void	setpeer(int, char **);
2166cdfca03SJohn Marino void	setport(int, char **);
2176cdfca03SJohn Marino void	setpreserve(int, char **);
2186cdfca03SJohn Marino void	setprogress(int, char **);
2196cdfca03SJohn Marino void	setprompt(int, char **);
2206cdfca03SJohn Marino void	setrate(int, char **);
2216cdfca03SJohn Marino void	setrunique(int, char **);
2226cdfca03SJohn Marino void	setstruct(int, char **);
2236cdfca03SJohn Marino void	setsunique(int, char **);
2246cdfca03SJohn Marino void	settenex(int, char **);
2256cdfca03SJohn Marino void	settrace(int, char **);
2266cdfca03SJohn Marino void	setttywidth(int);
2276cdfca03SJohn Marino void	settype(int, char **);
2286cdfca03SJohn Marino void	setupsockbufsize(int);
2296cdfca03SJohn Marino void	setverbose(int, char **);
2306cdfca03SJohn Marino void	setxferbuf(int, char **);
2316cdfca03SJohn Marino void	set_option(const char *, const char *, int);
2326cdfca03SJohn Marino void	shell(int, char **);
2336cdfca03SJohn Marino void	site(int, char **);
2346cdfca03SJohn Marino void	sizecmd(int, char **);
2356cdfca03SJohn Marino char   *slurpstring(void);
2366cdfca03SJohn Marino void	status(int, char **);
2376cdfca03SJohn Marino int	strsuftoi(const char *);
2386cdfca03SJohn Marino void	syst(int, char **);
2396cdfca03SJohn Marino int	togglevar(int, char **, int *, const char *);
2406cdfca03SJohn Marino void	unsetoption(int, char **);
2416cdfca03SJohn Marino void	updatelocalcwd(void);
2426cdfca03SJohn Marino void	updateremotecwd(void);
2436cdfca03SJohn Marino void	user(int, char **);
2446cdfca03SJohn Marino int	ftp_connect(int, const struct sockaddr *, socklen_t, int);
2456cdfca03SJohn Marino int	ftp_listen(int, int);
2466cdfca03SJohn Marino int	ftp_poll(struct pollfd *, int, int);
247*3a184c67SAntonio Huete Jimenez #ifndef SMALL
2486cdfca03SJohn Marino void   *ftp_malloc(size_t);
2496cdfca03SJohn Marino StringList *ftp_sl_init(void);
2506cdfca03SJohn Marino void	ftp_sl_add(StringList *, char *);
2516cdfca03SJohn Marino char   *ftp_strdup(const char *);
252*3a184c67SAntonio Huete Jimenez #else
253*3a184c67SAntonio Huete Jimenez #define	ftp_malloc(a)	malloc(a);
254*3a184c67SAntonio Huete Jimenez #define ftp_sl_init()	sl_init()
255*3a184c67SAntonio Huete Jimenez #define ftp_sl_add(a, b)	sl_add((a), (b))
256*3a184c67SAntonio Huete Jimenez #define ftp_strdup(a)	strdup(a)
257*3a184c67SAntonio Huete Jimenez #endif
258