23 BufferSize = Column = IndentColumn = LineCount = ByteCount = 0;
25 Buffer = Current = NULL;
27 ConvertNewlines =
true;
28 HasTranslations =
false;
29 PausedTranslations =
false;
54 ByteCount = Column = LineCount = 0; LineIsEmpty = 1;
57 ConvertNewlines =
true;
58 HasTranslations =
false;
68 if (! HasTranslations) {
69 HasTranslations =
true;
70 for (
uint i=0; i < 256; i++) {
71 Translation [i] = NULL;
74 Translation [(
byte) ch] = str;
83 if (Buffer != NULL) { my_Tcl_Free( Buffer); }
84 Buffer = my_Tcl_Alloc(
sizeof(
char[length]));
86 if (Buffer != NULL) {
delete[] Buffer; }
87 Buffer =
new char[length];
90 ByteCount = Column = LineCount = 0; LineIsEmpty = 1;
103 LineCount++; ByteCount++; LineIsEmpty = 1;
105 while (Column < IndentColumn) {
107 *Current++ =
' '; Column++; ByteCount++;
122 while (Column < IndentColumn) {
124 *Current++ =
' '; Column++; ByteCount++;
155 if (Column + length >= WrapColumn) {
NewLine(); }
175 if (Column + 1 >= WrapColumn) {
178 *Current =
' '; Current++; ByteCount++; Column++; LineIsEmpty = 0;
189 if (Column + 1 >= WrapColumn) {
NewLine(); }
192 Column++; LineIsEmpty = 0;
203 char currentWord[1024];
205 char * b = currentWord;
208 while (*str !=
' ' && *str !=
'\n' && *str !=
'\0') {
209 *b = *str; b++; str++;
214 if (err !=
OK) {
return err; }
215 if (*str == 0) {
return OK; }
216 if (*str ==
'\n' && !ConvertNewlines) {
221 if (err !=
OK) {
return err; }
235 sprintf(temp,
"%d%s", i, str);
uint strLength(const char *str)
errorT PrintLine(const char *str)
errorT PrintWord(const char *str)
errorT PrintString(const char *str)
void SetBufferSize(uint length)
const errorT ERROR_BufferFull
void AddTranslation(char ch, const char *str)
errorT PrintInt(uint i, const char *str)