home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / HPACK78S.ZIP / data / gui.txt < prev    next >
Text File  |  1992-11-16  |  6KB  |  136 lines

  1. Basics:
  2. -------
  3.  
  4. All directories can be referred to either by name or by a a magic number (the
  5. directory ID).  Either can be used, but the preferred way is to use the
  6. directory ID.  Some of the functions refer to this ID, some use pointers to
  7. directory or file headers.  As an example, getParent() takes an ID and
  8. returns the ID of the parent directory.  Other functions return either a
  9. FILEHDRLIST or DIRHDRLIST pointer which point directly at the file or
  10. directory headers (which contains filenames, timestamps, data sizes, file
  11. types, etc etc).
  12.  
  13. To display a directory, use the code in GUI.C.  This works roughly as follows:
  14.  
  15. call getFirstDirEntry() to get the first directory in dirPtr;
  16. while( dirPtr != NULL )
  17.     call getNextDirEntry() to get next directory in dirPtr;
  18.  
  19. call getFirstFileEntry() to get first file in filePtr;
  20. while( filePtr != NULL )
  21.     call getNextFileEntry() to get next directory in filePtr;
  22.  
  23. To get the previous directory/file, call getPrevDirEntry(),
  24. getPrevFileEntry().
  25.  
  26. There are various functions in ARCDIR.C to do this, and other housekeeping
  27. stuff like:
  28.  
  29. WORD getParent( WORD dirNo )
  30.     Returns the ID of the parent directory of the given directory ID.
  31. char *getDirName( WORD dirNo )
  32.     Returns the name of the directory with the given directory ID.
  33. LONG getDirTime( WORD dirNo )
  34.     Returns the timestamp of the directory with the given directory ID.
  35. void setDirTime( WORD dirNo, LONG timeStamp )
  36.     Sets the timestamp for the directory with the given directory ID.
  37.  
  38. void sortFiles( WORD dirNo )
  39.     Sort the files in a given directory by name.  Note that this changes the
  40.     order so it no longer corresponds to the order of the data in the archive.
  41.  
  42. FILEHDRLIST *getFirstFileEntry( const WORD dirNo )
  43.     Returns the first file entry in the current directory, or NULL if none.
  44. FILEHDRLIST *getNextFileEntry( void )
  45.     Returns the next file entry in the current directory, or NULL if none.
  46. FILEHDRLIST *getPrevFileEntry( void )
  47.     Returns the previous file entry in the current directory, or NULL if none.
  48.  
  49. DIRHDRLIST *getFirstDirEntry( const WORD dirNo )
  50.     Returns the first directory entry in the current directory, or NULL if
  51.     none.
  52. DIRHDRLIST *getNextDirEntry( void )
  53.     Returns the next directory entry in the current directory, or NULL if
  54.     none.
  55. DIRHDRLIST *getPrevDirEntry( void )
  56.     Returns the previous directory entry current directory, or NULL if none.
  57.  
  58. int matchPath( const char *pathName, const int pathLen, WORD *pathDirIndex )
  59.     Determines whether the path 'pathName' of length 'pathLen' is in the
  60.     archive directory structure.  Returns the directory ID in 'pathDirIndex'.
  61.     Basically used to go from dir.path -> dir.ID.  Returns PATH_FULLMATCH if
  62.     the path is in the archive, PATH_PARTIALMATCH is part of the path is in
  63.     the archive, and PATH_NOMATCH if none of the path is in the archive.
  64.  
  65. void selectFile( FILEHDRLIST *fileHeader, BOOLEAN status )
  66.     Selects a file, where 'status' is TRUE to select it, FALSE to unselect it.
  67. void selectDir( DIRHDRLIST *dirHeader, BOOLEAN status )
  68.     Selects this directory and all files and directories it contains.
  69.     'status' is TRUE to select the directory and all files it contains, FALSE
  70.     to unselect the directory and all files it contains.  NB Haven't tested
  71.     this one yet but it's based on fixEverything() so it should work.
  72.  
  73. General Menu Layout:
  74. --------------------
  75.  
  76. The options menu is laid out as follows:
  77.  
  78.   Encryption...
  79.     Conventional-key encryption
  80.       Get main password;
  81.       Get secondary password (optional);
  82.         If secondary userID/password given:
  83.                 -> cryptFlags |= CRYPT_SEC | CRYPT_CKE_ALL;
  84.     Public-key encryption
  85.       Get main userID, point char *mainUserID to it;
  86.       Get secondary userID (optional), point char *secUserID to it;
  87.         If secondary userID/password given:
  88.                 -> cryptFlags |= CRYPT_SEC | CRYPT_PKE_ALL;
  89.     Encrypt entire archive 
  90.                 -> cryptFlags |= CRYPT_{CKE,PKE}_ALL;
  91.     Encrypt individual files    
  92.                 -> cryptFlags |= CRYPT_{CKE,PKE}
  93.   Authentication...
  94.     Get userID, point char *signUserID to it;
  95.     Secure entire archive
  96.                 -> cryptFlags |= CRYPT_SIGN_ALL;
  97.     Secure individual files
  98.                 -> cryptFlags |= CRYPT_SIGN;
  99.   Overwrite options:
  100.     All         -> overwriteFlags |= OVERWRITE_ALL;
  101.     None        -> overwriteFlags |= OVERWRITE_NONE;
  102.     Smart       -> overwriteFlags |= OVERWRITE_SMART;
  103.     Prompt      -> overwriteFlags |= OVERWRITE_PROMPT;
  104.   Translate options:
  105.     Smart       -> xlateFlags = XLATE_SMART;
  106.     CR          -> xlateFlags |= XLATE_EOL;
  107.                    lineEndChar = '\r';
  108.     LF          -> xlateFlags |= XLATE_EOL;
  109.                    lineEndChar = '\n';
  110.     CRLF        -> xlateFlags |= XLATE_EOL;
  111.                    lineEndChar = '\r' | 0x80;
  112.     EBCDIC      -> xlateFlags |= XLATE_EBCDIC;
  113.     Prime       -> xlateFlags |= XLATE_PRIME;
  114.     ASCII       -> 
  115.     Hex const   -> xlateFlags |= XLATE_EOL;
  116.                    lineEndChar = hex byte;
  117.   Miscellaneous options:
  118.     Stealth mode -> flags |= STEALTH_MODE;
  119.     Touch file on extraction
  120.                 -> flags |= TOUCH_FILES;
  121.     Create multipart archive
  122.                 -> flags |= MULTIPART_ARCH;
  123.     Add error recovery information
  124.                 -> flags |= ERROR_RECOVER;
  125.     Store file/directory attributes
  126.                 -> flags |= STORE_ATTR;
  127.     Interactive mode
  128.                 -> flags |= CONFIRM_ALL;
  129.     Store all directories
  130.                 -> dirFlags |= DIR_ALLPATHS;
  131.     Don't create directories within archive
  132.                 -> dirFlags |= DIR_NOCREATE;
  133.   Extract to...
  134.     Set char basePath[], int basePathLen;
  135.  
  136. This layout is shown in the resource files and GIF pictures.