MCPcopy Create free account
hub / github.com/Kitware/CMake / Previous_Enum

Function Previous_Enum

Source/CursesDialog/form/fty_enum.c:251–276  ·  view source on GitHub ↗

--------------------------------------------------------------------------- | Facility : libnform | Function : static bool Previous_Enum( | FIELD * field, | const void * argp) | | Description : Check for the previous enumeration value | | Return Values : TRUE - previous value found and l

Source from the content-addressed store, hash-verified

249| FALSE - no previous value loaded
250+--------------------------------------------------------------------------*/
251static bool Previous_Enum(FIELD * field, const void * argp)
252{
253 const enumARG *args = (const enumARG *)argp;
254 int cnt = args->count;
255 char **kwds = &args->kwds[cnt-1];
256 bool ccase = args->checkcase;
257 unsigned char *bp = (unsigned char *)field_buffer(field,0);
258
259 if (kwds) {
260 while(cnt--)
261 {
262 if (Compare((unsigned char *)(*kwds--),bp,ccase)==EXACT)
263 break;
264 }
265
266 if (cnt<=0)
267 kwds = &args->kwds[args->count-1];
268
269 if ((cnt>=0) || (Compare((const unsigned char *)dummy,bp,ccase)==EXACT))
270 {
271 set_field_buffer(field,0,*kwds);
272 return TRUE;
273 }
274 }
275 return FALSE;
276}
277
278
279static FIELDTYPE typeENUM = {

Callers

nothing calls this directly

Calls 3

field_bufferFunction · 0.85
CompareFunction · 0.85
set_field_bufferFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…