00001
00002 #ifndef __CONSOLE_POSIX_PAL_HPP__
00003 #define __CONSOLE_POSIX_PAL_HPP__
00004
00005 #include <stdio.h>
00006 #include <assert.h>
00007
00008 namespace lfc
00009 {
00010 namespace posixPAL
00011 {
00012
00014
00017 namespace console
00018 {
00019
00020 const int MAX_ERROR_CODE = 0;
00021
00022 enum ErrorCodes
00023 {
00024 errOk,
00025 };
00026
00027 extern const char *messagesTable[MAX_ERROR_CODE + 1];
00028
00029
00031
00034 inline int init()
00035 {
00036 return errOk;
00037 }
00038
00040
00043 inline int cleanup()
00044 {
00045 return errOk;
00046 }
00047
00049
00053 inline int putChar(int value)
00054 {
00055 putchar(value);
00056 return errOk;
00057 }
00058
00060
00064 inline int getChar(int &value)
00065 {
00066 value = getchar();
00067 return errOk;
00068 }
00069
00070
00072
00075 inline int flush()
00076 {
00077 fflush(stdout);
00078 return errOk;
00079 }
00080
00081
00083
00086 inline const char *message(int index)
00087 {
00088 assert(index >= 0 && index <= MAX_ERROR_CODE);
00089 return messagesTable[index];
00090 }
00091
00092
00093 }
00094 }
00095
00096 namespace pal = posixPAL;
00097
00098 }
00099
00100
00101 #endif // __CONSOLE_POSIX_PAL_HPP__