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.7";
31 #define FN_DTAUS "dtaus0.txt"
32 #define FN_CONTROL "dtaus0.ctl"
33 #define FN_BELEG "dtaus0.doc"
34 #define FN_CHECK "dtaus0.sik"
35 #define FN_LATEX "dtaus0.tex"
37 char *dtaus = FN_DTAUS;
38 char *control = FN_CONTROL;
39 char *beleg = FN_BELEG;
40 char *check = FN_CHECK;
45 printf ("dtaus - Belegloser Datenträgeraustausch mit einer Bank\n\n");
46 printf (" -dtaus Erzeugt eine Bankdatei\n");
47 printf (" -control Liest eine Bankdatei und erzeugt die Kontrolldatei\n");
49 printf (" -d <dtaus> Bankdatei [%s]\n", FN_DTAUS);
50 printf (" -c <control> Steuerdatei [%s]\n", FN_CONTROL);
51 printf (" -b <begleit> Begleitzettel fĂ¼r die Bank [%s]\n", FN_BELEG);
52 printf (" -l [<begleit>] Begleitzettel als LaTeX [%s]\n", FN_LATEX);
53 printf (" -o <kontroll> Kontrolldatei zum Abheften [%s]\n", FN_CHECK);
59 int main (int argc, char **argv)
65 while (argc - i > 1) {
67 if ( !strcmp(argv[i], "-h") ) {
69 } else if ( !strcmp(argv[i], "-v") ) {
70 printf ("dtaus version %s - Copyright (c) 1997,8,2001,4 by Martin Schulze <joey@infodrom.org>\n", version);
72 } else if ( !strcmp(argv[i], "-d") ) {
77 } else if ( !strcmp(argv[i], "-c") ) {
82 } else if ( !strcmp(argv[i], "-b") ) {
87 } else if ( !strcmp(argv[i], "-l") ) {
88 if (argc - i > 1 && argv[i+1][0] != '-') {
93 } else if ( !strcmp(argv[i], "-o") ) {
98 } else if ( !strcmp(argv[i], "-dtaus") ) {
100 } else if ( !strcmp(argv[i], "-control") ) {
105 if (action == DTAUS) {
106 if (!strcmp("-", control) || !stat(control, &sbuf)) {
107 if (control2dtaus (control, dtaus, beleg, check, latex) == 0)
111 fprintf( stderr, "Can't stat %s\n", control);
114 } else if (action == CONTROL) {
115 if (!strcmp("-", dtaus) || !stat(dtaus, &sbuf))
116 dtaus2control (dtaus, control);
118 fprintf( stderr, "Can't stat %s\n", dtaus);
122 fprintf (stderr, "Keine Routine angegeben (-dtaus bzw. -control vergessen).\n");