00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <dcbase.h>
00020 #include <dcFile.h>
00021
00022 int
00023 main(int argc, char *argv[]) {
00024 if (argc < 2) {
00025 cerr <<
00026 "dcparse - a simple program to read one or more .dc files and report their\n"
00027 "contents to standard output.\n\n";
00028 return (1);
00029 }
00030
00031 DCFile file;
00032 for (int i = 1; i < argc; i++) {
00033 if (!file.read(argv[i])) {
00034 return (1);
00035 }
00036 }
00037
00038 if (!file.write(cout, "standard output")) {
00039 return (1);
00040 }
00041
00042 long hash = file.get_hash();
00043 cerr << "File hash is " << hash << "\n";
00044
00045 return (0);
00046 }