mirror of
https://gitlab.com/rnger/amath
synced 2025-10-05 18:39:41 +00:00
246 lines
4.9 KiB
Groff
246 lines
4.9 KiB
Groff
.TH "app/system/base/io.h" 3 "Tue Jan 24 2017" "Version 1.6.2" "amath" \" -*- nroff -*-
|
|
.ad l
|
|
.nh
|
|
.SH NAME
|
|
app/system/base/io.h \- System dependent I/O\&.
|
|
|
|
.SH SYNOPSIS
|
|
.br
|
|
.PP
|
|
\fC#include 'clib\&.h'\fP
|
|
.br
|
|
\fC#include 'platform\&.h'\fP
|
|
.br
|
|
\fC#include 'system/program\&.h'\fP
|
|
.br
|
|
|
|
.SS "Macros"
|
|
|
|
.in +1c
|
|
.ti -1c
|
|
.RI "#define \fBCPROCNAME\fP 'amath_console'"
|
|
.br
|
|
.in -1c
|
|
.SS "Functions"
|
|
|
|
.in +1c
|
|
.ti -1c
|
|
.RI "class \fBProgram\fP * \fBCreateProgram\fP (int, char **)"
|
|
.br
|
|
.ti -1c
|
|
.RI "class \fBLanguage\fP * \fBCreateLanguage\fP ()"
|
|
.br
|
|
.ti -1c
|
|
.RI "class \fBPreferencesBase\fP * \fBCreatePreferences\fP ()"
|
|
.br
|
|
.ti -1c
|
|
.RI "class \fBFilesystemBase\fP * \fBCreateFilesystem\fP ()"
|
|
.br
|
|
.ti -1c
|
|
.RI "class \fBGraphWindow\fP * \fBCreateGraphWindow\fP ()"
|
|
.br
|
|
.ti -1c
|
|
.RI "void \fBWriteToShell\fP (const char *)"
|
|
.br
|
|
.ti -1c
|
|
.RI "void \fBCleanup\fP ()"
|
|
.br
|
|
.in -1c
|
|
.SS "Variables"
|
|
|
|
.in +1c
|
|
.ti -1c
|
|
.RI "const char * \fBvers\fP"
|
|
.br
|
|
.ti -1c
|
|
.RI "class \fBProgram\fP * \fBProgram\fP"
|
|
.br
|
|
.in -1c
|
|
.SH "Detailed Description"
|
|
.PP
|
|
System dependent I/O\&.
|
|
|
|
|
|
.PP
|
|
Definition in file \fBio\&.h\fP\&.
|
|
.SH "Macro Definition Documentation"
|
|
.PP
|
|
.SS "#define CPROCNAME 'amath_console'"
|
|
|
|
.PP
|
|
Definition at line 40 of file io\&.h\&.
|
|
.SH "Function Documentation"
|
|
.PP
|
|
.SS "void Cleanup ()"
|
|
|
|
.PP
|
|
Definition at line 155 of file io\&.cpp\&.
|
|
.PP
|
|
References FreeAllSafe()\&.
|
|
.PP
|
|
Referenced by main()\&.
|
|
.PP
|
|
.nf
|
|
156 {
|
|
157 #ifdef AMIGA
|
|
158 if (DosBase != NULL) {
|
|
159 CloseLibrary((struct Library*)DosBase);
|
|
160 }
|
|
161
|
|
162 if (LocaleBase != NULL) {
|
|
163 CloseLibrary((struct Library*)LocaleBase);
|
|
164 }
|
|
165
|
|
166 if (GfxBase != NULL) {
|
|
167 CloseLibrary((struct Library*)GfxBase);
|
|
168 }
|
|
169
|
|
170 if (IntuitionBase != NULL) {
|
|
171 CloseLibrary((struct Library*)IntuitionBase);
|
|
172 }
|
|
173 #endif
|
|
174 delete Program;
|
|
175 FreeAllSafe();
|
|
176 }
|
|
.fi
|
|
.SS "class \fBFilesystemBase\fP* CreateFilesystem ()"
|
|
|
|
.PP
|
|
Definition at line 125 of file io\&.cpp\&.
|
|
.PP
|
|
Referenced by StandardLanguage::LoadCatalog(), and Program::Program()\&.
|
|
.PP
|
|
.nf
|
|
126 {
|
|
127 #ifdef AMIGA
|
|
128 DosBase = (struct DosBase*)OpenLibrary(AMIGADOS_NAME, AMIGADOS_REV);
|
|
129 if (DosBase == NULL) {
|
|
130 return NULL;
|
|
131 }
|
|
132 return new AmigaFilesystem();
|
|
133 #else
|
|
134 return new StandardFilesystem();
|
|
135 #endif
|
|
136 }
|
|
.fi
|
|
.SS "class \fBGraphWindow\fP* CreateGraphWindow ()"
|
|
|
|
.PP
|
|
Definition at line 138 of file io\&.cpp\&.
|
|
.PP
|
|
Referenced by GraphList::CreateNewWindow()\&.
|
|
.PP
|
|
.nf
|
|
138 {
|
|
139 #ifdef AMIGA
|
|
140 return new AmigaGraphWindow();
|
|
141 #else
|
|
142 return NOMEM;
|
|
143 #endif
|
|
144 }
|
|
.fi
|
|
.SS "class \fBLanguage\fP* CreateLanguage ()"
|
|
|
|
.PP
|
|
Definition at line 100 of file io\&.cpp\&.
|
|
.PP
|
|
References PosixLanguage::PosixLanguage(), and StandardLanguage::StandardLanguage()\&.
|
|
.PP
|
|
Referenced by Program::Program()\&.
|
|
.PP
|
|
.nf
|
|
101 {
|
|
102 #ifdef UNIX
|
|
103 return new PosixLanguage();
|
|
104 #endif
|
|
105 #ifdef AMIGA
|
|
106 LocaleBase = (struct LocaleBase*)OpenLibrary(LOCALE_NAME, LOCALE_REV);
|
|
107 if (LocaleBase != NULL) {
|
|
108 return new AmigaLanguage();
|
|
109 } else
|
|
110 #endif
|
|
111 {
|
|
112 return new StandardLanguage();
|
|
113 }
|
|
114 }
|
|
.fi
|
|
.SS "class \fBPreferencesBase\fP* CreatePreferences ()"
|
|
|
|
.PP
|
|
Definition at line 116 of file io\&.cpp\&.
|
|
.PP
|
|
Referenced by Program::Program()\&.
|
|
.PP
|
|
.nf
|
|
117 {
|
|
118 #ifdef AMIGA
|
|
119 return new AmigaPreferences();
|
|
120 #else
|
|
121 return new StandardPreferences();
|
|
122 #endif
|
|
123 }
|
|
.fi
|
|
.SS "class \fBProgram\fP* CreateProgram (int, char **)"
|
|
|
|
.PP
|
|
Definition at line 77 of file io\&.cpp\&.
|
|
.PP
|
|
References StandardProgram::StandardProgram()\&.
|
|
.PP
|
|
Referenced by main()\&.
|
|
.PP
|
|
.nf
|
|
77 {
|
|
78 #ifdef WITHTEST
|
|
79 if (argc == 2 && StrIsEqual(argv[1], "test")) {
|
|
80 return new TestProgram();
|
|
81 } else
|
|
82 #endif
|
|
83 {
|
|
84 #ifdef AMIGA
|
|
85 IntuitionBase = (struct IntuitionBase*)OpenLibrary(INTUITION_NAME, INTUITION_REV);
|
|
86 GfxBase = (struct GfxBase*)OpenLibrary(GRAPHICS_NAME, GRAPHICS_REV);
|
|
87
|
|
88 if (IntuitionBase != NULL && GfxBase != NULL) {
|
|
89 return new AmigaProgram();
|
|
90 } else {
|
|
91 return new StandardProgram();
|
|
92 }
|
|
93 #else
|
|
94 return new StandardProgram();
|
|
95 #endif
|
|
96 }
|
|
97 return NULL;
|
|
98 }
|
|
.fi
|
|
.SS "void WriteToShell (const char *)"
|
|
|
|
.PP
|
|
Definition at line 146 of file io\&.cpp\&.
|
|
.PP
|
|
Referenced by StandardProgram::Run()\&.
|
|
.PP
|
|
.nf
|
|
146 {
|
|
147 #ifdef AMIGA
|
|
148 Write(Output(), (APTR)out, StrLen(out));
|
|
149 Write(Output(), (APTR)NORMALTEXT, StrLen(NORMALTEXT));
|
|
150 #else
|
|
151 printf("%s%s", out, NORMALTEXT);
|
|
152 #endif
|
|
153 }
|
|
.fi
|
|
.SH "Variable Documentation"
|
|
.PP
|
|
.SS "class \fBProgram\fP* \fBProgram\fP"
|
|
|
|
.PP
|
|
Definition at line 69 of file io\&.cpp\&.
|
|
.SS "const char* vers"
|
|
|
|
.PP
|
|
Definition at line 68 of file io\&.cpp\&.
|
|
.SH "Author"
|
|
.PP
|
|
Generated automatically by Doxygen for amath from the source code\&.
|