home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 2
/
goldfish_vol2_cd1.bin
/
files
/
comm
/
mail
/
smail
/
src
/
rcs
/
convert.c,v
< prev
next >
Wrap
Text File
|
1993-12-21
|
2KB
|
99 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
@converts pathalias output to smail format
@
1.2
log
@insert GNU license text in the header
@
text
@/*
* convert.c
*
* 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$
*/
#include <stdio.h>
#include <string.h>
static char *version="$VER: convert V1.0 compiled "__DATE__;
main(argc, argv)
int argc;
char *argv[];
{
FILE *ifp, *ofp;
char buf[1024];
register char *p,*s;
char *cost,*host,*route;
ifp = stdin;
ofp = stdout;
while(fgets(buf, sizeof(buf), ifp) != NULL) {
for(s=p=buf;*p!='\t' && *p!='\0';p++);
if(p=='\0')break;
*p='\0';
cost=strdup(s);
for(s=++p;*p!='\t' && *p!='\0';p++);
if(p=='\0')break;
*p='\0';
host=strdup(s);
for(s=++p;*p!='\n' && *p!='\0';p++);
*p='\0';
route=strdup(s);
fprintf(ofp,"%s\t%s\t%s\n",host,route,cost);
}
return(0);
}
@
1.1
log
@Initial revision
@
text
@d2 1
d4 15
d20 1
@