home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / flistfrontend / src / fldump.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-06  |  1.6 KB  |  92 lines

  1. #ifndef NO_IDENT
  2. static char *Id = "$Id: fldump.c,v 1.6 1995/06/06 00:54:36 tom Exp $";
  3. #endif
  4.  
  5. /*
  6.  * Title:    fldump.c
  7.  * Author:    Thomas E. Dickey
  8.  * Created:    20 Jul 1985
  9.  * Last update:
  10.  *        18 Mar 1995, prototypes
  11.  *        09 Sep 1985, account for trailing '.' in FNAME
  12.  *        20 Jul 1985
  13.  *
  14.  * Function:    Dump the contents of FLIST's file database for debugging.
  15.  */
  16.  
  17. #include    "textlink.h"
  18. #include    "flist.h"
  19. #include    "dircmd.h"
  20. #include    "ttrace.h"
  21.  
  22. import(pathlist);
  23. import(filelink);
  24. import(filelist); import(numfiles); import(numdlets);
  25.  
  26. static    void    fldump_link (TEXTLINK *p);
  27. static    void    fldump_data (FLINK *p);
  28. static    void    fldump_path (PATHNT *p);
  29.  
  30. tDIRCMD(fldump)
  31. {
  32.     PATHNT    *P;
  33.     FLINK    *p = filelink;
  34.     int    j;
  35.  
  36.     trace ("\n\nDUMP\n");
  37.  
  38.     trace ("PathList\n");
  39.     for (P = pathlist; P; P = P->path_next)
  40.     {
  41.         fldump_link((TEXTLINK *)P);
  42.         fldump_path(P);
  43.         trace ("\n");
  44.     }
  45.  
  46.     trace ("FileList: %d - %d => %d\n",
  47.         numfiles, numdlets, numfiles-numdlets);
  48.     for (j = 0; j < numfiles; j++)
  49.     {
  50.         trace ("[%03d] -> %08X", j, p = filelist[j]);
  51.         fldump_data(p);
  52.     }
  53.  
  54.     trace ("FileLink:\n");
  55.     for (p = filelink; p; p = p->file_next)
  56.     {
  57.         fldump_link((TEXTLINK *)p);
  58.         fldump_data(p);
  59.     }
  60. }
  61.  
  62. static
  63. void    fldump_link (TEXTLINK *p)
  64. {
  65.     int    j;
  66.  
  67.     trace ("%08X ", p);
  68.     for (j = 1; j < 256; j <<= 1)
  69.         trace ("%c", p->refs & j ? '*' : '-');
  70. }
  71.  
  72. static
  73. void    fldump_data (FLINK *p)
  74. {
  75.     static    char    fmt[] =
  76. #if    NAME_DOT
  77.             "%s%s;%d";
  78. #else
  79.             "%s.%s;%d";
  80. #endif
  81.     fldump_path (p->fk.fpath_);
  82.     trace (fmt, p->fk.fname, p->fk.ftype, p->fk.fvers);
  83.     if (p->fk.fstat == RMS$_FNF) trace (" *");
  84.     trace ("\n");
  85. }
  86.  
  87. static
  88. void    fldump_path (PATHNT *p)
  89. {
  90.     trace (" %03d: %s", p->path_sort, p->path_text);
  91. }
  92.