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

Function grep_check_id

util/makedefs.c:777–804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775}
776
777static int
778grep_check_id(const char *id)
779{
780 struct grep_var *rv;
781
782 while (*id && isspace((uchar) *id))
783 id++;
784 if (!*id) {
785 Fprintf(stderr, "missing identifier in line %d", grep_lineno);
786 grep_errors++;
787 return 0;
788 }
789 rv = grepsearch(id);
790 if (rv) {
791 if (grep_trace) {
792 Fprintf(outputfp, "ID %d %s\n", rv->is_defined, id);
793 }
794 return rv->is_defined;
795 }
796
797 if (grep_trace) {
798 Fprintf(outputfp, "ID U %s\n", id);
799 }
800 Fprintf(stderr, "unknown identifier '%s' in line %d.\n", id, grep_lineno);
801 grep_errors++;
802 return 2; /* So new features can be checked before makedefs
803 * is rebuilt. */
804}
805
806static void
807grep_show_wstack(const char *tag)

Callers 1

do_grep_controlFunction · 0.85

Calls 2

isspaceFunction · 0.85
grepsearchFunction · 0.85

Tested by

no test coverage detected