|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ T m ┃
Length: 1344 (0x540) Types: TextFile Names: »main.c++«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki └─ ⟦this⟧ »EUUGD11/euug-87hel/sec1/image/ascii2var/main.c++«
/* This is the main routine for translating ascii to floating point images */ #include <stream.h> #include <stdio.h> #include <vartools.h++> int main(int argc,char *argv[]) { switch ( argc ) { // with 0 arguments it is a pipe case 1: ascii2var(stdin,stdout); break; // with 1 arguments it takes from named file to stdout case 2: { FILE *input; // pointer to the input file if ( NULL == ( input = fopen(argv[1],"r") ) ) { perror("ascii2var"); return 2; } ascii2var(input,stdout); } break; // with 2 arguments it takes from named file to named file case 3: { FILE *input; // pointer to the input file FILE *output; // pointer to the output file if ( NULL == ( input = fopen(argv[1],"r") ) ) { perror("ascii2var"); return 2; } if ( NULL == ( output = fopen(argv[2],"w") ) ) { perror("ascii2var"); return 2; } ascii2var(input,output); } break; // otherwise something is wrong default: cerr << "Syntax is: ascii2var [input [output]]\n"; return 1; } return 0; } /* Copyright (C) 1986, David Sher in the University of Rochester Permission is granted to any individual or institution to use, copy, or redistribute this software so long as it is not sold for profit, provided this copyright notice is retained. */