/***********************************************************************
* *
* This software is part of the BSD package *
*Copyright (c) 1978-2010 The Regents of the University of California an*
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* conditions are met: *
* *
* 1. Redistributions of source code must retain the above *
* copyright notice, this list of conditions and the *
* following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above *
* copyright notice, this list of conditions and the *
* materials provided with the distribution. *
* *
* 3. Neither the name of The Regents of the University of California*
* names of its contributors may be used to endorse or *
* promote products derived from this software without *
* specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS *
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED *
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON *
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, *
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY *
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
* POSSIBILITY OF SUCH DAMAGE. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* 1. Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the following disclaimer. *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in *
* distribution. *
* 3. Neither the name of the University nor the names of its *
* contributors may be used to endorse or promote products derived *
* from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" *
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF *
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, *
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT *
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF *
* SUCH DAMAGE. *
* *
* Kurt Shoens (UCB) *
* gsf *
* *
***********************************************************************/
#pragma prototyped
/*
* Mail -- a mail program
*
* Handle name lists.
*/
#include "mailx.h"
/*
* Grab a single word (liberal word)
* Throw away things between ()'s, and take anything between <>.
*/
char*
{
register char* cp;
register char* cp2;
for (;;) {
if (*cp == 0)
return 0;
if (*cp == '(') {
register int nesting = 0;
while (*cp != 0) {
switch (*cp++) {
case '(':
nesting++;
break;
case ')':
--nesting;
break;
}
if (nesting <= 0)
break;
}
}
cp++;
else
break;
}
if (*cp == '<')
;
else
;
*cp2 = 0;
}
/*
* Clear flags.
*/
static int
{
return 0;
}
/*
* Clear items from header.
*/
void
{
}
}
}
}
/*
* Extract a list of names from a line,
* and make a list of names from it.
*/
void
{
register int n;
register struct list* x;
if (s) {
note(DEBUG, "extract type=0x%08x data=\"%s\"%s", flags, s, (hp->h_clear & flags) ? " [clear]" : "");
}
}
}
}
if (!*s) {
}
}
}
}
if (*s) {
s[--n] = 0;
return;
x->next = 0;
else
}
}
}
}
/*
* Low level for detract().
*/
typedef struct
{
int flags;
int sep;
char* base;
char* next;
} Walk_str_t;
static int
{
register char* s;
register char* t;
*s++ = ',';
*s++ = ' ';
}
}
else
}
return 0;
}
/*
* Turn a list of names into a string of the same names.
*/
char*
{
}
}
}
return 0;
}
typedef struct {
int more;
int show;
} Walk_map_t;
/*
* Add name,flags to the next map level.
*/
static void
{
}
else {
}
}
}
/*
* Map all of the aliased users in the invoker's mailrc
* file and insert them into the list.
* Changed after all these months of service to recursively
* expand names (2/14/80).
* And changed after all these years to weed out state.var.user
* in one place (8/11/96).
*/
static int
{
char* s;
return 0;
return 0;
}
return 0;
}
if (!(np->flags & GMETOO) && !state.var.metoo && streq(np->name, state.var.user) && (np->flags & (GCC|GBCC))) {
return 0;
}
}
return 0;
}
int
{
do {
}
}
/*
* Return path of file to record outgoing messages.
*/
char*
{
register int c;
register char* ap;
register char* rp;
register char* ep;
register char* tp;
*rp++ = '+';
rp++;
*rp++ = '/';
}
*rp++ = '+';
for (;;) {
switch (c = *ap++) {
case 0:
break;
case '@':
break;
case '!':
continue;
default:
*rp++ = c;
continue;
}
break;
}
*rp = 0;
}
*rp = 0;
*rp++ = '+';
}
}