home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 2
/
goldfish_vol2_cd1.bin
/
files
/
comm
/
mail
/
smail
/
src
/
rcs
/
map.c,v
< prev
next >
Wrap
Text File
|
1993-12-21
|
3KB
|
127 lines
head 1.2;
access;
symbols
C_1:1.2;
locks; strict;
comment @ * @;
1.2
date 93.09.18.16.47.47; author Aussem; state Exp;
branches;
next 1.1;
1.1
date 93.09.08.16.27.13; author Aussem; state Exp;
branches;
next ;
desc
@map an UUCP address
@
1.2
log
@insert GNU license text in the header
@
text
@/*
* map.c
*
* Routines to map an address
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: map.c,v $
* Revision 1.1 1993/09/08 16:27:13 Aussem
* Initial revision
*
*
*/
static char *rcsid="$Id: map.c,v 1.1 1993/09/08 16:27:13 Aussem Exp Aussem $";
# include <stdio.h>
# include <sys/types.h>
# include "defs.h"
extern int queuecost;
/*
**
** map(): map addresses into <host, user, form, cost> sets.
**
** Calls resolve() for each address of argv. The result is hostv and
** userv arrays (pointing into buffers userz and hostz), and formv array.
**
*/
map(argc, argv, hostv, userv, formv, costv)
int argc; /* address count */
char **argv; /* address vector */
char *hostv[]; /* remote host vector */
char *userv[]; /* user name vector */
enum eform formv[]; /* address format vector */
int costv[]; /* cost vector */
{
int i, cost;
enum eform resolve();
char *c;
static char userbuf[BIGBUF], *userz;
static char hostbuf[BIGBUF], *hostz;
userz = userbuf;
hostz = hostbuf;
for( i=0; i<argc; i++ ) {
#ifdef DEFQUEUE
cost = queuecost+1; /* default is queueing */
#else
cost = queuecost-1; /* default is no queueing */
#endif
userv[i] = userz; /* put results here */
hostv[i] = hostz;
if ( **argv == '(' ) { /* strip () */
++*argv;
c = index( *argv, ')' );
if (c)
*c = '\0';
}
/* here it comes! */
formv[i] = resolve(*argv++, hostz, userz, &cost);
costv[i] = cost;
userz += strlen( userz ) + 1; /* skip past \0 */
hostz += strlen( hostz ) + 1;
}
}
@
1.1
log
@Initial revision
@
text
@d6 4
a9 1
* $Log$
d11 14
d27 1
a27 1
static char *rcsid="$Id$";
@