diff -c -r -N pine4.10.orig/build pine4.10.beos/build *** pine4.10.orig/build Tue Dec 15 15:53:29 1998 --- pine4.10.beos/build Fri Mar 19 16:01:48 1999 *************** *** 301,311 **** if [ ! -d bin ] ; then mkdir bin; fi cd $PHOME/bin rm -f pine mtest imapd pico pilot ! if [ -s ../pine/pine ] ; then ln ../pine/pine pine ; fi ! if [ -s ../mtest/mtest ] ; then ln ../mtest/mtest mtest ; fi ! if [ -s ../imapd/imapd ] ; then ln ../imapd/imapd imapd ; fi ! if [ -s ../pico/pico ] ; then ln ../pico/pico pico ; fi ! if [ -s ../pico/pilot ] ; then ln ../pico/pilot pilot ; fi cd $PHOME echo '' echo "Links to executables are in bin directory:" --- 301,311 ---- if [ ! -d bin ] ; then mkdir bin; fi cd $PHOME/bin rm -f pine mtest imapd pico pilot ! if [ -s ../pine/pine ] ; then cp ../pine/pine pine ; fi ! if [ -s ../mtest/mtest ] ; then cp ../mtest/mtest mtest ; fi ! if [ -s ../imapd/imapd ] ; then cp ../imapd/imapd imapd ; fi ! if [ -s ../pico/pico ] ; then cp ../pico/pico pico ; fi ! if [ -s ../pico/pilot ] ; then cp ../pico/pilot pilot ; fi cd $PHOME echo '' echo "Links to executables are in bin directory:" *************** *** 318,323 **** --- 318,327 ---- echo "Cleaning c-client and imapd" cd $PHOME/imap make clean + cd $PHOME + rm c-client + rm imapd + rm mtest echo "Cleaning Pine" cd $PHOME/pine make -f makefile.ult clean diff -c -r -N pine4.10.orig/imap/Makefile pine4.10.beos/imap/Makefile *** pine4.10.orig/imap/Makefile Wed Jan 27 15:33:11 1999 --- pine4.10.beos/imap/Makefile Fri Mar 19 16:04:12 1999 *************** *** 283,289 **** # Note on SCO you may have to set LN to "ln". ! a32 a41 aix bs3 bsf bsi bso d-g d54 drs epx gas gh9 ghp gs5 gso gsu gul hpp hpx lnp lyn mct mnt neb nxt nx3 osf os4 ptx qnx sc5 sco sgi shp sl4 sl5 slx snx sol sos uw2: an $(BUILD) OS=$@ # If you use sv4, you may find that it works to move it to use the an process. --- 283,289 ---- # Note on SCO you may have to set LN to "ln". ! a32 a41 aix bos bs3 bsf bsi bso d-g d54 drs epx gas gh9 ghp gs5 gso gsu gul hpp hpx lnp lyn mct mnt neb nxt nx3 osf os4 ptx qnx sc5 sco sgi shp sl4 sl5 slx snx sol sos uw2: an $(BUILD) OS=$@ # If you use sv4, you may find that it works to move it to use the an process. diff -c -r -N pine4.10.orig/imap/src/c-client/mail.h pine4.10.beos/imap/src/c-client/mail.h *** pine4.10.orig/imap/src/c-client/mail.h Tue Dec 1 12:42:36 1998 --- pine4.10.beos/imap/src/c-client/mail.h Fri Mar 19 16:01:49 1999 *************** *** 1095,1101 **** }; ! #include "linkage.h" /* Compatibility support names for old interfaces */ --- 1095,1101 ---- }; ! #include "../c-client/linkage.h" /* Compatibility support names for old interfaces */ diff -c -r -N pine4.10.orig/imap/src/osdep/unix/Makefile pine4.10.beos/imap/src/osdep/unix/Makefile *** pine4.10.orig/imap/src/osdep/unix/Makefile Tue Jan 26 15:19:19 1999 --- pine4.10.beos/imap/src/osdep/unix/Makefile Fri Mar 19 18:06:48 1999 *************** *** 174,179 **** --- 174,191 ---- BASECFLAGS="-g -B/usr/lib/big/ -Dvoid=char -Dconst= -DNFSKLUDGE" \ RANLIB=true ARRC="ar -rc" + bos: # BeOS R4 + ifeq ($(PLATFORM), intel) + $(BUILD) OS=$@ SIGTYPE=psx LOGINPW=bos \ + SPOOLDIR=/var/spool \ + BASELDFLAGS="-lbe" \ + BASECFLAGS="-O" + else + $(BUILD) OS=$@ SIGTYPE=psx LOGINPW=bos \ + SPOOLDIR=/var/spool \ + BASECFLAGS="-O" + endif + bs3: # BSD/i386 3.0 or higher $(BUILD) `cat EXTRASPECIALS` OS=bsi CHECKPW=bsi LOGINPW=bsi \ SPOOLDIR=/var NEWSSPOOL=/var/news/spool \ *************** *** 658,664 **** auths.c flock.c flockbsd.c flcksafe.c fsync.c gethstid.c \ gr_wait.c gr_wait4.c gr_waitp.c \ auth_log.c auth_md5.c \ ! scandir.c setpgrp.c strerror.c truncate.c write.c \ memmove.c memmove2.c memset.c \ tz_bsd.c tz_nul.c tz_sv4.c \ write.c \ --- 670,676 ---- auths.c flock.c flockbsd.c flcksafe.c fsync.c gethstid.c \ gr_wait.c gr_wait4.c gr_waitp.c \ auth_log.c auth_md5.c \ ! scandir.c scandir_beos.c setpgrp.c strerror.c truncate.c write.c \ memmove.c memmove2.c memset.c \ tz_bsd.c tz_nul.c tz_sv4.c \ write.c \ diff -c -r -N pine4.10.orig/imap/src/osdep/unix/env_unix.c pine4.10.beos/imap/src/osdep/unix/env_unix.c *** pine4.10.orig/imap/src/osdep/unix/env_unix.c Tue Dec 15 22:56:20 1998 --- pine4.10.beos/imap/src/osdep/unix/env_unix.c Fri Mar 19 17:40:23 1999 *************** *** 482,487 **** --- 482,488 ---- long env_init (char *user,char *home) { extern MAILSTREAM CREATEPROTO; + { extern MAILSTREAM EMPTYPROTO; struct passwd *pw; struct stat sbuf; *************** *** 539,544 **** --- 540,546 ---- endpwent (); /* close pw database */ return T; } + } /* Return my user name * Accepts: pointer to optional flags *************** *** 908,913 **** --- 910,916 ---- int i; char *s,*t,*k,tmp[MAILTMPLEN],tmpx[MAILTMPLEN]; extern MAILSTREAM CREATEPROTO; + { extern MAILSTREAM EMPTYPROTO; DRIVER *d; FILE *f = fopen (file,"r"); *************** *** 1068,1073 **** --- 1071,1077 ---- } while ((s = fgets (tmp,MAILTMPLEN,f)) && (t = strchr (s,'\n'))); fclose (f); /* flush the file */ + } } /* INBOX create function for tmail/dmail use only diff -c -r -N pine4.10.orig/imap/src/osdep/unix/env_unix.h pine4.10.beos/imap/src/osdep/unix/env_unix.h *** pine4.10.orig/imap/src/osdep/unix/env_unix.h Thu Dec 10 23:43:24 1998 --- pine4.10.beos/imap/src/osdep/unix/env_unix.h Fri Mar 19 16:01:49 1999 *************** *** 39,45 **** /* Function prototypes */ ! #include "env.h" long env_init (char *user,char *home); char *myusername_full (unsigned long *flags); --- 39,45 ---- /* Function prototypes */ ! #include "../c-client/env.h" long env_init (char *user,char *home); char *myusername_full (unsigned long *flags); diff -c -r -N pine4.10.orig/imap/src/osdep/unix/flock_beos.c pine4.10.beos/imap/src/osdep/unix/flock_beos.c *** pine4.10.orig/imap/src/osdep/unix/flock_beos.c Wed Dec 31 16:00:00 1969 --- pine4.10.beos/imap/src/osdep/unix/flock_beos.c Fri Mar 19 16:01:49 1999 *************** *** 0 **** --- 1,45 ---- + /* + * Program: File lock + * + * Author: Mark Crispin + * Networks and Distributed Computing + * Computing & Communications + * University of Washington + * Administration Building, AG-44 + * Seattle, WA 98195 + * Internet: MRC@CAC.Washington.EDU + * + * Date: 1 August 1988 + * Last Edited: 12 October 1996 + * + * Copyright 1996 by the University of Washington + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appears in all copies and that both the + * above copyright notice and this permission notice appear in supporting + * documentation, and that the name of the University of Washington not be + * used in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. This software is made available + * "as is", and + * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, + * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN + * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT + * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + /* Emulator for BSD flock() call + * Accepts: file descriptor + * operation bitmask + * Returns: 0 if successful, -1 if failure + */ + + int bsd_flock (int fd,int operation) + { + return 0; + } diff -c -r -N pine4.10.orig/imap/src/osdep/unix/log_bos.c pine4.10.beos/imap/src/osdep/unix/log_bos.c *** pine4.10.orig/imap/src/osdep/unix/log_bos.c Wed Dec 31 16:00:00 1969 --- pine4.10.beos/imap/src/osdep/unix/log_bos.c Fri Mar 19 16:01:49 1999 *************** *** 0 **** --- 1,6 ---- + + long loginpw (struct passwd *pw,int argc,char *argv[]) + { + return !(setgid (pw->pw_gid) || setuid (pw->pw_uid)); + } + diff -c -r -N pine4.10.orig/imap/src/osdep/unix/os_bos.c pine4.10.beos/imap/src/osdep/unix/os_bos.c *** pine4.10.orig/imap/src/osdep/unix/os_bos.c Wed Dec 31 16:00:00 1969 --- pine4.10.beos/imap/src/osdep/unix/os_bos.c Fri Mar 19 16:01:49 1999 *************** *** 0 **** --- 1,50 ---- + /* + * Program: Operating-system dependent routines -- BeOS version + * + * Copyright 1996 by the University of Washington + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appears in all copies and that both the + * above copyright notice and this permission notice appear in supporting + * documentation, and that the name of the University of Washington not be + * used in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. This software is made available + * "as is", and + * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, + * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN + * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT + * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + #include "tcp_unix.h" /* must be before osdep includes tcp.h */ + #include "mail.h" + #include "osdep.h" + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include "misc.h" + + #define DIR_SIZE(d) d->d_reclen + + #include "fs_unix.c" + #include "ftl_unix.c" + #include "nl_unix.c" + #include "env_unix.c" + #include "tcp_beos.c" + #include "gr_waitp.c" + #include "flock_beos.c" + #include "gethstid.c" + #include "scandir_beos.c" + #include "tz_sv4.c" diff -c -r -N pine4.10.orig/imap/src/osdep/unix/os_bos.h pine4.10.beos/imap/src/osdep/unix/os_bos.h *** pine4.10.orig/imap/src/osdep/unix/os_bos.h Wed Dec 31 16:00:00 1969 --- pine4.10.beos/imap/src/osdep/unix/os_bos.h Fri Mar 19 18:03:56 1999 *************** *** 0 **** --- 1,71 ---- + /* + * Program: Operating-system dependent routines -- BeOS version + * + * Author: Mark Crispin + * Networks and Distributed Computing + * Computing & Communications + * University of Washington + * Administration Building, AG-44 + * Seattle, WA 98195 + * Internet: MRC@CAC.Washington.EDU + * + * Date: 10 September 1993 + * Last Edited: 29 April 1997 + * + * Copyright 1997 by the University of Washington + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appears in all copies and that both the + * above copyright notice and this permission notice appear in supporting + * documentation, and that the name of the University of Washington not be + * used in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. This software is made available + * "as is", and + * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, + * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN + * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT + * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + #include + #include + #include + #include + #include + #include + #include + #include + + #if !__INTEL__ + #define isascii(c) (((c)&0x7f) == (c)) + #endif + + #define L_SET SEEK_SET + #define L_INCR SEEK_CUR + #define L_XTND SEEK_END + + /* For flock() emulation */ + + #define flock bsd_flock + + #define LOCK_SH 1 + #define LOCK_EX 2 + #define LOCK_NB 4 + #define LOCK_UN 8 + + #include "../c-client/env_unix.h" + #include "../c-client/fs.h" + #include "../c-client/ftl.h" + #include "../c-client/nl.h" + #include "../c-client/tcp.h" + + typedef int (*select_t) (struct direct *name); + typedef int (*compar_t) (const void *d1,const void *d2); + int scandir (char *dirname,struct direct ***namelist,select_t select, + compar_t compar); diff -c -r -N pine4.10.orig/imap/src/osdep/unix/scandir_beos.c pine4.10.beos/imap/src/osdep/unix/scandir_beos.c *** pine4.10.orig/imap/src/osdep/unix/scandir_beos.c Wed Dec 31 16:00:00 1969 --- pine4.10.beos/imap/src/osdep/unix/scandir_beos.c Fri Mar 19 16:01:49 1999 *************** *** 0 **** --- 1,74 ---- + /* + * Program: Scan directories + * + * Author: Mark Crispin + * Networks and Distributed Computing + * Computing & Communications + * University of Washington + * Administration Building, AG-44 + * Seattle, WA 98195 + * Internet: MRC@CAC.Washington.EDU + * + * Date: 1 August 1988 + * Last Edited: 15 June 1995 + * + * Copyright 1995 by the University of Washington + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appears in all copies and that both the + * above copyright notice and this permission notice appear in supporting + * documentation, and that the name of the University of Washington not be + * used in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. This software is made available + * "as is", and + * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, + * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN + * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT + * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + /* Emulator for BSD scandir() call + * Accepts: directory name + * destination pointer of names array + * selection function + * comparison function + * Returns: number of elements in the array or -1 if error + */ + + int scandir (char *dirname,struct direct ***namelist,select_t select, + compar_t compar) + { + struct direct *p,*d,**names; + int nitems; + struct stat stb; + long nlmax; + DIR *dirp = opendir (dirname);/* open directory and get status poop */ + if ((!dirp) || (fstat (dirp->fd,&stb) < 0)) return -1; + nlmax = stb.st_size / 24; /* guesstimate at number of files */ + names = (struct direct **) fs_get (nlmax * sizeof (struct direct *)); + nitems = 0; /* initially none found */ + while (d = readdir (dirp)) { /* read directory item */ + /* matches select criterion? */ + if (select && !(*select) (d)) continue; + /* get size of direct record for this file */ + p = (struct direct *) fs_get (DIR_SIZE (d)); + p->d_ino = d->d_ino; /* copy the poop */ + strcpy (p->d_name,d->d_name); + if (++nitems >= nlmax) { /* if out of space, try bigger guesstimate */ + nlmax *= 2; /* double it */ + fs_resize ((void **) &names,nlmax * sizeof (struct direct *)); + } + names[nitems - 1] = p; /* store this file there */ + } + closedir (dirp); /* done with directory */ + /* sort if necessary */ + if (nitems && compar) qsort (names,nitems,sizeof (struct direct *),compar); + *namelist = names; /* return directory */ + return nitems; /* and size */ + } diff -c -r -N pine4.10.orig/imap/src/osdep/unix/tcp_beos.c pine4.10.beos/imap/src/osdep/unix/tcp_beos.c *** pine4.10.orig/imap/src/osdep/unix/tcp_beos.c Wed Dec 31 16:00:00 1969 --- pine4.10.beos/imap/src/osdep/unix/tcp_beos.c Fri Mar 19 16:45:31 1999 *************** *** 0 **** --- 1,754 ---- + /* + * Program: UNIX TCP/IP routines + * + * Author: Mark Crispin + * Networks and Distributed Computing + * Computing & Communications + * University of Washington + * Administration Building, AG-44 + * Seattle, WA 98195 + * Internet: MRC@CAC.Washington.EDU + * + * Date: 1 August 1988 + * Last Edited: 29 July 1998 + * + * Copyright 1998 by the University of Washington + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appears in all copies and that both the + * above copyright notice and this permission notice appear in supporting + * documentation, and that the name of the University of Washington not be + * used in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. This software is made available + * "as is", and + * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, + * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN + * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT + * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + #undef write /* don't use redefined write() */ + + static tcptimeout_t tmoh = NIL; /* TCP timeout handler routine */ + static long ttmo_open = 0; /* TCP timeouts, in seconds */ + static long ttmo_read = 0; + static long ttmo_write = 0; + static long rshtimeout = 15; /* rsh timeout */ + static char *rshcommand = NIL; /* rsh command */ + static char *rshpath = NIL; /* rsh path */ + static long alarmsave = 0; /* save alarms */ + + + /* Local function prototypes */ + + int tcp_socket_open (struct sockaddr_in *sin,char *tmp,int *ctr,char *hst, + unsigned long port); + long tcp_abort (TCPSTREAM *stream); + + /* TCP/IP manipulate parameters + * Accepts: function code + * function-dependent value + * Returns: function-dependent return value + */ + + void *tcp_parameters (long function,void *value) + { + switch ((int) function) { + case SET_TIMEOUT: + tmoh = (tcptimeout_t) value; + break; + case GET_TIMEOUT: + value = (void *) tmoh; + break; + case SET_OPENTIMEOUT: + ttmo_open = (long) value; + break; + case GET_OPENTIMEOUT: + value = (void *) ttmo_open; + break; + case SET_READTIMEOUT: + ttmo_read = (long) value; + break; + case GET_READTIMEOUT: + value = (void *) ttmo_read; + break; + case SET_WRITETIMEOUT: + ttmo_write = (long) value; + break; + case GET_WRITETIMEOUT: + value = (void *) ttmo_write; + break; + case SET_RSHTIMEOUT: + rshtimeout = (long) value; + break; + case GET_RSHTIMEOUT: + value = (void *) rshtimeout; + break; + case SET_RSHCOMMAND: + if (rshcommand) fs_give ((void **) &rshcommand); + rshcommand = cpystr ((char *) value); + break; + case GET_RSHCOMMAND: + value = (void *) rshcommand; + break; + case SET_RSHPATH: + if (rshpath) fs_give ((void **) &rshpath); + rshpath = cpystr ((char *) value); + break; + case GET_RSHPATH: + value = (void *) rshpath; + break; + case SET_ALARMSAVE: + alarmsave = (long) value; + break; + case GET_ALARMSAVE: + value = (void *) alarmsave; + break; + default: + value = NIL; /* error case */ + break; + } + return value; + } + + /* TCP/IP open + * Accepts: host name + * contact service name + * contact port number + * Returns: TCP/IP stream if success else NIL + */ + + TCPSTREAM *tcp_open (char *host,char *service,unsigned long port) + { + TCPSTREAM *stream = NIL; + int i,j,sock; + int ctr = 0; + char *s; + struct sockaddr_in sin; + struct hostent *he; + char hostname[MAILTMPLEN]; + char tmp[MAILTMPLEN]; + + struct servent *sv = service ? getservbyname (service,"tcp") : NIL; + /* user service name port */ + if (sv) port = ntohs (sin.sin_port = sv->s_port); + /* copy port number in network format */ + else sin.sin_port = htons (port); + /* The domain literal form is used (rather than simply the dotted decimal + as with other Unix programs) because it has to be a valid "host name" + in mailsystem terminology. */ + /* look like domain literal? */ + if (host[0] == '[' && host[(strlen (host))-1] == ']') { + strcpy (hostname,host+1); /* yes, copy number part */ + hostname[(strlen (hostname))-1] = '\0'; + if ((sin.sin_addr.s_addr = inet_addr (hostname)) != -1) { + sin.sin_family = AF_INET; /* family is always Internet */ + strcpy (hostname,host); /* hostname is user's argument */ + /* get an open socket for this system */ + sock = tcp_socket_open (&sin,tmp,&ctr,hostname,port); + } + else { + sprintf (tmp,"Bad format domain-literal: %.80s",host); + mm_log (tmp,ERROR); + return NIL; + } + } + + else { /* lookup host name */ + /* quell alarms */ + i = alarmsave ? (int) max (alarm (0),1) : 0; + if (he = gethostbyname (lcase (strcpy (hostname,host)))) { + if (i) alarm (i); /* restore alarms */ + /* copy address type */ + sin.sin_family = he->h_addrtype; + /* copy host name */ + strcpy (hostname,he->h_name); + #ifdef HOST_NOT_FOUND /* muliple addresses only on DNS systems */ + for (sock = -1,i = 0; (sock < 0) && (s = he->h_addr_list[i]); i++) { + if (i) mm_log (tmp,WARN); + memcpy (&sin.sin_addr,s,he->h_length); + sock = tcp_socket_open (&sin,tmp,&ctr,hostname,port); + } + #else /* the one true address then */ + memcpy (&sin.sin_addr,he->h_addr,he->h_length); + sock = tcp_socket_open (&sin,tmp,&ctr,hostname,port); + #endif + } + else { + if (i) alarm (i); /* restore alarms */ + sprintf (tmp,"No such host as %.80s",host); + mm_log (tmp,ERROR); + return NIL; + } + } + if (sock < 0) mm_log (tmp,ERROR); + else { /* won */ + stream = (TCPSTREAM *) memset (fs_get (sizeof (TCPSTREAM)),0, + sizeof (TCPSTREAM)); + stream->port = port; /* port number */ + /* init sockets */ + stream->tcpsi = stream->tcpso = sock; + /* stash in the snuck-in byte */ + if (stream->ictr = ctr) *(stream->iptr = stream->ibuf) = tmp[0]; + /* copy official host name */ + stream->host = cpystr (hostname); + } + return stream; /* return success */ + } + + /* Open a TCP socket + * Accepts: Internet socket address block + * scratch buffer + * pointer to "first byte read in" storage + * host name for error message + * port number for error message + * Returns: socket if success, else -1 with error string in scratch buffer + */ + + int tcp_socket_open (struct sockaddr_in *sin,char *tmp,int *ctr,char *hst, + unsigned long port) + { + int i,sock,flgs; + fd_set fds,efds; + struct timeval tmo; + sprintf (tmp,"Trying IP address [%s]",inet_ntoa (sin->sin_addr)); + mm_log (tmp,NIL); + /* make a socket */ + if ((sock = socket (sin->sin_family,SOCK_STREAM, 0)) < 0) { + sprintf (tmp,"Unable to create TCP socket: %s",strerror (errno)); + return -1; + } + /* flgs = fcntl (sock,F_GETFL,0);/* get current socket flags */ + /* fcntl (sock,F_SETFL,flgs | FNDELAY);*/ + /* open connection */ + while ((i = connect (sock,(struct sockaddr *) sin, + sizeof (struct sockaddr_in))) < 0 && errno == EINTR); + if (i < 0) switch (errno) { /* failed? */ + case EAGAIN: /* DG brain damage */ + case EINPROGRESS: /* what we expect to happen */ + case EISCONN: /* restart after interrupt? */ + case EADDRINUSE: /* restart after interrupt? */ + break; /* well, not really, it was interrupted */ + default: + i = errno; /* make sure close() doesn't stomp it */ + closesocket (sock); /* flush socket */ + errno = i; + sprintf (tmp,"Can't connect to %.80s,%d: %s",hst,port,strerror (errno)); + return -1; + } + + tmo.tv_sec = ttmo_open; /* open timeout */ + tmo.tv_usec = 0; + FD_ZERO (&fds); /* initialize selection vector */ + FD_ZERO (&efds); /* handle errors too */ + FD_SET (sock,&fds); /* block for error or writeable */ + FD_SET (sock,&efds); + /* block under timeout */ + while (((i = select (sock+1,0,&fds,&efds,ttmo_open ? &tmo : 0)) < 0) && + (errno == EINTR)); + if (i > 0) { /* success, make sure really connected */ + /*fcntl (sock,F_SETFL,flgs); /* restore blocking status */ + /* This used to be a zero-byte read(), but that crashes Solaris */ + /* get socket status */ + while (((i = *ctr = recv (sock,tmp,1,0)) < 0) && (errno == EINTR)); + } + if (i <= 0) { /* timeout or error? */ + i = i ? errno : ETIMEDOUT; /* determine error code */ + closesocket (sock); /* flush socket */ + errno = i; /* return error code */ + sprintf (tmp,"Connection failed to %.80s,%d: %s",hst,port,strerror(errno)); + return -1; + } + return sock; /* return the socket */ + } + + /* TCP/IP authenticated open + * Accepts: host name + * service name + * returned user name buffer + * Returns: TCP/IP stream if success else NIL + */ + + #define MAXARGV 10 + + TCPSTREAM *tcp_aopen (NETMBX *mb,char *service,char *usrbuf) + { + return NIL; + #if 0 + TCPSTREAM *stream = NIL; + struct hostent *he; + char host[MAILTMPLEN],tmp[MAILTMPLEN],*path,*argv[MAXARGV+1]; + int i; + int pipei[2],pipeo[2]; + struct timeval tmo; + fd_set fds,efds; + /* return immediately if rsh disabled */ + if (!(tmo.tv_sec = rshtimeout)) return NIL; + tmo.tv_usec = 0; + FD_ZERO (&fds); /* initialize selection vector */ + FD_ZERO (&efds); /* handle errors too */ + /* look like domain literal? */ + if (mb->host[0] == '[' && mb->host[i = (strlen (mb->host))-1] == ']') { + strcpy (host,mb->host+1); /* yes, copy without brackets */ + host[i-1] = '\0'; + if (inet_addr (host) == -1) { + sprintf (tmp,"Bad format domain-literal: %.80s",host); + mm_log (tmp,ERROR); + return NIL; + } + } + /* note that Unix requires lowercase! */ + else if (he = gethostbyname (lcase (strcpy (host,mb->host)))) + strcpy (host,he->h_name); + /* rsh command prototype defined yet? */ + if (!rshpath) rshpath = cpystr (RSHPATH); + if (!rshcommand) rshcommand = cpystr ("%s %s -l %s exec /etc/r%sd"); + /* build rsh command */ + sprintf (tmp,rshcommand,rshpath,host,mb->user[0] ? mb->user : myusername (), + service); + for (i = 1,path = argv[0] = strtok (tmp," "); + (i < MAXARGV) && (argv[i] = strtok (NIL," ")); i++); + argv[i] = NIL; /* make sure argv tied off */ + + /* make command pipes */ + if (pipe (pipei) < 0) return NIL; + if (pipe (pipeo) < 0) { + close (pipei[0]); close (pipei[1]); + return NIL; + } + if ((i = fork ()) < 0) { /* make inferior process */ + close (pipei[0]); close (pipei[1]); + close (pipeo[0]); close (pipeo[1]); + return NIL; + } + if (!i) { /* if child */ + if (!fork ()) { /* make grandchild so it's inherited by init */ + int maxfd = max (20,max (max(pipei[0],pipei[1]),max(pipeo[0],pipeo[1]))); + dup2 (pipei[1],1); /* parent's input is my output */ + dup2 (pipei[1],2); /* parent's input is my error output too */ + dup2 (pipeo[0],0); /* parent's output is my input */ + /* close all unnecessary descriptors */ + for (i = 3; i <= maxfd; i++) close (i); + setpgrp (0,getpid ()); /* be our own process group */ + execv (path,argv); /* now run it */ + } + _exit (1); /* child is done */ + } + grim_pid_reap (i,NIL); /* reap child; grandchild now owned by init */ + close (pipei[1]); /* close child's side of the pipes */ + close (pipeo[0]); + /* create TCP/IP stream */ + stream = (TCPSTREAM *) memset (fs_get (sizeof (TCPSTREAM)),0, + sizeof (TCPSTREAM)); + /* copy remote host name from argument */ + stream->remotehost = cpystr (stream->host = cpystr (host)); + stream->tcpsi = pipei[0]; /* init sockets */ + stream->tcpso = pipeo[1]; + stream->ictr = 0; /* init input counter */ + stream->port = 0xffffffff; /* no port number */ + FD_SET (stream->tcpsi,&fds); /* set bit in selection vector */ + FD_SET (stream->tcpsi,&efds); /* set bit in error selection vector */ + while (((i = select (stream->tcpsi+1,&fds,0,&efds,&tmo)) < 0) && + (errno == EINTR)); + if (i <= 0) { /* timeout or error? */ + mm_log (i ? "error in rsh to IMAP server" : "rsh to IMAP server timed out", + WARN); + tcp_close (stream); /* punt stream */ + stream = NIL; + } + /* return user name */ + strcpy (usrbuf,mb->user[0] ? mb->user : myusername ()); + return stream; /* return success */ + #endif + } + + /* TCP/IP receive line + * Accepts: TCP/IP stream + * Returns: text line string or NIL if failure + */ + + char *tcp_getline (TCPSTREAM *stream) + { + int n,m; + char *st,*ret,*stp; + char c = '\0'; + char d; + /* make sure have data */ + if (!tcp_getdata (stream)) return NIL; + st = stream->iptr; /* save start of string */ + n = 0; /* init string count */ + while (stream->ictr--) { /* look for end of line */ + d = *stream->iptr++; /* slurp another character */ + if ((c == '\015') && (d == '\012')) { + ret = (char *) fs_get (n--); + memcpy (ret,st,n); /* copy into a free storage string */ + ret[n] = '\0'; /* tie off string with null */ + return ret; + } + n++; /* count another character searched */ + c = d; /* remember previous character */ + } + /* copy partial string from buffer */ + memcpy ((ret = stp = (char *) fs_get (n)),st,n); + /* get more data from the net */ + if (!tcp_getdata (stream)) fs_give ((void **) &ret); + /* special case of newline broken by buffer */ + else if ((c == '\015') && (*stream->iptr == '\012')) { + stream->iptr++; /* eat the line feed */ + stream->ictr--; + ret[n - 1] = '\0'; /* tie off string with null */ + } + /* else recurse to get remainder */ + else if (st = tcp_getline (stream)) { + ret = (char *) fs_get (n + 1 + (m = strlen (st))); + memcpy (ret,stp,n); /* copy first part */ + memcpy (ret + n,st,m); /* and second part */ + fs_give ((void **) &stp); /* flush first part */ + fs_give ((void **) &st); /* flush second part */ + ret[n + m] = '\0'; /* tie off string with null */ + } + return ret; + } + + /* TCP/IP receive buffer + * Accepts: TCP/IP stream + * size in bytes + * buffer to read into + * Returns: T if success, NIL otherwise + */ + + long tcp_getbuffer (TCPSTREAM *stream,unsigned long size,char *buffer) + { + unsigned long n; + char *bufptr = buffer; + while (size > 0) { /* until request satisfied */ + if (!tcp_getdata (stream)) return NIL; + n = min (size,stream->ictr);/* number of bytes to transfer */ + /* do the copy */ + memcpy (bufptr,stream->iptr,n); + bufptr += n; /* update pointer */ + stream->iptr +=n; + size -= n; /* update # of bytes to do */ + stream->ictr -=n; + } + bufptr[0] = '\0'; /* tie off string */ + return T; + } + + /* TCP/IP receive data + * Accepts: TCP/IP stream + * Returns: T if success, NIL otherwise + */ + + long tcp_getdata (TCPSTREAM *stream) + { + int i; + fd_set fds,efds; + struct timeval tmo; + time_t t = time (0); + if (stream->tcpsi < 0) return NIL; + while (stream->ictr < 1) { /* if nothing in the buffer */ + time_t tl = time (0); /* start of request */ + tmo.tv_sec = ttmo_read; /* read timeout */ + tmo.tv_usec = 0; + FD_ZERO (&fds); /* initialize selection vector */ + FD_ZERO (&efds); /* handle errors too */ + FD_SET (stream->tcpsi,&fds);/* set bit in selection vector */ + FD_SET(stream->tcpsi,&efds);/* set bit in error selection vector */ + errno = NIL; /* block and read */ + while (((i = select (stream->tcpsi+1,&fds,0,&efds,ttmo_read ? &tmo : 0))<0) + && (errno == EINTR)); + if (!i) { /* timeout? */ + time_t tc = time (0); + if (tmoh && ((*tmoh) (tc - t,tc - tl))) continue; + else return tcp_abort (stream); + } + else if (i < 0) return tcp_abort (stream); + while (((i = recv (stream->tcpsi,stream->ibuf,BUFLEN,0)) < 0) && + (errno == EINTR)); + if (i < 1) return tcp_abort (stream); + stream->iptr = stream->ibuf;/* point at TCP buffer */ + stream->ictr = i; /* set new byte count */ + } + return T; + } + + /* TCP/IP send string as record + * Accepts: TCP/IP stream + * string pointer + * Returns: T if success else NIL + */ + + long tcp_soutr (TCPSTREAM *stream,char *string) + { + return tcp_sout (stream,string,(unsigned long) strlen (string)); + } + + + /* TCP/IP send string + * Accepts: TCP/IP stream + * string pointer + * byte count + * Returns: T if success else NIL + */ + + long tcp_sout (TCPSTREAM *stream,char *string,unsigned long size) + { + int i; + fd_set fds; + struct timeval tmo; + time_t t = time (0); + if (stream->tcpso < 0) return NIL; + while (size > 0) { /* until request satisfied */ + time_t tl = time (0); /* start of request */ + tmo.tv_sec = ttmo_write; /* write timeout */ + tmo.tv_usec = 0; + FD_ZERO (&fds); /* initialize selection vector */ + FD_SET (stream->tcpso,&fds);/* set bit in selection vector */ + errno = NIL; /* block and write */ + while (((i = select (stream->tcpso+1,0,&fds,0,ttmo_write ? &tmo : 0)) < 0) + && (errno == EINTR)); + if (!i) { /* timeout? */ + time_t tc = time (0); + if (tmoh && ((*tmoh) (tc - t,tc - tl))) continue; + else return tcp_abort (stream); + } + else if (i < 0) return tcp_abort (stream); + while (((i = send (stream->tcpso,string,size,0)) < 0) && (errno == EINTR)); + if (i < 0) return tcp_abort (stream); + size -= i; /* how much we sent */ + string += i; + } + return T; /* all done */ + } + + /* TCP/IP close + * Accepts: TCP/IP stream + */ + + void tcp_close (TCPSTREAM *stream) + { + tcp_abort (stream); /* nuke the stream */ + /* flush host names */ + if (stream->host) fs_give ((void **) &stream->host); + if (stream->remotehost) fs_give ((void **) &stream->remotehost); + if (stream->localhost) fs_give ((void **) &stream->localhost); + fs_give ((void **) &stream); /* flush the stream */ + } + + + /* TCP/IP abort stream + * Accepts: TCP/IP stream + * Returns: NIL always + */ + + long tcp_abort (TCPSTREAM *stream) + { + int i; + if (stream->tcpsi >= 0) { /* no-op if no socket */ + closesocket (stream->tcpsi); /* nuke the socket */ + if (stream->tcpsi != stream->tcpso) closesocket (stream->tcpso); + stream->tcpsi = stream->tcpso = -1; + } + return NIL; + } + + /* TCP/IP get host name + * Accepts: TCP/IP stream + * Returns: host name for this stream + */ + + char *tcp_host (TCPSTREAM *stream) + { + return stream->host; /* use tcp_remotehost() if want guarantees */ + } + + + /* TCP/IP get remote host name + * Accepts: TCP/IP stream + * Returns: host name for this stream + */ + + char *tcp_remotehost (TCPSTREAM *stream) + { + if (!stream->remotehost) { + char *s,tmp[MAILTMPLEN]; + struct hostent *he; + struct sockaddr_in sin; + int sinlen = sizeof (struct sockaddr_in); + if (getpeername (stream->tcpsi,(struct sockaddr *) &sin,(void *) &sinlen)) + s = stream->host; + #ifndef DISABLE_REVERSE_DNS_LOOKUP + /* Guarantees that the client will have the same string as the server does + * from calling tcp_serverhost (). + */ + else if (he = gethostbyaddr ((char *) &sin.sin_addr, + sizeof (struct in_addr),sin.sin_family)) + s = he->h_name; + #else + /* Not recommended. In any mechanism (e.g. Kerberos) in which both client + * and server must agree on the name of the server system, this may cause + * the client to have a different idea of the server's name from the server. + * This is particularly important in those cases where a server has multiple + * CNAMEs; the gethostbyaddr() will canonicalize the name to the proper IP + * address. + */ + #endif + else sprintf (s = tmp,"[%s]",inet_ntoa (sin.sin_addr)); + stream->remotehost = cpystr (s); + } + return stream->remotehost; + } + + /* TCP/IP return port for this stream + * Accepts: TCP/IP stream + * Returns: port number for this stream + */ + + unsigned long tcp_port (TCPSTREAM *stream) + { + return stream->port; /* return port number */ + } + + + /* TCP/IP get local host name + * Accepts: TCP/IP stream + * Returns: local host name + */ + + char *tcp_localhost (TCPSTREAM *stream) + { + if (!stream->localhost) { + char *s,tmp[MAILTMPLEN]; + struct hostent *he; + struct sockaddr_in sin; + int sinlen = sizeof (struct sockaddr_in); + /* get socket address */ + if ((stream->port & 0xffff000) || + getsockname (stream->tcpsi,(struct sockaddr *) &sin,(void *) &sinlen)) + s = mylocalhost (); /* not a socket or failed, use my name */ + #ifndef DISABLE_REVERSE_DNS_LOOKUP + /* Guarantees that the client will have the same string as the server will + * get in doing a reverse DNS lookup on the client's IP address. + */ + /* translate socket address to name */ + else if (he = gethostbyaddr ((char *) &sin.sin_addr, + sizeof (struct in_addr),sin.sin_family)) + s = he->h_name; + #else + /* Not recommended. In any mechanism (e.g. SMTP or NNTP) in which both + * client and server must agree on the name of the client system, this may + * cause the client to use the wrong name. + */ + #endif + else sprintf (s = tmp,"[%s]",inet_ntoa (sin.sin_addr)); + stream->localhost = cpystr (s); + } + return stream->localhost; /* return local host name */ + } + + /* TCP/IP get client host name (server calls only) + * Returns: client host name + */ + + static char *myClientHost = NIL; + + char *tcp_clienthost () + { + if (!myClientHost) { + char *s,tmp[MAILTMPLEN]; + struct hostent *he; + struct sockaddr_in sin; + int sinlen = sizeof (struct sockaddr_in); + if (getpeername (0,(struct sockaddr *) &sin,(void *) &sinlen)) + s = "UNKNOWN"; + #ifndef DISABLE_REVERSE_DNS_LOOKUP + /* Includes both client name and IP address in syslog() output. */ + else if (he = gethostbyaddr ((char *) &sin.sin_addr, + sizeof (struct in_addr),sin.sin_family)) + sprintf (s = tmp,"%s [%s]",he->h_name,inet_ntoa (sin.sin_addr)); + #else + /* Not recommended. Syslog output will only have the client IP address. */ + #endif + else sprintf (s = tmp,"[%s]",inet_ntoa (sin.sin_addr)); + myClientHost = cpystr (s); + } + return myClientHost; + } + + /* TCP/IP get server host name (server calls only) + * Returns: server host name + */ + + static char *myServerHost = NIL; + static long myServerPort = -1; + + char *tcp_serverhost () + { + if (!myServerHost) { + char *s,tmp[MAILTMPLEN]; + struct hostent *he; + struct sockaddr_in sin; + int sinlen = sizeof (struct sockaddr_in); + /* get socket address */ + if (getsockname (0,(struct sockaddr *) &sin,(void *) &sinlen)) + s = mylocalhost (); + else { + #ifndef DISABLE_REVERSE_DNS_LOOKUP + myServerPort = ntohs (sin.sin_port); + /* Guarantees that the server will have the same string as the client + * does from calling tcp_remotehost (). + */ + if (he = gethostbyaddr ((char *) &sin.sin_addr, + sizeof (struct in_addr),sin.sin_family)) + s = he->h_name; + else + #else + /* Not recommended. In any mechanism (e.g. Kerberos) in which both + * client and server must agree on the name of the server system, this + * may cause a spurious mismatch. This is particularly important when + * multiple server systems are co-located on the same CPU with different + * IP addresses; the gethostbyaddr() call will return the name of the + * proper server system name and avoid canonicalizing it to a default + * name. + */ + #endif + sprintf (s = tmp,"[%s]",inet_ntoa (sin.sin_addr)); + } + myServerHost = cpystr (s); + } + return myServerHost; + } + + + /* TCP/IP get server port number (server calls only) + * Returns: server port number + */ + + long tcp_serverport () + { + if (!myServerHost) tcp_serverhost (); + return myServerPort; + } + + /* TCP/IP return canonical form of host name + * Accepts: host name + * Returns: canonical form of host name + */ + + char *tcp_canonical (char *name) + { + char host[MAILTMPLEN]; + struct hostent *he; + /* look like domain literal? */ + if (name[0] == '[' && name[strlen (name) - 1] == ']') return name; + /* note that Unix requires lowercase! */ + else return (he = gethostbyname (lcase (strcpy (host,name)))) ? + he->h_name : name; + } diff -c -r -N pine4.10.orig/pico/headers.h pine4.10.beos/pico/headers.h *** pine4.10.orig/pico/headers.h Wed Jan 27 14:14:32 1999 --- pine4.10.beos/pico/headers.h Fri Mar 19 16:01:49 1999 *************** *** 28,34 **** #include ! #include "os.h" /* * [Re]Define signal functions as needed... --- 28,34 ---- #include ! #include "../pico/os.h" /* * [Re]Define signal functions as needed... *************** *** 72,80 **** #define PROTO(args) () #endif ! #include "estruct.h" ! #include "pico.h" ! #include "edef.h" ! #include "efunc.h" #endif /* _PICO_HEADERS_INCLUDED */ --- 72,80 ---- #define PROTO(args) () #endif ! #include "../pico/estruct.h" ! #include "../pico/pico.h" ! #include "../pico/edef.h" ! #include "../pico/efunc.h" #endif /* _PICO_HEADERS_INCLUDED */ diff -c -r -N pine4.10.orig/pico/makefile.bos pine4.10.beos/pico/makefile.bos *** pine4.10.orig/pico/makefile.bos Wed Dec 31 16:00:00 1969 --- pine4.10.beos/pico/makefile.bos Fri Mar 19 16:01:49 1999 *************** *** 0 **** --- 1,89 ---- + # $Id: makefile.bos,v 1.5 1998/06/29 22:22:40 hubert Exp $ + # + # Michael Seibel + # Networks and Distributed Computing + # Computing and Communications + # University of Washington + # Administration Builiding, AG-44 + # Seattle, Washington, 98195, USA + # Internet: mikes@cac.washington.edu + # + # Please address all bugs and comments to "pine-bugs@cac.washington.edu" + # + # + # Pine and Pico are registered trademarks of the University of Washington. + # No commercial use of these trademarks may be made without prior written + # permission of the University of Washington. + # + # Pine, Pico, and Pilot software and its included text are Copyright + # 1989-1998 by the University of Washington. + # + # The full text of our legal notices is contained in the file called + # CPYRIGHT, included with this distribution. + # + + # + # Makefile for the BeOS version of the PINE composer library and + # stand-alone editor pico. + # + + RM= rm -f + LN= ln -s + MAKE= make + OPTIMIZE= # -O + PROFILE= # -pg + DEBUG= -g -DDEBUG + + STDCFLAGS= -DBOS + CFLAGS= $(OPTIMIZE) $(PROFILE) $(DEBUG) $(EXTRACFLAGS) $(STDCFLAGS) + + # switches for library building + LIBCMD= ar + LIBARGS= ru + RANLIB= ranlib + + LIBS= $(EXTRALIBES) -ltermcap + + OFILES= attach.o basic.o bind.o browse.o buffer.o \ + composer.o display.o file.o fileio.o line.o pico_os.o \ + pico.o random.o region.o search.o \ + window.o word.o + + HFILES= headers.h estruct.h edef.h efunc.h pico.h os.h + + # + # dependencies for the Unix versions of pico and libpico.a + # + all: pico pilot + pico pilot: libpico.a + + pico: main.o + $(CC) $(CFLAGS) main.o libpico.a $(LIBS) -o pico + + pilot: pilot.o + $(CC) $(CFLAGS) pilot.o libpico.a $(LIBS) -o pilot + + libpico.a: $(OFILES) + $(LIBCMD) $(LIBARGS) libpico.a $(OFILES) + $(RANLIB) libpico.a + + clean: + rm -f *.a *.o *~ pico_os.c os.h pico pilot + cd osdep; $(MAKE) clean; cd .. + + os.h: osdep/os-bos.h + $(RM) os.h + $(LN) osdep/os-bos.h os.h + + pico_os.c: osdep/os-bos.c + $(RM) pico_os.c + $(LN) osdep/os-bos.c pico_os.c + + $(OFILES) main.o pilot.o: $(HFILES) + pico.o: ebind.h + + # The dependencies here will be slightly different for each port. + osdep/os-bos.c: osdep/header osdep/unix osdep/read.bos osdep/raw.ios \ + osdep/spell.unx osdep/term.cap \ + osdep/os-bos.ic + cd osdep; $(MAKE) includer os-bos.c; cd .. diff -c -r -N pine4.10.orig/pico/osdep/makefile pine4.10.beos/pico/osdep/makefile *** pine4.10.orig/pico/osdep/makefile Mon Jan 25 09:44:04 1999 --- pine4.10.beos/pico/osdep/makefile Fri Mar 19 16:08:40 1999 *************** *** 4,10 **** RM= rm -f ALL= os-a32.c os-a41.c os-aix.c os-asv.c \ ! os-aux.c os-bs2.c os-bsd.c os-bsf.c os-bsi.c os-bso.c \ os-cvx.c os-dos.c os-dpx.c os-dyn.c \ os-gen.c os-hpp.c os-isc.c os-lnx.c \ os-lyn.c os-mnt.c os-neb.c os-nxt.c \ --- 4,10 ---- RM= rm -f ALL= os-a32.c os-a41.c os-aix.c os-asv.c \ ! os-aux.c os-bos.c os-bs2.c os-bsd.c os-bsf.c os-bsi.c os-bso.c \ os-cvx.c os-dos.c os-dpx.c os-dyn.c \ os-gen.c os-hpp.c os-isc.c os-lnx.c \ os-lyn.c os-mnt.c os-neb.c os-nxt.c \ *************** *** 40,45 **** --- 40,46 ---- os-asv.c: fsync.non header raw.io read.sel spell.unx term.inf truncate unix os-asv.ic os-att.c: header raw.io read.sel spell.unx term.cap unix os-att.ic os-aux.c: header raw.io read.sel spell.unx term.cap unix os-aux.ic + os-bos.c: header raw.ios read.bos spell.unx term.cap unix os-bos.ic os-bs2.c: header raw.ios read.sel spell.unx term.cap unix os-bs2.ic os-bsd.c: getcwd header raw.brk read.sel spell.unx term.cap unix os-bsd.ic os-bsf.c: header raw.ios read.sel spell.unx term.cap unix os-bsf.ic diff -c -r -N pine4.10.orig/pico/osdep/os-bos.h pine4.10.beos/pico/osdep/os-bos.h *** pine4.10.orig/pico/osdep/os-bos.h Wed Dec 31 16:00:00 1969 --- pine4.10.beos/pico/osdep/os-bos.h Fri Mar 19 17:44:55 1999 *************** *** 0 **** --- 1,172 ---- + #ifndef _PICO_OS_INCLUDED + #define _PICO_OS_INCLUDED + + + /*---------------------------------------------------------------------- + + OS dependencies, BeOS version. + The following stuff may need to be changed for a new port, but once + the port is done, it won't change. At the bottom of the file are a few + constants that you may want to configure differently than they + are configured, but probably not. + + ----*/ + + + + /*----------------- Are we ANSI? ---------------------------------------*/ + #define ANSI /* this is an ANSI compiler */ + + /*------ If our compiler doesn't understand type void ------------------*/ + /* #define void char /* no void in compiler */ + + + /* These three may vary widely from port to port. */ + #include + #include + #include + #include + + /*------- Some more includes that should usually be correct ------------*/ + #include + #include + #include + #include + #include + + + + /*----------------- locale.h -------------------------------------------*/ + #include /* To make matching and sorting work right */ + #define collator strcoll + + + + /*----------------- time.h ---------------------------------------------*/ + #include + /* plain time.h isn't enough on some systems */ + /* #include /* For struct timeval usually in time.h */ + + + + /*--------------- signal.h ---------------------------------------------*/ + #include /* sometimes both required, sometimes */ + /* #include /* only one or the other */ + + #define SigType void /* value returned by sig handlers is void */ + /* #define SigType int /* value returned by sig handlers is int */ + + #define POSIX_SIGNALS /* use POSIX signal semantics (ttyin.c) */ + /* #define SYSV_SIGNALS /* use System-V signal semantics (ttyin.c) */ + + #define SIG_PROTO(args) args + + + + /*-------------- A couple typedef's for integer sizes ------------------*/ + typedef unsigned int usign32_t; + typedef unsigned short usign16_t; + + + + /*-------------- qsort argument type -----------------------------------*/ + #define QSType void /* qsort arg is of type void * */ + /* #define QSType char /* qsort arg is of type char * */ + + + + /*-------------- fcntl flag to set non-blocking IO ---------------------*/ + #define NON_BLOCKING_IO O_NONBLOCK /* POSIX style */ + /*#define NON_BLOCKING_IO FNDELAY /* good ol' bsd style */ + + + + /* + * Choose one of the following three terminal drivers + */ + + /*--------- Good 'ol BSD -----------------------------------------------*/ + /* #include /* BSD-based systems */ + + /*--------- System V terminal driver -----------------------------------*/ + /* #define HAVE_TERMIO /* this is for pure System V */ + /* #include /* Sys V */ + + /*--------- POSIX terminal driver --------------------------------------*/ + #define HAVE_TERMIOS /* this is an alternative */ + #include /* POSIX */ + + + + /* Don't need to define this but do need to use either read.sel or read.pol + * in osdep. */ + /*-------- Use poll system call instead of select ----------------------*/ + /* #define USE_POLL /* use the poll() system call instead of select() */ + + + + /*-------- Use terminfo database instead of termcap --------------------*/ + /* #define USE_TERMINFO /* use terminfo instead of termcap */ + #define USE_TERMCAP /* use termcap */ + + + + /*-- What argument does wait(2) take? Define this if it is a union -----*/ + /*#define HAVE_WAIT_UNION /* the arg to wait is a union wait * */ + + + + /*-------- Is window resizing available? -------------------------------*/ + #if defined(TIOCGWINSZ) && defined(SIGWINCH) + #define RESIZING /* SIGWINCH and friends */ + #endif + + + + /*-------- If no vfork, use regular fork -------------------------------*/ + #define vfork fork /* vfork is just a lightweight fork, so can use fork */ + + + + /*---- When no screen size can be discovered this is the size used -----*/ + #define DEFAULT_LINES_ON_TERMINAL (24) + #define DEFAULT_COLUMNS_ON_TERMINAL (80) + #define NROW DEFAULT_LINES_ON_TERMINAL + #define NCOL DEFAULT_COLUMNS_ON_TERMINAL + + + /*---------------------------------------------------------------------- + + Pico OS dependencies. + + ----*/ + + + /* + * File name separator, as a char and string + */ + #define C_FILESEP '/' + #define S_FILESEP "/" + + /* + * Place where mail gets delivered (for pico's new mail checking) + */ + #define MAILDIR "/var/spool/mail" + + /* + * What and where the tool that checks spelling is located. If this is + * undefined, then the spelling checker is not compiled into pico. + */ + #define SPELLER "/boot/home/config/bin/spell" + + #ifdef MOUSE + #define XTERM_MOUSE_ON "\033[?1000h" /* DECSET with parm 1000 */ + #define XTERM_MOUSE_OFF "\033[?1000l" /* DECRST with parm 1000 */ + #endif + + /* + * Mode passed chmod() to make tmp files exclusively user read/write-able + */ + #define MODE_READONLY (0600) + + #endif /* _PICO_OS_INCLUDED */ diff -c -r -N pine4.10.orig/pico/osdep/os-bos.ic pine4.10.beos/pico/osdep/os-bos.ic *** pine4.10.orig/pico/osdep/os-bos.ic Wed Dec 31 16:00:00 1969 --- pine4.10.beos/pico/osdep/os-bos.ic Fri Mar 19 16:01:49 1999 *************** *** 0 **** --- 1,15 ---- + ; + ; os-bos.ic file for building os-bos.c. + ; + ; Boilerplate header. + include(header) + + include(unix) + + include(spell.unx) + + include(read.bos) + + include(raw.ios) + + include(term.cap) diff -c -r -N pine4.10.orig/pico/osdep/read.bos pine4.10.beos/pico/osdep/read.bos *** pine4.10.orig/pico/osdep/read.bos Wed Dec 31 16:00:00 1969 --- pine4.10.beos/pico/osdep/read.bos Fri Mar 19 16:01:49 1999 *************** *** 0 **** --- 1,106 ---- + /* + * Check whether or not a character is ready to be read, or time out. + * This version uses a select call. + * + * Args: time_out -- number of seconds before it will time out. + * + * Result: NO_OP_IDLE: timed out before any chars ready, time_out > 25 + * NO_OP_COMMAND: timed out before any chars ready, time_out <= 25 + * READ_INTR: read was interrupted + * READY_TO_READ: input is available + * BAIL_OUT: reading input failed, time to bail gracefully + * PANIC_NOW: system call error, die now + */ + + int firstchar=-1; + + void dummyalarm(int sig) { + } + + int + input_ready(time_out) + int time_out; + { + int res; + + fflush(stdout); + + if(time_out > 0){ + /* Check to see if there are bytes to read with a timeout */ + + /* BeOS hack */ + { + uchar c; + int al = alarm(0); + __signal_func_ptr sigf = signal(SIGALRM, dummyalarm); + alarm(time_out); + res = read(STDIN_FD, &c, 1); + if(res == 1) { + firstchar = c; + } + signal(SIGALRM, sigf); + alarm(al); + } + + if(res < 0){ + if(errno == EINTR || errno == EAGAIN) + return(READ_INTR); + + return(BAIL_OUT); + } + + if(res == 0){ /* the select timed out */ + if(getppid() == 1){ + /* Parent is init! */ + return(BAIL_OUT); + } + + /* + * "15" is the minimum allowed mail check interval. + * Anything less, and we're being told to cycle thru + * the command loop because some task is pending... + */ + return(time_out < 15 ? NO_OP_COMMAND : NO_OP_IDLE); + } + } + + return(READY_TO_READ); + } + + + /* + * Read one character from STDIN. + * + * Result: -- the single character read + * READ_INTR -- read was interrupted + * BAIL_OUT -- read error of some sort + */ + int + read_one_char() + { + int res; + unsigned char c; + + if(firstchar >= 0) { + c = firstchar; + res = 1; + firstchar = -1; + } + else { + res = read(STDIN_FD, &c, 1); + } + + if(res <= 0){ + /* + * Error reading from terminal! + * The only acceptable failure is being interrupted. If so, + * return a value indicating such... + */ + if(res < 0 && errno == EINTR) + return(READ_INTR); + else + return(BAIL_OUT); + } + + return((int)c); + } diff -c -r -N pine4.10.orig/pico/osdep/unix pine4.10.beos/pico/osdep/unix *** pine4.10.orig/pico/osdep/unix Thu Aug 27 11:19:36 1998 --- pine4.10.beos/pico/osdep/unix Fri Mar 19 16:01:49 1999 *************** *** 234,246 **** void (*bail_handler)(); { int res; - unsigned char c; ! while((res = read(STDIN_FD, &c, 1)) <= 0) ! if(!(res < 0 && errno == EINTR)) ! (*bail_handler)(); ! return(recorder ? (*recorder)((int)c) : (int)c); } void --- 234,246 ---- void (*bail_handler)(); { int res; ! while((res = read_one_char()) == READ_INTR) ! ; ! if(res == BAIL_OUT) ! (*bail_handler)(); ! return(recorder ? (*recorder)(res) : res); } void *************** *** 1261,1271 **** --- 1261,1276 ---- * Note: strerror() is not provided on all systems, so it's * done here once and for all. */ + char * errstr(err) int err; { + #ifdef BOS + return strerror(err); + #else return((err >= 0 && err < sys_nerr) ? (char *)sys_errlist[err] : NULL); + #endif } diff -c -r -N pine4.10.orig/pine/makefile.bos pine4.10.beos/pine/makefile.bos *** pine4.10.orig/pine/makefile.bos Wed Dec 31 16:00:00 1969 --- pine4.10.beos/pine/makefile.bos Fri Mar 19 16:01:49 1999 *************** *** 0 **** --- 1,134 ---- + # $Id: makefile.bos,v 4.35 1998/08/27 16:49:32 hubert Exp $ + # + # T H E P I N E M A I L S Y S T E M + # + # Laurence Lundblade and Mike Seibel + # Networks and Distributed Computing + # Computing and Communications + # University of Washington + # Administration Building, AG-44 + # Seattle, Washington, 98195, USA + # Internet: lgl@CAC.Washington.EDU + # mikes@CAC.Washington.EDU + # + # Please address all bugs and comments to "pine-bugs@cac.washington.edu" + # + # + # Pine and Pico are registered trademarks of the University of Washington. + # No commercial use of these trademarks may be made without prior written + # permission of the University of Washington. + # + # Pine, Pico, and Pilot software and its included text are Copyright + # 1989-1998 by the University of Washington. + # + # The full text of our legal notices is contained in the file called + # CPYRIGHT, included with this distribution. + # + # + # Pine is in part based on The Elm Mail System: + # *********************************************************************** + # * The Elm Mail System - Revision: 2.13 * + # * * + # * Copyright (c) 1986, 1987 Dave Taylor * + # * Copyright (c) 1988, 1989 USENET Community Trust * + # *********************************************************************** + # + # + + + # + # BeOS makefile for the Pine mail system. + # + # Most commonly fiddled flags for compiler. + # Uncomment the setttings desired here + # + RM= rm -f + LN= ln -s + MAKE= make + OPTIMIZE= # -O + PROFILE= # -pg + DEBUG= -g -DDEBUG + + CCLIENTDIR= ../c-client + PICODIR= ../pico + + # Only need to uncomment next two lines if you run make from this directory + # and you don't want to supply them as arguments to the make. + #LDAPLIBS= ../ldap/libraries/libldap.a ../ldap/libraries/liblber.a + #LDAPCFLAGS= -DENABLE_LDAP -I../ldap/include + # Object files that need to be rebuilt if ENABLE_LDAP gets defined. + LDAPOFILES= addrbook.o adrbkcmd.o args.o bldaddr.o init.o \ + other.o pine.o takeaddr.o + + STDLIBS= -ltermcap + LOCLIBS= $(PICODIR)/libpico.a $(CCLIENTDIR)/c-client.a + LIBS= $(EXTRALIBES) $(LOCLIBS) $(LDAPLIBS) $(STDLIBS) \ + `cat $(CCLIENTDIR)/LDFLAGS` + + STDCFLAGS= -DBOS -DSYSTYPE=\"BOS\" + CFLAGS= $(OPTIMIZE) $(PROFILE) $(DEBUG) $(EXTRACFLAGS) $(LDAPCFLAGS) \ + $(STDCFLAGS) + + OFILES= addrbook.o adrbkcmd.o adrbklib.o args.o bldaddr.o context.o filter.o \ + folder.o help.o helptext.o imap.o init.o mailcap.o mailcmd.o \ + mailindx.o mailpart.o mailview.o newmail.o other.o pine.o \ + reply.o screen.o send.o signals.o status.o strings.o takeaddr.o \ + os.o + + HFILES= headers.h os.h pine.h context.h helptext.h \ + $(PICODIR)/headers.h $(PICODIR)/estruct.h \ + $(PICODIR)/edef.h $(PICODIR)/efunc.h \ + $(PICODIR)/pico.h $(PICODIR)/os.h \ + $(CCLIENTDIR)/mail.h $(CCLIENTDIR)/osdep.h \ + $(CCLIENTDIR)/rfc822.h $(CCLIENTDIR)/misc.h + + pine: $(OFILES) $(LOCLIBS) + echo "char datestamp[]="\"`date`\"";" > date.c + echo "char hoststamp[]="\"`hostname`\"";" >> date.c + $(CC) $(LDFLAGS) $(CFLAGS) -o pine $(OFILES) date.c $(LIBS) + + abookcpy: abookcpy.o $(LOCLIBES) + $(CC) $(LDFLAGS) $(CFLAGS) -o abookcpy abookcpy.o $(LIBS) + + pine-use: pine-use.c + $(CC) -o pine-use pine-use.c + + clean: + $(RM) *.o os.h os.c helptext.c helptext.h pine + cd osdep; make clean; cd .. + + os.h: osdep/os-bos.h + $(RM) os.h + $(LN) osdep/os-bos.h os.h + + os.c: osdep/os-bos.c + $(RM) os.c + $(LN) osdep/os-bos.c os.c + + $(OFILES): $(HFILES) + addrbook.o adrbkcmd.o adrbklib.o bldaddr.o takeaddr.o: adrbklib.h + context.o: $(CCLIENTDIR)/misc.h + send.o: $(CCLIENTDIR)/smtp.h + $(LDAPOFILES): $(LDAPLIBS) + + helptext.c: pine.hlp + ./cmplhelp.sh < pine.hlp > helptext.c + + helptext.h: pine.hlp + ./cmplhlp2.sh < pine.hlp > helptext.h + + # os.c is derived from several files in the osdep sub-directory. + # The dependencies here will be slightly different for each port. + osdep/os-bos.c: osdep/bld_path osdep/canacces osdep/canonicl \ + osdep/chnge_pw osdep/coredump osdep/creatdir \ + osdep/diskquot osdep/domnames osdep/err_desc.beos \ + osdep/expnfldr osdep/fgetpos osdep/filesize osdep/fltrname \ + osdep/fnexpand osdep/header osdep/hostname \ + osdep/jobcntrl osdep/lstcmpnt osdep/mimedisp osdep/pipe \ + osdep/print osdep/pw_stuff.beos osdep/readfile osdep/debuging.tim \ + osdep/rename osdep/tempfile osdep/writ_dir \ + osdep/termin.unx osdep/termout.unx \ + osdep/termin.gen osdep/termout.gen \ + osdep/sendmail osdep/execview \ + osdep/postreap.wt4 osdep/os-bos.ic + cd osdep; $(MAKE) includer os-bos.c; cd .. diff -c -r -N pine4.10.orig/pine/osdep/err_desc.beos pine4.10.beos/pine/osdep/err_desc.beos *** pine4.10.orig/pine/osdep/err_desc.beos Wed Dec 31 16:00:00 1969 --- pine4.10.beos/pine/osdep/err_desc.beos Fri Mar 19 16:01:49 1999 *************** *** 0 **** --- 1,15 ---- + /*---------------------------------------------------------------------- + Return string describing the error + + Args: errnumber -- The system error number (errno) + + Result: long string describing the error is returned + ----*/ + char * + error_description(errnumber) + int errnumber; + { + return strerror(errnumber); + } + + diff -c -r -N pine4.10.orig/pine/osdep/makefile pine4.10.beos/pine/osdep/makefile *** pine4.10.orig/pine/osdep/makefile Fri Jan 22 16:35:59 1999 --- pine4.10.beos/pine/osdep/makefile Fri Mar 19 16:09:29 1999 *************** *** 4,10 **** RM= rm -f ALL= os-a32.c os-a41.c os-aix.c os-asv.c \ ! os-aux.c os-bs2.c os-bsd.c os-bsf.c os-bsi.c os-bso.c \ os-cvx.c os-dos.c os-dpx.c os-dyn.c \ os-gen.c os-hpp.c os-hpx.c os-isc.c os-lnx.c \ os-lyn.c os-mnt.c os-neb.c os-nxt.c \ --- 4,10 ---- RM= rm -f ALL= os-a32.c os-a41.c os-aix.c os-asv.c \ ! os-aux.c os-bos.c os-bs2.c os-bsd.c os-bsf.c os-bsi.c os-bso.c \ os-cvx.c os-dos.c os-dpx.c os-dyn.c \ os-gen.c os-hpp.c os-hpx.c os-isc.c os-lnx.c \ os-lyn.c os-mnt.c os-neb.c os-nxt.c \ *************** *** 46,51 **** --- 46,52 ---- os-aix.c: bld_path canacces canonicl chnge_pw coredump creatdir debuging diskquot domnames err_desc execview expnfldr fgetpos filesize fltrname fnexpand header hostname jobcntrl lstcmpnt mimedisp pipe print pw_stuff readfile rename sendmail tempfile termin.gen termin.unx termout.gen termout.unx writ_dir os-aix.ic os-asv.c: bld_path canacces canonicl chnge_pw coredump creatdir debuging diskquot.non domnames err_desc execview expnfldr fgetpos.non filesize fltrname fnexpand header hostname jobcntrl.non lstcmpnt mimedisp pipe print pw_stuff readfile rename sendmail srandom.dum tempfile termin.gen termin.unx termout.gen termout.unx writ_dir os-asv.ic os-aux.c: bld_path canacces canonicl chnge_pw coredump creatdir debuging diskquot.non domnames err_desc execview expnfldr fgetpos.non filesize fltrname fnexpand header hostname jobcntrl lstcmpnt mimedisp pipe print pw_stuff readfile rename.hom sendmail tempfile termin.gen termin.unx termout.gen termout.unx writ_dir os-aux.ic + os-bos.c: bld_path canacces canonicl chnge_pw coredump creatdir debuging.tim diskquot domnames err_desc.beos execview expnfldr fgetpos filesize fltrname fnexpand header hostname jobcntrl lstcmpnt mimedisp pipe postreap.wtp print pw_stuff.beos readfile rename sendmail tempfile termin.gen termin.unx termout.gen termout.unx writ_dir os-gen.ic os-bs2.c: bld_path canacces canonicl chnge_pw coredump creatdir debuging.tim diskquot.non domnames err_desc execview expnfldr fgetpos filesize fltrname fnexpand header hostname jobcntrl lstcmpnt mimedisp pipe print pw_stuff readfile rename sendmail tempfile termin.gen termin.unx termout.gen termout.unx writ_dir os-bs2.ic os-bsd.c: bld_path canacces canonicl chnge_pw coredump creatdir debuging.tim diskquot domnames err_desc execview expnfldr fgetpos.non filesize fltrname fnexpand header hostname jobcntrl lstcmpnt mimedisp pipe print pw_stuff readfile rename sendmail tempfile termin.gen termin.unx termout.gen termout.unx writ_dir os-bsd.ic os-bsf.c: bld_path canacces canonicl chnge_pw coredump creatdir debuging.tim diskquot.non domnames err_desc execview expnfldr fgetpos filesize fltrname fnexpand header hostname jobcntrl lstcmpnt mimedisp pipe postreap.wtp print pw_stuff readfile rename sendmail tempfile termin.gen termin.unx termout.gen termout.unx writ_dir os-bsf.ic diff -c -r -N pine4.10.orig/pine/osdep/os-bos.h pine4.10.beos/pine/osdep/os-bos.h *** pine4.10.orig/pine/osdep/os-bos.h Wed Dec 31 16:00:00 1969 --- pine4.10.beos/pine/osdep/os-bos.h Fri Mar 19 16:01:50 1999 *************** *** 0 **** --- 1,287 ---- + /*---------------------------------------------------------------------- + $Id: os-bos.h,v 5.48 1998/06/26 06:19:36 mikes Exp $ + + T H E P I N E M A I L S Y S T E M + + Laurence Lundblade and Mike Seibel + Networks and Distributed Computing + Computing and Communications + University of Washington + Administration Builiding, AG-44 + Seattle, Washington, 98195, USA + Internet: lgl@CAC.Washington.EDU + mikes@CAC.Washington.EDU + + Please address all bugs and comments to "pine-bugs@cac.washington.edu" + + + Pine and Pico are registered trademarks of the University of Washington. + No commercial use of these trademarks may be made without prior written + permission of the University of Washington. + + Pine, Pico, and Pilot software and its included text are Copyright + 1989-1998 by the University of Washington. + + The full text of our legal notices is contained in the file called + CPYRIGHT, included with this distribution. + + + Pine is in part based on The Elm Mail System: + *********************************************************************** + * The Elm Mail System - Revision: 2.13 * + * * + * Copyright (c) 1986, 1987 Dave Taylor * + * Copyright (c) 1988, 1989 USENET Community Trust * + *********************************************************************** + + + ----------------------------------------------------------------------*/ + + #ifndef _OS_INCLUDED + #define _OS_INCLUDED + + #include "../c-client/osdep.h" + + + /*---------------------------------------------------------------------- + + This first section has some constants that you may want to change + for your configuration. This is the BeOS version of the os.h file. + Further down in the file are os-dependent things that need to be set up + correctly for each os. They aren't interesting, they just have to be + right. There are also a few constants down there that may be of + interest to some. + + ----*/ + + /*---------------------------------------------------------------------- + Define this if you want the disk quota to be checked on startup. + Of course, this only makes sense if your system has quotas. If it doesn't, + there should be a dummy disk_quota() routine in os-xxx.c so that defining + this won't be harmful anyway. + ----*/ + /* #define USE_QUOTAS /* comment out if you never want quotas checked */ + + + + /*---------------------------------------------------------------------- + Define this if you want to be sure to not allow users to change their + From header line when they send out mail. Even if you don't define + this the default is to not allow From to be changed. The user would have + to edit (by hand) "allow-changing-from" into their .pinerc feature list + or the sys-admin would have to include it in the default feature-list. + Even after that, the user still has to include it in either their + default-composer-hdrs or customized-hdrs to get at it. Instead of + defining NEVER_ALLOW_CHANGING_FROM, an easier way of preventing From + changing is to put the feature "no-allow-changing-from" in the + /usr/local/lib/pine.conf.fixed file. + ----*/ + /* #define NEVER_ALLOW_CHANGING_FROM /* probably not needed */ + + + + /*---------------------------------------------------------------------- + Define this if you want to allow users to turn on the feature that + enables sending to take place in a fork()'d child. This may reduce + the time on the user's wall clock it takes to post mail. + NOTE: You'll also have to make sure the appropriate osdep/postreap.* + file is included in the os-*.ic file for your system. + ----*/ + /* #define BACKGROUND_POST /* comment out to disable posting from child */ + + + + /*---------------------------------------------------------------------- + Turn this on if you want to disable the keyboard lock function. + ----*/ + /* #define NO_KEYBOARD_LOCK */ + + + + /*---------------------------------------------------------------------- + Turn this on to trigger QP encoding of sent message text if it contains + "From " at the beginning of a line or "." on a line by itself. + ----*/ + /* #define ENCODE_FROMS */ + + + + /*---------------------------------------------------------------------- + Timeouts (seconds) + ----*/ + #define DF_MAILCHECK "150" /* How often to check for new mail, by + default. There's some expense in doing + this so it shouldn't be done too + frequently. (Can be set in config + file now.) */ + + /*---------------------------------------------------------------------- + Check pointing (seconds) + ----*/ + #define CHECK_POINT_TIME (7*60) /* Check point the mail file (write changes + to disk) if more than CHECK_POINT_TIME + seconds have passed since the first + change was made. Depending on what is + happening, we may wait up to three times + this long, since we don't want to do the + slow check pointing and irritate the user. */ + + #define CHECK_POINT_FREQ (12) /* Check point the mail file if there have been + at least this many (status) changes to the + current mail file. We may wait longer if + it isn't a good time to do the checkpoint. */ + + + + /*---------------------------------------------------------------------- + In scrolling through text, the number of lines from the previous + screen to overlap when showing the next screen. Usually set to two. + ----*/ + #define DF_OVERLAP "2" + + + + /*---------------------------------------------------------------------- + When scrolling screens, the number of lines from top and bottom of + the screen to initiate single-line scrolling. + ----*/ + #define DF_MARGIN "0" + + + + /*---------------------------------------------------------------------- + Default fill column for pine composer and maximum fill column. The max + is used to stop people from setting their custom fill column higher than + that number. Note that DF_FILLCOL is a string but MAX_FILLCOL is an integer. + ----*/ + #define DF_FILLCOL "74" + #define MAX_FILLCOL 80 + + + + /*----- System-wide config file ----------------------------------------*/ + #define SYSTEM_PINERC "/boot/home/config/lib/pine.conf" + #define SYSTEM_PINERC_FIXED "/boot/home/config/lib/pine.conf.fixed" + + + + /*---------------------------------------------------------------------- + The default folder names and folder directories (some for backwards + compatibility). Think hard before changing any of these. + ----*/ + #define DF_DEFAULT_FCC "sent-mail" + #define DEFAULT_SAVE "saved-messages" + #define POSTPONED_MAIL "postponed-mail" + #define POSTPONED_MSGS "postponed-msgs" + #define INTERRUPTED_MAIL ".pine-interrupted-mail" + #define DEADLETTER "dead.letter" + #define DF_MAIL_DIRECTORY "mail" + #define INBOX_NAME "INBOX" + #define DF_SIGNATURE_FILE ".signature" + #define DF_ELM_STYLE_SAVE "no" + #define DF_HEADER_IN_REPLY "no" + #define DF_OLD_STYLE_REPLY "no" + #define DF_USE_ONLY_DOMAIN_NAME "no" + #define DF_FEATURE_LEVEL "sapling" + #define DF_SAVE_BY_SENDER "no" + #define DF_SORT_KEY "arrival" + #define DF_AB_SORT_RULE "fullname-with-lists-last" + #define DF_FLD_SORT_RULE "alphabetical" + #define DF_SAVED_MSG_NAME_RULE "default-folder" + #define DF_FCC_RULE "default-fcc" + #define DF_STANDARD_PRINTER "lpr" + #define ANSI_PRINTER "attached-to-ansi" + #define DF_ADDRESSBOOK ".addressbook" + #define DF_BUGS_FULLNAME "Pine Developers" + #define DF_BUGS_ADDRESS "pine-bugs@cac.washington.edu" + #define DF_SUGGEST_FULLNAME "Pine Developers" + #define DF_SUGGEST_ADDRESS "pine-suggestions@cac.washington.edu" + #define DF_PINEINFO_FULLNAME "Pine-Info News Group" + #define DF_PINEINFO_ADDRESS "pine-info@cac.washington.edu" + #define DF_LOCAL_FULLNAME "Local Support" + #define DF_LOCAL_ADDRESS "postmaster" + #define DF_KBLOCK_PASSWD_COUNT "1" + #define DF_REMOTE_ABOOK_HISTORY "3" + + /*---------------------------------------------------------------------- + The default printer when pine starts up for the first time with no printer + ----*/ + #define DF_DEFAULT_PRINTER ANSI_PRINTER + + + + /*----- The usual sendmail configuration for sending mail on Unix ------*/ + #define SENDMAIL "/usr/lib/sendmail" + #define SENDMAILFLAGS "-bs -odb -oem" /* send via smtp with backgroud + delivery and mail back errors */ + + + /*---------------------------------------------------------------------- + If no nntp-servers are defined, this program will be used to post news. + ----*/ + /* #define SENDNEWS "/usr/local/bin/inews -h" /* news posting cmd */ + + + /*--------- Program employed by users to change their password ---------*/ + #define PASSWD_PROG "/bin/passwd" + + + /*-------------- A couple constants used to size arrays ----------------*/ + #include /* Get it from param.h if available */ + #undef MAXPATH /* Sometimes defined in param.h differently */ + #define MAXPATH MAXPATHLEN /* Longest pathname we ever expect */ + /* #define MAXPATH (512) /* Longest pathname we ever expect */ + #define MAXFOLDER (64) /* Longest foldername we ever expect */ + + + /*-- Max screen pine will display on. Used to define some array sizes --*/ + #define MAX_SCREEN_COLS (170) + #define MAX_SCREEN_ROWS (200) + + + /*---------------------------------------------------------------------- + Where to put the output of pine in debug mode. Files are created + in the user's home directory and have a number appended to them when + there is more than one. + ----*/ + #define DEBUGFILE ".pine-debug" + + /*---------------------------------------------------------------------- + The number of debug files to save in the user's home diretory. The files + are useful for figuring out what a user did when he complains that something + went wrong. It's important to keep a bunch around, usually 4, so that the + debug file in question will still be around when the problem gets + investigated. Users tend to go in and out of Pine a few times and there + is one file for each pine invocation + ----*/ + #define NUMDEBUGFILES 4 + + /*---------------------------------------------------------------------- + The default debug level to set (approximate meanings): + 1 logs only highest level events and errors + 2 logs events like file writes + 3 + 4 logs each command + 5 + 6 + 7 logs details of command execution (7 is highest to run any production) + 8 + 9 logs gross details of command execution + ----*/ + #define DEFAULT_DEBUG 2 + + + + /*---------------------------------------------------------------------- + Various maximum field lengths, probably shouldn't be changed. + ----*/ + #define MAX_FULLNAME (100) + #define MAX_NICKNAME (40) + #define MAX_ADDRESS (500) + #define MAX_NEW_LIST (500) /* Max addrs to be added when creating list */ + #define MAX_SEARCH (100) /* Longest string to search for */ + #define MAX_ADDR_EXPN (1000) /* Longest expanded addr */ + #define MAX_ADDR_FIELD (10000) /* Longest fully-expanded addr field */ + + + #endif /* _OS_INCLUDED */ diff -c -r -N pine4.10.orig/pine/osdep/os-bos.ic pine4.10.beos/pine/osdep/os-bos.ic *** pine4.10.orig/pine/osdep/os-bos.ic Wed Dec 31 16:00:00 1969 --- pine4.10.beos/pine/osdep/os-bos.ic Fri Mar 19 16:01:50 1999 *************** *** 0 **** --- 1,137 ---- + ; + ; BeOS os-bos.ic file for building os-bos.c. + ; + ; Boilerplate header. + include(header) + + ; Can_access function. Just calls access. Only one version available. + include(canacces) + + ; File_size function. Only one version available. + include(filesize) + + ; Is_writable_dir function. Only one version available. + include(writ_dir) + + ; Create_mail_dir function. All Unixes use creatdir and DOS + ; uses creatdir.dos. + include(creatdir) + + ; Rename_file function. All Unixes use rename and DOS uses + ; rename.dos. There is also one called rename.hom which + ; is currently unused. Hom stands for homemade. + include(rename) + + ; Build_path function. All Unixes use bld_path and DOS + ; uses bld_path.dos. + include(bld_path) + + ; Last_cmpnt function. All Unixes use lstcmpnt and DOS + ; uses lstcmpnt.dos. + include(lstcmpnt) + + ; Expand_foldername function. All Unixes use expnfldr and DOS + ; uses expnfldr.dos. + include(expnfldr) + + ; Fnexpand function. All Unixes use fnexpand and DOS + ; uses fnexpand.dos. + include(fnexpand) + + ; Filter_filename function. All Unixes use fltrname and DOS + ; uses fltrname.dos. + include(fltrname) + + ; There are several versions of disk quotas. Standard BSD-style quotas + ; (Australian) include diskquot. Systems which don't have quotas use + ; diskquot.non. Systems which use Sun-style quotas are slightly more + ; complicated. They usually require different include files. They are + ; set up to include the file sunquota and prepend include file info to + ; that. See diskquot.*. + include(diskquot) + + ; Read_file function. All Unixes use readfile and DOS + ; uses readfile.dos. + include(readfile) + + ; Create_tmpfile function. This usually just calls the ANSI standard + ; tmpfile function if there is one. That is the version in the file tempfile. + ; There is also a tempfile.non for Unix systems which don't have a tmpfile + ; function already. + include(tempfile) + + ; Coredump function. Version called coredump just calls abort, coredump.fpe + ; uses a floating point exception to cause the coredump on some systems. + include(coredump) + + ; This is usually a call to gethostname. That version is in the file hostname. + ; There is also a version called hostname.una which uses the uname system + ; call commonly found in SysV systems. An unused version called + ; hostname.hom also exists. + include(hostname) + + ; Getdomainnames function. All Unixes use domnames and DOS + ; uses domnames.dos. + include(domnames) + + ; Canonical_name function. All Unixes use canonicl and DOS + ; uses canonicl.dos. + include(canonicl) + + ; This file includes two functions, have_job_control and stop_process. + ; The Unix version is called jobcntrl and the slightly-different DOS + ; version is jobcntrl.dos. + include(jobcntrl) + + ; Error_desciption function. All Unixes use err_desc. The version + ; called err_desc.dos is the same except that it doesn't declare the + ; variable sys_errlist[], which is already declared. There + ; is also a version called err_desc.hom which is unused. + include(err_desc.beos) + + ; There are six functions in this include. They are get_system_login, + ; get_system_fullname, get_system_homedir, get_system_passwd, gcos_name, + ; and local_name_lookup. The Unix version is pw_stuff and the dos version + ; is pw_stuff.dos. There is also a pw_stuff.fun. Fun stands for funny + ; GCOS field. It's currently unused. + include(pw_stuff.beos) + + ; Change_passwd function. Unixes use chnge_pw. + ; There is also a DOS version. + include(chnge_pw) + + ; Mime_can_display function. Only a single version of this now. + include(mimedisp) + + ; Most systems have the ANSI fgetpos and fsetpos functions. For those, + ; use fgetpos. If a system doesn't have it use fgetpos.non. + include(fgetpos) + + ; These functions are similar to popen(), but allow both an input stream + ; and an output buffer. + include(pipe) + + ; These functions are used to wait on a fork'd child doing our posting + include(postreap.wtp) + + ; These functions are used to hand messages off to local mail transport + ; and posting agents (typically, "sendmail"). + include(sendmail) + + ; This function is used to actually spawn the given command (usually dredged + ; from mailcap) on the given data file (usually on /tmp). + include(execview) + + ; This includes the various routines to support printing + include(print) + + ; Debug file maintenance. + include(debuging.tim) + + ; Input. + include(termin.unx) + include(termin.gen) + + ; Output. + include(termout.unx) + include(termout.gen) diff -c -r -N pine4.10.orig/pine/osdep/pw_stuff.beos pine4.10.beos/pine/osdep/pw_stuff.beos *** pine4.10.orig/pine/osdep/pw_stuff.beos Wed Dec 31 16:00:00 1969 --- pine4.10.beos/pine/osdep/pw_stuff.beos Fri Mar 19 16:01:50 1999 *************** *** 0 **** --- 1,84 ---- + /*---------------------------------------------------------------------- + Pull the name out of the gcos field if we have that sort of /etc/passwd + + Args: gcos_field -- The long name or GCOS field to be parsed + logname -- Replaces occurances of & with logname string + + Result: returns pointer to buffer with name + ----*/ + static char * + gcos_name(gcos_field, logname) + char *logname, *gcos_field; + { + static char fullname[MAX_FULLNAME+1]; + register char *fncp, *gcoscp, *lncp, *end; + + /* full name is all chars up to first ',' (or whole gcos, if no ',') */ + /* replace any & with logname in upper case */ + + for(fncp = fullname, gcoscp= gcos_field, end = fullname + MAX_FULLNAME - 1; + (*gcoscp != ',' && *gcoscp != '\0' && fncp != end); + gcoscp++) { + + if(*gcoscp == '&') { + for(lncp = logname; *lncp; fncp++, lncp++) + *fncp = toupper((unsigned char)(*lncp)); + } else { + *fncp++ = *gcoscp; + } + } + + *fncp = '\0'; + return(fullname); + } + + + /*---------------------------------------------------------------------- + Fill in homedir, login, and fullname for the logged in user. + These are all pointers to static storage so need to be copied + in the caller. + + Args: ui -- struct pointer to pass back answers + + Result: fills in the fields + ----*/ + void + get_user_info(ui) + struct user_info *ui; + { + struct passwd *unix_pwd; + + unix_pwd = getpwuid(getuid()); + if(unix_pwd == NULL) { + ui->homedir = cpystr(""); + ui->login = cpystr(""); + ui->fullname = cpystr(""); + }else { + ui->homedir = cpystr(unix_pwd->pw_dir); + ui->login = cpystr(unix_pwd->pw_name); + /* ui->fullname = cpystr(gcos_name(unix_pwd->pw_gecos, unix_pwd->pw_name));*/ + ui->fullname = cpystr(""); + } + } + + + /*---------------------------------------------------------------------- + Look up a userid on the local system and return rfc822 address + + Args: name -- possible login name on local system + + Result: returns NULL or pointer to alloc'd string rfc822 address. + ----*/ + char * + local_name_lookup(name) + char *name; + { + /* struct passwd *pw = getpwnam(name); + + if(pw == NULL)*/ + return((char *)NULL); + + /* return(cpystr(gcos_name(pw->pw_gecos, name)));*/ + } + + diff -c -r -N pine4.10.orig/pine/signals.c pine4.10.beos/pine/signals.c *** pine4.10.orig/pine/signals.c Thu Nov 12 14:49:01 1998 --- pine4.10.beos/pine/signals.c Fri Mar 19 16:01:50 1999 *************** *** 100,110 **** if(CUSHION_SIG){ signal(SIGILL, auger_in_signal); signal(SIGTRAP, auger_in_signal); signal(SIGEMT, auger_in_signal); signal(SIGBUS, auger_in_signal); signal(SIGSEGV, auger_in_signal); - signal(SIGSYS, auger_in_signal); signal(SIGQUIT, auger_in_signal); /* Don't catch SIGFPE cause it's rare and we use it in a hack below*/ } --- 100,112 ---- if(CUSHION_SIG){ signal(SIGILL, auger_in_signal); + #ifndef BOS signal(SIGTRAP, auger_in_signal); signal(SIGEMT, auger_in_signal); + signal(SIGSYS, auger_in_signal); + #endif signal(SIGBUS, auger_in_signal); signal(SIGSEGV, auger_in_signal); signal(SIGQUIT, auger_in_signal); /* Don't catch SIGFPE cause it's rare and we use it in a hack below*/ } *************** *** 185,195 **** exit(-1); } signal(SIGTRAP, blockem ? SIG_IGN : SIG_DFL); signal(SIGEMT, blockem ? SIG_IGN : SIG_DFL); signal(SIGBUS, blockem ? SIG_IGN : SIG_DFL); signal(SIGSEGV, blockem ? SIG_IGN : SIG_DFL); - signal(SIGSYS, blockem ? SIG_IGN : SIG_DFL); #ifdef RESIZING signal(SIGWINCH, blockem ? SIG_IGN : SIG_DFL); #endif --- 187,199 ---- exit(-1); } + #ifndef BOS signal(SIGTRAP, blockem ? SIG_IGN : SIG_DFL); signal(SIGEMT, blockem ? SIG_IGN : SIG_DFL); + signal(SIGSYS, blockem ? SIG_IGN : SIG_DFL); + #endif signal(SIGBUS, blockem ? SIG_IGN : SIG_DFL); signal(SIGSEGV, blockem ? SIG_IGN : SIG_DFL); #ifdef RESIZING signal(SIGWINCH, blockem ? SIG_IGN : SIG_DFL); #endif