1*04203a83SThomas Cort /* $NetBSD: extern.h,v 1.80 2012/07/04 06:09:37 is Exp $ */ 2*04203a83SThomas Cort 3*04203a83SThomas Cort /*- 4*04203a83SThomas Cort * Copyright (c) 1996-2009 The NetBSD Foundation, Inc. 5*04203a83SThomas Cort * All rights reserved. 6*04203a83SThomas Cort * 7*04203a83SThomas Cort * This code is derived from software contributed to The NetBSD Foundation 8*04203a83SThomas Cort * by Luke Mewburn. 9*04203a83SThomas Cort * 10*04203a83SThomas Cort * Redistribution and use in source and binary forms, with or without 11*04203a83SThomas Cort * modification, are permitted provided that the following conditions 12*04203a83SThomas Cort * are met: 13*04203a83SThomas Cort * 1. Redistributions of source code must retain the above copyright 14*04203a83SThomas Cort * notice, this list of conditions and the following disclaimer. 15*04203a83SThomas Cort * 2. Redistributions in binary form must reproduce the above copyright 16*04203a83SThomas Cort * notice, this list of conditions and the following disclaimer in the 17*04203a83SThomas Cort * documentation and/or other materials provided with the distribution. 18*04203a83SThomas Cort * 19*04203a83SThomas Cort * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20*04203a83SThomas Cort * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21*04203a83SThomas Cort * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22*04203a83SThomas Cort * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23*04203a83SThomas Cort * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24*04203a83SThomas Cort * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25*04203a83SThomas Cort * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26*04203a83SThomas Cort * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27*04203a83SThomas Cort * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28*04203a83SThomas Cort * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29*04203a83SThomas Cort * POSSIBILITY OF SUCH DAMAGE. 30*04203a83SThomas Cort */ 31*04203a83SThomas Cort 32*04203a83SThomas Cort /*- 33*04203a83SThomas Cort * Copyright (c) 1994 The Regents of the University of California. 34*04203a83SThomas Cort * All rights reserved. 35*04203a83SThomas Cort * 36*04203a83SThomas Cort * Redistribution and use in source and binary forms, with or without 37*04203a83SThomas Cort * modification, are permitted provided that the following conditions 38*04203a83SThomas Cort * are met: 39*04203a83SThomas Cort * 1. Redistributions of source code must retain the above copyright 40*04203a83SThomas Cort * notice, this list of conditions and the following disclaimer. 41*04203a83SThomas Cort * 2. Redistributions in binary form must reproduce the above copyright 42*04203a83SThomas Cort * notice, this list of conditions and the following disclaimer in the 43*04203a83SThomas Cort * documentation and/or other materials provided with the distribution. 44*04203a83SThomas Cort * 3. Neither the name of the University nor the names of its contributors 45*04203a83SThomas Cort * may be used to endorse or promote products derived from this software 46*04203a83SThomas Cort * without specific prior written permission. 47*04203a83SThomas Cort * 48*04203a83SThomas Cort * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 49*04203a83SThomas Cort * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 50*04203a83SThomas Cort * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 51*04203a83SThomas Cort * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 52*04203a83SThomas Cort * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 53*04203a83SThomas Cort * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 54*04203a83SThomas Cort * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 55*04203a83SThomas Cort * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 56*04203a83SThomas Cort * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 57*04203a83SThomas Cort * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 58*04203a83SThomas Cort * SUCH DAMAGE. 59*04203a83SThomas Cort * 60*04203a83SThomas Cort * @(#)extern.h 8.3 (Berkeley) 10/9/94 61*04203a83SThomas Cort */ 62*04203a83SThomas Cort 63*04203a83SThomas Cort /* 64*04203a83SThomas Cort * Copyright (C) 1997 and 1998 WIDE Project. 65*04203a83SThomas Cort * All rights reserved. 66*04203a83SThomas Cort * 67*04203a83SThomas Cort * Redistribution and use in source and binary forms, with or without 68*04203a83SThomas Cort * modification, are permitted provided that the following conditions 69*04203a83SThomas Cort * are met: 70*04203a83SThomas Cort * 1. Redistributions of source code must retain the above copyright 71*04203a83SThomas Cort * notice, this list of conditions and the following disclaimer. 72*04203a83SThomas Cort * 2. Redistributions in binary form must reproduce the above copyright 73*04203a83SThomas Cort * notice, this list of conditions and the following disclaimer in the 74*04203a83SThomas Cort * documentation and/or other materials provided with the distribution. 75*04203a83SThomas Cort * 3. Neither the name of the project nor the names of its contributors 76*04203a83SThomas Cort * may be used to endorse or promote products derived from this software 77*04203a83SThomas Cort * without specific prior written permission. 78*04203a83SThomas Cort * 79*04203a83SThomas Cort * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 80*04203a83SThomas Cort * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 81*04203a83SThomas Cort * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 82*04203a83SThomas Cort * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 83*04203a83SThomas Cort * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 84*04203a83SThomas Cort * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 85*04203a83SThomas Cort * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 86*04203a83SThomas Cort * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 87*04203a83SThomas Cort * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 88*04203a83SThomas Cort * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 89*04203a83SThomas Cort * SUCH DAMAGE. 90*04203a83SThomas Cort */ 91*04203a83SThomas Cort 92*04203a83SThomas Cort struct sockaddr; 93*04203a83SThomas Cort struct tm; 94*04203a83SThomas Cort struct addrinfo; 95*04203a83SThomas Cort 96*04203a83SThomas Cort void abort_remote(FILE *); 97*04203a83SThomas Cort void account(int, char **); 98*04203a83SThomas Cort void ai_unmapped(struct addrinfo *); 99*04203a83SThomas Cort int another(int *, char ***, const char *); 100*04203a83SThomas Cort int auto_fetch(int, char **); 101*04203a83SThomas Cort int auto_put(int, char **, const char *); 102*04203a83SThomas Cort void blkfree(char **); 103*04203a83SThomas Cort void cd(int, char **); 104*04203a83SThomas Cort void cdup(int, char **); 105*04203a83SThomas Cort void changetype(int, int); 106*04203a83SThomas Cort void cleanuppeer(void); 107*04203a83SThomas Cort void cmdabort(int); 108*04203a83SThomas Cort void cmdtimeout(int); 109*04203a83SThomas Cort void cmdscanner(void); 110*04203a83SThomas Cort int command(const char *, ...) 111*04203a83SThomas Cort __attribute__((__format__(__printf__, 1, 2))); 112*04203a83SThomas Cort #ifndef NO_EDITCOMPLETE 113*04203a83SThomas Cort unsigned char complete(EditLine *, int); 114*04203a83SThomas Cort void controlediting(void); 115*04203a83SThomas Cort #endif /* !NO_EDITCOMPLETE */ 116*04203a83SThomas Cort void crankrate(int); 117*04203a83SThomas Cort FILE *dataconn(const char *); 118*04203a83SThomas Cort void delete(int, char **); 119*04203a83SThomas Cort void disconnect(int, char **); 120*04203a83SThomas Cort void do_chmod(int, char **); 121*04203a83SThomas Cort void do_umask(int, char **); 122*04203a83SThomas Cort void domacro(int, char **); 123*04203a83SThomas Cort void doproxy(int, char **); 124*04203a83SThomas Cort void feat(int, char **); 125*04203a83SThomas Cort void fget(int, char **); 126*04203a83SThomas Cort int fileindir(const char *, const char *); 127*04203a83SThomas Cort int foregroundproc(void); 128*04203a83SThomas Cort void formatbuf(char *, size_t, const char *); 129*04203a83SThomas Cort void ftpvis(char *, size_t, const char *, size_t); 130*04203a83SThomas Cort int ftp_login(const char *, const char *, const char *); 131*04203a83SThomas Cort void get(int, char **); 132*04203a83SThomas Cort struct cmd *getcmd(const char *); 133*04203a83SThomas Cort int getit(int, char **, int, const char *); 134*04203a83SThomas Cort int get_line(FILE *, char *, size_t, const char **); 135*04203a83SThomas Cort struct option *getoption(const char *); 136*04203a83SThomas Cort char *getoptionvalue(const char *); 137*04203a83SThomas Cort void getremoteinfo(void); 138*04203a83SThomas Cort int getreply(int); 139*04203a83SThomas Cort char *globulize(const char *); 140*04203a83SThomas Cort char *gunique(const char *); 141*04203a83SThomas Cort void help(int, char **); 142*04203a83SThomas Cort char *hookup(const char *, const char *); 143*04203a83SThomas Cort void idlecmd(int, char **); 144*04203a83SThomas Cort int initconn(void); 145*04203a83SThomas Cort __dead void intr(int); 146*04203a83SThomas Cort int isipv6addr(const char *); 147*04203a83SThomas Cort void list_vertical(StringList *); 148*04203a83SThomas Cort void lcd(int, char **); 149*04203a83SThomas Cort void lostpeer(int); 150*04203a83SThomas Cort void lpage(int, char **); 151*04203a83SThomas Cort void lpwd(int, char **); 152*04203a83SThomas Cort void ls(int, char **); 153*04203a83SThomas Cort void macdef(int, char **); 154*04203a83SThomas Cort void makeargv(void); 155*04203a83SThomas Cort void makedir(int, char **); 156*04203a83SThomas Cort void mdelete(int, char **); 157*04203a83SThomas Cort void mget(int, char **); 158*04203a83SThomas Cort void mls(int, char **); 159*04203a83SThomas Cort void mlst(int, char **); 160*04203a83SThomas Cort void modtime(int, char **); 161*04203a83SThomas Cort void mput(int, char **); 162*04203a83SThomas Cort const char *onoff(int); 163*04203a83SThomas Cort void opts(int, char **); 164*04203a83SThomas Cort void newer(int, char **); 165*04203a83SThomas Cort void page(int, char **); 166*04203a83SThomas Cort const char *parse_rfc2616time(struct tm *, const char *); 167*04203a83SThomas Cort int parserate(int, char **, int); 168*04203a83SThomas Cort char *prompt(void); 169*04203a83SThomas Cort __dead void proxabort(int); 170*04203a83SThomas Cort void proxtrans(const char *, const char *, const char *); 171*04203a83SThomas Cort void psabort(int); 172*04203a83SThomas Cort void pswitch(int); 173*04203a83SThomas Cort void put(int, char **); 174*04203a83SThomas Cort void pwd(int, char **); 175*04203a83SThomas Cort void quit(int, char **); 176*04203a83SThomas Cort void quote(int, char **); 177*04203a83SThomas Cort void quote1(const char *, int, char **); 178*04203a83SThomas Cort void recvrequest(const char *, const char *, const char *, 179*04203a83SThomas Cort const char *, int, int); 180*04203a83SThomas Cort void reget(int, char **); 181*04203a83SThomas Cort char *remglob(char **, int, const char **); 182*04203a83SThomas Cort time_t remotemodtime(const char *, int); 183*04203a83SThomas Cort off_t remotesize(const char *, int); 184*04203a83SThomas Cort void removedir(int, char **); 185*04203a83SThomas Cort void renamefile(int, char **); 186*04203a83SThomas Cort void reset(int, char **); 187*04203a83SThomas Cort void restart(int, char **); 188*04203a83SThomas Cort const char *rfc2822time(const struct tm *); 189*04203a83SThomas Cort void rmthelp(int, char **); 190*04203a83SThomas Cort void rmtstatus(int, char **); 191*04203a83SThomas Cort char *rprompt(void); 192*04203a83SThomas Cort int ruserpass(const char *, char **, char **, char **); 193*04203a83SThomas Cort void sendrequest(const char *, const char *, const char *, int); 194*04203a83SThomas Cort void setascii(int, char **); 195*04203a83SThomas Cort void setbell(int, char **); 196*04203a83SThomas Cort void setbinary(int, char **); 197*04203a83SThomas Cort void setcase(int, char **); 198*04203a83SThomas Cort void setcr(int, char **); 199*04203a83SThomas Cort void setdebug(int, char **); 200*04203a83SThomas Cort void setedit(int, char **); 201*04203a83SThomas Cort void setepsv4(int, char **); 202*04203a83SThomas Cort void setepsv6(int, char **); 203*04203a83SThomas Cort void setepsv(int, char **); 204*04203a83SThomas Cort void setform(int, char **); 205*04203a83SThomas Cort void setftmode(int, char **); 206*04203a83SThomas Cort void setgate(int, char **); 207*04203a83SThomas Cort void setglob(int, char **); 208*04203a83SThomas Cort void sethash(int, char **); 209*04203a83SThomas Cort void setnmap(int, char **); 210*04203a83SThomas Cort void setntrans(int, char **); 211*04203a83SThomas Cort void setoption(int, char **); 212*04203a83SThomas Cort void setpassive(int, char **); 213*04203a83SThomas Cort void setpeer(int, char **); 214*04203a83SThomas Cort void setport(int, char **); 215*04203a83SThomas Cort void setpreserve(int, char **); 216*04203a83SThomas Cort void setprogress(int, char **); 217*04203a83SThomas Cort void setprompt(int, char **); 218*04203a83SThomas Cort void setrate(int, char **); 219*04203a83SThomas Cort void setrunique(int, char **); 220*04203a83SThomas Cort void setstruct(int, char **); 221*04203a83SThomas Cort void setsunique(int, char **); 222*04203a83SThomas Cort void settenex(int, char **); 223*04203a83SThomas Cort void settrace(int, char **); 224*04203a83SThomas Cort void setttywidth(int); 225*04203a83SThomas Cort void settype(int, char **); 226*04203a83SThomas Cort void setupsockbufsize(int); 227*04203a83SThomas Cort void setverbose(int, char **); 228*04203a83SThomas Cort void setxferbuf(int, char **); 229*04203a83SThomas Cort void set_option(const char *, const char *, int); 230*04203a83SThomas Cort void shell(int, char **); 231*04203a83SThomas Cort void site(int, char **); 232*04203a83SThomas Cort void sizecmd(int, char **); 233*04203a83SThomas Cort char *slurpstring(void); 234*04203a83SThomas Cort void status(int, char **); 235*04203a83SThomas Cort int strsuftoi(const char *); 236*04203a83SThomas Cort void syst(int, char **); 237*04203a83SThomas Cort int togglevar(int, char **, int *, const char *); 238*04203a83SThomas Cort void unsetoption(int, char **); 239*04203a83SThomas Cort void updatelocalcwd(void); 240*04203a83SThomas Cort void updateremotecwd(void); 241*04203a83SThomas Cort void user(int, char **); 242*04203a83SThomas Cort int ftp_connect(int, const struct sockaddr *, socklen_t, int); 243*04203a83SThomas Cort int ftp_listen(int, int); 244*04203a83SThomas Cort int ftp_poll(struct pollfd *, int, int); 245*04203a83SThomas Cort void *ftp_malloc(size_t); 246*04203a83SThomas Cort StringList *ftp_sl_init(void); 247*04203a83SThomas Cort void ftp_sl_add(StringList *, char *); 248*04203a83SThomas Cort char *ftp_strdup(const char *); 249