File: spellpath-extract

package info (click to toggle)
crossfire 1.75.0-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,168 kB
  • sloc: ansic: 83,169; sh: 4,659; perl: 1,736; lex: 1,443; makefile: 1,199; python: 43
file content (28 lines) | stat: -rw-r--r-- 762 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

BEGIN {
        # Read the array data from living.c
        while ((getline buff < living_c) == 1) {
                if (buff ~ /spellpathnames\[/) {
			get_values(buff);
			fth = (tind-1)/4;
			for(i=1;i<tind;i+=5)
		           printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",array[i],
				array[i+1],array[i+2],array[i+3],array[i+4]);
			break;
                }
        }
        close(living_c);
}

function get_values (buff) {
        tind = 1;
        while (1) {
           getline buff < living_c;
           if (buff ~ /};/)
              break;
           gsub("[ \t]*\"", "", buff);
           nr = split(buff, val, ",");
           for (i = 1; i<=nr ; i++)
               if(val[i]!="") array[tind++]=val[i];
        }
}