2 main.c - Datentraegeraustausch mit einer Bank
3 Copyright (c) 1996 Martin Schulze <joey@orgatech.de>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 static char version[] = "0.2.1";
31 printf ("dtaus - Belegloser Datenträgeraustausch mit einer Bank\n\n");
32 printf (" -dtaus Erzeugt eine Bankdatei\n");
33 printf (" -control Liest eine Bankdatei und erzeugt die Kontrolldatei\n");
35 printf (" -d <dtaus> Bankdatei [dtaus0.txt]\n");
36 printf (" -c <control> Steuerdatei [dtaus0.ctl]\n");
37 printf (" -b <begleit> Begleitzettel für die Bank dtaus0.doc]\n");
38 printf (" -o <kontroll> Kontrolldatei zum Abheften [dtaus0.sik]\n");
44 void main (int argc, char **argv)
54 strcpy ((char *)dtaus, "dtaus0.txt");
55 strcpy ((char *)control, "dtaus0.ctl");
56 strcpy ((char *)beleg, "dtaus0.doc");
57 strcpy ((char *)check, "dtaus0.sik");
59 while (argc - i > 1) {
61 if ( !strcmp(argv[i], "-h") ) {
63 } else if ( !strcmp(argv[i], "-v") ) {
64 printf ("dtaus version %s - Copyright (c) 1997,8 by Martin Schulze <joey@infodrom.north.de>\n", version);
66 } else if ( !strcmp(argv[i], "-d") ) {
69 strcpy ((char *)dtaus, argv[i]);
71 } else if ( !strcmp(argv[i], "-c") ) {
74 strcpy ((char *)control, argv[i]);
76 } else if ( !strcmp(argv[i], "-b") ) {
79 strcpy ((char *)beleg, argv[i]);
81 } else if ( !strcmp(argv[i], "-o") ) {
84 strcpy ((char *)check, argv[i]);
86 } else if ( !strcmp(argv[i], "-dtaus") ) {
88 } else if ( !strcmp(argv[i], "-control") ) {
93 if (action == DTAUS) {
94 if (!stat((char *)control, &sbuf))
95 control2dtaus ((char *)control, (char *)dtaus, (char *)beleg, (char *)check);
97 } else if (action == CONTROL) {
98 if (!stat((char *)dtaus, &sbuf))
99 dtaus2control ((char *)dtaus, (char *)control);
102 printf ("Keine Routine angegeben (-dtaus bzw. -control vergessen).\n");