ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- os_a52.h000064400000002420152345746370006023 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- AIX on RS6000 * * 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: 30 August 2006 */ #include #include #include #include #include /* for struct tm */ #include #include #include #include #include #include #define setpgrp(a,b) Setpgrp(a,b) int Setpgrp (int pid,int gid); #define utime portable_utime int portable_utime (char *file,time_t timep[2]); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_shp.h000064400000002560152345746370006233 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- HP/UX 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: 11 May 1989 * Last Edited: 20 December 2006 */ #include #include #include #include #include #include #include #include #include #include #include #define direct dirent #define random lrand48 /* Many versions of SysV get this wrong */ #define setpgrp(a,b) Setpgrp(a,b) int Setpgrp (int pid,int gid); #define utime portable_utime int portable_utime (char *file,time_t timep[2]); long gethostid (void); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_drs.h000064400000002653152345746370006234 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- ICL DRS/NX 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: 1 August 1988 * Last Edited: 15 September 2006 */ #include #include #include #include #include #include /* for struct tm */ #include #include #include #include #include #define random rand #define direct dirent long gethostid (void); typedef int (*select_t) (struct direct *name); typedef int (*compar_t) (void *d1,void *d2); int scandir (char *dirname,struct direct ***namelist,select_t select, compar_t compar); int alphasort (void *d1,void *d2); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_osx.h000064400000002416152345746370006252 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Mac OS X 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: 1 August 1988 * Last Edited: 26 October 2007 */ #include #include #include #include #include #include #include #include /* Mac OS X gets this wrong as of Leopard */ #define setpgrp setpgid #define unix 1 /* Mac OS X security framework also has checkpw, and this causes * multiple-definition problems when building Alpine. */ #define checkpw Checkpw #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" osdep.h000064400000002711152345746370006050 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Linux 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: 30 August 2006 */ /* *** These lines are claimed to be necessary to build on Debian Linux on an *** Alpha. */ #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE 1 #endif /* _XOPEN_SOURCE */ #ifndef _BSD_SOURCE #define _BSD_SOURCE 1 #endif /* _BSD_SOURCE */ /* end Debian Linux on Alpha strangeness */ #include #include #include #include #include #include /* for struct tm */ #include #include #include /* Linux gets this wrong */ #define setpgrp setpgid #define direct dirent #define flock safe_flock #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" os_sgi.h000064400000002564152345746370006227 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- SGI 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: 1 August 1988 * Last Edited: 20 December 2006 */ #include #include #include #include #include #include /* for struct tm */ #include #include #include #include #include /* Many versions of SysV get this wrong */ #define setpgrp(a,b) Setpgrp(a,b) int Setpgrp (int pid,int gid); #define direct dirent #define fatal cclient_fatal #define utime portable_utime int portable_utime (char *file,time_t timep[2]); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_asv.h000064400000003650152345746370006233 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Altos System V 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 April 1992 * Last Edited: 15 September 2006 */ #include #include #include #include #include #include #include #include #include #include /* Different names, equivalent things in BSD and SysV */ #define L_SET SEEK_SET #define L_INCR SEEK_CUR #define L_XTND SEEK_END #define direct dirent #define ftruncate chsize #define random lrand48 struct passwd *getpwent (void); struct passwd *getpwuid (int uid); struct passwd *getpwnam (char *name); char *getenv (char *name); long gethostid (void); void *memmove (void *s,void *ct,size_t n); char *strstr (char *cs,char *ct); char *strerror (int n); unsigned long strtoul (char *s,char **endp,int base); typedef int (*select_t) (struct direct *name); typedef int (*compar_t) (void *d1,void *d2); int scandir (char *dirname,struct direct ***namelist,select_t select, compar_t compar); int alphasort (void *d1,void *d2); void *malloc (size_t byteSize); void free (void *ptr); void *realloc (void *oldptr,size_t newsize); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" fs.h000064400000001611152345746370005344 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Free storage management 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: 30 August 2006 */ /* Function prototypes */ void *fs_get (size_t size); void fs_resize (void **block,size_t size); void fs_give (void **block); misc.h000064400000006427152345746370005701 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Miscellaneous utility 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: 5 July 1988 * Last Edited: 30 August 2006 * * This original version of this file is * Copyright 1988 Stanford University * and was developed in the Symbolic Systems Resources Group of the Knowledge * Systems Laboratory at Stanford University in 1987-88, and was funded by the * Biomedical Research Technology Program of the NationalInstitutes of Health * under grant number RR-00785. */ /* Hash table operations */ #define HASHMULT 29 /* hash polynomial multiplier */ #define HASHENT struct hash_entry HASHENT { HASHENT *next; /* next entry with same hash code */ char *name; /* name of this hash entry */ void *data[1]; /* data of this hash entry */ }; #define HASHTAB struct hash_table HASHTAB { size_t size; /* size of this table */ HASHENT *table[1]; /* table */ }; /* KLUDGE ALERT!!! * * Yes, write() is overridden here instead of in osdep. This * is because misc.h is one of the last files that most things #include, so * this should avoid problems with some system #include file. */ #define write safe_write /* Some C compilers have these as macros */ #undef min #undef max /* And some C libraries have these as int functions */ #define min Min #define max Max /* Compatibility definitions */ #define pmatch(s,pat) \ pmatch_full (s,pat,NIL) /* Function prototypes */ unsigned char *ucase (unsigned char *string); unsigned char *lcase (unsigned char *string); char *cpystr (const char *string); char *cpytxt (SIZEDTEXT *dst,char *text,unsigned long size); char *textcpy (SIZEDTEXT *dst,SIZEDTEXT *src); char *textcpystring (SIZEDTEXT *text,STRING *bs); char *textcpyoffstring (SIZEDTEXT *text,STRING *bs,unsigned long offset, unsigned long size); unsigned long find_rightmost_bit (unsigned long *valptr); long min (long i,long j); long max (long i,long j); long search (unsigned char *base,long basec,unsigned char *pat,long patc); long ssearch (unsigned char *base,long basec,unsigned char *pat,long patc); HASHTAB *hash_create (size_t size); void hash_destroy (HASHTAB **hashtab); void hash_reset (HASHTAB *hashtab); unsigned long hash_index (HASHTAB *hashtab,char *key); void **hash_lookup (HASHTAB *hashtab,char *key); HASHENT *hash_add (HASHTAB *hashtab,char *key,void *data,long extra); void **hash_lookup_and_add (HASHTAB *hashtab,char *key,void *data,long extra); unsigned char hex2byte (unsigned char c1,unsigned char c2); int compare_ulong (unsigned long l1,unsigned long l2); int compare_uchar (unsigned char c1,unsigned char c2); int compare_cstring (unsigned char *s1,unsigned char *s2); int compare_csizedtext (unsigned char *s1,SIZEDTEXT *s2); os_a41.h000064400000002316152345746370006025 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- AIX on RS6000 * * 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: 30 August 2006 */ #include #include #include #include #include /* for struct tm */ #include #include #include #include #include #include #define utime portable_utime int portable_utime (char *file,time_t timep[2]); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_qnx.h000064400000002654152345746370006253 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- QNX 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: 20 December 2006 */ #include #include #include #include #include #include #include #include #include #include #include #include /* QNX gets these wrong */ #define setpgrp setpgid #define readdir Readdir #define FNDELAY O_NONBLOCK #define d_ino d_fileno typedef int (*select_t) (struct direct *name); typedef int (*compar_t) (void *d1,void *d2); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" long gethostid(void); struct direct *Readdir (DIR *dirp); extern long random (void); os_hpp.h000064400000002560152345746370006230 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- HP/UX 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: 11 May 1989 * Last Edited: 20 December 2006 */ #include #include #include #include #include #include #include #include #include #include #include #define direct dirent #define random lrand48 /* Many versions of SysV get this wrong */ #define setpgrp(a,b) Setpgrp(a,b) int Setpgrp (int pid,int gid); #define utime portable_utime int portable_utime (char *file,time_t timep[2]); long gethostid (void); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_sv2.h000064400000005643152345746370006160 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- SVR2 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 April 1992 * Last Edited: 20 December 2006 */ #include #include #define char void #include #undef char #include #include #include #include #include #include /* Many versions of SysV get this wrong */ #define setpgrp(a,b) Setpgrp(a,b) int Setpgrp (int pid,int gid); /* Different names between BSD and SVR4 */ #define L_SET SEEK_SET #define L_INCR SEEK_CUR #define L_XTND SEEK_END #define lstat stat #define random lrand48 #define SIGSTOP SIGQUIT #define S_IFLNK 0120000 /* syslog() emulation */ #define LOG_MAIL (2<<3) /* mail system */ #define LOG_DAEMON (3<<3) /* system daemons */ #define LOG_AUTH (4<<3) /* security/authorization messages */ #define LOG_ALERT 1 /* action must be taken immediately */ #define LOG_CONS 0x02 /* log on the console if errors in sending */ #define LOG_ODELAY 0x04 /* delay open until syslog() is called */ #define LOG_NDELAY 0x08 /* don't delay open */ #define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */ /* For setitimer() emulation */ #define ITIMER_REAL 0 /* For opendir() emulation */ typedef struct _dirdesc { int dd_fd; long dd_loc; long dd_size; char *dd_buf; } DIR; struct passwd *getpwent (void); struct passwd *getpwuid (int uid); struct passwd *getpwnam (char *name); struct group *getgrnam (char *name); char *getenv (char *name); long gethostid (void); void *memmove (void *s,void *ct,size_t n); char *strstr (char *cs,char *ct); char *strerror (int n); unsigned long strtoul (char *s,char **endp,int base); DIR *opendir (char * name); int closedir (DIR *d); struct direct *readdir (DIR *d); typedef int (*select_t) (struct direct *name); typedef int (*compar_t) (void *d1,void *d2); int scandir (char *dirname,struct direct ***namelist,select_t select, compar_t compar); int alphasort (void *d1,void *d2); int fsync (int fd); int openlog (ident,logopt,facility); int syslog (priority,message,parameters ...); void *malloc (size_t byteSize); void free (void *ptr); void *realloc (void *oldptr,size_t newsize); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" fdstring.h000064400000002057152345746370006561 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: File descriptor string 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: 15 April 1997 * Last Edited: 30 August 2006 */ /* Driver-dependent data passed to init method */ typedef struct fd_data { int fd; /* file descriptor */ unsigned long pos; /* initial position */ char *chunk; /* I/O buffer chunk */ unsigned long chunksize; /* I/O buffer chunk length */ } FDDATA; extern STRINGDRIVER fd_string; os_dyn.h000064400000002773152345746370006241 0ustar00/* ======================================================================== * Copyright 1988-2007 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Dynix 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: 11 May 1989 * Last Edited: 30 January 2007 */ #include #include #include #include #include #include typedef unsigned long size_t; char *strtok (char *s,char *ct); char *strtok_r (char *s,char *ct,char **r); char *strstr (char *cs,char *ct); char *strpbrk (char *cs,char *ct); char *strerror (int n); void *memmove (void *s,void *ct,size_t n); void *memset (void *s,int c,size_t n); unsigned long strtoul (char *s,char **endp,int base); void *malloc (size_t byteSize); void free (void *ptr); void *realloc (void *oldptr,size_t newsize); int errno; #define memcpy memmove #define strchr index #define strrchr rindex #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" os_ult.h000064400000002014152345746370006237 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Ultrix 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: 11 May 1989 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" os_isc.h000064400000003272152345746370006220 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- ISC 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 April 1992 * Last Edited: 15 September 2006 */ #include #include #include #include #include #include #include #include #include #include #include /* Different names, equivalent things in BSD and SysV */ /* L_SET is defined for some strange reason in on SVR4. */ #ifndef L_SET #define L_SET SEEK_SET #endif #define L_INCR SEEK_CUR #define L_XTND SEEK_END #define direct dirent #define ftruncate chsize #define random lrand48 long gethostid (void); void *memmove (void *s,void *ct,size_t n); typedef int (*select_t) (struct direct *name); typedef int (*compar_t) (void *d1,void *d2); int scandir (char *dirname,struct direct ***namelist,select_t select, compar_t compar); int alphasort (void *d1,void *d2); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_sua.h000064400000002241152345746370006225 0ustar00/* ======================================================================== * Copyright 1988-2007 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Windows Vista SUA * * 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: 4 May 2007 */ #define _REENTRANT /* for strtok_r() */ #include #include #include #include #include #include /* for struct tm */ #include #include #include #define setpgrp setpgid #define direct dirent #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" os_aix.h000064400000002142152345746370006216 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- AIX 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: 1 August 1988 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include #define direct dirent char *strerror (int n); void *memmove (void *s,void *ct,size_t n); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" os_art.h000064400000004015152345746370006224 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- AIX/RT 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 April 1992 * Last Edited: 15 September 2006 */ #include #include #include #include #define direct dirent #include #include #include #include #include /* Different names between BSD and SVR4 */ #define L_SET SEEK_SET #define L_INCR SEEK_CUR #define L_XTND SEEK_END #define random lrand48 #define SIGSTOP SIGQUIT /* For setitimer() emulation */ #define ITIMER_REAL 0 struct passwd *getpwent (void); struct passwd *getpwuid (int uid); struct passwd *getpwnam (char *name); char *getenv (char *name); long gethostid (void); void *memmove (void *s,void *ct,size_t n); char *strstr (char *cs,char *ct); char *strerror (int n); unsigned long strtoul (char *s,char **endp,int base); typedef int (*select_t) (struct direct *name); typedef int (*compar_t) (void *d1,void *d2); int scandir (char *dirname,struct direct ***namelist,select_t select, compar_t compar); int alphasort (void *d1,void *d2); void *malloc (size_t byteSize); void free (void *ptr); void *realloc (void *oldptr,size_t newsize); int openlog (ident,logopt,facility); int syslog (priority,message,parameters ...); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_osf.h000064400000002257152345746370006233 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- OSF/Digital UNIX/Tru64 * * 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: 30 August 2006 */ #include #include #include #include #include #include /* for struct tm */ #include #include #include /* OSF/1 gets this wrong */ #define setpgrp setpgid #define direct dirent #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" tcp.h000064400000003357152345746370005533 0ustar00/* ======================================================================== * Copyright 1988-2007 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: 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: 31 January 2007 */ /* Dummy definition overridden by TCP routines */ #ifndef TCPSTREAM #define TCPSTREAM void #endif /* Function prototypes */ void *tcp_parameters (long function,void *value); TCPSTREAM *tcp_open (char *host,char *service,unsigned long port); TCPSTREAM *tcp_aopen (NETMBX *mb,char *service,char *usrbuf); char *tcp_getline (TCPSTREAM *stream); long tcp_getbuffer (TCPSTREAM *stream,unsigned long size,char *buffer); long tcp_getdata (TCPSTREAM *stream); long tcp_soutr (TCPSTREAM *stream,char *string); long tcp_sout (TCPSTREAM *stream,char *string,unsigned long size); void tcp_close (TCPSTREAM *stream); char *tcp_host (TCPSTREAM *stream); char *tcp_remotehost (TCPSTREAM *stream); unsigned long tcp_port (TCPSTREAM *stream); char *tcp_localhost (TCPSTREAM *stream); char *tcp_clientaddr (void); char *tcp_clienthost (void); long tcp_clientport (void); char *tcp_serveraddr (void); char *tcp_serverhost (void); long tcp_serverport (void); char *tcp_canonical (char *name); long tcp_isclienthost (char *host); nntp.h000064400000003122152345746370005712 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Network News Transfer Protocol (NNTP) 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: 10 February 1992 * Last Edited: 30 August 2006 */ /* Constants (should be in nntp.c) */ #define NNTPTCPPORT (long) 119 /* assigned TCP contact port */ /* NNTP open options * For compatibility with the past, NOP_DEBUG must always be 1. */ #define NOP_DEBUG (long) 0x1 /* debug protocol negotiations */ #define NOP_READONLY (long) 0x2 /* read-only open */ #define NOP_TRYSSL (long) 0x4 /* try SSL first */ /* reserved for application use */ #define NOP_RESERVED (unsigned long) 0xff000000 /* Compatibility support names */ #define nntp_open(hostlist,options) \ nntp_open_full (NIL,hostlist,"nntp",NIL,options) /* Function prototypes */ SENDSTREAM *nntp_open_full (NETDRIVER *dv,char **hostlist,char *service, unsigned long port,long options); SENDSTREAM *nntp_close (SENDSTREAM *stream); long nntp_mail (SENDSTREAM *stream,ENVELOPE *msg,BODY *body); flocksim.h000064400000010444152345746370006547 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: flock() emulation via fcntl() locking * * 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 April 2001 * Last Edited: 20 December 2006 */ #include "dummy.h" /* get scan_contents() prototype */ #define flock flocksim /* use ours instead of theirs */ #undef LOCK_SH #define LOCK_SH 1 /* shared lock */ #undef LOCK_EX #define LOCK_EX 2 /* exclusive lock */ #undef LOCK_NB #define LOCK_NB 4 /* no blocking */ #undef LOCK_UN #define LOCK_UN 8 /* unlock */ /* Safe locking definitions */ extern int lockslavep; /* non-zero means slave process */ #undef SAFE_DELETE #define SAFE_DELETE(dtb,stream,mbx) (dtb->flags & DR_LOCKING) ? \ safe_delete (dtb,stream,mbx) : (*dtb->mbxdel) (stream,mbx) #undef SAFE_RENAME #define SAFE_RENAME(dtb,stream,old,newname) (dtb->flags & DR_LOCKING) ? \ safe_rename (dtb,stream,old,newname) : (*dtb->mbxren) (stream,old,newname) #undef SAFE_STATUS #define SAFE_STATUS(dtb,stream,mbx,bits) (dtb->flags & DR_LOCKING) ? \ safe_status (dtb,stream,mbx,bits) : (*dtb->status) (stream,mbx,bits) #undef SAFE_SCAN_CONTENTS #define SAFE_SCAN_CONTENTS(dtb,name,contents,csiz,fsiz) \ (!dtb || (dtb->flags & DR_LOCKING)) ? \ safe_scan_contents (dtb,name,contents,csiz,fsiz) : \ scan_contents (dtb,name,contents,csiz,fsiz) #undef SAFE_COPY #define SAFE_COPY(dtb,stream,seq,mbx,bits) (dtb->flags & DR_LOCKING) ? \ safe_copy (dtb,stream,seq,mbx,bits) : (*dtb->copy) (stream,seq,mbx,bits) #undef SAFE_APPEND #define SAFE_APPEND(dtb,stream,mbx,af,data) (dtb->flags & DR_LOCKING) ? \ safe_append (dtb,stream,mbx,af,data) : (*dtb->append) (stream,mbx,af,data) #undef MM_EXISTS #define MM_EXISTS (lockslavep ? slave_exists : mm_exists) #undef MM_EXPUNGED #define MM_EXPUNGED (lockslavep ? slave_expunged : mm_expunged) #undef MM_FLAGS #define MM_FLAGS (lockslavep ? slave_flags : mm_flags) #undef MM_NOTIFY #define MM_NOTIFY (lockslavep ? slave_notify : mm_notify) #undef MM_STATUS #define MM_STATUS (lockslavep ? slave_status : mm_status) #undef MM_LOG #define MM_LOG (lockslavep ? slave_log : mm_log) #undef MM_CRITICAL #define MM_CRITICAL (lockslavep ? slave_critical : mm_critical) #undef MM_NOCRITICAL #define MM_NOCRITICAL (lockslavep ? slave_nocritical : mm_nocritical) #undef MM_DISKERROR #define MM_DISKERROR (lockslavep ? slave_diskerror : mm_diskerror) #undef MM_FATAL #define MM_FATAL (lockslavep ? slave_fatal : mm_fatal) #undef MM_APPEND #define MM_APPEND(af) (lockslavep ? slave_append : (*af)) /* Function prototypes */ int flocksim (int fd,int operation); long safe_delete (DRIVER *dtb,MAILSTREAM *stream,char *mbx); long safe_rename (DRIVER *dtb,MAILSTREAM *stream,char *old,char *newname); long safe_status (DRIVER *dtb,MAILSTREAM *stream,char *mbx,long flags); long safe_scan_contents (DRIVER *dtb,char *name,char *contents, unsigned long csiz,unsigned long fsiz); long safe_copy (DRIVER *dtb,MAILSTREAM *stream,char *seq,char *mbx,long flags); long safe_append (DRIVER *dtb,MAILSTREAM *stream,char *mbx,append_t af, void *data); void slave_exists (MAILSTREAM *stream,unsigned long number); void slave_expunged (MAILSTREAM *stream,unsigned long number); void slave_flags (MAILSTREAM *stream,unsigned long number); void slave_notify (MAILSTREAM *stream,char *string,long errflg); void slave_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status); void slave_log (char *string,long errflg); void slave_critical (MAILSTREAM *stream); void slave_nocritical (MAILSTREAM *stream); long slave_diskerror (MAILSTREAM *stream,long errcode,long serious); void slave_fatal (char *string); long slave_append (MAILSTREAM *stream,void *data,char **flags,char **date, STRING **message); long slaveproxycopy (MAILSTREAM *stream,char *sequence,char *mailbox, long options); os_ptx.h000064400000003312152345746370006250 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- PTX 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: 11 May 1989 * Last Edited: 15 September 2006 */ #include #include #include #include #include #include #include #include #include #include /* needed in daemons */ #include #include #include /* Different names, equivalent things in BSD and SysV */ #define L_SET SEEK_SET #define L_INCR SEEK_CUR #define L_XTND SEEK_END #define direct dirent #define random lrand48 #define utime portable_utime int portable_utime (char *file,time_t timep[2]); long gethostid (void); typedef int (*select_t) (struct direct *name); typedef int (*compar_t) (void *d1,void *d2); int scandir (char *dirname,struct direct ***namelist,select_t select, compar_t compar); int alphasort (void *d1,void *d2); long ENV_INIT (char *user,char *home); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" rfc822.h000064400000012455152345746370005752 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: RFC 2822 and MIME 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: 27 July 1988 * Last Edited: 30 August 2006 * * This original version of this file is * Copyright 1988 Stanford University * and was developed in the Symbolic Systems Resources Group of the Knowledge * Systems Laboratory at Stanford University in 1987-88, and was funded by the * Biomedical Research Technology Program of the NationalInstitutes of Health * under grant number RR-00785. */ #define MAXGROUPDEPTH 50 /* RFC [2]822 doesn't allow any group nesting */ #define MAXMIMEDEPTH 50 /* more than any sane MIMEgram */ /* Output buffering for RFC [2]822 */ typedef long (*soutr_t) (void *stream,char *string); typedef long (*rfc822out_t) (char *tmp,ENVELOPE *env,BODY *body,soutr_t f, void *s,long ok8bit); typedef struct rfc822buffer { soutr_t f; /* I/O flush routine */ void *s; /* stream for I/O routine */ char *beg; /* start of buffer */ char *cur; /* current buffer pointer */ char *end; /* end of buffer */ } RFC822BUFFER; typedef long (*rfc822outfull_t) (RFC822BUFFER *buf,ENVELOPE *env,BODY *body, long ok8bit); /* Function prototypes */ char *rfc822_default_subtype (unsigned short type); void rfc822_parse_msg_full (ENVELOPE **en,BODY **bdy,char *s,unsigned long i, STRING *bs,char *host,unsigned long depth, unsigned long flags); void rfc822_parse_content (BODY *body,STRING *bs,char *h,unsigned long depth, unsigned long flags); void rfc822_parse_content_header (BODY *body,char *name,char *s); void rfc822_parse_parameter (PARAMETER **par,char *text); void rfc822_parse_adrlist (ADDRESS **lst,char *string,char *host); ADDRESS *rfc822_parse_address (ADDRESS **lst,ADDRESS *last,char **string, char *defaulthost,unsigned long depth); ADDRESS *rfc822_parse_group (ADDRESS **lst,ADDRESS *last,char **string, char *defaulthost,unsigned long depth); ADDRESS *rfc822_parse_mailbox (char **string,char *defaulthost); long rfc822_phraseonly (char *end); ADDRESS *rfc822_parse_routeaddr (char *string,char **ret,char *defaulthost); ADDRESS *rfc822_parse_addrspec (char *string,char **ret,char *defaulthost); char *rfc822_parse_domain (char *string,char **end); char *rfc822_parse_phrase (char *string); char *rfc822_parse_word (char *string,const char *delimiters); char *rfc822_cpy (char *src); char *rfc822_quote (char *src); ADDRESS *rfc822_cpy_adr (ADDRESS *adr); void rfc822_skipws (char **s); char *rfc822_skip_comment (char **s,long trim); long rfc822_output_full (RFC822BUFFER *buf,ENVELOPE *env,BODY *body,long ok8); long rfc822_output_flush (RFC822BUFFER *buf); long rfc822_output_header (RFC822BUFFER *buf,ENVELOPE *env,BODY *body, const char *specials,long flags); long rfc822_output_header_line (RFC822BUFFER *buf,char *type,long resent, char *text); long rfc822_output_address_line (RFC822BUFFER *buf,char *type,long resent, ADDRESS *adr,const char *specials); long rfc822_output_address_list (RFC822BUFFER *buf,ADDRESS *adr,long pretty, const char *specials); long rfc822_output_address (RFC822BUFFER *buf,ADDRESS *adr); long rfc822_output_cat (RFC822BUFFER *buf,char *src,const char *specials); long rfc822_output_parameter (RFC822BUFFER *buf,PARAMETER *param); long rfc822_output_stringlist (RFC822BUFFER *buf,STRINGLIST *stl); long rfc822_output_body_header (RFC822BUFFER *buf,BODY *body); void rfc822_encode_body_7bit (ENVELOPE *env,BODY *body); void rfc822_encode_body_8bit (ENVELOPE *env,BODY *body); long rfc822_output_text (RFC822BUFFER *buf,BODY *body); void *rfc822_base64 (unsigned char *src,unsigned long srcl,unsigned long *len); unsigned char *rfc822_binary (void *src,unsigned long srcl,unsigned long *len); unsigned char *rfc822_qprint (unsigned char *src,unsigned long srcl, unsigned long *len); unsigned char *rfc822_8bit (unsigned char *src,unsigned long srcl, unsigned long *len); /* Legacy routines for compatibility with the past */ void rfc822_header (char *header,ENVELOPE *env,BODY *body); void rfc822_header_line (char **header,char *type,ENVELOPE *env,char *text); void rfc822_address_line (char **header,char *type,ENVELOPE *env,ADDRESS *adr); char *rfc822_write_address_full (char *dest,ADDRESS *adr,char *base); void rfc822_address (char *dest,ADDRESS *adr); void rfc822_cat (char *dest,char *src,const char *specials); void rfc822_write_body_header (char **header,BODY *body); long rfc822_output (char *t,ENVELOPE *env,BODY *body,soutr_t f,void *s, long ok8bit); long rfc822_output_body (BODY *body,soutr_t f,void *s); #define rfc822_write_address(dest,adr) \ rfc822_write_address_full (dest,adr,NIL) #define rfc822_parse_msg(en,bdy,s,i,bs,host,flags) \ rfc822_parse_msg_full (en,bdy,s,i,bs,host,0,flags) flockcyg.h000064400000002541152345746370006540 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: flock() emulation via fcntl() locking * * 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 April 2001 * Last Edited: 30 August 2006 */ /* Cygwin does not seem to have the design flaw in fcntl() locking that * most other systems do (see flocksim.c for details). If some cretin * decides to implement that design flaw, then Cygwin will have to use * flocksim. Also, we don't test NFS either */ #define flock flocksim /* use ours instead of theirs */ #undef LOCK_SH #define LOCK_SH 1 /* shared lock */ #undef LOCK_EX #define LOCK_EX 2 /* exclusive lock */ #undef LOCK_NB #define LOCK_NB 4 /* no blocking */ #undef LOCK_UN #define LOCK_UN 8 /* unlock */ /* Function prototypes */ int flocksim (int fd,int operation); os_lyn.h000064400000002042152345746370006236 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- LynxOS 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: 5 March 1993 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include #define gethostid clock #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" sslio.h000064400000004405152345746370006071 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: SSL 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: 7 February 2001 * Last Edited: 30 August 2006 */ /* SSL driver */ struct ssl_driver { /* must parallel NETDRIVER in mail.h */ SSLSTREAM *(*open) (char *host,char *service,unsigned long port); SSLSTREAM *(*aopen) (NETMBX *mb,char *service,char *usrbuf); char *(*getline) (SSLSTREAM *stream); long (*getbuffer) (SSLSTREAM *stream,unsigned long size,char *buffer); long (*soutr) (SSLSTREAM *stream,char *string); long (*sout) (SSLSTREAM *stream,char *string,unsigned long size); void (*close) (SSLSTREAM *stream); char *(*host) (SSLSTREAM *stream); char *(*remotehost) (SSLSTREAM *stream); unsigned long (*port) (SSLSTREAM *stream); char *(*localhost) (SSLSTREAM *stream); }; /* SSL stdio stream */ typedef struct ssl_stdiostream { SSLSTREAM *sslstream; /* SSL stream */ int octr; /* output counter */ char *optr; /* output pointer */ char obuf[SSLBUFLEN]; /* output buffer */ } SSLSTDIOSTREAM; /* Function prototypes */ SSLSTREAM *ssl_open (char *host,char *service,unsigned long port); SSLSTREAM *ssl_aopen (NETMBX *mb,char *service,char *usrbuf); char *ssl_getline (SSLSTREAM *stream); long ssl_getbuffer (SSLSTREAM *stream,unsigned long size,char *buffer); long ssl_getdata (SSLSTREAM *stream); long ssl_soutr (SSLSTREAM *stream,char *string); long ssl_sout (SSLSTREAM *stream,char *string,unsigned long size); void ssl_close (SSLSTREAM *stream); char *ssl_host (SSLSTREAM *stream); char *ssl_remotehost (SSLSTREAM *stream); unsigned long ssl_port (SSLSTREAM *stream); char *ssl_localhost (SSLSTREAM *stream); long ssl_server_input_wait (long seconds); os_do4.h000064400000002355152345746370006131 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Apollo Domain/OS sr10.4 * * 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: 11 May 1989 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include #ifndef htons #include /* needed for htons() prototypes */ #endif extern int daylight; /* local timzone uses daylight savings time */ extern long altzone; /* seconds west of UTC during daylight time */ #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" os_sun.h000064400000002433152345746370006245 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- SUN-OS 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: 11 May 1989 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include #define strstr Strstr /* override system definition */ #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" char *Strstr (char *cs,char *ct); char *strerror (int n); unsigned long strtoul (char *s,char **endp,int base); #define memcpy memmove void *memmove (void *s,void *ct,size_t n); void *memset (void *s,int c,size_t n); os_cyg.h000064400000003142152345746370006220 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Cygwin 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: 1 August 1988 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include #include #include #include #define direct dirent #define CYGKLUDGEOFFSET 1 /* don't write 1st byte of shared-lock files */ /* Cygwin gets this wrong */ #define setpgrp setpgid #define SYSTEMUID 18 /* Cygwin returns this for SYSTEM */ #define geteuid Geteuid uid_t Geteuid (void); /* Now Cygwin has reportedly joined this madness. Use ifndef in case it shares the SVR4 silliness too */ #ifndef L_SET #define L_SET SEEK_SET #endif #ifndef L_INCR #define L_INCR SEEK_CUR #endif #ifndef L_XTND #define L_XTND SEEK_END #endif #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flockcyg.h" tcp_unix.h000064400000002310152345746370006562 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * 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: 30 August 2006 */ /* TCP input buffer */ #define BUFLEN 8192 /* TCP I/O stream */ #define TCPSTREAM struct tcp_stream TCPSTREAM { char *host; /* host name */ unsigned long port; /* port number */ char *localhost; /* local host name */ char *remotehost; /* remote host name */ int tcpsi; /* input socket */ int tcpso; /* output socket */ int ictr; /* input counter */ char *iptr; /* input pointer */ char ibuf[BUFLEN]; /* input buffer */ }; linkage.h000064400000001035152345746370006346 0ustar00extern DRIVER mboxdriver; extern DRIVER imapdriver; extern DRIVER nntpdriver; extern DRIVER pop3driver; extern DRIVER mixdriver; extern DRIVER mxdriver; extern DRIVER mbxdriver; extern DRIVER tenexdriver; extern DRIVER mtxdriver; extern DRIVER mhdriver; extern DRIVER mmdfdriver; extern DRIVER unixdriver; extern DRIVER newsdriver; extern DRIVER philedriver; extern DRIVER dummydriver; extern AUTHENTICATOR auth_gss; extern AUTHENTICATOR auth_ext; extern AUTHENTICATOR auth_md5; extern AUTHENTICATOR auth_pla; extern AUTHENTICATOR auth_log; os_vu2.h000064400000004534152345746370006160 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- VAX Ultrix 2.3 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: 11 May 1989 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include /* syslog() emulation */ #define LOG_MAIL (2<<3) /* mail system */ #define LOG_DAEMON (3<<3) /* system daemons */ #define LOG_AUTH (4<<3) /* security/authorization messages */ #define LOG_EMERG 0 /* system is unusable */ #define LOG_ALERT 1 /* action must be taken immediately */ #define LOG_CRIT 2 /* critical conditions */ #define LOG_ERR 3 /* error conditions */ #define LOG_WARNING 4 /* warning conditions */ #define LOG_NOTICE 5 /* normal but signification condition */ #define LOG_INFO 6 /* informational */ #define LOG_DEBUG 7 /* debug-level messages */ #define LOG_PID 0x01 /* log the pid with each message */ #define LOG_CONS 0x02 /* log on the console if errors in sending */ #define LOG_ODELAY 0x04 /* delay open until syslog() is called */ #define LOG_NDELAY 0x08 /* don't delay open */ #define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */ #define isodigit(c) (((unsigned)(c)>=060)&((unsigned)(c)<=067)) #define toint(c) ((c)-'0') extern int sys_nerr; extern char *sys_errlist[]; char *getenv (char *name); char *strstr (char *cs,char *ct); char *strerror (int n); void *memmove (void *s,void *ct,size_t n); unsigned long strtoul (char *s,char **endp,int base); void *malloc (size_t byteSize); void free (void *ptr); void *realloc (void *oldptr,size_t newsize); u_long portable_inet_addr (char *hostname); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" utf8.h000064400000054667152345746370005645 0ustar00/* ======================================================================== * Copyright 1988-2008 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: UTF-8 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: 11 June 1997 * Last Edited: 17 January 2008 */ /* UTF-8 size and conversion routines from UCS-2 values (thus in the BMP). * Don't use these if UTF-16 data (surrogate pairs) are an issue. * For UCS-4 values, use the utf8_size() and utf8_put() functions. */ #define UTF8_SIZE_BMP(c) ((c & 0xff80) ? ((c & 0xf800) ? 3 : 2) : 1) #define UTF8_PUT_BMP(b,c) { \ if (c & 0xff80) { /* non-ASCII? */ \ if (c & 0xf800) { /* three byte code */ \ *b++ = 0xe0 | (c >> 12); \ *b++ = 0x80 | ((c >> 6) & 0x3f); \ } \ else *b++ = 0xc0 | ((c >> 6) & 0x3f); \ *b++ = 0x80 | (c & 0x3f); \ } \ else *b++ = c; \ } /* utf8_text() flag values */ #define U8T_CASECANON 2 /* canonicalize case */ #define U8T_DECOMPOSE 4 /* decompose */ /* full canonicalization */ #define U8T_CANONICAL (U8T_CASECANON | U8T_DECOMPOSE) /* utf8_get() return values */ /* 0x0000 - 0xffff BMP plane */ #define U8GM_NONBMP 0xffff0000 /* mask for non-BMP values */ /* 0x10000 - 0x10ffff extended planes */ /* 0x110000 - 0x7ffffff non-Unicode */ #define U8G_ERROR 0x80000000 /* error flag */ #define U8G_BADCONT U8G_ERROR+1 /* continuation when not in progress */ #define U8G_INCMPLT U8G_ERROR+2 /* incomplete UTF-8 character */ #define U8G_NOTUTF8 U8G_ERROR+3 /* not a valid UTF-8 octet */ #define U8G_ENDSTRG U8G_ERROR+4 /* end of string */ #define U8G_ENDSTRI U8G_ERROR+5 /* end of string w/ incomplete UTF-8 char */ #define U8G_SURROGA U8G_ERROR+6 /* surrogate codepoint */ #define U8G_NOTUNIC U8G_ERROR+7 /* non-Unicode codepoint */ /* ucs4_width() return values */ #define U4W_ERROR 0x80000000 /* error flags */ #define U4W_NOTUNCD U4W_ERROR+1 /* not a Unicode char */ #define U4W_PRIVATE U4W_ERROR+2 /* private-space plane */ #define U4W_SSPCHAR U4W_ERROR+3 /* Supplementary Special-purpose Plane */ #define U4W_UNASSGN U4W_ERROR+4 /* unassigned space plane */ #define U4W_CONTROL U4W_ERROR+5 /* C0/C1 control */ #define U4W_CTLSRGT U4W_CONTROL /* in case legacy code references this */ /* ISO-2022 engine states */ #define I2S_CHAR 0 /* character */ #define I2S_ESC 1 /* previous character was ESC */ #define I2S_MUL 2 /* previous character was multi-byte code */ #define I2S_INT 3 /* previous character was intermediate */ /* ISO-2022 Gn selections */ #define I2C_G0 0 /* G0 */ #define I2C_G1 1 /* G1 */ #define I2C_G2 2 /* G2 */ #define I2C_G3 3 /* G3 */ #define I2C_SG2 (2 << 2) /* single shift G2 */ #define I2C_SG3 (3 << 2) /* single shift G2 */ /* ISO-2022 octet definitions */ #define I2C_ESC 0x1b /* ESCape */ /* Intermediate character */ #define I2C_STRUCTURE 0x20 /* announce code structure */ #define I2C_C0 0x21 /* C0 */ #define I2C_C1 0x22 /* C1 */ #define I2C_CONTROL 0x23 /* single control function */ #define I2C_MULTI 0x24 /* multi-byte character set */ #define I2C_OTHER 0x25 /* other coding system */ #define I2C_REVISED 0x26 /* revised registration */ #define I2C_G0_94 0x28 /* G0 94-character set */ #define I2C_G1_94 0x29 /* G1 94-character set */ #define I2C_G2_94 0x2A /* G2 94-character set */ #define I2C_G3_94 0x2B /* G3 94-character set */ #define I2C_G0_96 0x2C /* (not in ISO-2022) G0 96-character set */ #define I2C_G1_96 0x2D /* G1 96-character set */ #define I2C_G2_96 0x2E /* G2 96-character set */ #define I2C_G3_96 0x2F /* G3 96-character set */ /* Locking shifts */ #define I2C_SI 0x0f /* lock shift to G0 (Shift In) */ #define I2C_SO 0x0e /* lock shift to G1 (Shift Out) */ /* prefixed by ESC */ #define I2C_LS2 0x6e /* lock shift to G2 */ #define I2C_LS3 0x6f /* lock shift to G3 */ #define I2C_LS1R 0x7e /* lock shift GR to G1 */ #define I2C_LS2R 0x7d /* lock shift GR to G2 */ #define I2C_LS3R 0x7c /* lock shift GR to G3 */ /* Single shifts */ #define I2C_SS2_ALT 0x8e /* single shift to G2 (SS2) */ #define I2C_SS3_ALT 0x8f /* single shift to G3 (SS3) */ #define I2C_SS2_ALT_7 0x19 /* single shift to G2 (SS2) */ #define I2C_SS3_ALT_7 0x1d /* single shift to G3 (SS3) */ /* prefixed by ESC */ #define I2C_SS2 0x4e /* single shift to G2 (SS2) */ #define I2C_SS3 0x4f /* single shift to G3 (SS3) */ /* 94 character sets */ /* 4/0 ISO 646 IRV */ #define I2CS_94_BRITISH 0x41 /* 4/1 ISO 646 British */ #define I2CS_94_ASCII 0x42 /* 4/2 ISO 646 USA (ASCII) */ /* 4/3 NATS Finland/Sweden (primary) */ /* 4/4 NATS Finland/Sweden (secondary) */ /* 4/5 NATS Denmark/Norway (primary) */ /* 4/6 NATS Denmark/Norway (secondary) */ /* 4/7 ISO 646 Swedish SEN 850200 */ /* 4/8 ISO 646 Swedish names */ #define I2CS_94_JIS_BUGROM 0x48 /* 4/8 some buggy software does this */ #define I2CS_94_JIS_KANA 0x49 /* 4/9 JIS X 0201-1976 right half */ #define I2CS_94_JIS_ROMAN 0x4a /* 4/a JIS X 0201-1976 left half */ /* 4/b ISO 646 German */ /* 4/c ISO 646 Portuguese (Olivetti) */ /* 4/d ISO 6438 African */ /* 4/e ISO 5427 Cyrillic (Honeywell-Bull) */ /* 4/f DIN 31624 extended bibliography */ /* 5/0 ISO 5426-1980 Bibliography */ /* 5/1 ISO 5427-1981 Cyrillic*/ /* 5/2 ISO 646 French (withdrawn) */ /* 5/3 ISO 5428-1980 Greek bibliography */ /* 5/4 GB 1988-80 Chinese */ /* 5/5 Latin-Greek (Honeywell-Bull) */ /* 5/6 UK Viewdata/Teletext */ /* 5/7 INIS (IRV subset) */ /* 5/8 ISO 5428 Greek Bibliography */ /* 5/9 ISO 646 Italian (Olivetti) */ /* 5/a ISO 646 Spanish (Olivetti) */ /* 5/b Greek (Olivetti) */ /* 5/c Latin-Greek (Olivetti) */ /* 5/d INIS non-standard extension */ /* 5/e INIS Cyrillic extension */ /* 5/f Arabic CODAR-U IERA */ /* 6/0 ISO 646 Norwegian */ /* 6/1 Norwegian version 2 (withdrawn) */ /* 6/2 Videotex supplementary */ /* 6/3 Videotex supplementary #2 */ /* 6/4 Videotex supplementary #3 */ /* 6/5 APL */ /* 6/6 ISO 646 French */ /* 6/7 ISO 646 Portuguese (IBM) */ /* 6/8 ISO 646 Spanish (IBM) */ /* 6/9 ISO 646 Hungarian */ /* 6/a Greek ELOT (withdrawn) */ /* 6/b ISO 9036 Arabic 7-bit */ /* 6/c ISO 646 IRV supplementary set */ /* 6/d JIS C6229-1984 OCR-A */ /* 6/e JIS C6229-1984 OCR-B */ /* 6/f JIS C6229-1984 OCR-B additional */ /* 7/0 JIS C6229-1984 hand-printed */ /* 7/1 JIS C6229-1984 additional hand-printd */ /* 7/2 JIS C6229-1984 katakana hand-printed */ /* 7/3 E13B Japanese graphic */ /* 7/4 Supplementary Videotex (withdrawn) */ /* 7/5 Teletex primary CCITT T.61 */ /* 7/6 Teletex secondary CCITT T.61 */ /* 7/7 CSA Z 243.4-1985 Alternate primary #1 */ /* 7/8 CSA Z 243.4-1985 Alternate primary #2 */ /* 7/9 Mosaic CCITT T.101 */ /* 7/a Serbocroatian/Slovenian Latin */ /* 7/b Serbocroatian Cyrillic */ /* 7/c Supplementary CCITT T.101 */ /* 7/d Macedonian Cyrillic */ /* 94 character sets - second intermediate byte */ /* 4/0 Greek primary CCITT */ /* 4/1 Cuba */ /* 4/2 ISO/IEC 646 invariant */ /* 4/3 Irish Gaelic 7-bit */ /* 4/4 Turkmen */ /* 94x94 character sets */ #define I2CS_94x94_JIS_OLD 0x40 /* 4/0 JIS X 0208-1978 */ #define I2CS_94x94_GB 0x41 /* 4/1 GB 2312 */ #define I2CS_94x94_JIS_NEW 0x42 /* 4/2 JIS X 0208-1983 */ #define I2CS_94x94_KSC 0x43 /* 4/3 KSC 5601 */ #define I2CS_94x94_JIS_EXT 0x44 /* 4/4 JIS X 0212-1990 */ /* 4/5 CCITT Chinese */ /* 4/6 Blisssymbol Graphic */ #define I2CS_94x94_CNS1 0x47 /* 4/7 CNS 11643 plane 1 */ #define I2CS_94x94_CNS2 0x48 /* 4/8 CNS 11643 plane 2 */ #define I2CS_94x94_CNS3 0x49 /* 4/9 CNS 11643 plane 3 */ #define I2CS_94x94_CNS4 0x4a /* 4/a CNS 11643 plane 4 */ #define I2CS_94x94_CNS5 0x4b /* 4/b CNS 11643 plane 5 */ #define I2CS_94x94_CNS6 0x4c /* 4/c CNS 11643 plane 6 */ #define I2CS_94x94_CNS7 0x4d /* 4/d CNS 11643 plane 7 */ /* 4/e DPRK (North Korea) KGCII */ /* 4/f JGCII plane 1 */ /* 5/0 JGCII plane 2 */ /* 96 character sets */ #define I2CS_96_ISO8859_1 0x41 /* 4/1 Latin-1 (Western Europe) */ #define I2CS_96_ISO8859_2 0x42 /* 4/2 Latin-2 (Czech, Slovak) */ #define I2CS_96_ISO8859_3 0x43 /* 4/3 Latin-3 (Dutch, Turkish) */ #define I2CS_96_ISO8859_4 0x44 /* 4/4 Latin-4 (Scandinavian) */ /* 4/5 CSA Z 243.4-1985 */ #define I2CS_96_ISO8859_7 0x46 /* 4/6 Greek */ #define I2CS_96_ISO8859_6 0x47 /* 4/7 Arabic */ #define I2CS_96_ISO8859_8 0x48 /* 4/8 Hebrew */ /* 4/9 Czechoslovak CSN 369103 */ /* 4/a Supplementary Latin and non-alpha */ /* 4/b Technical */ #define I2CS_96_ISO8859_5 0x4c /* 4/c Cyrillic */ #define I2CS_96_ISO8859_9 0x4d /* 4/d Latin-5 (Finnish, Portuguese) */ /* 4/e ISO 6937-2 residual */ /* 4/f Basic Cyrillic */ /* 5/0 Supplementary Latin 1, 2 and 5 */ /* 5/1 Basic Box */ /* 5/2 Supplementary ISO/IEC 6937 : 1992 */ /* 5/3 CCITT Hebrew supplementary */ #define I2CS_96_TIS620 0x54 /* 5/4 TIS 620 */ /* 5/5 Arabic/French/German */ #define I2CS_96_ISO8859_10 0x56 /* 5/6 Latin-6 (Northern Europe) */ /* 5/7 ??? */ /* 5/8 Sami (Lappish) supplementary */ #define I2CS_96_ISO8859_13 0x59 /* 5/9 Latin-7 (Baltic) */ #define I2CS_96_VSCII 0x5a /* 5/a Vietnamese */ /* 5/b Technical #1 IEC 1289 */ #define I2CS_96_ISO8859_14 0x5c /* 5/c Latin-8 (Celtic) */ /* 5/d Sami supplementary Latin */ /* 5/e Latin/Hebrew */ /* 5/f Celtic supplementary Latin */ /* 6/0 Uralic supplementary Cyrillic */ /* 6/1 Volgaic supplementary Cyrillic */ #define I2CS_96_ISO8859_15 0x62 /* 6/2 Latin-9 (Euro) */ /* 6/3 Latin-1 with Euro */ /* 6/4 Latin-4 with Euro */ /* 6/5 Latin-7 with Euro */ #define I2CS_96_ISO8859_16 0x66 /* 6/6 Latin-10 (Balkan) */ /* 6/7 Ogham */ /* 6/8 Sami supplementary Latin #2 */ /* 7/d Supplementary Mosaic for CCITT 101 */ /* 96x96 character sets */ /* Types of character sets */ #define I2CS_94 0x000 /* 94 character set */ #define I2CS_96 0x100 /* 96 character set */ #define I2CS_MUL 0x200 /* multi-byte */ #define I2CS_94x94 (I2CS_MUL | I2CS_94) #define I2CS_96x96 (I2CS_MUL | I2CS_96) /* Character set identifiers stored in Gn */ #define I2CS_BRITISH (I2CS_94 | I2CS_94_BRITISH) #define I2CS_ASCII (I2CS_94 | I2CS_94_ASCII) #define I2CS_JIS_BUGROM (I2CS_94 | I2CS_94_JIS_BUGROM) #define I2CS_JIS_KANA (I2CS_94 | I2CS_94_JIS_KANA) #define I2CS_JIS_ROMAN (I2CS_94 | I2CS_94_JIS_ROMAN) #define I2CS_JIS_OLD (I2CS_94x94 | I2CS_94x94_JIS_OLD) #define I2CS_GB (I2CS_94x94 | I2CS_94x94_GB) #define I2CS_JIS_NEW (I2CS_94x94 | I2CS_94x94_JIS_NEW) #define I2CS_KSC (I2CS_94x94 | I2CS_94x94_KSC) #define I2CS_JIS_EXT (I2CS_94x94 | I2CS_94x94_JIS_EXT) #define I2CS_CNS1 (I2CS_94x94 | I2CS_94x94_CNS1) #define I2CS_CNS2 (I2CS_94x94 | I2CS_94x94_CNS2) #define I2CS_CNS3 (I2CS_94x94 | I2CS_94x94_CNS3) #define I2CS_CNS4 (I2CS_94x94 | I2CS_94x94_CNS4) #define I2CS_CNS5 (I2CS_94x94 | I2CS_94x94_CNS5) #define I2CS_CNS6 (I2CS_94x94 | I2CS_94x94_CNS6) #define I2CS_CNS7 (I2CS_94x94 | I2CS_94x94_CNS7) #define I2CS_ISO8859_1 (I2CS_96 | I2CS_96_ISO8859_1) #define I2CS_ISO8859_2 (I2CS_96 | I2CS_96_ISO8859_2) #define I2CS_ISO8859_3 (I2CS_96 | I2CS_96_ISO8859_3) #define I2CS_ISO8859_4 (I2CS_96 | I2CS_96_ISO8859_4) #define I2CS_ISO8859_7 (I2CS_96 | I2CS_96_ISO8859_7) #define I2CS_ISO8859_6 (I2CS_96 | I2CS_96_ISO8859_6) #define I2CS_ISO8859_8 (I2CS_96 | I2CS_96_ISO8859_8) #define I2CS_ISO8859_5 (I2CS_96 | I2CS_96_ISO8859_5) #define I2CS_ISO8859_9 (I2CS_96 | I2CS_96_ISO8859_9) #define I2CS_TIS620 (I2CS_96 | I2CS_96_TIS620) #define I2CS_ISO8859_10 (I2CS_96 | I2CS_96_ISO8859_10) #define I2CS_ISO8859_13 (I2CS_96 | I2CS_96_ISO8859_13) #define I2CS_VSCII (I2CS_96 | I2CS_96_VSCII) #define I2CS_ISO8859_14 (I2CS_96 | I2CS_96_ISO8859_14) #define I2CS_ISO8859_15 (I2CS_96 | I2CS_96_ISO8859_15) #define I2CS_ISO8859_16 (I2CS_96 | I2CS_96_ISO8859_16) /* Miscellaneous ISO 2022 definitions */ #define EUC_CS2 0x8e /* single shift CS2 */ #define EUC_CS3 0x8f /* single shift CS3 */ #define BITS7 0x7f /* 7-bit value mask */ #define BIT8 0x80 /* 8th bit mask */ /* The following saves us from having to have yet more charset tables */ /* Unicode codepoints */ #define UCS2_C0CONTROL 0x00 /* first C0 control */ #define UCS2_C0CONTROLEND 0x1F /* last C0 control */ #define UCS2_C1CONTROL 0x80 /* first C1 control */ #define UCS2_C1CONTROLEND 0x9F /* last C1 control */ /* ISO 646 substituted Unicode codepoints */ #define UCS2_POUNDSTERLING 0x00a3 #define UCS2_YEN 0x00a5 #define UCS2_OVERLINE 0x203e #define UCS2_EURO 0x20ac #define UCS2_KATAKANA 0xff61 /* first katakana codepoint */ #define UCS2_BOM 0xfeff /* byte order mark */ #define UCS2_BOGON 0xfffd /* replacement character */ /* next two codepoints are not Unicode chars */ #define UCS2_BOMCHECK 0xfffe /* used to check byte order with UCS2_BOM */ #define UCS2_NOTCHAR 0xffff /* not a character */ #define UCS4_BMPBASE 0x0000 /* Basic Multilingual Plane */ #define UCS4_SMPBASE 0x10000 /* Supplementary Multilinugual Plane */ #define UCS4_SIPBASE 0x20000 /* Supplementary Ideographic Plane */ /* EastAsianWidth says plane 3 is wide */ #define UCS4_UNABASE 0x40000 /* unassigned space */ #define UCS4_SSPBASE 0xe0000 /* Supplementary Special-purpose Plane */ #define UCS4_PVTBASE 0xf0000 /* private-space (two planes) */ #define UCS4_MAXUNICODE 0x10ffff/* highest Unicode codepoint */ #define UTF16_BASE 0x10000 /* base of codepoints needing surrogates */ #define UTF16_SHIFT 10 /* surrogate shift */ #define UTF16_MASK 0x3ff /* surrogate mask */ #define UTF16_SURR 0xd800 /* UTF-16 surrogate area */ #define UTF16_SURRH 0xd800 /* UTF-16 first high surrogate */ #define UTF16_SURRHEND 0xdbff /* UTF-16 last high surrogate */ #define UTF16_SURRL 0xdc00 /* UTF-16 first low surrogate */ #define UTF16_SURRLEND 0xdfff /* UTF-16 last low surrogate */ #define UTF16_MAXSURR 0xdfff /* end of UTF-16 surrogates */ /* UBOGON is used to represent a codepoint in a character set which does not * map to Unicode. It is also used for mapping failures, e.g. incomplete * shift sequences. This name has the same text width as 0x????, for * convenience in the mapping tables. * * NOCHAR is used to represent a codepoint in Unicode which does not map to * the target character set in a reverse mapping table. This name has the * same text width as 0x???? in case we ever add static reverse mapping tables. */ #define UBOGON UCS2_BOGON #define NOCHAR UCS2_NOTCHAR /* Codepoints in non-Unicode character sets */ /* Codepoints in ISO 646 character sets */ /* British ASCII codepoints */ #define BRITISH_POUNDSTERLING 0x23 /* JIS Roman codepoints */ #define JISROMAN_YEN 0x5c #define JISROMAN_OVERLINE 0x7e /* Hankaku katakana codepoints & parameters * * In earlier versions, MAX_KANA_7 and MAX_KANA_8 were the maximum codepoint * values. Although this made sense, it was confusing with the "max ku" and * "max ten" values used in the double-byte tables; there are 1-origin, but * the calculated values used for "ku" and "ten" are 0-origin (derived by * substracting the "base"). What this all meant is that for double byte * characters the limit test is of the form (value < max_ku), but for single * byte characters (which used the same cell to hold the max ku) the limit * test was (value <= max_ku). * * By making MAX_KANA_[78] be maximum+1, the same (value < max_ku) limit test * is used throughout. - 6/15/2006 */ #define MIN_KANA_7 0x21 #define MAX_KANA_7 0x60 /* maximum value + 1 */ #define KANA_7 (UCS2_KATAKANA - MIN_KANA_7) #define MIN_KANA_8 (MIN_KANA_7 | BIT8) #define MAX_KANA_8 (MAX_KANA_7 | BIT8) #define KANA_8 (UCS2_KATAKANA - MIN_KANA_8) /* Charset scripts */ /* The term "script" is used here in a very loose sense, enough to make * purists cringe. Basically, the idea is to give the main program some * idea of how it should treat the characters of text in a charset with * respect to font, drawing routines, etc. * * In some cases, "script" is associated with a charset; in other cases, * it's more closely tied to a language. */ #define SC_UNICODE 0x1 /* Unicode */ #define SC_LATIN_1 0x10 /* Western Europe */ #define SC_LATIN_2 0x20 /* Eastern Europe */ #define SC_LATIN_3 0x40 /* Southern Europe */ #define SC_LATIN_4 0x80 /* Northern Europe */ #define SC_LATIN_5 0x100 /* Turkish */ #define SC_LATIN_6 0x200 /* Nordic */ #define SC_LATIN_7 0x400 /* Baltic */ #define SC_LATIN_8 0x800 /* Celtic */ #define SC_LATIN_9 0x1000 /* Euro */ #define SC_LATIN_0 SC_LATIN_9 /* colloquial name for Latin-9 */ #define SC_ARABIC 0x2000 #define SC_CYRILLIC 0x4000 #define SC_GREEK 0x8000 #define SC_HEBREW 0x10000 #define SC_THAI 0x20000 #define SC_UKRANIAN 0x40000 #define SC_LATIN_10 0x80000 /* Balkan */ #define SC_VIETNAMESE 0x100000 #define SC_CHINESE_SIMPLIFIED 0x1000000 #define SC_CHINESE_TRADITIONAL 0x2000000 #define SC_JAPANESE 0x4000000 #define SC_KOREAN 0x8000000 /* Script table */ typedef struct utf8_scent { char *name; /* script name */ char *description; /* script description */ unsigned long script; /* script bitmask */ } SCRIPT; /* Character set table support */ typedef struct utf8_csent { char *name; /* charset name */ unsigned short type; /* type of charset */ unsigned short flags; /* charset flags */ void *tab; /* additional data */ unsigned long script; /* script(s) implemented by this charset */ char *preferred; /* preferred charset over this one */ } CHARSET; struct utf8_eucparam { unsigned int base_ku : 8; /* base row */ unsigned int base_ten : 8; /* base column */ unsigned int max_ku : 8; /* maximum row */ unsigned int max_ten : 8; /* maximum column */ void *tab; /* conversion table */ }; /* Charset types */ #define CT_UNKNOWN 0 /* unknown 8-bit */ #define CT_ASCII 1 /* 7-bit ASCII no table */ #define CT_UCS2 2 /* 2 byte 16-bit Unicode no table */ #define CT_UCS4 3 /* 4 byte 32-bit Unicode no table */ #define CT_1BYTE0 10 /* 1 byte ISO 8859-1 no table */ #define CT_1BYTE 11 /* 1 byte ASCII + table 0x80-0xff */ #define CT_1BYTE8 12 /* 1 byte table 0x00 - 0xff */ #define CT_EUC 100 /* 2 byte ASCII + utf8_eucparam base/CS2/CS3 */ #define CT_DBYTE 101 /* 2 byte ASCII + utf8_eucparam */ #define CT_DBYTE2 102 /* 2 byte ASCII + utf8_eucparam plane1/2 */ #define CT_UTF16 1000 /* variable UTF-16 encoded Unicode no table */ #define CT_UTF8 1001 /* variable UTF-8 encoded Unicode no table */ #define CT_UTF7 1002 /* variable UTF-7 encoded Unicode no table */ #define CT_2022 10000 /* variable ISO-2022 encoded no table */ #define CT_SJIS 10001 /* 2 byte Shift-JIS encoded JIS no table */ /* Character set flags */ #define CF_PRIMARY 0x1 /* primary name for this charset */ #define CF_DISPLAY 0x2 /* charset used in displays */ #define CF_POSTING 0x4 /* charset used in email posting */ #define CF_UNSUPRT 0x8 /* charset unsupported (can't convert to it) */ #define CF_NOEMAIL 0x10 /* charset not used in email */ /* UTF-7 engine states */ #define U7_ASCII 0 /* ASCII character */ #define U7_PLUS 1 /* plus seen */ #define U7_UNICODE 2 /* Unicode characters */ #define U7_MINUS 3 /* absorbed minus seen */ /* Function prototypes */ typedef unsigned long (*ucs4cn_t) (unsigned long c); typedef unsigned long (*ucs4de_t) (unsigned long c,void **more); SCRIPT *utf8_script (char *script); const CHARSET *utf8_charset (char *charset); char *utf8_badcharset (char *charset); long utf8_text (SIZEDTEXT *text,char *charset,SIZEDTEXT *ret,long flags); long utf8_text_cs (SIZEDTEXT *text,const CHARSET *cs,SIZEDTEXT *ret, ucs4cn_t cv,ucs4de_t de); long utf8_cstext (SIZEDTEXT *text,char *charset,SIZEDTEXT *ret, unsigned long errch); long utf8_cstocstext (SIZEDTEXT *text,char *sc,SIZEDTEXT *ret,char *dc, unsigned long errch); unsigned short *utf8_rmap (char *charset); unsigned short *utf8_rmap_cs (const CHARSET *cs); unsigned short *utf8_rmap_gen (const CHARSET *cs,unsigned short *oldmap); long utf8_rmaptext (SIZEDTEXT *text,unsigned short *rmap,SIZEDTEXT *ret, unsigned long errch,long iso2022jp); unsigned long utf8_rmapsize (SIZEDTEXT *text,unsigned short *rmap, unsigned long errch,long iso2022jp); long ucs4_rmaptext (unsigned long *ucs4,unsigned long len,unsigned short *rmap, SIZEDTEXT *ret,unsigned long errch); long ucs4_rmaplen (unsigned long *ucs4,unsigned long len,unsigned short *rmap, unsigned long errch); long ucs4_rmapbuf (unsigned char *t,unsigned long *ucs4,unsigned long len, unsigned short *rmap,unsigned long errch); unsigned long utf8_get (unsigned char **s,unsigned long *i); unsigned long utf8_get_raw (unsigned char **s,unsigned long *i); unsigned long ucs4_cs_get (CHARSET *cs,unsigned char **s,unsigned long *i); unsigned long *utf8_csvalidmap (char *charsets[]); const CHARSET *utf8_infercharset (SIZEDTEXT *src); long utf8_validate (unsigned char *s,unsigned long i); void utf8_text_1byte0 (SIZEDTEXT *text,SIZEDTEXT *ret,ucs4cn_t cv,ucs4de_t de); void utf8_text_1byte (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab,ucs4cn_t cv, ucs4de_t de); void utf8_text_1byte8 (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab,ucs4cn_t cv, ucs4de_t de); void utf8_text_euc (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab,ucs4cn_t cv, ucs4de_t de); void utf8_text_dbyte (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab,ucs4cn_t cv, ucs4de_t de); void utf8_text_dbyte2 (SIZEDTEXT *text,SIZEDTEXT *ret,void *tab,ucs4cn_t cv, ucs4de_t de); void utf8_text_sjis (SIZEDTEXT *text,SIZEDTEXT *ret,ucs4cn_t cv,ucs4de_t de); void utf8_text_2022 (SIZEDTEXT *text,SIZEDTEXT *ret,ucs4cn_t cv,ucs4de_t de); void utf8_text_utf7 (SIZEDTEXT *text,SIZEDTEXT *ret,ucs4cn_t cv,ucs4de_t de); void utf8_text_utf8 (SIZEDTEXT *text,SIZEDTEXT *ret,ucs4cn_t cv,ucs4de_t de); void utf8_text_ucs2 (SIZEDTEXT *text,SIZEDTEXT *ret,ucs4cn_t cv,ucs4de_t de); void utf8_text_ucs4 (SIZEDTEXT *text,SIZEDTEXT *ret,ucs4cn_t cv,ucs4de_t de); void utf8_text_utf16 (SIZEDTEXT *text,SIZEDTEXT *ret,ucs4cn_t cv,ucs4de_t de); unsigned long utf8_size (unsigned long c); unsigned char *utf8_put (unsigned char *s,unsigned long c); unsigned long ucs4_titlecase (unsigned long c); long ucs4_width (unsigned long c); long utf8_strwidth (unsigned char *s); long utf8_textwidth (SIZEDTEXT *utf8); unsigned long ucs4_decompose (unsigned long c,void **more); unsigned long ucs4_decompose_recursive (unsigned long c,void **more); os_nxt.h000064400000002273152345746370006253 0ustar00/* ======================================================================== * Copyright 1988-2007 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- NeXT 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: 1 August 1988 * Last Edited: 30 January 2007 */ #include #include #include #include #include #include #include #include /* Use ours instead of theirs */ #define strtok STRTOK #define strtok_r STRTOK_R char *strtok (char *s,char *ct); char *strtok_r (char *s,char *ct,char **r); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" utf8aux.h000064400000002771152345746370006350 0ustar00/* ======================================================================== * Copyright 1988-2007 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: UTF-8 auxillary routines (c-client and MIME2 support) * * 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: 11 June 1997 * Last Edited: 9 October 2007 */ /* Following routines are in utf8aux.c as these depend upon c-client. * Splitting these routines out makes it possible for pico to link with utf8.o * and a few rump routines (e.g., fs_get()) but not all the rest of c-client * (which pico does not need). */ void utf8_searchpgm (SEARCHPGM *pgm,char *charset); long utf8_mime2text (SIZEDTEXT *src,SIZEDTEXT *dst,long flags); unsigned char *mime2_token (unsigned char *s,unsigned char *se, unsigned char **t); unsigned char *mime2_text (unsigned char *s,unsigned char *se); long mime2_decode (unsigned char *e,unsigned char *t,unsigned char *te, SIZEDTEXT *txt); unsigned char *utf8_to_mutf7 (unsigned char *src); unsigned char *utf8_from_mutf7 (unsigned char *src); env_unix.h000064400000005565152345746370006603 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: UNIX environment 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: 30 August 2006 */ typedef struct dotlock_base { char lock[MAILTMPLEN]; int pipei; int pipeo; } DOTLOCK; /* Bits that can be set in restrictBox */ #define RESTRICTROOT 0x1 /* restricted box doesn't allow root */ #define RESTRICTOTHERUSER 0x2 /* restricted box doesn't allow other user */ /* Subscription definitions for UNIX */ #define SUBSCRIPTIONFILE(t) sprintf (t,"%s/.mailboxlist",myhomedir ()) #define SUBSCRIPTIONTEMP(t) sprintf (t,"%s/.mlbxlsttmp",myhomedir ()) /* dorc() options */ #define SYSCONFIG "/etc/c-client.cf" /* Special users */ #define ANONYMOUSUSER "nobody" /* anonymous user */ #define UNLOGGEDUSER "root" /* unlogged-in user */ #define ADMINGROUP "mailadm" /* mail administrator group */ /* Function prototypes */ #include "env.h" void rfc822_fixed_date (char *date); long env_init (char *user,char *home); char *myusername_full (unsigned long *flags); #define MU_LOGGEDIN 0 #define MU_NOTLOGGEDIN 1 #define MU_ANONYMOUS 2 #define myusername() \ myusername_full (NIL) char *sysinbox (); char *mailboxdir (char *dst,char *dir,char *name); long dotlock_lock (char *file,DOTLOCK *base,int fd); long dotlock_unlock (DOTLOCK *base); int lockname (char *lock,char *fname,int op,long *pid); int lockfd (int fd,char *lock,int op); int lock_work (char *lock,void *sbuf,int op,long *pid); long chk_notsymlink (char *name,void *sbuf); void unlockfd (int fd,char *lock); long set_mbx_protections (char *mailbox,char *path); long get_dir_protection (char *mailbox); MAILSTREAM *user_flags (MAILSTREAM *stream); char *default_user_flag (unsigned long i); void dorc (char *file,long flag); long path_create (MAILSTREAM *stream,char *mailbox); void grim_pid_reap_status (int pid,int killreq,void *status); #define grim_pid_reap(pid,killreq) \ grim_pid_reap_status (pid,killreq,NIL) long safe_write (int fd,char *buf,long nbytes); void *arm_signal (int sig,void *action); struct passwd *checkpw (struct passwd *pw,char *pass,int argc,char *argv[]); long loginpw (struct passwd *pw,int argc,char *argv[]); long pw_login (struct passwd *pw,char *auser,char *user,char *home,int argc, char *argv[]); void *mm_blocknotify (int reason,void *data); os_nto.h000064400000003220152345746370006233 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- QNX Neutrino RTP 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: 30 August 2006 */ #include #include #include #include #include #include #include #include #include #include /* QNX gets these wrong */ #define setpgrp setpgid #define readdir Readdir #define FNDELAY O_NONBLOCK #define d_ino d_fileno /* Different names, equivalent things in BSD and SysV */ #ifndef L_SET #define L_SET SEEK_SET #endif #ifndef L_INCR #define L_INCR SEEK_CUR #endif #ifndef L_XTND #define L_XTND SEEK_END #endif #define utime portable_utime int portable_utime (char *file,time_t timep[2]); long gethostid (void); struct direct *Readdir (DIR *dirp); typedef int (*select_t) (struct direct *name); typedef int (*compar_t) (void *d1,void *d2); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_aux.h000064400000002275152345746370006241 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- A/UX 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: 11 May 1989 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include #include extern int errno; char *strerror (int n); unsigned long strtoul (char *s,char **endp,int base); void *memmove (void *s,void *ct,size_t n); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_slx.h000064400000002711152345746370006245 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Linux 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: 30 August 2006 */ /* *** These lines are claimed to be necessary to build on Debian Linux on an *** Alpha. */ #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE 1 #endif /* _XOPEN_SOURCE */ #ifndef _BSD_SOURCE #define _BSD_SOURCE 1 #endif /* _BSD_SOURCE */ /* end Debian Linux on Alpha strangeness */ #include #include #include #include #include #include /* for struct tm */ #include #include #include /* Linux gets this wrong */ #define setpgrp setpgid #define direct dirent #define flock safe_flock #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" os_bsf.h000064400000002065152345746370006213 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- FreeBSD 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: 5 March 1993 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include #include #define direct dirent #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" os_sco.h000064400000003417152345746370006227 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- SCO Unix 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: 1 August 1988 * Last Edited: 20 December 2006 */ #include #include #include #include #include #include #include #include #include #include #include #include /* SCO gets this wrong */ #define setpgrp Setpgrp int Setpgrp (int pid,int gid); #define rename Rename /* Different names, equivalent things in BSD and SysV */ #define L_SET SEEK_SET #define L_INCR SEEK_CUR #define L_XTND SEEK_END #define direct dirent #define utime portable_utime int portable_utime (char *file,time_t timep[2]); #define ftruncate chsize #define random rand long gethostid (void); typedef int (*select_t) (struct direct *name); typedef int (*compar_t) (void *d1,void *d2); int scandir (char *dirname,struct direct ***namelist,select_t select, compar_t compar); int alphasort (void *d1,void *d2); int fsync (int fd); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" dummy.h000064400000002764152345746370006101 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Dummy 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: 9 May 1991 * Last Edited: 30 August 2006 */ /* Exported function prototypes */ void dummy_scan (MAILSTREAM *stream,char *ref,char *pat,char *contents); void dummy_list (MAILSTREAM *stream,char *ref,char *pat); void dummy_lsub (MAILSTREAM *stream,char *ref,char *pat); long scan_contents (DRIVER *dtb,char *name,char *contents, unsigned long csiz,unsigned long fsiz); long dummy_scan_contents (char *name,char *contents,unsigned long csiz, unsigned long fsiz); long dummy_create (MAILSTREAM *stream,char *mailbox); long dummy_create_path (MAILSTREAM *stream,char *path,long dirmode); long dummy_delete (MAILSTREAM *stream,char *mailbox); long dummy_rename (MAILSTREAM *stream,char *old,char *newname); char *dummy_file (char *dst,char *name); long dummy_canonicalize (char *tmp,char *ref,char *pat); ftl.h000064400000001471152345746370005525 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Crash management 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: 30 August 2006 */ /* Function prototypes */ void fatal (char *string); os_a32.h000064400000002316152345746370006025 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- AIX on RS6000 * * 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: 30 August 2006 */ #include #include #include #include #include /* for struct tm */ #include #include #include #include #include #include #define utime portable_utime int portable_utime (char *file,time_t timep[2]); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" mail.h000064400000205470152345746370005667 0ustar00/* ======================================================================== * Copyright 1988-2008 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Mailbox Access routines * * Author: Mark Crispin * UW Technology * University of Washington * Seattle, WA 98195 * Internet: MRC@Washington.EDU * * Date: 22 November 1989 * Last Edited: 22 July 2011 */ /* The Version */ #define CCLIENTVERSION "2007f" /* Build parameters */ #define CACHEINCREMENT 250 /* cache growth increments */ #define MAILTMPLEN 1024 /* size of a temporary buffer */ #define SENDBUFLEN 16385 /* size of temporary sending buffer, also * used for SMTP commands and NETMBX generation * buffer so shouldn't be made smaller than * MAILTMPLEN. Note that there's a guard byte, * so this is actually len+1. */ #define MAXAUTHENTICATORS 8 /* maximum number of SASL authenticators */ /* maximum number of messages */ #define MAXMESSAGES (unsigned long) 1000000 #define MAXLOGINTRIALS 3 /* maximum number of client login attempts */ #define MAXWILDCARDS 10 /* maximum wildcards allowed in LIST/LSUB */ /* These can't be changed without changing code */ #define NUSERFLAGS 30 /* maximum number of user flags */ #define MAXUSERFLAG 50 /* maximum length of a user flag */ #define BASEYEAR 1970 /* the year time began on Unix DON'T CHANGE */ /* default for unqualified addresses */ #define BADHOST ".MISSING-HOST-NAME." /* default for syntax errors in addresses */ #define ERRHOST ".SYNTAX-ERROR." /* Coddle certain compilers' 6-character symbol limitation */ #ifdef __COMPILER_KCC__ #include "shortsym.h" #endif /* Function status code */ #define NIL 0 /* convenient name */ #define T 1 /* opposite of NIL */ #define LONGT (long) 1 /* long T to pacify some compilers */ #define VOIDT (void *) "" /* void T ditto */ /* Global and Driver Parameters */ /* 0xx: driver and authenticator flags */ #define ENABLE_DRIVER (long) 1 #define DISABLE_DRIVER (long) 2 #define ENABLE_AUTHENTICATOR (long) 3 #define DISABLE_AUTHENTICATOR (long) 4 #define ENABLE_DEBUG (long) 5 #define DISABLE_DEBUG (long) 6 #define HIDE_AUTHENTICATOR (long) 7 #define UNHIDE_AUTHENTICATOR (long) 8 /* 1xx: c-client globals */ #define GET_DRIVERS (long) 101 #define SET_DRIVERS (long) 102 #define GET_GETS (long) 103 #define SET_GETS (long) 104 #define GET_CACHE (long) 105 #define SET_CACHE (long) 106 #define GET_SMTPVERBOSE (long) 107 #define SET_SMTPVERBOSE (long) 108 #define GET_RFC822OUTPUT (long) 109 #define SET_RFC822OUTPUT (long) 110 #define GET_READPROGRESS (long) 111 #define SET_READPROGRESS (long) 112 #define GET_THREADERS (long) 113 #define SET_THREADERS (long) 114 #define GET_NAMESPACE (long) 115 #define SET_NAMESPACE (long) 116 #define GET_MAILPROXYCOPY (long) 117 #define SET_MAILPROXYCOPY (long) 118 #define GET_SERVICENAME (long) 119 #define SET_SERVICENAME (long) 120 #define GET_DRIVER (long) 121 #define SET_DRIVER (long) 122 #define GET_EXPUNGEATPING (long) 123 #define SET_EXPUNGEATPING (long) 124 #define GET_PARSEPHRASE (long) 125 #define SET_PARSEPHRASE (long) 126 #define GET_SSLDRIVER (long) 127 #define SET_SSLDRIVER (long) 128 #define GET_TRYSSLFIRST (long) 129 #define SET_TRYSSLFIRST (long) 130 #define GET_BLOCKNOTIFY (long) 131 #define SET_BLOCKNOTIFY (long) 132 #define GET_SORTRESULTS (long) 133 #define SET_SORTRESULTS (long) 134 #define GET_THREADRESULTS (long) 135 #define SET_THREADRESULTS (long) 136 #define GET_PARSELINE (long) 137 #define SET_PARSELINE (long) 138 #define GET_NEWSRCQUERY (long) 139 #define SET_NEWSRCQUERY (long) 140 #define GET_FREEENVELOPESPAREP (long) 141 #define SET_FREEENVELOPESPAREP (long) 142 #define GET_FREEELTSPAREP (long) 143 #define SET_FREEELTSPAREP (long) 144 #define GET_SSLSTART (long) 145 #define SET_SSLSTART (long) 146 #define GET_DEBUGSENSITIVE (long) 147 #define SET_DEBUGSENSITIVE (long) 148 #define GET_TCPDEBUG (long) 149 #define SET_TCPDEBUG (long) 150 #define GET_FREESTREAMSPAREP (long) 151 #define SET_FREESTREAMSPAREP (long) 152 #define GET_FREEBODYSPAREP (long) 153 #define SET_FREEBODYSPAREP (long) 154 #define GET_COPYUID (long) 155 #define SET_COPYUID (long) 156 #define GET_APPENDUID (long) 157 #define SET_APPENDUID (long) 158 #define GET_RFC822OUTPUTFULL (long) 159 #define SET_RFC822OUTPUTFULL (long) 160 #define GET_BLOCKENVINIT (long) 161 #define SET_BLOCKENVINIT (long) 162 /* 2xx: environment */ #define GET_USERNAME (long) 201 #define SET_USERNAME (long) 202 #define GET_HOMEDIR (long) 203 #define SET_HOMEDIR (long) 204 #define GET_LOCALHOST (long) 205 #define SET_LOCALHOST (long) 206 #define GET_SYSINBOX (long) 207 #define SET_SYSINBOX (long) 208 #define GET_USERPROMPT (long) 209 #define SET_USERPROMPT (long) 210 #define GET_DISABLEPLAINTEXT (long) 211 #define SET_DISABLEPLAINTEXT (long) 212 #define GET_CHROOTSERVER (long) 213 #define SET_CHROOTSERVER (long) 214 #define GET_ADVERTISETHEWORLD (long) 215 #define SET_ADVERTISETHEWORLD (long) 216 #define GET_DISABLEAUTOSHAREDNS (long) 217 #define SET_DISABLEAUTOSHAREDNS (long) 218 #define GET_MAILSUBDIR 219 #define SET_MAILSUBDIR 220 #define GET_DISABLE822TZTEXT 221 #define SET_DISABLE822TZTEXT 222 #define GET_LIMITEDADVERTISE (long) 223 #define SET_LIMITEDADVERTISE (long) 224 #define GET_LOGOUTHOOK (long) 225 #define SET_LOGOUTHOOK (long) 226 #define GET_LOGOUTDATA (long) 227 #define SET_LOGOUTDATA (long) 228 #define GET_EXTERNALAUTHID (long) 229 #define SET_EXTERNALAUTHID (long) 230 #define GET_SSLCAPATH (long) 231 #define SET_SSLCAPATH (long) 232 /* 3xx: TCP/IP */ #define GET_OPENTIMEOUT (long) 300 #define SET_OPENTIMEOUT (long) 301 #define GET_READTIMEOUT (long) 302 #define SET_READTIMEOUT (long) 303 #define GET_WRITETIMEOUT (long) 304 #define SET_WRITETIMEOUT (long) 305 #define GET_CLOSETIMEOUT (long) 306 #define SET_CLOSETIMEOUT (long) 307 #define GET_TIMEOUT (long) 308 #define SET_TIMEOUT (long) 309 #define GET_RSHTIMEOUT (long) 310 #define SET_RSHTIMEOUT (long) 311 #define GET_ALLOWREVERSEDNS (long) 312 #define SET_ALLOWREVERSEDNS (long) 313 #define GET_RSHCOMMAND (long) 314 #define SET_RSHCOMMAND (long) 315 #define GET_RSHPATH (long) 316 #define SET_RSHPATH (long) 317 #define GET_SSHTIMEOUT (long) 318 #define SET_SSHTIMEOUT (long) 319 #define GET_SSHCOMMAND (long) 320 #define SET_SSHCOMMAND (long) 321 #define GET_SSHPATH (long) 322 #define SET_SSHPATH (long) 323 #define GET_SSLCERTIFICATEQUERY (long) 324 #define SET_SSLCERTIFICATEQUERY (long) 325 #define GET_SSLFAILURE (long) 326 #define SET_SSLFAILURE (long) 327 #define GET_NEWSRCCANONHOST (long) 328 #define SET_NEWSRCCANONHOST (long) 329 #define GET_KINIT (long) 330 #define SET_KINIT (long) 331 #define GET_SSLCLIENTCERT (long) 332 #define SET_SSLCLIENTCERT (long) 333 #define GET_SSLCLIENTKEY (long) 334 #define SET_SSLCLIENTKEY (long) 335 #define GET_KERBEROS_CP_SVR_NAME (long) 336 #define SET_KERBEROS_CP_SVR_NAME (long) 337 /* 4xx: network drivers */ #define GET_MAXLOGINTRIALS (long) 400 #define SET_MAXLOGINTRIALS (long) 401 #define GET_LOOKAHEAD (long) 402 #define SET_LOOKAHEAD (long) 403 #define GET_IMAPPORT (long) 404 #define SET_IMAPPORT (long) 405 #define GET_PREFETCH (long) 406 #define SET_PREFETCH (long) 407 #define GET_CLOSEONERROR (long) 408 #define SET_CLOSEONERROR (long) 409 #define GET_POP3PORT (long) 410 #define SET_POP3PORT (long) 411 #define GET_UIDLOOKAHEAD (long) 412 #define SET_UIDLOOKAHEAD (long) 413 #define GET_NNTPPORT (long) 414 #define SET_NNTPPORT (long) 415 #define GET_IMAPENVELOPE (long) 416 #define SET_IMAPENVELOPE (long) 417 #define GET_IMAPREFERRAL (long) 418 #define SET_IMAPREFERRAL (long) 419 #define GET_SSLIMAPPORT (long) 420 #define SET_SSLIMAPPORT (long) 421 #define GET_SSLPOPPORT (long) 422 #define SET_SSLPOPPORT (long) 423 #define GET_SSLNNTPPORT (long) 424 #define SET_SSLNNTPPORT (long) 425 #define GET_SSLSMTPPORT (long) 426 #define SET_SSLSMTPPORT (long) 427 #define GET_SMTPPORT (long) 428 #define SET_SMTPPORT (long) 429 #define GET_IMAPEXTRAHEADERS (long) 430 #define SET_IMAPEXTRAHEADERS (long) 431 #define GET_ACL (long) 432 #define SET_ACL (long) 433 #define GET_LISTRIGHTS (long) 434 #define SET_LISTRIGHTS (long) 435 #define GET_MYRIGHTS (long) 436 #define SET_MYRIGHTS (long) 437 #define GET_QUOTA (long) 438 #define SET_QUOTA (long) 439 #define GET_QUOTAROOT (long) 440 #define SET_QUOTAROOT (long) 441 #define GET_IMAPTRYSSL (long) 442 #define SET_IMAPTRYSSL (long) 443 #define GET_FETCHLOOKAHEAD (long) 444 #define SET_FETCHLOOKAHEAD (long) 445 #define GET_NNTPRANGE (long) 446 #define SET_NNTPRANGE (long) 447 #define GET_NNTPHIDEPATH (long) 448 #define SET_NNTPHIDEPATH (long) 449 #define GET_SENDCOMMAND (long) 450 #define SET_SENDCOMMAND (long) 451 #define GET_IDLETIMEOUT (long) 452 #define SET_IDLETIMEOUT (long) 453 #define GET_FETCHLOOKAHEADLIMIT (long) 454 #define SET_FETCHLOOKAHEADLIMIT (long) 455 /* 5xx: local file drivers */ #define GET_MBXPROTECTION (long) 500 #define SET_MBXPROTECTION (long) 501 #define GET_DIRPROTECTION (long) 502 #define SET_DIRPROTECTION (long) 503 #define GET_LOCKPROTECTION (long) 504 #define SET_LOCKPROTECTION (long) 505 #define GET_FROMWIDGET (long) 506 #define SET_FROMWIDGET (long) 507 #define GET_NEWSACTIVE (long) 508 #define SET_NEWSACTIVE (long) 509 #define GET_NEWSSPOOL (long) 510 #define SET_NEWSSPOOL (long) 511 #define GET_NEWSRC (long) 512 #define SET_NEWSRC (long) 513 #define GET_EXTENSION (long) 514 #define SET_EXTENSION (long) 515 #define GET_DISABLEFCNTLLOCK (long) 516 #define SET_DISABLEFCNTLLOCK (long) 517 #define GET_LOCKEACCESERROR (long) 518 #define SET_LOCKEACCESERROR (long) 519 #define GET_LISTMAXLEVEL (long) 520 #define SET_LISTMAXLEVEL (long) 521 #define GET_ANONYMOUSHOME (long) 522 #define SET_ANONYMOUSHOME (long) 523 #define GET_FTPHOME (long) 524 #define SET_FTPHOME (long) 525 #define GET_PUBLICHOME (long) 526 #define SET_PUBLICHOME (long) 527 #define GET_SHAREDHOME (long) 528 #define SET_SHAREDHOME (long) 529 #define GET_MHPROFILE (long) 530 #define SET_MHPROFILE (long) 531 #define GET_MHPATH (long) 532 #define SET_MHPATH (long) 533 #define GET_ONETIMEEXPUNGEATPING (long) 534 #define SET_ONETIMEEXPUNGEATPING (long) 535 #define GET_USERHASNOLIFE (long) 536 #define SET_USERHASNOLIFE (long) 537 #define GET_FTPPROTECTION (long) 538 #define SET_FTPPROTECTION (long) 539 #define GET_PUBLICPROTECTION (long) 540 #define SET_PUBLICPROTECTION (long) 541 #define GET_SHAREDPROTECTION (long) 542 #define SET_SHAREDPROTECTION (long) 543 #define GET_LOCKTIMEOUT (long) 544 #define SET_LOCKTIMEOUT (long) 545 #define GET_NOTIMEZONES (long) 546 #define SET_NOTIMEZONES (long) 547 #define GET_HIDEDOTFILES (long) 548 #define SET_HIDEDOTFILES (long) 549 #define GET_FTPDIRPROTECTION (long) 550 #define SET_FTPDIRPROTECTION (long) 551 #define GET_PUBLICDIRPROTECTION (long) 552 #define SET_PUBLICDIRPROTECTION (long) 553 #define GET_SHAREDDIRPROTECTION (long) 554 #define SET_SHAREDDIRPROTECTION (long) 555 #define GET_TRUSTDNS (long) 556 #define SET_TRUSTDNS (long) 557 #define GET_SASLUSESPTRNAME (long) 558 #define SET_SASLUSESPTRNAME (long) 559 #define GET_NETFSSTATBUG (long) 560 #define SET_NETFSSTATBUG (long) 561 #define GET_SNARFMAILBOXNAME (long) 562 #define SET_SNARFMAILBOXNAME (long) 563 #define GET_SNARFINTERVAL (long) 564 #define SET_SNARFINTERVAL (long) 565 #define GET_SNARFPRESERVE (long) 566 #define SET_SNARFPRESERVE (long) 567 #define GET_INBOXPATH (long) 568 #define SET_INBOXPATH (long) 569 #define GET_DIRFMTTEST (long) 570 #define SET_DIRFMTTEST (long) 571 #define GET_SCANCONTENTS (long) 572 #define SET_SCANCONTENTS (long) 573 #define GET_MHALLOWINBOX (long) 574 #define SET_MHALLOWINBOX (long) 575 /* Driver flags */ #define DR_DISABLE (long) 0x1 /* driver is disabled */ #define DR_LOCAL (long) 0x2 /* local file driver */ #define DR_MAIL (long) 0x4 /* supports mail */ #define DR_NEWS (long) 0x8 /* supports news */ #define DR_READONLY (long) 0x10 /* driver only allows readonly access */ #define DR_NOFAST (long) 0x20 /* "fast" data is slow (whole msg fetch) */ #define DR_NAMESPACE (long) 0x40/* driver has a special namespace */ #define DR_LOWMEM (long) 0x80 /* low amounts of memory available */ #define DR_LOCKING (long) 0x100 /* driver does locking */ #define DR_CRLF (long) 0x200 /* driver internal form uses CRLF newlines */ #define DR_NOSTICKY (long) 0x400/* driver does not support sticky UIDs */ #define DR_RECYCLE (long) 0x800 /* driver does stream recycling */ #define DR_XPOINT (long) 0x1000 /* needs to be checkpointed */ /* driver has no real internal date */ #define DR_NOINTDATE (long) 0x2000 /* driver does not announce new mail */ #define DR_NONEWMAIL (long) 0x4000 /* driver does not announce new mail when RO */ #define DR_NONEWMAILRONLY (long) 0x8000 /* driver can be halfopen */ #define DR_HALFOPEN (long) 0x10000 #define DR_DIRFMT (long) 0x20000/* driver is a directory-format */ #define DR_MODSEQ (long) 0x40000/* driver supports modseqs */ /* Cache management function codes */ #define CH_INIT (long) 10 /* initialize cache */ #define CH_SIZE (long) 11 /* (re-)size the cache */ #define CH_MAKEELT (long) 30 /* return elt, make if needed */ #define CH_ELT (long) 31 /* return elt if exists */ #define CH_SORTCACHE (long) 35 /* return sortcache entry, make if needed */ #define CH_FREE (long) 40 /* free space used by elt */ /* free space used by sortcache */ #define CH_FREESORTCACHE (long) 43 #define CH_EXPUNGE (long) 45 /* delete elt pointer from list */ /* Mailbox open options * For compatibility with the past, OP_DEBUG must always be 1. */ #define OP_DEBUG (long) 0x1 /* debug protocol negotiations */ #define OP_READONLY (long) 0x2 /* read-only open */ #define OP_ANONYMOUS (long) 0x4 /* anonymous open of newsgroup */ #define OP_SHORTCACHE (long) 0x8/* short (elt-only) caching */ #define OP_SILENT (long) 0x10 /* don't pass up events (internal use) */ #define OP_PROTOTYPE (long) 0x20/* return driver prototype */ #define OP_HALFOPEN (long) 0x40 /* half-open (IMAP connect but no select) */ #define OP_EXPUNGE (long) 0x80 /* silently expunge recycle stream */ #define OP_SECURE (long) 0x100 /* don't do non-secure authentication */ #define OP_TRYSSL (long) 0x200 /* try SSL first */ /* use multiple newsrc files */ #define OP_MULNEWSRC (long) 0x400 #define OP_NOKOD (long) 0x800 /* suppress kiss-of-death */ #define OP_SNIFF (long) 0x1000 /* metadata only open */ /* reserved for application use */ #define OP_RESERVED (unsigned long) 0xff000000 /* Net open options */ /* no error messages */ #define NET_SILENT ((unsigned long) 0x80000000) /* no validation of SSL certificates */ #define NET_NOVALIDATECERT ((unsigned long) 0x40000000) /* no open timeout */ #define NET_NOOPENTIMEOUT ((unsigned long) 0x20000000) /* TLS not SSL */ #define NET_TLSCLIENT ((unsigned long) 0x10000000) /* try SSL mode */ #define NET_TRYSSL ((unsigned long) 0x8000000) /* Close options */ #define CL_EXPUNGE (long) 1 /* expunge silently */ /* Fetch options */ #define FT_UID (long) 0x1 /* argument is a UID */ #define FT_PEEK (long) 0x2 /* peek at data */ #define FT_NOT (long) 0x4 /* NOT flag for header lines fetch */ #define FT_INTERNAL (long) 0x8 /* text can be internal strings */ /* IMAP prefetch text when fetching header */ #define FT_PREFETCHTEXT (long) 0x20 #define FT_NOHDRS (long) 0x40 /* suppress fetching extra headers (note that this breaks news handling) */ #define FT_NEEDENV (long) 0x80 /* (internal use) include envelope */ #define FT_NEEDBODY (long) 0x100/* (internal use) include body structure */ /* no fetch lookahead */ #define FT_NOLOOKAHEAD (long) 0x200 /* (internal use) lookahead in hdr searching */ #define FT_SEARCHLOOKAHEAD (long) 0x400 /* stringstruct return hack */ #define FT_RETURNSTRINGSTRUCT (long) 0x800 /* Flagging options */ #define ST_UID (long) 0x1 /* argument is a UID sequence */ #define ST_SILENT (long) 0x2 /* don't return results */ #define ST_SET (long) 0x4 /* set vs. clear */ /* Expunge options */ #define EX_UID (long) 0x1 /* argument is a UID sequence */ /* Copy options */ #define CP_UID (long) 0x1 /* argument is a UID sequence */ #define CP_MOVE (long) 0x2 /* delete from source after copying */ /* set debug in any created stream */ #define CP_DEBUG (long) 0x20000000 /* Search/sort/thread options */ #define SE_UID (long) 0x1 /* return UID */ #define SE_FREE (long) 0x2 /* free search program after finished */ #define SE_NOPREFETCH (long) 0x4/* no search prefetching */ #define SO_FREE (long) 0x8 /* free sort program after finished */ #define SE_NOSERVER (long) 0x10 /* don't do server-based search/sort/thread */ #define SE_RETAIN (long) 0x20 /* retain previous search results */ #define SO_OVERVIEW (long) 0x40 /* use overviews in searching (NNTP only) */ #define SE_NEEDBODY (long) 0x80 /* include body structure in prefetch */ #define SE_NOHDRS (long) 0x100 /* suppress prefetching extra headers (note that this breaks news handling) */ #define SE_NOLOCAL (long) 0x200 /* no local retry (IMAP only) */ #define SO_NOSERVER SE_NOSERVER /* compatibility name */ #define SE_SILLYOK (long) 0x400 /* allow silly searches */ /* Status options */ #define SA_MESSAGES (long) 0x1 /* number of messages */ #define SA_RECENT (long) 0x2 /* number of recent messages */ #define SA_UNSEEN (long) 0x4 /* number of unseen messages */ #define SA_UIDNEXT (long) 0x8 /* next UID to be assigned */ /* UID validity value */ #define SA_UIDVALIDITY (long) 0x10 /* set OP_DEBUG on any created stream */ #define SA_DEBUG (long) 0x10000000 /* use multiple newsrcs */ #define SA_MULNEWSRC (long) 0x20000000 /* Mailgets flags */ #define MG_UID (long) 0x1 /* message number is a UID */ #define MG_COPY (long) 0x2 /* must return copy of argument */ /* SASL authenticator categories */ #define AU_SECURE (long) 0x1 /* /secure allowed */ #define AU_AUTHUSER (long) 0x2 /* /authuser=xxx allowed */ /* authenticator hidden */ #define AU_HIDE (long) 0x10000000 /* authenticator disabled */ #define AU_DISABLE (long) 0x20000000 /* Garbage collection flags */ #define GC_ELT (long) 0x1 /* message cache elements */ #define GC_ENV (long) 0x2 /* envelopes and bodies */ #define GC_TEXTS (long) 0x4 /* cached texts */ /* mm_log()/mm_notify() condition codes */ #define WARN (long) 1 /* mm_log warning type */ #define ERROR (long) 2 /* mm_log error type */ #define PARSE (long) 3 /* mm_log parse error type */ #define BYE (long) 4 /* mm_notify stream dying */ #define TCPDEBUG (long) 5 /* mm_log TCP debug babble */ /* Bits from mail_parse_flags(). Don't change these, since the header format * used by tenex, mtx, and mbx corresponds to these bits. */ #define fSEEN 0x1 #define fDELETED 0x2 #define fFLAGGED 0x4 #define fANSWERED 0x8 #define fOLD 0x10 #define fDRAFT 0x20 #define fEXPUNGED 0x8000 /* internal flag */ /* Bits for mm_list() and mm_lsub() */ /* Note that (LATT_NOINFERIORS LATT_HASCHILDREN LATT_HASNOCHILDREN) and * (LATT_NOSELECT LATT_MARKED LATT_UNMARKED) each have eight possible states, * but only four of these are valid. The other four are silly states which * while invalid can unfortunately be expressed in the IMAP protocol. */ /* terminal node in hierarchy */ #define LATT_NOINFERIORS (long) 0x1 /* name can not be selected */ #define LATT_NOSELECT (long) 0x2 /* changed since last accessed */ #define LATT_MARKED (long) 0x4 /* accessed since last changed */ #define LATT_UNMARKED (long) 0x8 /* name has referral to remote mailbox */ #define LATT_REFERRAL (long) 0x10 /* has selectable inferiors */ #define LATT_HASCHILDREN (long) 0x20 /* has no selectable inferiors */ #define LATT_HASNOCHILDREN (long) 0x40 /* Sort functions */ #define SORTDATE 0 /* date */ #define SORTARRIVAL 1 /* arrival date */ #define SORTFROM 2 /* from */ #define SORTSUBJECT 3 /* subject */ #define SORTTO 4 /* to */ #define SORTCC 5 /* cc */ #define SORTSIZE 6 /* size */ /* imapreferral_t codes */ #define REFAUTHFAILED (long) 0 /* authentication referral -- not logged in */ #define REFAUTH (long) 1 /* authentication referral -- logged in */ #define REFSELECT (long) 2 /* select referral */ #define REFCREATE (long) 3 #define REFDELETE (long) 4 #define REFRENAME (long) 5 #define REFSUBSCRIBE (long) 6 #define REFUNSUBSCRIBE (long) 7 #define REFSTATUS (long) 8 #define REFCOPY (long) 9 #define REFAPPEND (long) 10 /* sendcommand_t codes */ /* expunge response deferred */ #define SC_EXPUNGEDEFERRED (long) 1 /* Block notification codes */ #define BLOCK_NONE 0 /* not blocked */ #define BLOCK_SENSITIVE 1 /* sensitive code, disallow alarms */ #define BLOCK_NONSENSITIVE 2 /* non-sensitive code, allow alarms */ #define BLOCK_DNSLOOKUP 10 /* blocked on DNS lookup */ #define BLOCK_TCPOPEN 11 /* blocked on TCP open */ #define BLOCK_TCPREAD 12 /* blocked on TCP read */ #define BLOCK_TCPWRITE 13 /* blocked on TCP write */ #define BLOCK_TCPCLOSE 14 /* blocked on TCP close */ #define BLOCK_FILELOCK 20 /* blocked on file locking */ /* In-memory sized-text */ #define SIZEDTEXT struct mail_sizedtext SIZEDTEXT { unsigned char *data; /* text */ unsigned long size; /* size of text in octets */ }; /* String list */ #define STRINGLIST struct string_list STRINGLIST { SIZEDTEXT text; /* string text */ STRINGLIST *next; }; /* Parse results from mail_valid_net_parse */ #define NETMAXHOST 256 #define NETMAXUSER 65 #define NETMAXMBX (MAILTMPLEN/4) #define NETMAXSRV 21 typedef struct net_mailbox { char host[NETMAXHOST]; /* host name (may be canonicalized) */ char orighost[NETMAXHOST]; /* host name before canonicalization */ char user[NETMAXUSER]; /* user name */ char authuser[NETMAXUSER]; /* authentication user name */ char mailbox[NETMAXMBX]; /* mailbox name */ char service[NETMAXSRV]; /* service name */ unsigned long port; /* TCP port number */ unsigned int anoflag : 1; /* anonymous */ unsigned int dbgflag : 1; /* debug flag */ unsigned int secflag : 1; /* secure flag */ unsigned int sslflag : 1; /* SSL driver flag */ unsigned int trysslflag : 1; /* try SSL driver first flag */ unsigned int novalidate : 1; /* don't validate certificates */ unsigned int tlsflag : 1; /* TLS flag */ unsigned int notlsflag : 1; /* do not do TLS flag */ unsigned int readonlyflag : 1;/* want readonly */ unsigned int norsh : 1; /* don't use rsh/ssh */ unsigned int loser : 1; /* server is a loser */ unsigned int tlssslv23 : 1; /* force SSLv23 client method over TLS */ } NETMBX; /* Item in an address list */ #define ADDRESS struct mail_address ADDRESS { char *personal; /* personal name phrase */ char *adl; /* at-domain-list source route */ char *mailbox; /* mailbox name */ char *host; /* domain name of mailbox's host */ char *error; /* error in address from SMTP module */ struct { char *type; /* address type (default "rfc822") */ char *addr; /* address as xtext */ } orcpt; ADDRESS *next; /* pointer to next address in list */ }; /* Message envelope */ typedef struct mail_envelope { unsigned int incomplete : 1; /* envelope may be incomplete */ unsigned int imapenvonly : 1; /* envelope only has IMAP envelope */ char *remail; /* remail header if any */ ADDRESS *return_path; /* error return address */ unsigned char *date; /* message composition date string */ ADDRESS *from; /* originator address list */ ADDRESS *sender; /* sender address list */ ADDRESS *reply_to; /* reply address list */ char *subject; /* message subject string */ ADDRESS *to; /* primary recipient list */ ADDRESS *cc; /* secondary recipient list */ ADDRESS *bcc; /* blind secondary recipient list */ char *in_reply_to; /* replied message ID */ char *message_id; /* message ID */ char *newsgroups; /* USENET newsgroups */ char *followup_to; /* USENET reply newsgroups */ char *references; /* USENET references */ void *sparep; /* spare pointer reserved for main program */ } ENVELOPE; /* Primary body types */ /* If you change any of these you must also change body_types in rfc822.c */ #define TYPETEXT 0 /* unformatted text */ #define TYPEMULTIPART 1 /* multiple part */ #define TYPEMESSAGE 2 /* encapsulated message */ #define TYPEAPPLICATION 3 /* application data */ #define TYPEAUDIO 4 /* audio */ #define TYPEIMAGE 5 /* static image */ #define TYPEVIDEO 6 /* video */ #define TYPEMODEL 7 /* model */ #define TYPEOTHER 8 /* unknown */ #define TYPEMAX 15 /* maximum type code */ /* Body encodings */ /* If you change any of these you must also change body_encodings in rfc822.c */ #define ENC7BIT 0 /* 7 bit SMTP semantic data */ #define ENC8BIT 1 /* 8 bit SMTP semantic data */ #define ENCBINARY 2 /* 8 bit binary data */ #define ENCBASE64 3 /* base-64 encoded data */ #define ENCQUOTEDPRINTABLE 4 /* human-readable 8-as-7 bit data */ #define ENCOTHER 5 /* unknown */ #define ENCMAX 10 /* maximum encoding code */ /* Body contents */ #define BODY struct mail_bodystruct #define MESSAGE struct mail_body_message #define PARAMETER struct mail_body_parameter #define PART struct mail_body_part #define PARTTEXT struct mail_body_text /* Message body text */ PARTTEXT { unsigned long offset; /* offset from body origin */ SIZEDTEXT text; /* text */ }; /* Message body structure */ BODY { unsigned short type; /* body primary type */ unsigned short encoding; /* body transfer encoding */ char *subtype; /* subtype string */ PARAMETER *parameter; /* parameter list */ char *id; /* body identifier */ char *description; /* body description */ struct { /* body disposition */ char *type; /* disposition type */ PARAMETER *parameter; /* disposition parameters */ } disposition; STRINGLIST *language; /* body language */ char *location; /* body content URI */ PARTTEXT mime; /* MIME header */ PARTTEXT contents; /* body part contents */ union { /* different ways of accessing contents */ PART *part; /* body part list */ MESSAGE *msg; /* body encapsulated message */ } nested; struct { unsigned long lines; /* size of text in lines */ unsigned long bytes; /* size of text in octets */ } size; char *md5; /* MD5 checksum */ void *sparep; /* spare pointer reserved for main program */ }; /* Parameter list */ PARAMETER { char *attribute; /* parameter attribute name */ char *value; /* parameter value */ PARAMETER *next; /* next parameter in list */ }; /* Multipart content list */ PART { BODY body; /* body information for this part */ PART *next; /* next body part */ }; /* RFC-822 Message */ MESSAGE { ENVELOPE *env; /* message envelope */ BODY *body; /* message body */ PARTTEXT full; /* full message */ STRINGLIST *lines; /* lines used to filter header */ PARTTEXT header; /* header text */ PARTTEXT text; /* body text */ }; /* Entry in the message cache array */ typedef struct message_cache { unsigned long msgno; /* message number */ unsigned int lockcount : 8; /* non-zero if multiple references */ unsigned long rfc822_size; /* # of bytes of message as raw RFC822 */ struct { /* c-client internal use only */ unsigned long uid; /* message unique ID */ unsigned long mod; /* modseq */ PARTTEXT special; /* special text pointers */ MESSAGE msg; /* internal message pointers */ union { /* driver internal use */ unsigned long data; void *ptr; } spare; unsigned int sequence : 1; /* saved sequence bit */ unsigned int dirty : 1; /* driver internal use */ unsigned int filter : 1; /* driver internal use */ unsigned int ghost : 1; /* driver internal use */ } private; /* internal date */ unsigned int day : 5; /* day of month (1-31) */ unsigned int month : 4; /* month of year (1-12) */ unsigned int year : 7; /* year since BASEYEAR (expires in 127 yrs) */ unsigned int hours: 5; /* hours (0-23) */ unsigned int minutes: 6; /* minutes (0-59) */ unsigned int seconds: 6; /* seconds (0-59) */ unsigned int zoccident : 1; /* non-zero if west of UTC */ unsigned int zhours : 4; /* hours from UTC (0-12) */ unsigned int zminutes: 6; /* minutes (0-59) */ /* system flags */ unsigned int seen : 1; /* system Seen flag */ unsigned int deleted : 1; /* system Deleted flag */ unsigned int flagged : 1; /* system Flagged flag */ unsigned int answered : 1; /* system Answered flag */ unsigned int draft : 1; /* system Draft flag */ unsigned int recent : 1; /* system Recent flag */ /* message status */ unsigned int valid : 1; /* elt has valid flags */ unsigned int searched : 1; /* message was searched */ unsigned int sequence : 1; /* message is in sequence */ /* reserved for use by main program */ unsigned int spare : 1; /* first spare bit */ unsigned int spare2 : 1; /* second spare bit */ unsigned int spare3 : 1; /* third spare bit */ unsigned int spare4 : 1; /* fourth spare bit */ unsigned int spare5 : 1; /* fifth spare bit */ unsigned int spare6 : 1; /* sixth spare bit */ unsigned int spare7 : 1; /* seventh spare bit */ unsigned int spare8 : 1; /* eighth spare bit */ void *sparep; /* spare pointer */ unsigned long user_flags; /* user-assignable flags */ } MESSAGECACHE; /* String structure */ #define STRINGDRIVER struct string_driver typedef struct mailstring { void *data; /* driver-dependent data */ unsigned long data1; /* driver-dependent data */ unsigned long size; /* total length of string */ char *chunk; /* base address of chunk */ unsigned long chunksize; /* size of chunk */ unsigned long offset; /* offset of this chunk in base */ char *curpos; /* current position in chunk */ unsigned long cursize; /* number of bytes remaining in chunk */ STRINGDRIVER *dtb; /* driver that handles this type of string */ } STRING; /* Dispatch table for string driver */ STRINGDRIVER { /* initialize string driver */ void (*init) (STRING *s,void *data,unsigned long size); /* get next character in string */ char (*next) (STRING *s); /* set position in string */ void (*setpos) (STRING *s,unsigned long i); }; /* Stringstruct access routines */ #define INIT(s,d,data,size) ((*((s)->dtb = &d)->init) (s,data,size)) #define SIZE(s) ((s)->size - GETPOS (s)) #define CHR(s) (*(s)->curpos) #define SNX(s) (--(s)->cursize ? *(s)->curpos++ : (*(s)->dtb->next) (s)) #define GETPOS(s) ((s)->offset + ((s)->curpos - (s)->chunk)) #define SETPOS(s,i) (*(s)->dtb->setpos) (s,i) /* Search program */ #define SEARCHPGM struct search_program #define SEARCHHEADER struct search_header #define SEARCHSET struct search_set #define SEARCHOR struct search_or #define SEARCHPGMLIST struct search_pgm_list SEARCHHEADER { /* header search */ SIZEDTEXT line; /* header line */ SIZEDTEXT text; /* text in header */ SEARCHHEADER *next; /* next in list */ }; SEARCHSET { /* message set */ unsigned long first; /* sequence number */ unsigned long last; /* last value, if a range */ SEARCHSET *next; /* next in list */ }; SEARCHOR { SEARCHPGM *first; /* first program */ SEARCHPGM *second; /* second program */ SEARCHOR *next; /* next in list */ }; SEARCHPGMLIST { SEARCHPGM *pgm; /* search program */ SEARCHPGMLIST *next; /* next in list */ }; SEARCHPGM { /* search program */ SEARCHSET *msgno; /* message numbers */ SEARCHSET *uid; /* unique identifiers */ SEARCHOR *or; /* or'ed in programs */ SEARCHPGMLIST *not; /* and'ed not program */ SEARCHHEADER *header; /* list of headers */ STRINGLIST *bcc; /* bcc recipients */ STRINGLIST *body; /* text in message body */ STRINGLIST *cc; /* cc recipients */ STRINGLIST *from; /* originator */ STRINGLIST *keyword; /* keywords */ STRINGLIST *unkeyword; /* unkeywords */ STRINGLIST *subject; /* text in subject */ STRINGLIST *text; /* text in headers and body */ STRINGLIST *to; /* to recipients */ unsigned long larger; /* larger than this size */ unsigned long smaller; /* smaller than this size */ unsigned long older; /* older than this interval */ unsigned long younger; /* younger than this interval */ unsigned short sentbefore; /* sent before this date */ unsigned short senton; /* sent on this date */ unsigned short sentsince; /* sent since this date */ unsigned short before; /* before this date */ unsigned short on; /* on this date */ unsigned short since; /* since this date */ unsigned int answered : 1; /* answered messages */ unsigned int unanswered : 1; /* unanswered messages */ unsigned int deleted : 1; /* deleted messages */ unsigned int undeleted : 1; /* undeleted messages */ unsigned int draft : 1; /* message draft */ unsigned int undraft : 1; /* message undraft */ unsigned int flagged : 1; /* flagged messages */ unsigned int unflagged : 1; /* unflagged messages */ unsigned int recent : 1; /* recent messages */ unsigned int old : 1; /* old messages */ unsigned int seen : 1; /* seen messages */ unsigned int unseen : 1; /* unseen messages */ /* These must be simulated in IMAP */ STRINGLIST *return_path; /* error return address */ STRINGLIST *sender; /* sender address list */ STRINGLIST *reply_to; /* reply address list */ STRINGLIST *in_reply_to; /* replied message ID */ STRINGLIST *message_id; /* message ID */ STRINGLIST *newsgroups; /* USENET newsgroups */ STRINGLIST *followup_to; /* USENET reply newsgroups */ STRINGLIST *references; /* USENET references */ }; /* Mailbox status */ typedef struct mbx_status { long flags; /* validity flags */ unsigned long messages; /* number of messages */ unsigned long recent; /* number of recent messages */ unsigned long unseen; /* number of unseen messages */ unsigned long uidnext; /* next UID to be assigned */ unsigned long uidvalidity; /* UID validity value */ } MAILSTATUS; /* Sort program */ typedef void (*postsort_t) (void *sc); #define SORTPGM struct sort_program SORTPGM { unsigned int reverse : 1; /* sort function is to be reversed */ unsigned int abort : 1; /* abort sorting */ short function; /* sort function */ unsigned long nmsgs; /* number of messages being sorted */ struct { unsigned long cached; /* number of messages cached so far */ unsigned long sorted; /* number of messages sorted so far */ unsigned long postsorted; /* number of postsorted messages so far */ } progress; postsort_t postsort; /* post sorter */ SORTPGM *next; /* next function */ }; /* Sort cache */ #define SORTCACHE struct sort_cache SORTCACHE { unsigned int sorted : 1; /* message has been sorted */ unsigned int postsorted : 1; /* message has been postsorted */ unsigned int refwd : 1; /* subject is a re or fwd */ unsigned int dirty : 1; /* has data not written to backup */ SORTPGM *pgm; /* sort program */ unsigned long num; /* message number (sequence or UID) */ unsigned long date; /* sent date */ unsigned long arrival; /* arrival date */ unsigned long size; /* message size */ char *from; /* from string */ char *to; /* to string */ char *cc; /* cc string */ char *subject; /* extracted subject string */ char *message_id; /* message-id string */ char *unique; /* unique string, normally message-id */ STRINGLIST *references; /* references string */ }; /* ACL list */ #define ACLLIST struct acl_list ACLLIST { char *identifier; /* authentication identifier */ char *rights; /* access rights */ ACLLIST *next; }; /* Quota resource list */ #define QUOTALIST struct quota_list QUOTALIST { char *name; /* resource name */ unsigned long usage; /* resource usage */ unsigned long limit; /* resource limit */ QUOTALIST *next; /* next resource */ }; /* Mail Access I/O stream */ /* Structure for mail driver dispatch */ #define DRIVER struct driver /* Mail I/O stream */ typedef struct mail_stream { DRIVER *dtb; /* dispatch table for this driver */ void *local; /* pointer to driver local data */ char *mailbox; /* mailbox name (canonicalized) */ char *original_mailbox; /* mailbox name (non-canonicalized) */ unsigned short use; /* stream use count */ unsigned short sequence; /* stream sequence */ unsigned int inbox : 1; /* stream open on an INBOX */ unsigned int lock : 1; /* stream lock flag */ unsigned int debug : 1; /* stream debug flag */ unsigned int silent : 1; /* don't pass events to main program */ unsigned int rdonly : 1; /* stream read-only flag */ unsigned int anonymous : 1; /* stream anonymous access flag */ unsigned int scache : 1; /* stream short cache flag */ unsigned int halfopen : 1; /* stream half-open flag */ unsigned int secure : 1; /* stream secure flag */ unsigned int tryssl : 1; /* stream tryssl flag */ unsigned int mulnewsrc : 1; /* stream use multiple newsrc files */ unsigned int perm_seen : 1; /* permanent Seen flag */ unsigned int perm_deleted : 1;/* permanent Deleted flag */ unsigned int perm_flagged : 1;/* permanent Flagged flag */ unsigned int perm_answered :1;/* permanent Answered flag */ unsigned int perm_draft : 1; /* permanent Draft flag */ unsigned int kwd_create : 1; /* can create new keywords */ unsigned int uid_nosticky : 1;/* UIDs are not preserved */ unsigned int unhealthy : 1; /* unhealthy protocol negotiations */ unsigned int nokod : 1; /* suppress kiss-of-death */ unsigned int sniff : 1; /* metadata only */ unsigned long perm_user_flags;/* mask of permanent user flags */ unsigned long gensym; /* generated tag */ unsigned long nmsgs; /* # of associated msgs */ unsigned long recent; /* # of recent msgs */ unsigned long uid_validity; /* UID validity sequence */ unsigned long uid_last; /* last assigned UID */ char *user_flags[NUSERFLAGS]; /* pointers to user flags in bit order */ unsigned long cachesize; /* size of message cache */ MESSAGECACHE **cache; /* message cache array */ SORTCACHE **sc; /* sort cache array */ unsigned long msgno; /* message number of `current' message */ ENVELOPE *env; /* scratch buffer for envelope */ BODY *body; /* scratch buffer for body */ SIZEDTEXT text; /* scratch buffer for text */ struct { char *name; /* mailbox name to snarf from */ unsigned long time; /* last snarf time */ long options; /* snarf open options */ } snarf; struct { /* internal use only */ struct { /* search temporaries */ STRINGLIST *string; /* string(s) to search */ long result; /* search result */ char *text; /* cache of fetched text */ } search; STRING string; /* stringstruct return hack */ } private; /* reserved for use by main program */ void *sparep; /* spare pointer */ unsigned int spare : 1; /* first spare bit */ unsigned int spare2 : 1; /* second spare bit */ unsigned int spare3 : 1; /* third spare bit */ unsigned int spare4 : 1; /* fourth spare bit */ unsigned int spare5 : 1; /* fifth spare bit */ unsigned int spare6 : 1; /* sixth spare bit */ unsigned int spare7 : 1; /* seventh spare bit */ unsigned int spare8 : 1; /* eighth spare bit */ } MAILSTREAM; /* Mail I/O stream handle */ typedef struct mail_stream_handle { MAILSTREAM *stream; /* pointer to mail stream */ unsigned short sequence; /* sequence of what we expect stream to be */ } MAILHANDLE; /* Message overview */ typedef struct mail_overview { char *subject; /* message subject string */ ADDRESS *from; /* originator address list */ char *date; /* message composition date string */ char *message_id; /* message ID */ char *references; /* USENET references */ struct { /* may be 0 or NUL if unknown/undefined */ unsigned long octets; /* message octets (probably LF-newline form) */ unsigned long lines; /* message lines */ char *xref; /* cross references */ } optional; } OVERVIEW; /* Network access I/O stream */ /* Structure for network driver dispatch */ #define NETDRIVER struct net_driver /* Network transport I/O stream */ typedef struct net_stream { void *stream; /* driver's I/O stream */ NETDRIVER *dtb; /* network driver */ } NETSTREAM; /* Network transport driver dispatch */ NETDRIVER { void *(*open) (char *host,char *service,unsigned long port); void *(*aopen) (NETMBX *mb,char *service,char *usrbuf); char *(*getline) (void *stream); long (*getbuffer) (void *stream,unsigned long size,char *buffer); long (*soutr) (void *stream,char *string); long (*sout) (void *stream,char *string,unsigned long size); void (*close) (void *stream); char *(*host) (void *stream); char *(*remotehost) (void *stream); unsigned long (*port) (void *stream); char *(*localhost) (void *stream); }; /* Mailgets data identifier */ typedef struct getsdata { MAILSTREAM *stream; unsigned long msgno; char *what; STRINGLIST *stl; unsigned long first; unsigned long last; long flags; } GETS_DATA; #define INIT_GETS(md,s,m,w,f,l) \ md.stream = s, md.msgno = m, md.what = w, md.first = f, md.last = l, \ md.stl = NIL, md.flags = NIL; /* Mail delivery I/O stream */ typedef struct send_stream { NETSTREAM *netstream; /* network I/O stream */ char *host; /* SMTP service host */ char *reply; /* last reply string */ long replycode; /* last reply code */ unsigned int debug : 1; /* stream debug flag */ unsigned int sensitive : 1; /* sensitive data in progress */ unsigned int loser : 1; /* server is a loser */ unsigned int saslcancel : 1; /* SASL cancelled by protocol */ union { /* protocol specific */ struct { /* SMTP specific */ unsigned int ok : 1; /* supports ESMTP */ struct { /* service extensions */ unsigned int send : 1; /* supports SEND */ unsigned int soml : 1; /* supports SOML */ unsigned int saml : 1; /* supports SAML */ unsigned int expn : 1; /* supports EXPN */ unsigned int help : 1; /* supports HELP */ unsigned int turn : 1; /* supports TURN */ unsigned int etrn : 1; /* supports ETRN */ unsigned int starttls:1;/* supports STARTTLS */ unsigned int relay : 1; /* supports relaying */ unsigned int pipe : 1; /* supports pipelining */ unsigned int ensc : 1; /* supports enhanced status codes */ unsigned int bmime : 1; /* supports BINARYMIME */ unsigned int chunk : 1; /* supports CHUNKING */ } service; struct { /* 8-bit MIME transport */ unsigned int ok : 1; /* supports 8-bit MIME */ unsigned int want : 1; /* want 8-bit MIME */ } eightbit; struct { /* delivery status notification */ unsigned int ok : 1; /* supports DSN */ unsigned int want : 1; /* want DSN */ struct { /* notification options */ /* notify on failure */ unsigned int failure : 1; /* notify on delay */ unsigned int delay : 1; /* notify on success */ unsigned int success : 1; } notify; unsigned int full : 1; /* return full headers */ char *envid; /* envelope identifier as xtext */ } dsn; struct { /* size declaration */ unsigned int ok : 1; /* supports SIZE */ unsigned long limit; /* maximum size supported */ } size; struct { /* deliverby declaration */ unsigned int ok : 1; /* supports DELIVERBY */ unsigned long minby; /* minimum by-time */ } deliverby; struct { /* authenticated turn */ unsigned int ok : 1; /* supports ATRN */ char *domains; /* domains */ } atrn; /* supported SASL authenticators */ unsigned int auth : MAXAUTHENTICATORS; } esmtp; struct { /* NNTP specific */ unsigned int post : 1; /* supports POST */ struct { /* NNTP extensions */ unsigned int ok : 1; /* supports extensions */ /* supports LISTGROUP */ unsigned int listgroup : 1; unsigned int over : 1; /* supports OVER */ unsigned int hdr : 1; /* supports HDR */ unsigned int pat : 1; /* supports PAT */ /* supports STARTTLS */ unsigned int starttls : 1; /* server has MULTIDOMAIN */ unsigned int multidomain : 1; /* supports AUTHINFO USER */ unsigned int authuser : 1; /* supported authenticators */ unsigned int sasl : MAXAUTHENTICATORS; } ext; } nntp; } protocol; } SENDSTREAM; /* Jacket into external interfaces */ typedef long (*readfn_t) (void *stream,unsigned long size,char *buffer); typedef char *(*mailgets_t) (readfn_t f,void *stream,unsigned long size, GETS_DATA *md); typedef char *(*readprogress_t) (GETS_DATA *md,unsigned long octets); typedef void *(*mailcache_t) (MAILSTREAM *stream,unsigned long msgno,long op); typedef long (*mailproxycopy_t) (MAILSTREAM *stream,char *sequence, char *mailbox,long options); typedef long (*tcptimeout_t) (long overall,long last); typedef void *(*authchallenge_t) (void *stream,unsigned long *len); typedef long (*authrespond_t) (void *stream,char *s,unsigned long size); typedef long (*authcheck_t) (void); typedef long (*authclient_t) (authchallenge_t challenger, authrespond_t responder,char *service,NETMBX *mb, void *s,unsigned long *trial,char *user); typedef char *(*authresponse_t) (void *challenge,unsigned long clen, unsigned long *rlen); typedef char *(*authserver_t) (authresponse_t responder,int argc,char *argv[]); typedef void (*smtpverbose_t) (char *buffer); typedef void (*imapenvelope_t) (MAILSTREAM *stream,unsigned long msgno, ENVELOPE *env); typedef char *(*imapreferral_t) (MAILSTREAM *stream,char *url,long code); typedef void (*overview_t) (MAILSTREAM *stream,unsigned long uid,OVERVIEW *ov, unsigned long msgno); typedef unsigned long *(*sorter_t) (MAILSTREAM *stream,char *charset, SEARCHPGM *spg,SORTPGM *pgm,long flags); typedef void (*parseline_t) (ENVELOPE *env,char *hdr,char *data,char *host); typedef ADDRESS *(*parsephrase_t) (char *phrase,char *end,char *host); typedef void *(*blocknotify_t) (int reason,void *data); typedef long (*kinit_t) (char *host,char *reason); typedef void (*sendcommand_t) (MAILSTREAM *stream,char *cmd,long flags); typedef char *(*newsrcquery_t) (MAILSTREAM *stream,char *mulname,char *name); typedef void (*getacl_t) (MAILSTREAM *stream,char *mailbox,ACLLIST *acl); typedef void (*listrights_t) (MAILSTREAM *stream,char *mailbox,char *id, char *alwaysrights,STRINGLIST *possiblerights); typedef void (*myrights_t) (MAILSTREAM *stream,char *mailbox,char *rights); typedef void (*quota_t) (MAILSTREAM *stream,char *qroot,QUOTALIST *qlist); typedef void (*quotaroot_t) (MAILSTREAM *stream,char *mbx,STRINGLIST *qroot); typedef void (*sortresults_t) (MAILSTREAM *stream,unsigned long *list, unsigned long size); typedef char *(*userprompt_t) (void); typedef long (*append_t) (MAILSTREAM *stream,void *data,char **flags, char **date,STRING **message); typedef void (*copyuid_t) (MAILSTREAM *stream,char *mailbox, unsigned long uidvalidity,SEARCHSET *sourceset, SEARCHSET *destset); typedef void (*appenduid_t) (char *mailbox,unsigned long uidvalidity, SEARCHSET *set); typedef long (*dirfmttest_t) (char *name); typedef long (*scancontents_t) (char *name,char *contents,unsigned long csiz, unsigned long fsiz); typedef void (*freeeltsparep_t) (void **sparep); typedef void (*freeenvelopesparep_t) (void **sparep); typedef void (*freebodysparep_t) (void **sparep); typedef void (*freestreamsparep_t) (void **sparep); typedef void *(*sslstart_t) (void *stream,char *host,unsigned long flags); typedef long (*sslcertificatequery_t) (char *reason,char *host,char *cert); typedef void (*sslfailure_t) (char *host,char *reason,unsigned long flags); typedef void (*logouthook_t) (void *data); typedef char *(*sslclientcert_t) (void); typedef char *(*sslclientkey_t) (void); /* Globals */ extern char *body_types[]; /* defined body type strings */ extern char *body_encodings[]; /* defined body encoding strings */ extern const char *days[]; /* day name strings */ extern const char *months[]; /* month name strings */ /* Threading */ /* Thread node */ #define THREADNODE struct thread_node THREADNODE { unsigned long num; /* message number */ SORTCACHE *sc; /* (internal use) sortcache entry */ THREADNODE *branch; /* branch at this point in tree */ THREADNODE *next; /* next node */ }; typedef void (*threadresults_t) (MAILSTREAM *stream,THREADNODE *tree); /* Thread dispatch */ #define THREADER struct threader_list THREADER { char *name; /* name of threader */ THREADNODE *(*dispatch) (MAILSTREAM *stream,char *charset,SEARCHPGM *spg, long flags,sorter_t sorter); THREADER *next; }; /* Container for references threading */ typedef void ** container_t; /* Namespaces */ #define NAMESPACE struct mail_namespace NAMESPACE { char *name; /* name of this namespace */ int delimiter; /* hierarchy delimiter */ PARAMETER *param; /* namespace parameters */ NAMESPACE *next; /* next namespace */ }; /* Authentication */ #define AUTHENTICATOR struct mail_authenticator AUTHENTICATOR { long flags; /* authenticator flags */ char *name; /* name of this authenticator */ authcheck_t valid; /* authenticator valid on this system */ authclient_t client; /* client function that supports it */ authserver_t server; /* server function that supports it */ AUTHENTICATOR *next; /* next authenticator */ }; /* Mail driver dispatch */ DRIVER { char *name; /* driver name */ unsigned long flags; /* driver flags */ DRIVER *next; /* next driver */ /* mailbox is valid for us */ DRIVER *(*valid) (char *mailbox); /* manipulate driver parameters */ void *(*parameters) (long function,void *value); /* scan mailboxes */ void (*scan) (MAILSTREAM *stream,char *ref,char *pat,char *contents); /* list mailboxes */ void (*list) (MAILSTREAM *stream,char *ref,char *pat); /* list subscribed mailboxes */ void (*lsub) (MAILSTREAM *stream,char *ref,char *pat); /* subscribe to mailbox */ long (*subscribe) (MAILSTREAM *stream,char *mailbox); /* unsubscribe from mailbox */ long (*unsubscribe) (MAILSTREAM *stream,char *mailbox); /* create mailbox */ long (*create) (MAILSTREAM *stream,char *mailbox); /* delete mailbox */ long (*mbxdel) (MAILSTREAM *stream,char *mailbox); /* rename mailbox */ long (*mbxren) (MAILSTREAM *stream,char *old,char *newname); /* status of mailbox */ long (*status) (MAILSTREAM *stream,char *mbx,long flags); /* open mailbox */ MAILSTREAM *(*open) (MAILSTREAM *stream); /* close mailbox */ void (*close) (MAILSTREAM *stream,long options); /* fetch message "fast" attributes */ void (*fast) (MAILSTREAM *stream,char *sequence,long flags); /* fetch message flags */ void (*msgflags) (MAILSTREAM *stream,char *sequence,long flags); /* fetch message overview */ long (*overview) (MAILSTREAM *stream,overview_t ofn); /* fetch message envelopes */ ENVELOPE *(*structure) (MAILSTREAM *stream,unsigned long msgno,BODY **body, long flags); /* return RFC-822 header */ char *(*header) (MAILSTREAM *stream,unsigned long msgno, unsigned long *length,long flags); /* return RFC-822 text */ long (*text) (MAILSTREAM *stream,unsigned long msgno,STRING *bs,long flags); /* load cache */ long (*msgdata) (MAILSTREAM *stream,unsigned long msgno,char *section, unsigned long first,unsigned long last,STRINGLIST *lines, long flags); /* return UID for message */ unsigned long (*uid) (MAILSTREAM *stream,unsigned long msgno); /* return message number from UID */ unsigned long (*msgno) (MAILSTREAM *stream,unsigned long uid); /* modify flags */ void (*flag) (MAILSTREAM *stream,char *sequence,char *flag,long flags); /* per-message modify flags */ void (*flagmsg) (MAILSTREAM *stream,MESSAGECACHE *elt); /* search for message based on criteria */ long (*search) (MAILSTREAM *stream,char *charset,SEARCHPGM *pgm,long flags); /* sort messages */ unsigned long *(*sort) (MAILSTREAM *stream,char *charset,SEARCHPGM *spg, SORTPGM *pgm,long flags); /* thread messages */ THREADNODE *(*thread) (MAILSTREAM *stream,char *type,char *charset, SEARCHPGM *spg,long flag); /* ping mailbox to see if still alive */ long (*ping) (MAILSTREAM *stream); /* check for new messages */ void (*check) (MAILSTREAM *stream); /* expunge deleted messages */ long (*expunge) (MAILSTREAM *stream,char *sequence,long options); /* copy messages to another mailbox */ long (*copy) (MAILSTREAM *stream,char *sequence,char *mailbox,long options); /* append string message to mailbox */ long (*append) (MAILSTREAM *stream,char *mailbox,append_t af,void *data); /* garbage collect stream */ void (*gc) (MAILSTREAM *stream,long gcflags); }; #include "linkage.h" /* Compatibility support names for old interfaces */ #define GET_TRYALTFIRST GET_TRYSSLFIRST #define SET_TRYALTFIRST SET_TRYSSLFIRST #define GET_IMAPTRYALT GET_IMAPTRYSSL #define SET_IMAPTRYALT SET_IMAPTRYSSL #define OP_TRYALT OP_TRYSSL #define altflag sslflag #define mail_close(stream) \ mail_close_full (stream,NIL) #define mail_fetchfast(stream,sequence) \ mail_fetch_fast (stream,sequence,NIL) #define mail_fetchfast_full mail_fetch_fast #define mail_fetchflags(stream,sequence) \ mail_fetch_flags (stream,sequence,NIL) #define mail_fetchflags_full mail_fetch_flags #define mail_fetchenvelope(stream,msgno) \ mail_fetch_structure (stream,msgno,NIL,NIL) #define mail_fetchstructure(stream,msgno,body) \ mail_fetch_structure (stream,msgno,body,NIL) #define mail_fetchstructure_full mail_fetch_structure #define mail_fetchheader(stream,msgno) \ mail_fetch_header (stream,msgno,NIL,NIL,NIL,FT_PEEK) #define mail_fetchheader_full(stream,msgno,lines,len,flags) \ mail_fetch_header (stream,msgno,NIL,lines,len,FT_PEEK | (flags)) #define mail_fetchtext(stream,msgno) \ mail_fetch_text (stream,msgno,NIL,NIL,NIL) #define mail_fetchtext_full(stream,msgno,length,flags) \ mail_fetch_text (stream,msgno,NIL,length,flags) #define mail_fetchbody(stream,msgno,section,length) \ mail_fetch_body (stream,msgno,section,length,NIL) #define mail_fetchbody_full mail_fetch_body #define mail_setflag(stream,sequence,flag) \ mail_flag (stream,sequence,flag,ST_SET) #define mail_setflag_full(stream,sequence,flag,flags) \ mail_flag (stream,sequence,flag,ST_SET | (flags)) #define mail_clearflag(stream,sequence,flag) \ mail_flag (stream,sequence,flag,NIL) #define mail_clearflag_full mail_flag #define mail_search(stream,criteria) \ mail_search_full (stream,NIL,mail_criteria (criteria),SE_FREE); #define mail_expunge(stream) \ mail_expunge_full (stream,NIL,NIL) #define mail_copy(stream,sequence,mailbox) \ mail_copy_full (stream,sequence,mailbox,NIL) #define mail_move(stream,sequence,mailbox) \ mail_copy_full (stream,sequence,mailbox,CP_MOVE) #define mail_append(stream,mailbox,message) \ mail_append_full (stream,mailbox,NIL,NIL,message) /* Interfaces for SVR4 locking brain-damage workaround */ /* Driver dispatching */ #define SAFE_DELETE(dtb,stream,mailbox) (*dtb->mbxdel) (stream,mailbox) #define SAFE_RENAME(dtb,stream,old,newname) (*dtb->mbxren) (stream,old,newname) #define SAFE_STATUS(dtb,stream,mbx,flags) (*dtb->status) (stream,mbx,flags) #define SAFE_COPY(dtb,stream,sequence,mailbox,options) \ (*dtb->copy) (stream,sequence,mailbox,options) #define SAFE_APPEND(dtb,stream,mailbox,af,data) \ (*dtb->append) (stream,mailbox,af,data) #define SAFE_SCAN_CONTENTS(dtb,name,contents,csiz,fsiz) \ scan_contents (dtb,name,contents,csiz,fsiz) /* Driver callbacks */ #define MM_EXISTS mm_exists #define MM_EXPUNGED mm_expunged #define MM_FLAGS mm_flags #define MM_NOTIFY mm_notify #define MM_STATUS mm_status #define MM_LOG mm_log #define MM_CRITICAL mm_critical #define MM_NOCRITICAL mm_nocritical #define MM_DISKERROR mm_diskerror #define MM_FATAL mm_fatal #define MM_APPEND(af) (*af) /* Function prototypes */ void mm_searched (MAILSTREAM *stream,unsigned long number); void mm_exists (MAILSTREAM *stream,unsigned long number); void mm_expunged (MAILSTREAM *stream,unsigned long number); void mm_flags (MAILSTREAM *stream,unsigned long number); void mm_notify (MAILSTREAM *stream,char *string,long errflg); void mm_list (MAILSTREAM *stream,int delimiter,char *name,long attributes); void mm_lsub (MAILSTREAM *stream,int delimiter,char *name,long attributes); void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status); void mm_log (char *string,long errflg); void mm_dlog (char *string); void mm_login (NETMBX *mb,char *user,char *pwd,long trial); void mm_critical (MAILSTREAM *stream); void mm_nocritical (MAILSTREAM *stream); long mm_diskerror (MAILSTREAM *stream,long errcode,long serious); void mm_fatal (char *string); void *mm_cache (MAILSTREAM *stream,unsigned long msgno,long op); extern STRINGDRIVER mail_string; void mail_versioncheck (char *version); void mail_link (DRIVER *driver); void *mail_parameters (MAILSTREAM *stream,long function,void *value); DRIVER *mail_valid (MAILSTREAM *stream,char *mailbox,char *purpose); DRIVER *mail_valid_net (char *name,DRIVER *drv,char *host,char *mailbox); long mail_valid_net_parse (char *name,NETMBX *mb); long mail_valid_net_parse_work (char *name,NETMBX *mb,char *service); void mail_scan (MAILSTREAM *stream,char *ref,char *pat,char *contents); void mail_list (MAILSTREAM *stream,char *ref,char *pat); void mail_lsub (MAILSTREAM *stream,char *ref,char *pat); long mail_subscribe (MAILSTREAM *stream,char *mailbox); long mail_unsubscribe (MAILSTREAM *stream,char *mailbox); long mail_create (MAILSTREAM *stream,char *mailbox); long mail_delete (MAILSTREAM *stream,char *mailbox); long mail_rename (MAILSTREAM *stream,char *old,char *newname); char *mail_utf7_valid (char *mailbox); long mail_status (MAILSTREAM *stream,char *mbx,long flags); long mail_status_default (MAILSTREAM *stream,char *mbx,long flags); MAILSTREAM *mail_open (MAILSTREAM *stream,char *name,long options); MAILSTREAM *mail_open_work (DRIVER *d,MAILSTREAM *stream,char *name, long options); MAILSTREAM *mail_close_full (MAILSTREAM *stream,long options); MAILHANDLE *mail_makehandle (MAILSTREAM *stream); void mail_free_handle (MAILHANDLE **handle); MAILSTREAM *mail_stream (MAILHANDLE *handle); void mail_fetch_fast (MAILSTREAM *stream,char *sequence,long flags); void mail_fetch_flags (MAILSTREAM *stream,char *sequence,long flags); void mail_fetch_overview (MAILSTREAM *stream,char *sequence,overview_t ofn); void mail_fetch_overview_sequence (MAILSTREAM *stream,char *sequence, overview_t ofn); void mail_fetch_overview_default (MAILSTREAM *stream,overview_t ofn); ENVELOPE *mail_fetch_structure (MAILSTREAM *stream,unsigned long msgno, BODY **body,long flags); char *mail_fetch_message (MAILSTREAM *stream,unsigned long msgno, unsigned long *len,long flags); char *mail_fetch_header (MAILSTREAM *stream,unsigned long msgno,char *section, STRINGLIST *lines,unsigned long *len,long flags); char *mail_fetch_text (MAILSTREAM *stream,unsigned long msgno,char *section, unsigned long *len,long flags); char *mail_fetch_mime (MAILSTREAM *stream,unsigned long msgno,char *section, unsigned long *len,long flags); char *mail_fetch_body (MAILSTREAM *stream,unsigned long msgno,char *section, unsigned long *len,long flags); long mail_partial_text (MAILSTREAM *stream,unsigned long msgno,char *section, unsigned long first,unsigned long last,long flags); long mail_partial_body (MAILSTREAM *stream,unsigned long msgno,char *section, unsigned long first,unsigned long last,long flags); char *mail_fetch_text_return (GETS_DATA *md,SIZEDTEXT *t,unsigned long *len); char *mail_fetch_string_return (GETS_DATA *md,STRING *bs,unsigned long i, unsigned long *len,long flags); long mail_read (void *stream,unsigned long size,char *buffer); unsigned long mail_uid (MAILSTREAM *stream,unsigned long msgno); unsigned long mail_msgno (MAILSTREAM *stream,unsigned long uid); void mail_fetchfrom (char *s,MAILSTREAM *stream,unsigned long msgno, long length); void mail_fetchsubject (char *s,MAILSTREAM *stream,unsigned long msgno, long length); MESSAGECACHE *mail_elt (MAILSTREAM *stream,unsigned long msgno); void mail_flag (MAILSTREAM *stream,char *sequence,char *flag,long flags); long mail_search_full (MAILSTREAM *stream,char *charset,SEARCHPGM *pgm, long flags); long mail_search_default (MAILSTREAM *stream,char *charset,SEARCHPGM *pgm, long flags); long mail_ping (MAILSTREAM *stream); void mail_check (MAILSTREAM *stream); long mail_expunge_full (MAILSTREAM *stream,char *sequence,long options); long mail_copy_full (MAILSTREAM *stream,char *sequence,char *mailbox, long options); long mail_append_full (MAILSTREAM *stream,char *mailbox,char *flags,char *date, STRING *message); long mail_append_multiple (MAILSTREAM *stream,char *mailbox,append_t af, void *data); void mail_gc (MAILSTREAM *stream,long gcflags); void mail_gc_msg (MESSAGE *msg,long gcflags); void mail_gc_body (BODY *body); BODY *mail_body (MAILSTREAM *stream,unsigned long msgno, unsigned char *section); char *mail_date (char *string,MESSAGECACHE *elt); char *mail_cdate (char *string,MESSAGECACHE *elt); long mail_parse_date (MESSAGECACHE *elt,unsigned char *string); void mail_exists (MAILSTREAM *stream,unsigned long nmsgs); void mail_recent (MAILSTREAM *stream,unsigned long recent); void mail_expunged (MAILSTREAM *stream,unsigned long msgno); void mail_lock (MAILSTREAM *stream); void mail_unlock (MAILSTREAM *stream); void mail_debug (MAILSTREAM *stream); void mail_nodebug (MAILSTREAM *stream); void mail_dlog (char *string,long flag); long mail_match_lines (STRINGLIST *lines,STRINGLIST *msglines,long flags); unsigned long mail_filter (char *text,unsigned long len,STRINGLIST *lines, long flags); long mail_search_msg (MAILSTREAM *stream,unsigned long msgno,char *section, SEARCHPGM *pgm); long mail_search_header_text (char *s,STRINGLIST *st); long mail_search_header (SIZEDTEXT *hdr,STRINGLIST *st); long mail_search_text (MAILSTREAM *stream,unsigned long msgno,char *section, STRINGLIST *st,long flags); long mail_search_body (MAILSTREAM *stream,unsigned long msgno,BODY *body, char *prefix,unsigned long section,long flags); long mail_search_string (SIZEDTEXT *s,char *charset,STRINGLIST **st); long mail_search_string_work (SIZEDTEXT *s,STRINGLIST **st); long mail_search_keyword (MAILSTREAM *stream,MESSAGECACHE *elt,STRINGLIST *st, long flag); long mail_search_addr (ADDRESS *adr,STRINGLIST *st); char *mail_search_gets (readfn_t f,void *stream,unsigned long size, GETS_DATA *md); SEARCHPGM *mail_criteria (char *criteria); int mail_criteria_date (unsigned short *date,char **r); int mail_criteria_string (STRINGLIST **s,char **r); unsigned short mail_shortdate (unsigned int year,unsigned int month, unsigned int day); SEARCHSET *mail_parse_set (char *s,char **ret); SEARCHSET *mail_append_set (SEARCHSET *set,unsigned long msgno); unsigned long *mail_sort (MAILSTREAM *stream,char *charset,SEARCHPGM *spg, SORTPGM *pgm,long flags); unsigned long *mail_sort_cache (MAILSTREAM *stream,SORTPGM *pgm,SORTCACHE **sc, long flags); unsigned long *mail_sort_msgs (MAILSTREAM *stream,char *charset,SEARCHPGM *spg, SORTPGM *pgm,long flags); SORTCACHE **mail_sort_loadcache (MAILSTREAM *stream,SORTPGM *pgm); unsigned int mail_strip_subject (char *t,char **ret); char *mail_strip_subject_wsp (char *s); char *mail_strip_subject_blob (char *s); int mail_sort_compare (const void *a1,const void *a2); unsigned long mail_longdate (MESSAGECACHE *elt); THREADNODE *mail_thread (MAILSTREAM *stream,char *type,char *charset, SEARCHPGM *spg,long flags); THREADNODE *mail_thread_msgs (MAILSTREAM *stream,char *type,char *charset, SEARCHPGM *spg,long flags,sorter_t sorter); THREADNODE *mail_thread_orderedsubject (MAILSTREAM *stream,char *charset, SEARCHPGM *spg,long flags, sorter_t sorter); THREADNODE *mail_thread_references (MAILSTREAM *stream,char *charset, SEARCHPGM *spg,long flags, sorter_t sorter); void mail_thread_loadcache (MAILSTREAM *stream,unsigned long uid,OVERVIEW *ov, unsigned long msgno); char *mail_thread_parse_msgid (char *s,char **ss); STRINGLIST *mail_thread_parse_references (char *s,long flag); long mail_thread_check_child (container_t mother,container_t daughter); container_t mail_thread_prune_dummy (container_t msg,container_t ane); container_t mail_thread_prune_dummy_work (container_t msg,container_t ane); THREADNODE *mail_thread_c2node (MAILSTREAM *stream,container_t con,long flags); THREADNODE *mail_thread_sort (THREADNODE *thr,THREADNODE **tc); int mail_thread_compare_date (const void *a1,const void *a2); long mail_sequence (MAILSTREAM *stream,unsigned char *sequence); long mail_uid_sequence (MAILSTREAM *stream,unsigned char *sequence); long mail_parse_flags (MAILSTREAM *stream,char *flag,unsigned long *uf); long mail_usable_network_stream (MAILSTREAM *stream,char *name); MESSAGECACHE *mail_new_cache_elt (unsigned long msgno); ENVELOPE *mail_newenvelope (void); ADDRESS *mail_newaddr (void); BODY *mail_newbody (void); BODY *mail_initbody (BODY *body); PARAMETER *mail_newbody_parameter (void); PART *mail_newbody_part (void); MESSAGE *mail_newmsg (void); STRINGLIST *mail_newstringlist (void); SEARCHPGM *mail_newsearchpgm (void); SEARCHHEADER *mail_newsearchheader (char *line,char *text); SEARCHSET *mail_newsearchset (void); SEARCHOR *mail_newsearchor (void); SEARCHPGMLIST *mail_newsearchpgmlist (void); SORTPGM *mail_newsortpgm (void); THREADNODE *mail_newthreadnode (SORTCACHE *sc); ACLLIST *mail_newacllist (void); QUOTALIST *mail_newquotalist (void); void mail_free_body (BODY **body); void mail_free_body_data (BODY *body); void mail_free_body_parameter (PARAMETER **parameter); void mail_free_body_part (PART **part); void mail_free_cache (MAILSTREAM *stream); void mail_free_elt (MESSAGECACHE **elt); void mail_free_envelope (ENVELOPE **env); void mail_free_address (ADDRESS **address); void mail_free_stringlist (STRINGLIST **string); void mail_free_searchpgm (SEARCHPGM **pgm); void mail_free_searchheader (SEARCHHEADER **hdr); void mail_free_searchset (SEARCHSET **set); void mail_free_searchor (SEARCHOR **orl); void mail_free_searchpgmlist (SEARCHPGMLIST **pgl); void mail_free_namespace (NAMESPACE **n); void mail_free_sortpgm (SORTPGM **pgm); void mail_free_threadnode (THREADNODE **thr); void mail_free_acllist (ACLLIST **al); void mail_free_quotalist (QUOTALIST **ql); void auth_link (AUTHENTICATOR *auth); char *mail_auth (char *mechanism,authresponse_t resp,int argc,char *argv[]); AUTHENTICATOR *mail_lookup_auth (unsigned long i); unsigned int mail_lookup_auth_name (char *mechanism,long flags); NETSTREAM *net_open (NETMBX *mb,NETDRIVER *dv,unsigned long port, NETDRIVER *ssld,char *ssls,unsigned long sslp); NETSTREAM *net_open_work (NETDRIVER *dv,char *host,char *service, unsigned long port,unsigned long portoverride, unsigned long flags); NETSTREAM *net_aopen (NETDRIVER *dv,NETMBX *mb,char *service,char *usrbuf); char *net_getline (NETSTREAM *stream); /* stream must be void* for use as readfn_t */ long net_getbuffer (void *stream,unsigned long size,char *buffer); long net_soutr (NETSTREAM *stream,char *string); long net_sout (NETSTREAM *stream,char *string,unsigned long size); void net_close (NETSTREAM *stream); char *net_host (NETSTREAM *stream); char *net_remotehost (NETSTREAM *stream); unsigned long net_port (NETSTREAM *stream); char *net_localhost (NETSTREAM *stream); long sm_subscribe (char *mailbox); long sm_unsubscribe (char *mailbox); char *sm_read (void **sdb); void ssl_onceonlyinit (void); char *ssl_start_tls (char *s); void ssl_server_init (char *server); /* Server I/O functions */ int PBIN (void); char *PSIN (char *s,int n); long PSINR (char *s,unsigned long n); int PBOUT (int c); long INWAIT (long seconds); int PSOUT (char *s); int PSOUTR (SIZEDTEXT *s); int PFLUSH (void); os_solo.h000064400000003635152345746370006421 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Solaris 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: 1 August 1988 * Last Edited: 20 December 2006 */ #include #include #include #include #include #include #include #include #include #include #include /* Many versions of SysV get this wrong */ #define setpgrp(a,b) Setpgrp(a,b) int Setpgrp (int pid,int gid); /* Different names, equivalent things in BSD and SysV */ /* L_SET is defined for some strange reason in on SVR4. */ #ifndef L_SET #define L_SET SEEK_SET #endif #ifndef L_INCR #define L_INCR SEEK_CUR #endif #ifndef L_XTND #define L_XTND SEEK_END #endif #define direct dirent #define random lrand48 #define scandir Scandir #define alphasort Alphasort #define utime portable_utime int portable_utime (char *file,time_t timep[2]); long gethostid (void); 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); int alphasort (void *d1,void *d2); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" smtp.h000064400000004752152345746370005730 0ustar00/* ======================================================================== * Copyright 1988-2007 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Simple Mail Transfer Protocol (SMTP) 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: 27 July 1988 * Last Edited: 15 August 2007 * * This original version of this file is * Copyright 1988 Stanford University * and was developed in the Symbolic Systems Resources Group of the Knowledge * Systems Laboratory at Stanford University in 1987-88, and was funded by the * Biomedical Research Technology Program of the NationalInstitutes of Health * under grant number RR-00785. */ /* Constants (should be in smtp.c) */ #define SMTPTCPPORT (long) 25 /* assigned TCP contact port */ #define SUBMITTCPPORT (long) 587/* assigned TCP contact port */ /* SMTP open options * For compatibility with the past, SOP_DEBUG must always be 1. */ #define SOP_DEBUG (long) 1 /* debug protocol negotiations */ #define SOP_DSN (long) 2 /* DSN requested */ /* DSN notification, none set mean NEVER */ #define SOP_DSN_NOTIFY_FAILURE (long) 4 #define SOP_DSN_NOTIFY_DELAY (long) 8 #define SOP_DSN_NOTIFY_SUCCESS (long) 16 /* DSN return full msg vs. header */ #define SOP_DSN_RETURN_FULL (long) 32 #define SOP_8BITMIME (long) 64 /* 8-bit MIME requested */ #define SOP_SECURE (long) 256 /* don't do non-secure authentication */ #define SOP_TRYSSL (long) 512 /* try SSL first */ #define SOP_TRYALT SOP_TRYSSL /* old name */ /* reserved for application use */ #define SOP_RESERVED (unsigned long) 0xff000000 /* Compatibility support names */ #define smtp_open(hostlist,options) \ smtp_open_full (NIL,hostlist,"smtp",NIL,options) /* Function prototypes */ void *smtp_parameters (long function,void *value); SENDSTREAM *smtp_open_full (NETDRIVER *dv,char **hostlist,char *service, unsigned long port,long options); SENDSTREAM *smtp_close (SENDSTREAM *stream); long smtp_mail (SENDSTREAM *stream,char *type,ENVELOPE *msg,BODY *body); long smtp_verbose (SENDSTREAM *stream); os_d-g.h000064400000002543152345746370006111 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- D-G 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: 1 August 1988 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include /* for struct tm */ #include #define _USEC_UTIME_FLAVOR /* break it for compatibility with */ #include /* the incompatible past */ #include #include /* D-G gets this wrong */ #define setpgrp setpgrp2 #define utime portable_utime int portable_utime (char *file,time_t timep[2]); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" flstring.h000064400000001437152345746370006572 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: File string 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: 15 April 1997 * Last Edited: 30 August 2006 */ extern STRINGDRIVER file_string; os_s40.h000064400000001675152345746370006055 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- SUN-OS 4.0 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: 11 May 1989 * Last Edited: 30 August 2006 */ void *malloc (size_t byteSize); void free (void *ptr); void *realloc (void *oldptr,size_t newsize); #include "os_sun.h" /* now use regular SUN-OS file */ c-client.h000064400000003227152345746370006437 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: c-client master include for application programs * * 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: 19 May 2000 * Last Edited: 6 December 2006 */ #ifndef __CCLIENT_H /* nobody should include this twice... */ #define __CCLIENT_H #ifdef __cplusplus /* help out people who use C++ compilers */ extern "C" { /* If you use gcc, you may also have to use -fno-operator-names */ #define private cclientPrivate /* private to c-client */ #define and cclientAnd /* C99 doesn't realize that ISO 646 is dead */ #define or cclientOr #define not cclientNot #endif #include "mail.h" /* primary interfaces */ #include "osdep.h" /* OS-dependent routines */ #include "rfc822.h" /* RFC822 and MIME routines */ #include "smtp.h" /* SMTP sending routines */ #include "nntp.h" /* NNTP sending routines */ #include "utf8.h" /* Unicode and charset routines */ #include "utf8aux.h" /* Unicode auxillary routines */ #include "misc.h" /* miscellaneous utility routines */ #ifdef __cplusplus /* undo the C++ mischief */ #undef private } #endif #endif os_pyr.h000064400000002661152345746370006255 0ustar00/* ======================================================================== * Copyright 1988-2007 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Pyramid OSx 4.4c 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: 11 May 1989 * Last Edited: 30 January 2007 */ #include #include #include #include #include #include char *strtok (char *s,char *ct); char *strtok_r (char *s,char *ct,char **r); char *strstr (char *cs,char *ct); char *strpbrk (char *cs,char *ct); char *strerror (int n); void *memmove (void *s,void *ct,size_t n); void *memset (void *s,int c,size_t n); void *malloc (size_t byteSize); void free (void *ptr); void *realloc (void *oldptr,size_t newsize); int errno; #define memcpy memmove #define strchr index #define strrchr rindex #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" os_mnt.h000064400000002265152345746370006241 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Mint 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: 30 August 2006 */ #include #include #include #include #include #include #include #include #include #include #define EAGAIN EWOULDBLOCK #define FNDELAY O_NDELAY /* MiNT gets this wrong */ #define setpgrp setpgid #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" os_bsd.h000064400000002517152345746370006213 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- 4.3BSD 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: 11 May 1989 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include /* needed for htons() prototypes */ char *getenv (char *name); char *strstr (char *cs,char *ct); char *strerror (int n); void *memmove (void *s,void *ct,size_t n); unsigned long strtoul (char *s,char **endp,int base); void *malloc (size_t byteSize); void free (void *ptr); void *realloc (void *oldptr,size_t newsize); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" newsrc.h000064400000002716152345746370006244 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Newsrc manipulation 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: 12 September 1994 * Last Edited: 30 August 2006 */ /* Function prototypes */ long newsrc_error (char *fmt,char *text,long errflg); long newsrc_write_error (char *name,FILE *f1,FILE *f2); FILE *newsrc_create (MAILSTREAM *stream,int notify); long newsrc_newstate (FILE *f,char *group,char state,char *nl); long newsrc_newmessages (FILE *f,MAILSTREAM *stream,char *nl); void newsrc_lsub (MAILSTREAM *stream,char *pattern); long newsrc_update (MAILSTREAM *stream,char *group,char state); long newsrc_read (char *group,MAILSTREAM *stream); long newsrc_write (char *group,MAILSTREAM *stream); char *newsrc_state (MAILSTREAM *stream,char *group); void newsrc_check_uid (unsigned char *state,unsigned long uid, unsigned long *recent,unsigned long *unseen); os_lnx.h000064400000002711152345746370006240 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Linux 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: 30 August 2006 */ /* *** These lines are claimed to be necessary to build on Debian Linux on an *** Alpha. */ #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE 1 #endif /* _XOPEN_SOURCE */ #ifndef _BSD_SOURCE #define _BSD_SOURCE 1 #endif /* _BSD_SOURCE */ /* end Debian Linux on Alpha strangeness */ #include #include #include #include #include #include /* for struct tm */ #include #include #include /* Linux gets this wrong */ #define setpgrp setpgid #define direct dirent #define flock safe_flock #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" pseudo.h000064400000001506152345746370006236 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Pseudo Header Strings * * 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: 26 September 1996 * Last Edited: 30 August 2006 */ extern char *pseudo_from,*pseudo_name,*pseudo_subject,*pseudo_msg; os_mct.h000064400000002057152345746370006225 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- MachTen 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: 1 August 1988 * Last Edited: 7 December 2006 */ #include #include #include #include #include #include #include #include #define unix 1 #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" os_sc5.h000064400000003341152345746370006131 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- SCO Unix 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: 1 August 1988 * Last Edited: 20 December 2006 */ #include #include #include #include #include #include #include #include #include #include #include #include /* SCO gets this wrong */ #define setpgrp Setpgrp int Setpgrp (int pid,int gid); #define rename Rename /* Different names, equivalent things in BSD and SysV */ #define L_SET SEEK_SET #define L_INCR SEEK_CUR #define L_XTND SEEK_END #define direct dirent #define utime portable_utime int portable_utime (char *file,time_t timep[2]); long gethostid (void); typedef int (*select_t) (struct direct *name); typedef int (*compar_t) (void *d1,void *d2); int scandir (char *dirname,struct direct ***namelist,select_t select, compar_t compar); int alphasort (void *d1,void *d2); int fsync (int fd); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_aos.h000064400000002414152345746370006221 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- AOS 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: 11 May 1989 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include char *getenv (char *name); char *strstr (char *cs,char *ct); char *strerror (int n); void *memmove (void *s,void *ct,size_t n); unsigned long strtoul (char *s,char **endp,int base); void *malloc (size_t byteSize); void free (void *ptr); void *realloc (void *oldptr,size_t newsize); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" linkage.c000064400000002321152345746370006340 0ustar00 mail_link (&mboxdriver); /* link in the mbox driver */ mail_link (&imapdriver); /* link in the imap driver */ mail_link (&nntpdriver); /* link in the nntp driver */ mail_link (&pop3driver); /* link in the pop3 driver */ mail_link (&mixdriver); /* link in the mix driver */ mail_link (&mxdriver); /* link in the mx driver */ mail_link (&mbxdriver); /* link in the mbx driver */ mail_link (&tenexdriver); /* link in the tenex driver */ mail_link (&mtxdriver); /* link in the mtx driver */ mail_link (&mhdriver); /* link in the mh driver */ mail_link (&mmdfdriver); /* link in the mmdf driver */ mail_link (&unixdriver); /* link in the unix driver */ mail_link (&newsdriver); /* link in the news driver */ mail_link (&philedriver); /* link in the phile driver */ mail_link (&dummydriver); /* link in the dummy driver */ auth_link (&auth_gss); /* link in the gss authenticator */ auth_link (&auth_ext); /* link in the ext authenticator */ auth_link (&auth_md5); /* link in the md5 authenticator */ auth_link (&auth_pla); /* link in the pla authenticator */ auth_link (&auth_log); /* link in the log authenticator */ mail_versioncheck (CCLIENTVERSION); ssl_onceonlyinit (); os_bsi.h000064400000002043152345746370006212 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- BSDI BSD/386 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: 5 March 1993 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include #include #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" env.h000064400000002743152345746370005533 0ustar00/* ======================================================================== * Copyright 1988-2008 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Environment routines * * Author: Mark Crispin * UW Technology * University of Washington * Seattle, WA 98195 * Internet: MRC@Washington.EDU * * Date: 1 August 1988 * Last Edited: 13 February 2008 */ /* Function prototypes */ long pmatch_full (unsigned char *s,unsigned char *pat,unsigned char delim); long dmatch (unsigned char *s,unsigned char *pat,unsigned char delim); void *env_parameters (long function,void *value); void rfc822_date (char *date); void rfc822_timezone (char *s,void *t); void internal_date (char *date); long server_input_wait (long seconds); void server_init (char *server,char *service,char *sasl, void *clkint,void *kodint,void *hupint,void *trmint, void *staint); long server_login (char *user,char *pass,char *authuser,int argc,char *argv[]); long authserver_login (char *user,char *authuser,int argc,char *argv[]); long anonymous_login (int argc,char *argv[]); char *mylocalhost (void); char *myhomedir (void); char *mailboxfile (char *dst,char *name); MAILSTREAM *default_proto (long type); os_soln.h000064400000003675152345746370006424 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Solaris 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: 1 August 1988 * Last Edited: 20 December 2006 */ #include #include #include #include #include #include #include #include #include #include #include /* Many versions of SysV get this wrong */ #define setpgrp(a,b) Setpgrp(a,b) int Setpgrp (int pid,int gid); /* Different names, equivalent things in BSD and SysV */ /* L_SET is defined for some strange reason in on SVR4. */ #ifndef L_SET #define L_SET SEEK_SET #endif #ifndef L_INCR #define L_INCR SEEK_CUR #endif #ifndef L_XTND #define L_XTND SEEK_END #endif #define direct dirent #define random lrand48 #define scandir Scandir #define alphasort Alphasort #define getpass getpassphrase #define utime portable_utime int portable_utime (char *file,time_t timep[2]); long gethostid (void); 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); int alphasort (void *d1,void *d2); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_sv4.h000064400000003456152345746370006162 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- SVR4 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 April 1992 * Last Edited: 20 December 2006 */ #include #include #include #include #include #include #include #include #include #include #include /* Many versions of SysV get this wrong */ #define setpgrp(a,b) Setpgrp(a,b) int Setpgrp (int pid,int gid); /* Different names, equivalent things in BSD and SysV */ /* L_SET is defined for some strange reason in on SVR4. */ #ifndef L_SET #define L_SET SEEK_SET #endif #define L_INCR SEEK_CUR #define L_XTND SEEK_END #define direct dirent #define random lrand48 #define utime portable_utime int portable_utime (char *file,time_t timep[2]); long gethostid (void); typedef int (*select_t) (struct direct *name); typedef int (*compar_t) (void *d1,void *d2); int scandir (char *dirname,struct direct ***namelist,select_t select, compar_t compar); int alphasort (void *d1,void *d2); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" imap4r1.h000064400000020012152345746370006205 0ustar00/* ======================================================================== * Copyright 1988-2007 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Interactive Mail Access Protocol 4rev1 (IMAP4R1) 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: 14 October 1988 * Last Edited: 5 September 2007 */ /* This include file is provided for applications which need to look under * the covers at the IMAP driver and in particular want to do different * operations depending upon the IMAP server's protocol level and * capabilities. It is NOT included in the normal c-client.h application * export, and most applications do NOT need the definitions in this file. * * As of October 15, 2003, it is believed that: * * Version RFC Status Known Implementations * ------- --- ------ --------------------- * IMAP1 none extinct experimental TOPS-20 server * IMAP2 1064 extinct old TOPS-20, SUMEX servers * IMAP2 1176 rare TOPS-20, old UW servers * IMAP2bis expired I-D uncommon old UW, Cyrus servers * IMAP3 1203 extinct none (never implemented) * IMAP4 1730 rare old UW, Cyrus, Netscape servers * IMAP4rev1 2060, 3501 ubiquitous UW, Cyrus, and many others * * Most client implementations will only interoperate with an IMAP4rev1 * server. c-client based client implementations can interoperate with IMAP2, * IMAP2bis, IMAP4, and IMAP4rev1 servers, but only if they are very careful. * * The LEVELxxx() macros in this file enable the client to determine the * server protocol level and capabilities. This file also contains a few * backdoor calls into the IMAP driver. */ /* Server protocol level and capabilities */ typedef struct imap_cap { unsigned int rfc1176 : 1; /* server is RFC-1176 IMAP2 */ unsigned int imap2bis : 1; /* server is IMAP2bis */ unsigned int imap4 : 1; /* server is IMAP4 (RFC 1730) */ unsigned int imap4rev1 : 1; /* server is IMAP4rev1 */ unsigned int acl : 1; /* server has ACL (RFC 2086) */ unsigned int quota : 1; /* server has QUOTA (RFC 2087) */ unsigned int litplus : 1; /* server has LITERAL+ (RFC 2088) */ unsigned int idle : 1; /* server has IDLE (RFC 2177) */ unsigned int mbx_ref : 1; /* server has mailbox referrals (RFC 2193) */ unsigned int log_ref : 1; /* server has login referrals (RFC 2221) */ unsigned int authanon : 1; /* server has anonymous SASL (RFC 2245) */ unsigned int namespace :1; /* server has NAMESPACE (RFC 2342) */ unsigned int uidplus : 1; /* server has UIDPLUS (RFC 2359) */ unsigned int starttls : 1; /* server has STARTTLS (RFC 2595) */ /* server disallows LOGIN command (RFC 2595) */ unsigned int logindisabled : 1; unsigned int id : 1; /* server has ID (RFC 2971) */ unsigned int children : 1; /* server has CHILDREN (RFC 3348) */ unsigned int multiappend : 1; /* server has multi-APPEND (RFC 3502) ;*/ unsigned int binary : 1; /* server has BINARY (RFC 3516) */ unsigned int unselect : 1; /* server has UNSELECT */ unsigned int sasl_ir : 1; /* server has SASL-IR initial response */ unsigned int sort : 1; /* server has SORT */ unsigned int scan : 1; /* server has SCAN */ unsigned int urlauth : 1; /* server has URLAUTH (RFC 4467) */ unsigned int catenate : 1; /* server has CATENATE (RFC 4469) */ unsigned int condstore : 1; /* server has CONDSTORE (RFC 4551) */ unsigned int esearch : 1; /* server has ESEARCH (RFC 4731) */ unsigned int within : 1; /* server has WITHIN (RFC 5032) */ unsigned int extlevel; /* extension data level supported by server */ /* supported authenticators */ unsigned int auth : MAXAUTHENTICATORS; THREADER *threader; /* list of threaders */ } IMAPCAP; /* IMAP4rev1 level or better */ #define LEVELIMAP4rev1(stream) imap_cap (stream)->imap4rev1 #define LEVELSTATUS LEVELIMAP4rev1 /* IMAP4 level or better (not including RFC 1730 design mistakes) */ #define LEVELIMAP4(stream) (imap_cap (stream)->imap4rev1 || \ imap_cap (stream)->imap4) /* IMAP4 RFC-1730 level */ #define LEVEL1730(stream) imap_cap (stream)->imap4 /* IMAP2bis level or better */ #define LEVELIMAP2bis(stream) imap_cap (stream)->imap2bis /* IMAP2 RFC-1176 level or better */ #define LEVEL1176(stream) imap_cap (stream)->rfc1176 /* IMAP2 RFC-1064 or better */ #define LEVEL1064(stream) 1 /* Has ACL extension */ #define LEVELACL(stream) imap_cap (stream)->acl /* Has QUOTA extension */ #define LEVELQUOTA(stream) imap_cap (stream)->quota /* Has LITERALPLUS extension */ #define LEVELLITERALPLUS(stream) imap_cap (stream)->litplus /* Has IDLE extension */ #define LEVELIDLE(stream) imap_cap (stream)->idle /* Has mailbox referrals */ #define LEVELMBX_REF(stream) imap_cap (stream)->mbx_ref /* Has login referrals */ #define LEVELLOG_REF(stream) imap_cap (stream)->log_ref /* Has AUTH=ANONYMOUS extension */ #define LEVELANONYMOUS(stream) imap_cap (stream)->authanon /* Has NAMESPACE extension */ #define LEVELNAMESPACE(stream) imap_cap (stream)->namespace /* Has UIDPLUS extension */ #define LEVELUIDPLUS(stream) imap_cap (stream)->uidplus /* Has STARTTLS extension */ #define LEVELSTARTTLS(stream) imap_cap (stream)->starttls /* Has LOGINDISABLED extension */ #define LEVELLOGINDISABLED(stream) imap_cap (stream)->logindisabled /* Has ID extension */ #define LEVELID(stream) imap_cap (stream)->id /* Has CHILDREN extension */ #define LEVELCHILDREN(stream) imap_cap (stream)->children /* Has MULTIAPPEND extension */ #define LEVELMULTIAPPEND(stream) imap_cap (stream)->multiappend /* Has BINARY extension */ #define LEVELBINARY(stream) imap_cap (stream)->binary /* Has UNSELECT extension */ #define LEVELUNSELECT(stream) imap_cap (stream)->unselect /* Has SASL initial response extension */ #define LEVELSASLIR(stream) imap_cap (stream)->sasl_ir /* Has SORT extension */ #define LEVELSORT(stream) imap_cap (stream)->sort /* Has at least one THREAD extension */ #define LEVELTHREAD(stream) ((imap_cap (stream)->threader) ? T : NIL) /* Has SCAN extension */ #define LEVELSCAN(stream) imap_cap (stream)->scan /* Has URLAUTH extension */ #define LEVELURLAUTH(stream) imap_cap (stream)->urlauth /* Has CATENATE extension */ #define LEVELCATENATE(stream) imap_cap (stream)->catenate /* Has CONDSTORE extension */ #define LEVELCONDSTORE(stream) imap_cap (stream)->condstore /* Has ESEARCH extension */ #define LEVELESEARCH(stream) imap_cap (stream)->esearch /* Has WITHIN extension */ #define LEVELWITHIN(stream) imap_cap (stream)->within /* Body structure extension levels */ /* These are in BODYSTRUCTURE order. Note that multipart bodies do not have * body-fld-md5. This is alright, since all subsequent body structure * extensions are in both singlepart and multipart bodies. If that ever * changes, this will have to be split. */ #define BODYEXTMD5 1 /* body-fld-md5 */ #define BODYEXTDSP 2 /* body-fld-dsp */ #define BODYEXTLANG 3 /* body-fld-lang */ #define BODYEXTLOC 4 /* body-fld-loc */ /* Function prototypes */ IMAPCAP *imap_cap (MAILSTREAM *stream); char *imap_host (MAILSTREAM *stream); long imap_cache (MAILSTREAM *stream,unsigned long msgno,char *seg, STRINGLIST *stl,SIZEDTEXT *text); /* Temporary */ long imap_setacl (MAILSTREAM *stream,char *mailbox,char *id,char *rights); long imap_deleteacl (MAILSTREAM *stream,char *mailbox,char *id); long imap_getacl (MAILSTREAM *stream,char *mailbox); long imap_listrights (MAILSTREAM *stream,char *mailbox,char *id); long imap_myrights (MAILSTREAM *stream,char *mailbox); long imap_setquota (MAILSTREAM *stream,char *qroot,STRINGLIST *limits); long imap_getquota (MAILSTREAM *stream,char *qroot); long imap_getquotaroot (MAILSTREAM *stream,char *mailbox); os_sos.h000064400000002257152345746370006250 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- OSF/Digital UNIX/Tru64 * * 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: 30 August 2006 */ #include #include #include #include #include #include /* for struct tm */ #include #include #include /* OSF/1 gets this wrong */ #define setpgrp setpgid #define direct dirent #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" unix.h000064400000015067152345746370005731 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: UNIX mail 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: 20 December 1989 * Last Edited: 30 August 2006 */ /* DEDICATION * * This file is dedicated to my dog, Unix, also known as Yun-chan and * Unix J. Terwilliker Jehosophat Aloysius Monstrosity Animal Beast. Unix * passed away at the age of 11 1/2 on September 14, 1996, 12:18 PM PDT, after * a two-month bout with cirrhosis of the liver. * * He was a dear friend, and I miss him terribly. * * Lift a leg, Yunie. Luv ya forever!!!! */ /* Validate line * Accepts: pointer to candidate string to validate as a From header * return pointer to end of date/time field * return pointer to offset from t of time (hours of ``mmm dd hh:mm'') * return pointer to offset from t of time zone (if non-zero) * Returns: t,ti,zn set if valid From string, else ti is NIL */ #define VALID(s,x,ti,zn) { \ ti = 0; \ if ((*s == 'F') && (s[1] == 'r') && (s[2] == 'o') && (s[3] == 'm') && \ (s[4] == ' ')) { \ for (x = s + 5; *x && *x != '\012'; x++); \ if (*x) { \ if (x[-1] == '\015') --x; \ if (x - s >= 41) { \ for (zn = -1; x[zn] != ' '; zn--); \ if ((x[zn-1] == 'm') && (x[zn-2] == 'o') && (x[zn-3] == 'r') && \ (x[zn-4] == 'f') && (x[zn-5] == ' ') && (x[zn-6] == 'e') && \ (x[zn-7] == 't') && (x[zn-8] == 'o') && (x[zn-9] == 'm') && \ (x[zn-10] == 'e') && (x[zn-11] == 'r') && (x[zn-12] == ' '))\ x += zn - 12; \ } \ if (x - s >= 27) { \ if (x[-5] == ' ') { \ if (x[-8] == ':') zn = 0,ti = -5; \ else if (x[-9] == ' ') ti = zn = -9; \ else if ((x[-11] == ' ') && ((x[-10]=='+') || (x[-10]=='-'))) \ ti = zn = -11; \ } \ else if (x[-4] == ' ') { \ if (x[-9] == ' ') zn = -4,ti = -9; \ } \ else if (x[-6] == ' ') { \ if ((x[-11] == ' ') && ((x[-5] == '+') || (x[-5] == '-'))) \ zn = -6,ti = -11; \ } \ if (ti && !((x[ti - 3] == ':') && \ (x[ti -= ((x[ti - 6] == ':') ? 9 : 6)] == ' ') && \ (x[ti - 3] == ' ') && (x[ti - 7] == ' ') && \ (x[ti - 11] == ' '))) ti = 0; \ } \ } \ } \ } /* You are not expected to understand this macro, but read the next page if * you are not faint of heart. * * Known formats to the VALID macro are: * From user Wed Dec 2 05:53 1992 * BSD From user Wed Dec 2 05:53:22 1992 * SysV From user Wed Dec 2 05:53 PST 1992 * rn From user Wed Dec 2 05:53:22 PST 1992 * From user Wed Dec 2 05:53 -0700 1992 * emacs From user Wed Dec 2 05:53:22 -0700 1992 * From user Wed Dec 2 05:53 1992 PST * From user Wed Dec 2 05:53:22 1992 PST * From user Wed Dec 2 05:53 1992 -0700 * Solaris From user Wed Dec 2 05:53:22 1992 -0700 * * Plus all of the above with `` remote from xxx'' after it. Thank you very * much, smail and Solaris, for making my life considerably more complicated. */ /* * What? You want to understand the VALID macro anyway? Alright, since you * insist. Actually, it isn't really all that difficult, provided that you * take it step by step. * * Line 1 Initializes the return ti value to failure (0); * Lines 2-3 Validates that the 1st-5th characters are ``From ''. * Lines 4-6 Validates that there is an end of line and points x at it. * Lines 7-14 First checks to see if the line is at least 41 characters long. * If so, it scans backwards to find the rightmost space. From * that point, it scans backwards to see if the string matches * `` remote from''. If so, it sets x to point to the space at * the start of the string. * Line 15 Makes sure that there are at least 27 characters in the line. * Lines 16-21 Checks if the date/time ends with the year (there is a space * five characters back). If there is a colon three characters * further back, there is no timezone field, so zn is set to 0 * and ti is set in front of the year. Otherwise, there must * either to be a space four characters back for a three-letter * timezone, or a space six characters back followed by a + or - * for a numeric timezone; in either case, zn and ti become the * offset of the space immediately before it. * Lines 22-24 Are the failure case for line 14. If there is a space four * characters back, it is a three-letter timezone; there must be a * space for the year nine characters back. zn is the zone * offset; ti is the offset of the space. * Lines 25-28 Are the failure case for line 20. If there is a space six * characters back, it is a numeric timezone; there must be a * space eleven characters back and a + or - five characters back. * zn is the zone offset; ti is the offset of the space. * Line 29-32 If ti is valid, make sure that the string before ti is of the * form www mmm dd hh:mm or www mmm dd hh:mm:ss, otherwise * invalidate ti. There must be a colon three characters back * and a space six or nine characters back (depending upon * whether or not the character six characters back is a colon). * There must be a space three characters further back (in front * of the day), one seven characters back (in front of the month), * and one eleven characters back (in front of the day of week). * ti is set to be the offset of the space before the time. * * Why a macro? It gets invoked a *lot* in a tight loop. On some of the * newer pipelined machines it is faster being open-coded than it would be if * subroutines are called. * * Why does it scan backwards from the end of the line, instead of doing the * much easier forward scan? There is no deterministic way to parse the * ``user'' field, because it may contain unquoted spaces! Yes, I tested it to * see if unquoted spaces were possible. They are, and I've encountered enough * evil mail to be totally unwilling to trust that ``it will never happen''. */ /* Build parameters */ #define KODRETRY 15 /* kiss-of-death retry in seconds */ #define LOCKTIMEOUT 5 /* lock timeout in minutes */ nl.h000064400000001653152345746370005353 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Newline 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: 30 August 2006 */ /* Function prototypes */ unsigned long strcrlfcpy (unsigned char **dst,unsigned long *dstl, unsigned char *src,unsigned long srcl); unsigned long strcrlflen (STRING *s); os_os4.h000064400000002257152345746370006151 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- OSF/Digital UNIX/Tru64 * * 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: 30 August 2006 */ #include #include #include #include #include #include /* for struct tm */ #include #include #include /* OSF/1 gets this wrong */ #define setpgrp setpgid #define direct dirent #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" #include "flocksim.h" os_cvx.h000064400000002131152345746370006233 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Operating-system dependent routines -- Convex 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: 11 May 1989 * Last Edited: 30 August 2006 */ #include #include #include #include #include #include #include void *malloc (size_t byteSize); void *realloc (void *oldptr,size_t newsize); #include "env_unix.h" #include "fs.h" #include "ftl.h" #include "nl.h" #include "tcp.h" shortsym.h000064400000043231152345746370006630 0ustar00/* ======================================================================== * Copyright 1988-2008 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Definitions for compilers with 6-letter symbol limits * * 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: 24 May 1995 * Last Edited: 1 January 2008 */ #define auth_link a_link #define auth_log a_log #define auth_login_client al_cli #define auth_login_server al_ser #define auth_ext a_ext #define auth_external_client ae_cli #define auth_external_server ae_ser #define auth_md5 a_md5 #define auth_md5_valid a5_val #define auth_md5_client a5_cli #define auth_md5_server a5_ser #define auth_pla a_pla #define auth_plain_client ap_cli #define auth_plain_server ap_ser #define authenticate a_auth #define authserver_login a_serv #define body_encodings bencds #define body_types btypes #define compare_csizedtext cm_szt #define compare_cstring cm_str #define compare_uchar cm_uch #define compare_ulong cm_uln #define default_proto d_prot #define dummy_append d_appn #define dummy_canonicalize d_cano #define dummy_check d_chck #define dummy_close d_clos #define dummy_copy d_copy #define dummy_create d_crea #define dummy_create_path d_crep #define dummy_delete d_del #define dummy_expunge d_exp #define dummy_file d_fil #define dummy_list d_list #define dummy_list_work d_lstw #define dummy_listed d_lstd #define dummy_lsub d_lsub #define dummy_open d_open #define dummy_parameters d_parm #define dummy_ping d_ping #define dummy_rename d_ren #define dummy_scan d_scan #define dummy_search d_srch #define dummy_subscribe d_subs #define dummy_valid d_val #define env_parameters e_parm #define fatal fatal #define file_string fl_str #define file_string_init fl_ini #define file_string_next fl_nxt #define file_string_setpos fl_sps #define fs_get f_get #define fs_give f_give #define fs_resize f_rsiz #define hash_create h_crea #define hash_destory h_dest #define hash_index h_indx #define hash_lookup h_lkup #define hash_add h_add #define hash_lookup_and_add h_lad #define imap_OK i_OK #define imap_acl_work i_aclw #define imap_append i_appn #define imap_append_single i_apps #define imap_anon i_anon #define imap_auth i_auth #define imap_cache i_cach #define imap_cap i_cap #define imap_capability i_capa #define imap_challenge i_chln #define imap_check i_chck #define imap_close i_clos #define imap_copy i_copy #define imap_create i_crea #define imap_delete i_del #define imap_deleteacl i_dacl #define imap_expunge i_expn #define imap_fake i_fake #define imap_fast i_fast #define imap_fetch i_fetc #define imap_flag i_flag #define imap_flags i_flgs #define imap_gc i_gc #define imap_gc_body ig_bdy #define imap_getacl i_gacl #define imap_getquota i_gqot #define imap_getquotaroot i_gqtr #define imap_host i_host #define imap_list i_list #define imap_listrights i_lrgh #define imap_list_work il_wrk #define imap_login i_logn #define imap_lsub i_lsub #define imap_manage i_man #define imap_msgdata i_msgd #define imap_msgno i_msgn #define imap_myrights i_mrgh #define imap_open i_open #define imap_parameters i_parm #define imap_parse_address ip_adr #define imap_parse_adrlist ip_adl #define imap_parse_astring ip_ast #define imap_parse_body ip_bdy #define imap_parse_body_parameter ipb_pa #define imap_parse_body_structure ipb_st #define imap_parse_capabilities ip_cap #define imap_parse_disposition ip_dsp #define imap_parse_envelope ip_env #define imap_parse_extension ip_ext #define imap_parse_flags ip_flg #define imap_parse_header ip_hdr #define imap_parse_language ip_lng #define imap_parse_namespace ip_nam #define imap_parse_reply ip_rep #define imap_parse_response ip_rsp #define imap_parse_string ip_str #define imap_parse_stringlist ip_stl #define imap_parse_thread ip_thr #define imap_parse_unsolicited ip_uns #define imap_parse_user_flag ipu_fl #define imap_ping i_ping #define imap_reform_sequence i_rfrs #define imap_rename i_ren #define imap_reply i_rep #define imap_response i_rspn #define imap_scan i_scan #define imap_search i_srch #define imap_send i_send #define imap_send_astring is_ast #define imap_send_literal is_lit #define imap_send_sdate iss_da #define imap_send_slist iss_sl #define imap_send_spgm iss_pg #define imap_send_spgm_trim iss_pt #define imap_send_sset iss_st #define imap_send_sset_work iss_sw #define imap_setacl i_sacl #define imap_setquota i_sqot #define imap_sort i_sort #define imap_sout i_sout #define imap_soutr i_sotr #define imap_status i_stat #define imap_structure i_stru #define imap_subscribe i_sub #define imap_thread i_thrd #define imap_thread_work i_thrw #define imap_uid i_uid #define imap_unsubscribe i_uns #define imap_valid i_val #define internal_date in_dat #define mail_append_full m_appn #define mail_append_multiple m_appm #define mail_append_set m_apps #define mail_auth m_auth #define mail_body m_body #define mail_cdate m_cdat #define mail_check m_chck #define mail_close_full m_clos #define mail_copy_full m_copy #define mail_create m_crea #define mail_criteria m_crit #define mail_criteria_date mc_dat #define mail_criteria_string mc_str #define mail_date m_date #define mail_debug m_dbug #define mail_delete m_del #define mail_dlog m_dlog #define mail_elt m_elt #define mail_exists m_exst #define mail_expunge_full m_expn #define mail_expunged m_expd #define mail_fetch_body fs_bdy #define mail_fetch_fast mf_fst #define mail_fetch_flags mf_flg #define mail_fetch_header mf_hdr #define mail_fetch_message mf_msg #define mail_fetch_mime mf_mim #define mail_fetch_overview mf_ovr #define mail_fetch_overview_sequence mf_ovs #define mail_fetch_overview_default mf_ovd #define mail_fetch_structure mf_str #define mail_fetch_text mf_txt #define mail_fetch_text_return mf_txr #define mail_fetch_string_return mf_tsr #define mail_fetchfrom mf_frm #define mail_fetchsubject mf_sub #define mail_filter m_filt #define mail_flag m_flag #define mail_free_acl mr_acl #define mail_free_address mr_add #define mail_free_body mr_bdy #define mail_free_body_data mrb_da #define mail_free_body_parameter mrb_pr #define mail_free_body_part mrb_pt #define mail_free_cache mr_cac #define mail_free_elt mr_elt #define mail_free_envelope mr_env #define mail_free_handle mr_han #define mail_free_namespace mr_nsp #define mail_free_quotalist mr_qtl #define mail_free_searchheader mrs_hd #define mail_free_searchor mrs_or #define mail_free_searchpgm mrs_pg #define mail_free_searchpgmlist mrs_pl #define mail_free_searchset mrs_st #define mail_free_sortpgm mr_spg #define mail_free_stringlist mr_sls #define mail_free_threadnode mr_thn #define mail_gc m_gc #define mail_gc_msg m_gcm #define mail_gc_body m_gcb #define mail_initbody m_ibdy #define mail_link m_link #define mail_list m_list #define mail_lock m_lock #define mail_longdate ml_lda #define mail_lookup_auth m_laut #define mail_lookup_auth_name m_latn #define mail_lsub m_lsub #define mail_makehandle m_mhdl #define mail_match_lines m_mlns #define mail_msgno m_msgn #define mail_newacl mn_acl #define mail_newaddr mn_add #define mail_newbody mn_bdy #define mail_newbody_parameter mnb_pr #define mail_newbody_part mnb_pt #define mail_newbody_message_part mnb_mp #define mail_new_cache_elt mn_elt #define mail_newenvelope mn_env #define mail_newmsg mn_msg #define mail_newquotalist mn_qtl #define mail_newsearchheader mns_hd #define mail_newsearchor mns_or #define mail_newsearchpgm mns_pg #define mail_newsearchpgmlist mns_pl #define mail_newsearchset mns_st #define mail_newsortpgm mn_spg #define mail_newstringlist mn_sls #define mail_newthreadnode mn_thr #define mail_nodebug m_ndbg #define mail_open m_open #define mail_parameters m_parm #define mail_parse_date mp_dat #define mail_parse_flags mp_flg #define mail_parse_set mp_set #define mail_partial_body mpt_bd #define mail_partial_text mpt_tx #define mail_ping m_ping #define mail_read m_read #define mail_recent m_rcent #define mail_rename m_ren #define mail_scan m_scan #define mail_search_addr ms_adr #define mail_search_body ms_bdy #define mail_search_default ms_def #define mail_search_full m_srch #define mail_search_gets ms_gts #define mail_search_header ms_hdr #define mail_search_header_text ms_hdt #define mail_search_keyword ms_key #define mail_search_msg ms_msg #define mail_search_string ms_str #define mail_search_string_work ms_stw #define mail_search_text ms_txt #define mail_sequence m_seq #define mail_shortdate m_shtd #define mail_skip_fwd msk_fw #define mail_skip_re msk_re #define mail_sort ml_srt #define mail_sort_cache ms_csh #define mail_sort_compare ms_cmp #define mail_sort_loadcache ms_lcs #define mail_sort_msgs ms_mgs #define mail_status m_stat #define mail_status_default m_stad #define mail_stream m_strm #define mail_string m_strg #define mail_string_init mt_ini #define mail_string_next mt_nxt #define mail_string_setpos mt_sps #define mail_strip_subject mst_sb #define mail_strip_subject_wsp mst_ws #define mail_strip_subject_blob mst_bl #define mail_subscribe m_sub #define mail_thread m_thr #define mail_threadlist mt_lst #define mail_thread_c2node mt_c2n #define mail_thread_check_child mt_ckc #define mail_thread_compare_date mtc_da #define mail_thread_loadcache mt_ldc #define mail_thread_msgs mt_mgs #define mail_thread_orderedsubject mt_osb #define mail_thread_parse_msgid mtp_mi #define mail_thread_parse_references mtp_rf #define mail_thread_prune_dummy mt_prd #define mail_thread_references mt_ref #define mail_thread_sort mt_srt #define mail_uid m_uid #define mail_uid_sequence mu_seq #define mail_unlock m_unl #define mail_unsubscribe m_uns #define mail_usable_network_stream m_usns #define mail_utf7_valid m_ut7v #define mail_valid m_val #define mail_valid_net mv_net #define mail_valid_net_parse mvn_pr #define mail_valid_net_parse_work mvn_pw #define mail_versioncheck m_vers #define mailboxfile mbxfil #define md5_init m5_ini #define md5_update m5_upd #define md5_final m5_fin #define mime2_decode m2_dec #define mime2_text m2_txt #define mime2_token m2_tok #define mm_cache mm_cac #define mm_critical mm_crt #define mm_diskerror mm_dse #define mm_dlog mm_dlg #define mm_exists mm_exs #define mm_expunged mm_exp #define mm_fatal mm_ftl #define mm_flags mm_flg #define mm_list mm_lst #define mm_log mm_log #define mm_login mm_lgi #define mm_lsub mm_lsb #define mm_mailbox mm_mbx #define mm_nocritical mm_ncr #define mm_notify mm_not #define mm_searched mm_src #define myhomedir myhome #define mylocalhost myhost #define myusername_full myuser #define net_aopen nt_aop #define net_close nt_cls #define net_getbuffer nt_gtb #define net_getdata nt_gtd #define net_getline nt_gtl #define net_host nt_hst #define net_localhost nt_lhs #define net_open nt_opn #define net_port nt_prt #define net_sout nt_sot #define net_soutr nt_str #define netmsg_read nm_rea #define netmsg_slurp nm_slr #define netmsg_slurp_text nm_slt #define newsrc_check_uid nsc_ui #define newsrc_create ns_crea #define newsrc_error ns_err #define newsrc_lsub ns_lsub #define newsrc_newmessages ns_nms #define newsrc_newstate ns_nst #define newsrc_read ns_rea #define newsrc_status ns_sta #define newsrc_update ns_upd #define newsrc_write ns_wri #define newsrc_write_error ns_wer #define nntp_append n_appn #define nntp_canonicalize n_cano #define nntp_check n_chck #define nntp_close n_clos #define nntp_copy n_copy #define nntp_create n_crea #define nntp_delete n_del #define nntp_expunge n_expn #define nntp_fake n_fake #define nntp_fetchfast nf_fst #define nntp_fetchflags nf_flg #define nntp_fetchmessage nf_msg #define nntp_flagmsg n_fmsg #define nntp_gc n_gc #define nntp_getmap n_gmap #define nntp_header n_head #define nntp_isvalid n_isvl #define nntp_list n_list #define nntp_lsub n_lsub #define nntp_mail n_mail #define nntp_mclose n_mcls #define nntp_mopen n_mopn #define nntp_open_full n_open #define nntp_over n_ovr #define nntp_overview n_over #define nntp_parameters n_parm #define nntp_parsestructure n_pars #define nntp_parse_overview n_povr #define nntp_ping n_ping #define nntp_rename n_ren #define nntp_reply n_repl #define nntp_scan n_scan #define nntp_search n_srch #define nntp_search_msg ns_msg #define nntp_send n_send #define nntp_send_auth ns_aut #define nntp_send_auth_work ns_atw #define nntp_send_work n_sndw #define nntp_sort n_sort #define nntp_sort_loadcache ns_lcs #define nntp_soutr n_sout #define nntp_status n_stat #define nntp_subscribe n_sub #define nntp_text n_text #define nntp_text_slurp nt_slp #define nntp_thread n_thrd #define nntp_unsubscribe n_uns #define nntp_valid n_val #define pop3_append p_appn #define pop3_auth p_auth #define pop3_cache p_cach #define pop3_challenge p_chal #define pop3_check p_chck #define pop3_close p_clos #define pop3_copy p_copy #define pop3_create p_crea #define pop3_delete p_del #define pop3_expunge p_exp #define pop3_fake p_fake #define pop3_fetchfast pf_fst #define pop3_fetchflags pf_flg #define pop3_fetchmessage pf_msg #define pop3_gc p_gc #define pop3_list p_list #define pop3_lsub p_lsub #define pop3_open p_open #define pop3_parameters p_parm #define pop3_parsestructure p_pars #define pop3_ping p_ping #define pop3_rename p_ren #define pop3_reply p_rep #define pop3_response p_resp #define pop3_scan p_scan #define pop3_send p_send #define pop3_send_num ps_num #define pop3_status p_stat #define pop3_subscribe p_sub #define pop3_unsubscribe p_uns #define pop3_valid p_val #define rfc822_8bit r #define rfc822_address r_addr #define rfc822_address_line ra_lin #define rfc822_base64 r_b64 #define rfc822_binary r_bin #define rfc822_cat r_cat #define rfc822_contents r_cont #define rfc822_cpy r_cpy #define rfc822_cpy_adr rc_adr #define rfc822_date r_date #define rfc822_default_subtype rd_sub #define rfc822_encode_body_7bit reb_7b #define rfc822_encode_body_8bit reb_8b #define rfc822_header r_head #define rfc822_header_line rh_lin #define rfc822_output r_out #define rfc822_output_address ro_adr #define rfc822_output_address_line roa_ln #define rfc822_output_address_list roa_li #define rfc822_output_body ro_bdy #define rfc822_output_body_header rob_hd #define rfc822_output_full ro_ful #define rfc822_output_flush ro_flu #define rfc822_output_header ro_hdr #define rfc822_output_header_line roh_ln #define rfc822_output_cat ro_cat #define rfc822_output_parameter ro_par #define rfc822_output_stringlist ro_stl #define rfc822_output_text ro_txt #define rfc822_parse_address rp_adr #define rfc822_parse_addrspec rp_ads #define rfc822_parse_adrlist rp_adl #define rfc822_parse_content rp_cnt #define rfc822_parse_content_header rpc_hd #define rfc822_parse_group rp_grp #define rfc822_parse_mailbox rp_mbx #define rfc822_parse_msg_full rp_msg #define rfc822_parse_parameter rp_par #define rfc822_parse_phrase rp_phr #define rfc822_parse_routeaddr rp_rte #define rfc822_parse_word rp_wrd #define rfc822_phraseonly r_poly #define rfc822_qprint r_qpnt #define rfc822_quote r_quot #define rfc822_skip_comment rs_cmt #define rfc822_skipws rs_ws #define rfc822_timezone r_tz #define rfc822_write_address_full rw_adr #define rfc822_write_body_header rwbh_8 #define server_input_wait s_iwat #define server_login s_log #define server_init s_init #define sm_read sm_rd #define sm_subscribe sm_sub #define sm_unsubscribe sm_uns #define smtp_auth s_auth #define smtp_challenge s_chal #define smtp_close s_clos #define smtp_ehlo s_ehlo #define smtp_fake s_fake #define smtp_mail s_mail #define smtp_open_full s_open #define smtp_rcpt s_rcpt #define smtp_reply s_repl #define smtp_response s_resp #define smtp_send s_send #define smtp_send_auth ss_aut #define smtp_send_auth_work ss_atw #define smtp_send_work ss_wrk #define smtp_soutr s_str #define strcrlfcpy sc_cpy #define strcrlflen sc_len #define tcp_aopen t_aopn #define tcp_canonical t_cnon #define tcp_clientaddr t_cadr #define tcp_clienthost t_chst #define tcp_clientport t_cprt #define tcp_close t_clos #define tcp_getbuffer tg_buf #define tcp_getdata tg_dat #define tcp_getline tg_lin #define tcp_host t_host #define tcp_localhost t_lhst #define tcp_open t_open #define tcp_parameters t_parameters #define tcp_port t_port #define tcp_remotehost t_rhst #define tcp_serveraddr t_sadr #define tcp_serverhost t_shst #define tcp_serverport t_sprt #define tcp_sout t_sout #define tcp_soutr t_str #define textcpy txcopy #define textcpystring txcpst #define textcpyoffstring txcpos #define ucs4_cs_get u4_csg #define ucs4_decompose u4_dcm #define ucs4_decompose_recursive u4_dcr #define ucs4_rmapbuf u4r_bf #define ucs4_rmaplen u4r_ln #define ucs4_rmaptext u4r_tx #define ucs4_titlecase u4_tcs #define ucs4_width u4_wid #define utf8_badcharset u8_bcs #define utf8_charset u8_chs #define utf8_cstext u8_cst #define utf8_cstocstext u8_cct #define utf8_from_mutf7 u8fmu7 #define utf8_get u8_get #define utf8_get_raw u8_gtr #define utf8_iso2022text u8_i22 #define utf8_mime2text u8_mi2 #define utf8_put u8_put #define utf8_rmap u8_rmp #define utf8_rmap_cs u8r_cs #define utf8_rmap_gen u8r_gn #define utf8_rmapsize u8r_sz #define utf8_rmaptext u8r_tx #define utf8_script u8_scr #define utf8_searchpgm u8_spg #define utf8_size u8_siz #define utf8_stringlist u8_lst #define utf8_text u8_txt #define utf8_text_2022 u8t_22 #define utf8_text_8859_1 u8t_we #define utf8_text_1byte0 u8t_10 #define utf8_text_1byte u8t_1b #define utf8_text_1byte8 u8t_18 #define utf8_text_cs ut8_cs #define utf8_text_euc u8t_eu #define utf8_text_dbyte u8t_db #define utf8_text_dbyte2 u8t_d2 #define utf8_text_sjis u8t_sj #define utf8_text_ucs2 u8t_u2 #define utf8_text_ucs4 ut8_u4 #define utf8_text_utf7 ut8_u7 #define utf8_text_utf8 ut8_u8 #define utf8_text_utf16 ut8_16 #define utf8_to_mutf7 u8tmu7 #define utf8_validate u8_val #define utf8_textwidth u8_twd netmsg.h000064400000001733152345746370006236 0ustar00/* ======================================================================== * Copyright 1988-2006 University of Washington * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * * ======================================================================== */ /* * Program: Network message (SMTP/NNTP/POP2/POP3) 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: 8 June 1995 * Last Edited: 30 August 2006 */ /* stream must be void* for use as readfn_t */ long netmsg_read (void *stream,unsigned long count,char *buffer); FILE *netmsg_slurp (NETSTREAM *stream,unsigned long *size,unsigned long *hsiz);