SCCS keywords
SCCS-vsn: contrib/bib/src/invert.c 2.2
#ifndef lint
static char sccsid[] = "@(#)invert.c 2.2 %G%";
#endif not lint
#ifndef lint
static char sccsid[] = "@(#)invert.c 2.2 %G%";
#endif not lint
/* input: records of lines, separated by blank lines
output: key:file1 start/length ... start/length:file2 start/length ...
*/
/* input: records of lines, separated by blank lines
output: key:file1 start/length ... start/length:file2 start/length ...
*/
records++;
kcnt= 0;
length= recsize(input,start);
records++;
kcnt= 0;
length= recsize(input,start);
- sprintf(tag_line, " %s %ld %ld\n", filename, start, length);
+ sprintf(tag_line, " %s %d %d\n", filename, start, length);
while (ftell(input) < start+length && kcnt < max_kcnt)
{ getword(input,word,ignore);
while (ftell(input) < start+length && kcnt < max_kcnt)
{ getword(input,word,ignore);
distinct = shorten(tmpfile,INDEX);
if( silent == 0 )
fprintf(stderr,
distinct = shorten(tmpfile,INDEX);
if( silent == 0 )
fprintf(stderr,
- "%ld documents %ld distinct keys %ld key occurrences\n",
+ "%d documents %d distinct keys %d key occurrences\n",
records, distinct, keys);
}
records, distinct, keys);
}
- sscanf(line,"%s%s%ld%ld", key, file, &start, &length);
- fprintf(out, "%s :%s %ld/%ld", key, file, start, length);
+ sscanf(line,"%s%s%d%d", key, file, &start, &length);
+ fprintf(out, "%s :%s %d/%d", key, file, start, length);
for ( getline(in, line) ; !feof(in); getline(in, line))
for ( getline(in, line) ; !feof(in); getline(in, line))
- { sscanf(line,"%s%s%ld%ld", newkey, newfile, &start, &length);
+ { sscanf(line,"%s%s%d%d", newkey, newfile, &start, &length);
if (strcmp(key,newkey)!=0)
{ strcpy(key, newkey);
strcpy(file, newfile);
if (strcmp(key,newkey)!=0)
{ strcpy(key, newkey);
strcpy(file, newfile);
- fprintf(out, "\n%s :%s %ld/%ld", key, file, start, length);
+ fprintf(out, "\n%s :%s %d/%d", key, file, start, length);
lines++;
}
else if (strcmp(file,newfile)!=0)
{ strcpy(file,newfile);
lines++;
}
else if (strcmp(file,newfile)!=0)
{ strcpy(file,newfile);
- fprintf(out, ":%s %ld/%ld", file, start, length);
+ fprintf(out, ":%s %d/%d", file, start, length);
- fprintf(out, " %ld/%ld", start, length);
+ fprintf(out, " %d/%d", start, length);
}
fprintf(out, "\n");
lines++;
}
fprintf(out, "\n");
lines++;