2 main.c - Belegloser Datenträgeraustausch mit einer Bank
3 Copyright (c) 1996,8,2001-4 Martin Schulze <joey@infodrom.org>
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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 static char version[] = "0.6";
33 printf ("dtaus - Belegloser Datenträgeraustausch mit einer Bank\n\n");
34 printf (" -dtaus Erzeugt eine Bankdatei\n");
35 printf (" -control Liest eine Bankdatei und erzeugt die Kontrolldatei\n");
37 printf (" -d <dtaus> Bankdatei [dtaus0.txt]\n");
38 printf (" -c <control> Steuerdatei [dtaus0.ctl]\n");
39 printf (" -b <begleit> Begleitzettel fĂ¼r die Bank dtaus0.doc]\n");
40 printf (" -o <kontroll> Kontrolldatei zum Abheften [dtaus0.sik]\n");
46 int main (int argc, char **argv)
56 strcpy ((char *)dtaus, "dtaus0.txt");
57 strcpy ((char *)control, "dtaus0.ctl");
58 strcpy ((char *)beleg, "dtaus0.doc");
59 strcpy ((char *)check, "dtaus0.sik");
61 while (argc - i > 1) {
63 if ( !strcmp(argv[i], "-h") ) {
65 } else if ( !strcmp(argv[i], "-v") ) {
66 printf ("dtaus version %s - Copyright (c) 1997,8,2001 by Martin Schulze <joey@infodrom.org>\n", version);
68 } else if ( !strcmp(argv[i], "-d") ) {
71 strcpy ((char *)dtaus, argv[i]);
73 } else if ( !strcmp(argv[i], "-c") ) {
76 strcpy ((char *)control, argv[i]);
78 } else if ( !strcmp(argv[i], "-b") ) {
81 strcpy ((char *)beleg, argv[i]);
83 } else if ( !strcmp(argv[i], "-o") ) {
86 strcpy ((char *)check, argv[i]);
88 } else if ( !strcmp(argv[i], "-dtaus") ) {
90 } else if ( !strcmp(argv[i], "-control") ) {
95 if (action == DTAUS) {
96 if (!stat((char *)control, &sbuf)) {
97 if (control2dtaus ((char *)control, (char *)dtaus, (char *)beleg, (char *)check) == 0)
101 } else if (action == CONTROL) {
102 if (!stat((char *)dtaus, &sbuf))
103 dtaus2control ((char *)dtaus, (char *)control);
106 printf ("Keine Routine angegeben (-dtaus bzw. -control vergessen).\n");