- Timestamp:
- Mar 20, 2009, 7:38:19 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/RpOutcome.cc
r1325 r1352 150 150 Outcome::addContext(const char *rem) 151 151 { 152 // FIXME: There should be a stack of contexts 152 153 if (_contextPtr.isNull()) { 153 154 _contextPtr = new std::string(); … … 158 159 } 159 160 161 #ifdef soon 162 /** 163 * Push context information on to the context stack for an outcome. 164 */ 165 void 166 Outcome::pushContext(const char* format, ...) 167 { 168 char stackSpace[1024]; 169 va_list lst; 170 size_t n; 171 char *bufPtr; 172 173 va_start(lst, format); 174 bufPtr = stackSpace; 175 n = vsnprintf(bufPtr, 1024, format, lst); 176 if (n >= 1024) { 177 bufPtr = (char *)malloc(n); 178 vsnprintf(bufPtr, n, format, lst); 179 } 180 _contexts.push_front(bufPtr); 181 } 182 183 /** 184 * Pop the last context from the stack. 185 */ 186 void 187 Outcome::popContext(void) 188 { 189 _contexts.pop_front(); 190 } 191 192 void 193 Outcome::printContext(void) 194 { 195 list<const char *>::interator iter; 196 197 for (iter = _contexts.begin(); iter != _contexts.end(); iter++) { 198 fprintf(stderr, "Called from %s\n", *iter); 199 } 200 } 201 202 #endif /*soon*/ 203 160 204 /** 161 205 * Query the context stack from an outcome.
Note: See TracChangeset
for help on using the changeset viewer.