MCPcopy Create free account
hub / github.com/CruiserOne/Astrolog / FieldWord

Function FieldWord

intrpret.cpp:67–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65// text with newlines inserted just before the end of screen is reached.
66
67void FieldWord(CONST char *sz)
68{
69 static char line[cchSzMax];
70 static int cursor = 0;
71 int ich = 0, i, j;
72 char ch;
73
74 // Display buffer if function called with a null string.
75
76 if (sz == NULL)
77 sz = "\n";
78 else if (cursor > 0)
79 line[cursor++] = ' ';
80 loop {
81 ch = sz[ich];
82 if (ch == chNull)
83 break;
84 if (ch == '\n') {
85 line[cursor] = 0;
86 PrintSz(line); PrintL();
87 cursor = 0;
88 ich++;
89 continue;
90 }
91 line[cursor] = ch;
92
93 // When buffer overflows 'n' columns, display one line and start over.
94
95 if (cursor >= us.nScreenWidth-1) {
96 for (i = us.nScreenWidth-1; i > 2 && line[i] != ' '; i--)
97 ;
98 if (i <= 2)
99 i = us.nScreenWidth-1;
100 line[i] = 0;
101 PrintSz(line); PrintL();
102 line[0] = line[1] = ' ';
103 for (j = 2; (line[j] = line[j+i-1]) != 0; j++)
104 ;
105 cursor -= (i-1);
106 }
107 ich++, cursor++;
108 }
109}
110
111

Callers 15

NProcessSwitchesRareFunction · 0.85
mainFunction · 0.85
InterpretGeneralFunction · 0.85
InterpretLocationFunction · 0.85
InterpretAspectCoreFunction · 0.85
InterpretMidpointFunction · 0.85
InterpretArabicFunction · 0.85
InterpretInDayFunction · 0.85
InterpretTransitFunction · 0.85
InterpretSynastryFunction · 0.85
InterpretAspectRelationFunction · 0.85

Calls 1

PrintSzFunction · 0.85

Tested by

no test coverage detected