MCPcopy Create free account
hub / github.com/NetHack/NetHack / get_feature_notice_ver

Function get_feature_notice_ver

src/version.c:430–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428#endif
429
430unsigned long
431get_feature_notice_ver(char *str)
432{
433 char buf[BUFSZ];
434 int ver_maj, ver_min, patch;
435 char *istr[3];
436 int j = 0;
437
438 if (!str)
439 return 0L;
440 str = strcpy(buf, str);
441 istr[j] = str;
442 while (*str) {
443 if (*str == '.') {
444 *str++ = '\0';
445 j++;
446 istr[j] = str;
447 if (j == 2)
448 break;
449 } else if (strchr("0123456789", *str) != 0) {
450 str++;
451 } else
452 return 0L;
453 }
454 if (j != 2)
455 return 0L;
456 ver_maj = atoi(istr[0]);
457 ver_min = atoi(istr[1]);
458 patch = atoi(istr[2]);
459 return FEATURE_NOTICE_VER(ver_maj, ver_min, patch);
460 /* macro from hack.h */
461}
462
463unsigned long
464get_current_feature_ver(void)

Callers 1

feature_alert_optsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected