-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodestudio2.cpp
More file actions
118 lines (112 loc) · 2.87 KB
/
codestudio2.cpp
File metadata and controls
118 lines (112 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/** Programm.: code-studio2.c
* Autor....: Nico Anders
* Version..: 2.1
* Datum....: 18.11.2011
* Stand....: 30.09.2012
* Status...: vorgelegt
*/
/** Praeprozessor
* Bibliothek-Einbindung fuer Ansi Ein- und Ausgaben (scanf, printf)
*/
#include <stdio.h> /* Standard-I/O */
#include <stdlib.h> /* Nuetzliche Funktionen */
#include <string.h> /* Zeichenkettenoperationen */
#include <time.h> /* Datum und Uhrzeit */
#include <ctype.h> /* Zeichenkonvertierung */
#include <sys/stat.h>
#include "./dat/in.cpp"
#include "./dat/out.cpp"
/********************** Hauptprogramm Code-Studio *****************************/
/** Funktion....: Startbildschirm anzeigen
* Status......: vorgelegt
*/
int iCodegen()
{
char sEingabe[12];
/* Woerter aus in.h in Struct laden */
iInitialisiere_Datenbank();
iSetze_Pause(3);
iMenue();
do
{
/* abgesicherte Eingabe */
fgets(sEingabe, sizeof(sEingabe), stdin);
sscanf(sEingabe, "%s", stInteraktion.sAbfrage);
/* Eingabe in Kleinbuchstaben umwandeln und Strings aus
* Initialisiere_Datenbank() vergleichen. */
for(stInteraktion.iLoop = 0;
stInteraktion.sAbfrage[stInteraktion.iLoop];stInteraktion.iLoop++)
{
stInteraktion.sAbfrage[stInteraktion.iLoop] =
tolower(stInteraktion.sAbfrage[stInteraktion.iLoop]);
}
/* das Menue aufklappen
* wiederhole die Schleife, um das Menue von
* allen Funktionen aus aufrufen zu koennen */
if((strncmp(stDatenbank.sHallo, stInteraktion.sAbfrage, 4)) == 0)
{
iMenue();
continue;
}
if((strncmp(stDatenbank.sHilfe,
stInteraktion.sAbfrage, 4)) == 0)
{
iHilfe();
continue;
}
else if((strncmp(stDatenbank.sVersion,
stInteraktion.sAbfrage, 4)) == 0)
{
iVersion();
continue;
}
else if((strncmp(stDatenbank.sFormular,
stInteraktion.sAbfrage, 1)) == 0)
{
iFormular();
continue;
}
else if((strncmp(stDatenbank.sIncludes,
stInteraktion.sAbfrage, 4)) == 0)
{
iHeader();
continue;
}
else if((strncmp(stDatenbank.sGenerieren,
stInteraktion.sAbfrage, 4)) == 0)
{
iGenerieren();
continue;
}
else if((strncmp(stDatenbank.sBeenden,
stInteraktion.sAbfrage, 4)) == 0)
{
iSetze_Pause(3);
/* Codegenerator sauber beenden */
break;
}
else
{
iHinweis();
continue;
}
/* Ende der Schleifenbedingung */
}while(stDatenbank.sBeenden != stInteraktion.sAbfrage);
return EXIT_SUCCESS;
}
/** Steuerprogramm
*/
int iController()
{
iCodegen();
return EXIT_SUCCESS;
}
/** Hauptprogramm
*/
int main()
{
iController();
return EXIT_SUCCESS;
}
/** Programmende
*/