1function isaptr(elem) 2{ 3 if (substr(elem, 1, 1) == "*") { 4 return 1; 5 } 6 return 0; 7} 8 9function noptr(elem) 10{ 11 if (!isaptr(elem)) return elem; 12 return substr(elem, 2); 13} 14 15function xprintf(f, fmt, v1, v2, v3, v4, v5, v6, v7) 16{ 17 printf(fmt, v1, v2, v3, v4, v5, v6) > f; 18} 19 20function fatal(why) 21{ 22 printf("FATAL: %s\n", why); 23 exit 1; 24} 25 26function numlines(fname, 27 LOCAL, line, count) 28{ 29 count=0; 30 while ((getline line < fname) > 0) count++; 31 close(fname); 32 return count; 33} 34 35# return 1 if the string is a constant 36function is_constant(s) 37{ 38 return match(s,"^[0-9]+$"); 39} 40