home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / UNIX / ARCHIE / CLIENTS / NEXTARCH.TAR / NeXTArchie / FTPManager.h < prev    next >
Encoding:
Text File  |  1992-01-25  |  3.9 KB  |  83 lines

  1. /* A subclass of Object that performs ftp excursions on behalf of the
  2.     invoking program */
  3.  
  4. #import <objc/Object.h>
  5. #import <dpsclient/dpsclient.h>
  6. #import <stdio.h>
  7. #import <sys/param.h>
  8.  
  9. @interface FTPManager : Object
  10. {
  11.     char ftpDirectory[MAXPATHLEN];    // Local target directory for ftp transfers
  12.     char *localFilePath ;    // The local system's path for the file being received
  13.     id pwdPanelID;        // The OpenPanel displayed to set the transfer directory
  14.     id saveAsPanelID;    // The SavePanel displayed if file name collision occurs
  15.     id ftpPanelID;        // The Panel displayed during the ftp process
  16.     id ftpErrPanelID;    // A panel that can be brought up by the user to view the last
  17.                         // ftp output if an error occurs
  18.     id ftpErrViewID;        // The scrollview in the ftpErrPanel
  19.     id hostnameFieldID;    // TextField for displaying the hostname
  20.     id messageFieldID;    // TextField for status messages
  21.     id sizeFieldID;        // TextField for displaying the number of bytes transfered
  22.     id statusBoxID;        // The Box which encloses the status objects
  23.     id statusViewID;        // A PercentView object for displaying the percent transfered
  24.     id timerViewID;        // A ClockView for displaying the process time
  25.     int ftpProcessPID;    // The id of the child process running the ftp program
  26.     int ftpMode;            // A variable used to coordinate parent/child communication
  27.     int targetFileSize;    // The size of the remote file being retrieved
  28.     int listingTECalls;    // The number of times the dirListingTE has executed without
  29.                         // seeing the size of the listingBuffer increase
  30.     DPSTimedEntry ftpDaemonTE;    // The process which reads the ftp output
  31.     DPSTimedEntry dirListingTE;        // The process which tries to make sure that
  32.                                     // we don't stall while waiting for a dir listing
  33.     BOOL transferComplete;    // A flag on which the main modal session loops
  34.     BOOL listingTEStarted;    // A flag indicating if the dirListingTE is running
  35.     id errStringTable;        // The NXStringTable of the program error messages
  36.  
  37. // Debugging
  38.     int ftpDebugLevel;
  39.     FILE *errFile;
  40. }
  41.  
  42.     // Ftp process initiation methods
  43. /* Initiate the ftp process to host hostName and retrieve the file targetPathName.
  44.     anonymous is a flag indicating if this should be run as an anonymous ftp and
  45.     as such does not prompt for login info.  The overWrite flag indicates whether
  46.     an alert panel should be displayed when a local file has the same name as
  47.     the remote file.  NO means the user will be prompted, YES means the local
  48.     file will be wiped out without user verification.  A directory listing is
  49.     requested by passing a non-nil value for dirVLINK.  On return, the listing instance
  50.     variable of dirVLINK will be set to a linked list of DirEntry's. */
  51. - runModal: (const char *) hostName get: (const char *) targetPathName;
  52. - runModal: (const char *) hostName get: (const char *) targetPathName anon: (BOOL) anonymous;
  53. - runModal: (const char *) hostName get: (const char *) targetPathName dir: (BOOL) listing;
  54. - runModal: (const char *) hostName get: (const char *) targetPathName anon: (BOOL) anonymous
  55.     write: (BOOL) overWrite binary: (BOOL) mode vlink: dirVLINK;
  56. - abortTransfer: sender;
  57. - displayErrOutput: sender;
  58.  
  59. /* Write a command line to the ftp program */
  60. - writeFtp : sender;
  61. - writeFtpCommand : (char *) formatString, ...;
  62.  
  63. /* Future routines */
  64. - runBatch: (const char *) hostName get: (const char *) targetPathName;
  65. - runBatch: (const char *) hostName get: (const char *) targetPathName priority: (int) priority;
  66.  
  67. /* Set the local transfer directory */
  68. - setLocalDir: sender;
  69. - setLocalPath: (const char *) dirName file: (const char *) fileName panel: (BOOL) display;
  70.  
  71. /* Error handling */
  72. - error:(int) severity key:(const char *) keyString;
  73.  
  74. /* My debugging methods */
  75.     // Required arguemts are: (int) debugLevel,(char *)formatString
  76. - debug: (int) debugLevel, ...;
  77.     // Required arguemts are: (int)condition,(int) debugLevel,(char *)formatString
  78. - conditionalDebug: (BOOL) condition : (int) debugLevel, ...;
  79. - setDebugLevel: sender;
  80. - setErrFile: (FILE *) err;
  81.  
  82. @end
  83.