2 main.c - Belegloser Datenträgeraustausch mit einer Bank
3 Copyright (c) 1996,8,2001 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.5";
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 int 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,2001 by Martin Schulze <joey@infodrom.org>\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 if (control2dtaus ((char *)control, (char *)dtaus, (char *)beleg, (char *)check) == 0)
99 } else if (action == CONTROL) {
100 if (!stat((char *)dtaus, &sbuf))
101 dtaus2control ((char *)dtaus, (char *)control);
104 printf ("Keine Routine angegeben (-dtaus bzw. -control vergessen).\n");