home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / UNIX / ARCHIE / CLIENTS / NEXTARCH / PROSPERO.H < prev    next >
Encoding:
Text File  |  1992-01-24  |  1.9 KB  |  52 lines

  1. /* A subclass of the Date class which holds the Prospero VLINK info returned by the
  2.     archie_query() procedure */
  3.  
  4. #import <Date.h>    // My Date class
  5. #import <pfs.h>        // Prospero defines, structs
  6. #import <objc/hashtable.h>    // NXAtom type
  7. #import "DirEntry.h"
  8.  
  9. /* struct pattrib name attributes. I could not find these in the prospero includes
  10.     so they are subject to becoming invalid. */
  11. #define SIZE        "SIZE"
  12. #define MODES    "UNIX-MODES"
  13. #define DATE    "LAST-MODIFIED"
  14.  
  15. @interface ProsperoVLINK : Date
  16. {
  17.     int fileSize;            // File size in bytes
  18.     char unixMode[10];    // UNIX files modes
  19.     NXAtom hostname;    // A unique system host
  20.     char *filePath;        // System pathname
  21.     int componentIndex;    // Offset into filePath of the file component
  22.     int fileDepth;        // The level of the file in the directory tree
  23.     char *subPath;        // The buffer for the subpath name returned by the nameAtLevel: method
  24.     id listing;            // A List of ProsperoVLINKs which hold the result of
  25.                         // a ftp dir command.  Only used if a user requests a directory listing
  26.                         // and then only to a depth of 1 below the original query directory.
  27.     // Modification date is represented by the Date superclass members
  28. }
  29.  
  30. /* Initialize an instance from a VLINK structure */
  31. - initVLINK:(VLINK) v;
  32. - initVLINK : (DirEntryPtr) dirList host: (const char *) host
  33.     parent: (const char *) parentPath;
  34. - setListing:(DirEntryPtr) list;
  35.  
  36. /* Instance variable access methods */
  37. - (int) fileSize;
  38. - (int) mode;                // Octal mode representation
  39. - (const char *) unixMode;    // ls -l mode representation
  40. - (BOOL) isDirectory;
  41. - (int) fileDepth;        // Level of file.  Root files have fileDepth == 1
  42. - (const char *) filePath;
  43. - (const char *) fileName;
  44. - (const char *) hostname;
  45. - listing;
  46.  
  47. /* Returns the filename at the requested level.  Returns NULL if
  48.     level is greater than fileDepth */
  49. - (const char *) nameAtLevel: (int) level;
  50.  
  51. @end
  52.