Changeset 8123 in orxonox.OLD for branches/gui/src/lib/shell
- Timestamp:
- Jun 2, 2006, 6:16:15 PM (19 years ago)
- Location:
- branches/gui/src/lib/shell
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/shell/shell_buffer.cc
r7764 r8123 41 41 ShellBuffer* ShellBuffer::singletonRef = NULL; 42 42 std::list<std::string> ShellBuffer::buffer; 43 char ShellBuffer::bufferArray[SHELL_BUFFER_SIZE]; 44 43 45 44 46 /** … … 64 66 bool ShellBuffer::addBufferLineStatic(const char* line, ...) 65 67 { 66 va_list arguments;67 va_start(arguments, line);68 69 68 static OrxThread::Mutex ShellBuffer__bufferMutex; 70 69 71 70 OrxThread::MutexLock bufferLock(&ShellBuffer__bufferMutex); 71 72 va_list arguments; 73 va_start(arguments, line); 74 vsnprintf(ShellBuffer::bufferArray, SHELL_BUFFER_SIZE, line, arguments); 75 va_end(arguments); 76 72 77 #if DEBUG_LEVEL < 3 73 78 if (ShellBuffer::singletonRef == NULL) 74 79 #endif 75 vprintf(line, arguments);80 printf(ShellBuffer::bufferArray); 76 81 #if DEBUG_LEVEL < 3 77 82 else … … 79 84 if (ShellBuffer::singletonRef != NULL) 80 85 #endif 81 ShellBuffer::singletonRef->addBufferLine( line, arguments);86 ShellBuffer::singletonRef->addBufferLine(ShellBuffer::bufferArray); 82 87 return true; 83 88 } … … 91 96 * and displays the line as the First Line of the display-buffer 92 97 */ 93 void ShellBuffer::addBufferLine(const char* line , va_list arguments)98 void ShellBuffer::addBufferLine(const char* line) 94 99 { 95 // copy the output to the bufferArray 96 vsprintf(this->bufferArray, line, arguments); 97 98 std::string inputBuffer = this->keepBuffer + this->bufferArray; 100 std::string inputBuffer = this->keepBuffer + line; 99 101 100 102 int lineBegin = 0; -
branches/gui/src/lib/shell/shell_buffer.h
r7762 r8123 33 33 34 34 static bool addBufferLineStatic(const char* line, ...); 35 void addBufferLine(const char* line , va_list arg);35 void addBufferLine(const char* line); 36 36 37 37 /// BUFFER … … 56 56 unsigned int maxBufferSize; //!< The Size of the buffer 57 57 58 char bufferArray[SHELL_BUFFER_SIZE]; //!< a BUFFER for fast writing59 58 std::string keepBuffer; //!< a BUFFER to have multi-non-newLine commands be copied into the shell. 60 59 … … 62 61 63 62 // The Beginning of buffer (buffer.front()) is the last added line. 63 static char bufferArray[SHELL_BUFFER_SIZE]; //!< a BUFFER for fast writing 64 64 static std::list<std::string> buffer; //!< A list of stored char-arrays(strings) to store the history 65 65 };
Note: See TracChangeset
for help on using the changeset viewer.