-}
-
-char *
-toss_comment(start)
-char *start;
-{
- register char *sp;
-
- /*
- * first, see if the end-of-comment is on the same line
- */
- do {
- while ((sp = index(start, '*')) != NULL)
- if (sp[1] == '/')
- return ++sp;
- else
- start = ++sp;
- start = line;
- lineno++;
- } while (fgets(line, sizeof line, inf) != NULL);
-}
-
-getline()
-{
- long saveftell = ftell( inf );
- register char *cp;
-
- fseek( inf , lineftell , 0 );
- fgets(lbuf, sizeof lbuf, inf);
- cp = rindex(lbuf, '\n');
- if (cp)
- *cp = 0;
- fseek(inf, saveftell, 0);
-}
-
-free_tree(node)
-NODE *node;
-{
-
- while (node) {
- free_tree(node->right);
- cfree(node);
- node = node->left;
- }
-}
-
-add_node(node, cur_node)
- NODE *node,*cur_node;
-{
- register int dif;
-
- dif = strcmp(node->entry, cur_node->entry);
- if (dif == 0) {
- if (node->file == cur_node->file) {
- if (!wflag) {
-fprintf(stderr,"Duplicate entry in file %s, line %d: %s\n",
- node->file,lineno,node->entry);
-fprintf(stderr,"Second entry ignored\n");
- }
- return;
- }
- if (!cur_node->been_warned)
- if (!wflag)
-fprintf(stderr,"Duplicate entry in files %s and %s: %s (Warning only)\n",
- node->file, cur_node->file, node->entry);
- cur_node->been_warned = TRUE;
- return;
- }
-
- if (dif < 0) {
- if (cur_node->left != NULL)
- add_node(node,cur_node->left);
- else
- cur_node->left = node;
- return;
- }
- if (cur_node->right != NULL)
- add_node(node,cur_node->right);
- else
- cur_node->right = node;
-}
-
-put_entries(node)
-reg NODE *node;
-{
- reg char *sp;
-
- if (node == NULL)
- return;
- put_entries(node->left);
- if (xflag == 0)
- if (node->f) { /* a function */
- fprintf(outf, "%s\t%s\t%c^",
- node->entry, node->file, searchar);
- for (sp = node->pat; *sp; sp++)
- if (*sp == '\\')
- fprintf(outf, "\\\\");
- else if (*sp == searchar)
- fprintf(outf, "\\%c", searchar);
- else
- putc(*sp, outf);
- fprintf(outf, "%c\n", searchar);
- }
- else { /* a typedef; text pattern inadequate */
- fprintf(outf, "%s\t%s\t%d\n",
- node->entry, node->file, node->lno);
- }
- else if (vflag)
- fprintf(stdout, "%s %s %d\n",
- node->entry, node->file, (node->lno+63)/64);
- else
- fprintf(stdout, "%-16s%4d %-16s %s\n",
- node->entry, node->lno, node->file, node->pat);
- put_entries(node->right);
-}
-char *dbp = lbuf;
-int pfcnt;
-
-PF_funcs(fi)
- FILE *fi;
-{
-
- pfcnt = 0;
- while (fgets(lbuf, sizeof(lbuf), fi)) {
- lineno++;
- dbp = lbuf;
- if ( *dbp == '%' ) dbp++ ; /* Ratfor escape to fortran */
- while (isspace(*dbp))
- dbp++;
- if (*dbp == 0)
- continue;
- switch (*dbp |' ') {
-
- case 'i':
- if (tail("integer"))
- takeprec();
- break;
- case 'r':
- if (tail("real"))
- takeprec();
- break;
- case 'l':
- if (tail("logical"))
- takeprec();
- break;
- case 'c':
- if (tail("complex") || tail("character"))
- takeprec();
- break;
- case 'd':
- if (tail("double")) {
- while (isspace(*dbp))
- dbp++;
- if (*dbp == 0)
- continue;
- if (tail("precision"))
- break;
- continue;