home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / MoreFiles 1.1.1 / MoreFilesExtras.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-22  |  47.1 KB  |  1,250 lines  |  [TEXT/KAHL]

  1. /*
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    A collection of useful high-level File Manager routines.
  5. **
  6. **    by Jim Luther, Apple Developer Technical Support
  7. **
  8. **    File:        MoreFilesExtras.h
  9. **
  10. **    Copyright © 1992-1994 Apple Computer, Inc.
  11. **    All rights reserved.
  12. **
  13. **    You may incorporate this sample code into your applications without
  14. **    restriction, though the sample code has been provided "AS IS" and the
  15. **    responsibility for its operation is 100% yours.  However, what you are
  16. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  17. **    after having made changes. If you're going to re-distribute the source,
  18. **    we require that you make it clear in the source that the code was
  19. **    descended from Apple Sample Code, but that you've made changes.
  20. */
  21.  
  22. #ifndef __MOREFILESEXTRAS__
  23. #define __MOREFILESEXTRAS__
  24.  
  25.  
  26. #ifndef __TYPES__
  27. #include <Types.h>
  28. #endif
  29.  
  30. #ifndef __ERRORS__
  31. #include <Errors.h>
  32. #endif
  33.  
  34. #ifndef __MEMORY__
  35. #include <Memory.h>
  36. #endif
  37.  
  38. #ifndef __OSUTILS__
  39. #include <OSUtils.h>
  40. #endif
  41.  
  42. #ifndef __FILES__
  43. #include <Files.h>
  44. #endif
  45.  
  46. #ifndef __FOLDERS__
  47. #include <Folders.h>
  48. #endif
  49.  
  50. #ifndef __MOREFILES__
  51. #include "MoreFiles.h"
  52. #endif
  53.  
  54. /*    Sharing.h should be in Files.h, but isn't yet... */
  55. //#ifndef __SHARING__
  56. //#include "Sharing.h"
  57. //#endif
  58.  
  59.  
  60. /*
  61. **    Macros to get information out of GetVolParmsInfoBuffer
  62. */
  63.  
  64. #define    isNetworkVolume(volParms)    ((volParms).vMServerAdr != 0)
  65. #define    hasLimitFCBs(volParms)        (((volParms).vMAttrib & (1L << bLimitFCBs)) != 0)
  66. #define    hasLocalList(volParms)        (((volParms).vMAttrib & (1L << bLocalWList)) != 0)
  67. #define    hasNoMiniFndr(volParms)        (((volParms).vMAttrib & (1L << bNoMiniFndr)) != 0)
  68. #define hasNoVNEdit(volParms)        (((volParms).vMAttrib & (1L << bNoVNEdit)) != 0)
  69. #define hasNoLclSync(volParms)        (((volParms).vMAttrib & (1L << bNoLclSync)) != 0)
  70. #define hasTrshOffLine(volParms)    (((volParms).vMAttrib & (1L << bTrshOffLine)) != 0)
  71. #define hasNoSwitchTo(volParms)        (((volParms).vMAttrib & (1L << bNoSwitchTo)) != 0)
  72. #define hasNoDeskItems(volParms)    (((volParms).vMAttrib & (1L << bNoDeskItems)) != 0)
  73. #define hasNoBootBlks(volParms)        (((volParms).vMAttrib & (1L << bNoBootBlks)) != 0)
  74. #define hasAccessCntl(volParms)        (((volParms).vMAttrib & (1L << bAccessCntl)) != 0)
  75. #define hasNoSysDir(volParms)        (((volParms).vMAttrib & (1L << bNoSysDir)) != 0)
  76. #define hasExtFSVol(volParms)        (((volParms).vMAttrib & (1L << bHasExtFSVol)) != 0)
  77. #define hasOpenDeny(volParms)        (((volParms).vMAttrib & (1L << bHasOpenDeny)) != 0)
  78. #define hasCopyFile(volParms)        (((volParms).vMAttrib & (1L << bHasCopyFile)) != 0)
  79. #define hasMoveRename(volParms)        (((volParms).vMAttrib & (1L << bHasMoveRename)) != 0)
  80. #define hasDesktopMgr(volParms)        (((volParms).vMAttrib & (1L << bHasDesktopMgr)) != 0)
  81. #define hasShortName(volParms)        (((volParms).vMAttrib & (1L << bHasShortName)) != 0)
  82. #define hasFolderLock(volParms)        (((volParms).vMAttrib & (1L << bHasFolderLock)) != 0)
  83. #define hasPersonalAccessPrivileges(volParms) \
  84.         (((volParms).vMAttrib & (1L << bHasPersonalAccessPrivileges)) != 0)
  85. #define hasUserGroupList(volParms)    (((volParms).vMAttrib & (1L << bHasUserGroupList)) != 0)
  86. #define hasCatSearch(volParms)        (((volParms).vMAttrib & (1L << bHasCatSearch)) != 0)
  87. #define hasFileIDs(volParms)        (((volParms).vMAttrib & (1L << bHasFileIDs)) != 0)
  88. #define hasBTreeMgr(volParms)        (((volParms).vMAttrib & (1L << bHasBTreeMgr)) != 0)
  89. #define hasBlankAccessPrivileges(volParms) \
  90.         (((volParms).vMAttrib & (1L << bHasBlankAccessPrivileges)) != 0)
  91.  
  92. /*
  93. **    Deny mode permissions for use with the HOpenAware, HOpenRFAware,
  94. **    FSpOpenAware, and FSpOpenRFAware functions.
  95. */
  96.  
  97. enum
  98. {
  99.     dmNone            = 0x0000,
  100.     dmNoneDenyRd    = 0x0010,
  101.     dmNoneDenyWr    = 0x0020,
  102.     dmNoneDenyRdWr    = 0x0030,
  103.     dmRd            = 0x0001,    /* Single writer, multiple readers; the readers */
  104.     dmRdDenyRd        = 0x0011,
  105.     dmRdDenyWr        = 0x0021,    /* Browsing - equivalent to fsRdPerm */
  106.     dmRdDenyRdWr    = 0x0031,
  107.     dmWr            = 0x0002,
  108.     dmWrDenyRd        = 0x0012,
  109.     dmWrDenyWr        = 0x0022,
  110.     dmWrDenyRdWr    = 0x0032,
  111.     dmRdWr            = 0x0003,    /* Shared access - equivalent to fsRdWrShPerm */
  112.     dmRdWrDenyRd    = 0x0013,
  113.     dmRdWrDenyWr    = 0x0023,    /* Single writer, multiple readers; the writer */
  114.     dmRdWrDenyRdWr    = 0x0033    /* Exclusive access - equivalent to fsRdWrPerm */
  115. };
  116.     
  117.  
  118. /*
  119. **    For those times where you need to use more than one kind of File Manager parameter
  120. **    block but don't feel like wasting stack space, here's a parameter block you can reuse.
  121. */
  122. union UniversalFMPB
  123. {
  124.     ParamBlockRec    PB;
  125.     CInfoPBRec        ciPB;
  126.     DTPBRec            dtPB;
  127.     HParamBlockRec    hPB;
  128.     CMovePBRec        cmPB;
  129.     WDPBRec            wdPB;
  130.     FCBPBRec        fcbPB;
  131. };
  132. typedef union UniversalFMPB UniversalFMPB;
  133. typedef UniversalFMPB *UniversalFMPBPtr, **UniversalFMPBHandle;
  134.  
  135.  
  136. /*
  137. **    Used by GetUGEntries to return user or group lists
  138. */
  139. struct UGEntry
  140. {
  141.     short    objType;    /* object type: -1 = group; 0 = user */
  142.     long    objID;        /* the user or group ID */
  143.     Str31    name;        /* the user or group name */
  144. };
  145. typedef struct UGEntry UGEntry;
  146. typedef UGEntry *UGEntryPtr, **UGEntryHandle;
  147.  
  148.  
  149. typedef unsigned char Str8[9];
  150.  
  151.  
  152. /*
  153. **    I use the following record instead of the AFPVolMountInfo structure in Files.h
  154. */
  155. struct MyAFPVolMountInfo
  156. {
  157.     short length;                /* length of this record */
  158.     VolumeType media;            /* type of media, always AppleShareMediaType */
  159.     short flags;                /* 0 = normal mount; set bit 0 to inhibit greeting messages */
  160.     char nbpInterval;            /* NBP interval parameter; 7 is a good choice */
  161.     char nbpCount;                /* NBP count parameter; 5 is a good choice */
  162.     short uamType;                /* User Authentication Method */
  163.     short zoneNameOffset;        /* offset from start of record to zoneName */
  164.     short serverNameOffset;        /* offset from start of record to serverName */
  165.     short volNameOffset;        /* offset from start of record to volName */
  166.     short userNameOffset;        /* offset from start of record to userName */
  167.     short userPasswordOffset;    /* offset from start of record to userPassword */
  168.     short volPasswordOffset;    /* offset from start of record to volPassword */
  169.     Str31 zoneName;                /* server's AppleTalk zone name */                    
  170.     Str31 serverName;            /* server name */                    
  171.     Str27 volName;                /* volume name */                    
  172.     Str31 userName;                /* user name (zero length Pascal string for guest) */
  173.     Str8 userPassword;            /* user password (zero length Pascal string if no user password) */                    
  174.     char filler1;                /* to word align volPassword */
  175.     Str8 volPassword;            /* volume password (zero length Pascal string if no volume password) */                    
  176.     char filler2;                /* to end record on word boundry */
  177. };
  178. typedef struct MyAFPVolMountInfo MyAFPVolMountInfo;
  179. typedef MyAFPVolMountInfo *MyAFPVolMountInfoPtr, **MyAFPVolMountInfoHandle;
  180.  
  181.  
  182. /*****************************************************************************/
  183.  
  184. pascal    OSErr    NameFileSearch(StringPtr volName,
  185.                                short vRefNum,
  186.                                const Str255 fileName,
  187.                                FSSpecPtr matches,
  188.                                long reqMatchCount,
  189.                                long *actMatchCount,
  190.                                Boolean newSearch,
  191.                                Boolean partial);
  192. /*    Use NameFileSearch to search for files with a specific file name on a
  193.     volume that supports PBCatSearch.
  194.     Note: A result of catChangedErr means the catalog has changed between
  195.     searches, but the search can be continued with the possiblity that you
  196.     may miss some matches or get duplicate matches.  For all other results
  197.     (except for noErr), the search cannot be continued.
  198.  
  199.     volName            input:    A pointer to the name of a mounted volume
  200.                             or nil.
  201.     vRefNum            input:    Volume specification.
  202.     fileName        input:    The name of the file to search for.
  203.     matches            input:    Pointer to array of FSSpec where the match list is
  204.                             returned.
  205.     reqMatchCount    input:    Maximum number of matches to return    (the number of
  206.                             elements in the matches array).
  207.     actMatchCount    output: The number of matches actually returned.
  208.     newSearch        input:    If true, start a new search. If false and if
  209.                             vRefNum is the same as the last call to
  210.                             NameFileSearch, then start searching at the
  211.                             position where the last search left off.
  212.     partial            input:    If the partial parameter is false, then only files
  213.                             that exactly match fileName will be found.  If the
  214.                             partial parameter is true, then all file names that
  215.                             contain fileName will be found.
  216. */
  217.  
  218. /*****************************************************************************/
  219.  
  220. pascal    OSErr    CreatorTypeFileSearch(StringPtr volName,
  221.                                       short vRefNum,
  222.                                       OSType creator,
  223.                                       OSType fileType,
  224.                                       FSSpecPtr matches,
  225.                                       long reqMatchCount,
  226.                                       long *actMatchCount,
  227.                                       Boolean newSearch);
  228. /*    Use CreatorTypeFileSearch to search for files with a specific creator
  229.     or fileType on a volume that supports PBCatSearch.
  230.     Note: A result of catChangedErr means the catalog has changed between
  231.     searches, but the search can be continued with the possiblity that you
  232.     may miss some matches or get duplicate matches.  For all other results
  233.     (except for noErr), the search cannot be continued.
  234.  
  235.     volName            input:    A pointer to the name of a mounted volume
  236.                             or nil.
  237.     vRefNum            input:    Volume specification.
  238.     creator            input:    The creator type of the file to search for.
  239.                             To ignore the creator type, pass 0x00000000 in
  240.                             this field.
  241.     fileType        input:    The file type of the file to search for.
  242.                             To ignore the file type, pass 0x00000000 in
  243.                             this field.
  244.     matches            input:    Pointer to array of FSSpec where the match list is
  245.                             returned.
  246.     reqMatchCount    input:    Maximum number of matches to return    (the number of
  247.                             elements in the matches array).
  248.     actMatchCount    output: The number of matches actually returned.
  249.     newSearch        input:    If true, start a new search. If false and if
  250.                             vRefNum is the same as the last call to
  251.                             CreatorTypeFileSearch, then start searching at the
  252.                             position where the last search left off.
  253. */
  254.  
  255. /*****************************************************************************/
  256.  
  257. pascal    OSErr    DetermineVRefNum(StringPtr pathname,
  258.                                  short vRefNum,
  259.                                  short *realVRefNum);
  260. /*    Use DetermineVRefNum to determine the volume reference number of a
  261.     volume from a pathname, a volume specification, or a combination
  262.     of the two.
  263.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  264.     mounted volumes can have the same name. For this reason, the use of a
  265.     volume name or full pathname to identify a specific volume may not
  266.     produce the results you expect.  If more than one volume has the same
  267.     name and a volume name or full pathname is used, the File Manager
  268.     currently uses the first volume it finds with a matching name in the
  269.     volume queue.
  270.  
  271.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  272.                         partial pathname, it is ignored. A full pathname to a
  273.                         volume must end with a colon character (:).
  274.     vRefNum        input:    Volume specification (volume reference number, working
  275.                         directory number, drive number, or 0).
  276.     realVRefNum    output:    The real volume reference number.
  277. */
  278.  
  279. /*****************************************************************************/
  280.  
  281. pascal    OSErr    UnmountAndEject(StringPtr pathname,
  282.                                 short vRefNum);
  283. /*    Use UnmountAndEject to unmount and eject a volume. The volume is ejected
  284.     only if it's ejectable and not already ejected.
  285.     
  286.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  287.                         partial pathname, it is ignored. A full pathname to a
  288.                         volume must end with a colon character (:).
  289.     vRefNum        input:    Volume specification (volume reference number, working
  290.                         directory number, drive number, or 0).
  291. */
  292.  
  293. /*****************************************************************************/
  294.  
  295. pascal    OSErr    OnLine(FSSpecPtr volumes,
  296.                        short reqVolCount,
  297.                        short *actVolCount,
  298.                        short *volIndex);
  299. /*    Use OnLine to return the list of volumes currently mounted.
  300.  
  301.     volumes        input:    Pointer to array of FSSpec where the volume list
  302.                         is returned.
  303.     reqVolCount    input:    Maximum number of volumes to return    (the number of
  304.                         elements in the volumes array).
  305.     actVolCount    output: The number of volumes actually returned.
  306.     volIndex    input:    The current volume index position. Set to 1 to
  307.                         start with the first volume.
  308.                 output:    The volume index position to get the next volume.
  309.                         Pass this value the next time you call OnLine to
  310.                         start where you left off.
  311. */
  312.  
  313. /*****************************************************************************/
  314.  
  315. pascal    OSErr    GetDirID(short vRefNum,
  316.                          long dirID,
  317.                          StringPtr name,
  318.                          long *theDirID,
  319.                          Boolean *isDirectory);
  320. /*    Use GetDirID to get the directory ID number of the directory
  321.     specified.  If a file is specified, then the parent
  322.     directory of the file is returned and isDirectory is false.  If
  323.     a directory is specified, then that directory's ID number is
  324.     returned and isDirectory is true.
  325.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  326.     mounted volumes can have the same name. For this reason, the use of a
  327.     volume name or full pathname to identify a specific volume may not
  328.     produce the results you expect.  If more than one volume has the same
  329.     name and a volume name or full pathname is used, the File Manager
  330.     currently uses the first volume it finds with a matching name in the
  331.     volume queue.
  332.     
  333.     vRefNum            input:    Volume specification.
  334.     dirID            input:    Directory ID.
  335.     name            input:    Pointer to object name, or nil when dirID
  336.                             specifies a directory that's the object.
  337.     theDirID        output:    If the object is a file, then its parent directory
  338.                             ID. If the object is a directory, then its ID.
  339.     isDirectory        output:    True if object is a directory; false if
  340.                             object is a file.
  341. */
  342.  
  343. /*****************************************************************************/
  344.  
  345. pascal    OSErr    DirIDFromFSSpec(const FSSpec *spec,
  346.                                 long *dirID,
  347.                                 Boolean *isDirectory);
  348. /*    Use DirIDFromFSSpec to get the directory ID number of the directory
  349.     specified by spec. If spec is to a file, then the parent
  350.     directory of the file is returned and isDirectory is false.  If
  351.     spec is to a directory, then that directory's ID number is
  352.     returned and isDirectory is true.
  353.     
  354.     spec            input:    An FSSpec record specifying the directory.
  355.     theDirID        output:    The directory ID.
  356.     isDirectory        output:    True if object is a directory; false if
  357.                             object is a file.
  358. */
  359.  
  360. /*****************************************************************************/
  361.  
  362. pascal    OSErr    GetDirName(short vRefNum,
  363.                            long dirID,
  364.                            StringPtr name);
  365. /*    Use GetDirName to get the name of a directory from its directory ID.
  366.  
  367.     vRefNum        input:    Volume specification.
  368.     dirID        input:    Directory ID.
  369.     name        output:    Points to a buffer (minimum Str63) where the
  370.                         directory name is to be returned or must be nil.
  371. */
  372.  
  373. /*****************************************************************************/
  374.  
  375. pascal    OSErr    GetParentID(short vRefNum,
  376.                             long dirID,
  377.                             StringPtr name,
  378.                             long *parID);
  379. /*    Use GetParentID to get the parent directory ID number of the specified
  380.     object.
  381.     
  382.     vRefNum        input:    Volume specification.
  383.     dirID        input:    Directory ID.
  384.     name        input:    Pointer to object name, or nil when dirID specifies
  385.                         a directory that's the object.
  386.     parID        output:    The parent directory ID of the specified object.
  387. */
  388.  
  389. /*****************************************************************************/
  390.  
  391. pascal    OSErr    GetFilenameFromPathname(const Str255 pathname,
  392.                                         Str255 filename);
  393. /*    Use GetFilenameFromPathname to get the file (or directory) name from
  394.     the end of a full or partial pathname. Returns notAFileErr if the
  395.     pathname is nil, the pathname is empty, or the pathname cannot refer to
  396.     a filename (with a noErr result, the pathname could still refer to a
  397.     directory). GetFilenameFromPathname is used by GetObjectLocation.
  398.     
  399.     pathname    input:    A full or partial pathname.
  400.     filename    output:    The file (or directory) name.
  401. */
  402.  
  403. /*****************************************************************************/
  404.  
  405. pascal    OSErr    GetObjectLocation(short vRefNum,
  406.                                   long dirID,
  407.                                   StringPtr pathname,
  408.                                   short *realVRefNum,
  409.                                   long *realParID,
  410.                                   Str255 realName,
  411.                                   Boolean *isDirectory);
  412. /*    Use GetObjectLocation to get a file system object's location - that is,
  413.     its real volume reference number, real parent directory ID, and name.
  414.     While we're at it, determine if the object is a file or directory.
  415.     If GetObjectLocation returns fnfErr, then the location information
  416.     returned is valid, but it describes an object that doesn't exist.
  417.     You can use the location information for another operation, such as
  418.     creating a file or directory.
  419.     
  420.     vRefNum        input:    Volume specification.
  421.     dirID        input:    Directory ID.
  422.     pathname    input:    Pointer to object name, or nil when dirID specifies
  423.                         a directory that's the object.
  424.     realVRefNum    output:    The real volume reference number.
  425.     realParID    output:    The parent directory ID of the specified object.
  426.     realName    output:    The name of the specified object (the case of the
  427.                         object name may not be the same as the object's
  428.                         catalog entry on disk - since the Macintosh file
  429.                         system is not case sensitive, it shouldn't matter).
  430.     isDirectory    output:    True if object is a directory; false if object
  431.                         is a file.
  432. */
  433.  
  434. /*****************************************************************************/
  435.  
  436. pascal    OSErr    GetDirItems(short vRefNum,
  437.                             long dirID,
  438.                             StringPtr name,
  439.                             Boolean getFiles,
  440.                             Boolean getDirectories,
  441.                             FSSpecPtr items,
  442.                             short reqItemCount,
  443.                             short *actItemCount,
  444.                             short *itemIndex);
  445. /*    Use GetDirItems to return a list of items in a directory.
  446.  
  447.     vRefNum            input:    Volume specification.
  448.     dirID            input:    Directory ID.
  449.     name            input:    Pointer to object name, or nil when dirID
  450.                             specifies a directory that's the object.
  451.     getFiles        input:    Pass true to have files added to the items list.
  452.     getDirectories    input:    Pass true to have directories added to the
  453.                             items list.
  454.     items            input:    Pointer to array of FSSpec where the item list
  455.                             is returned.
  456.     reqItemCount    input:    Maximum number of items to return (the number
  457.                             of elements in the items array).
  458.     actItemCount    output: The number of volumes actually returned.
  459.     itemIndex        input:    The current item index position. Set to 1 to
  460.                             start with the first item in the directory.
  461.                     output:    The item index position to get the next item.
  462.                             Pass this value the next time you call
  463.                             GetDirItems to start where you left off.
  464. */
  465.  
  466. /*****************************************************************************/
  467.  
  468. pascal    OSErr    DeleteDirectoryContents(short vRefNum,
  469.                                          long dirID,
  470.                                         StringPtr name);
  471. /*    Use DeleteDirectoryContents to delete the contents of a directory.
  472.     All files and subdirectories in the specified directory are deleted.
  473.     If a locked file or directory is encountered, it is unlocked and then
  474.     deleted.  If any unexpected errors are encountered,
  475.     DeleteDirectoryContents quits and returns to the caller.
  476.     
  477.     vRefNum    input:    Volume specification.
  478.     dirID    input:    Directory ID.
  479.     name    input:    Pointer to directory name, or nil when dirID specifies
  480.                     a directory that's the object.
  481. */
  482.  
  483. /*****************************************************************************/
  484.  
  485. pascal    OSErr    DeleteDirectory(short vRefNum,
  486.                                 long dirID,
  487.                                 StringPtr name);
  488. /*    Use DeleteDirectory to delete a directory and its contents.
  489.     All files and subdirectories in the specified directory are deleted.
  490.     If a locked file or directory is encountered, it is unlocked and then
  491.     deleted.  After deleting the directories contents, the directory is
  492.     deleted. If any unexpected errors are encountered, DeleteDirectory
  493.     quits and returns to the caller.
  494.     
  495.     vRefNum    input:    Volume specification.
  496.     dirID    input:    Directory ID.
  497.     name    input:    Pointer to directory name, or nil when dirID specifies
  498.                     a directory that's the object.
  499. */
  500.  
  501. /*****************************************************************************/
  502.  
  503. pascal    OSErr    BumpDate(short vRefNum,
  504.                          long dirID,
  505.                          StringPtr name);
  506. /*    Use BumpDate to change the modification date of a file or directory to
  507.     the current date/time.  If the modification date is already equal to
  508.     the current date/time, then add one second to the modification date.
  509.     
  510.     vRefNum    input:    Volume specification.
  511.     dirID    input:    Directory ID.
  512.     name    input:    Pointer to object name, or nil when dirID specifies
  513.                     a directory that's the object.
  514. */
  515.  
  516. /*****************************************************************************/
  517.  
  518. pascal    OSErr    FSpBumpDate(const FSSpec *spec);
  519. /*    Use FSpBumpDate to change the modification date of a file or directory
  520.     to the current date/time.  If the modification date is already equal
  521.     to the current date/time, then add one second to the modification date.
  522.     
  523.     spec    input:    An FSSpec record specifying the object.
  524. */
  525.  
  526. /*****************************************************************************/
  527.  
  528. pascal    OSErr    ChangeCreatorType(short vRefNum,
  529.                                   long dirID,
  530.                                   const Str255 name,
  531.                                   OSType creator,
  532.                                   OSType fileType);
  533. /*    Use ChangeCreatorType to change the creator or file type of a file.
  534.  
  535.     vRefNum        input:    Volume specification.
  536.     dirID        input:    Directory ID.
  537.     name        input:    The name of the file.
  538.     creator        input:    The new creator type or 0x00000000 to leave
  539.                         the creator type alone.
  540.     fileType    input:    The new file type or 0x00000000 to leave the
  541.                         file type alone.
  542. */
  543.  
  544. /*****************************************************************************/
  545.  
  546. pascal    OSErr    FSpChangeCreatorType(const FSSpec *spec,
  547.                                      OSType creator,
  548.                                      OSType fileType);
  549. /*    Use FSpChangeCreatorType to change the creator or file type of a file.
  550.  
  551.     spec        input:    An FSSpec record specifying the file.
  552.     creator        input:    The new creator type or 0x00000000 to leave
  553.                         the creator type alone.
  554.     fileType    input:    The new file type or 0x00000000 to leave the
  555.                         file type alone.
  556. */
  557.  
  558. /*****************************************************************************/
  559.  
  560. pascal    OSErr    ChangeFDFlags(short vRefNum,
  561.                               long dirID,
  562.                               StringPtr name,
  563.                               Boolean    setBits,
  564.                               unsigned short flagBits);
  565. /*    Use ChangeFDFlags to set or clear Finder Flag bits in the fdFlags field
  566.     of a file or directory's FInfo record.
  567.     
  568.     vRefNum        input:    Volume specification.
  569.     dirID        input:    Directory ID.
  570.     name        input:    Pointer to object name, or nil when dirID specifies
  571.                         a directory that's the object.
  572.     setBits        input:    If true, then set the bits specified in flagBits.
  573.                         If false, then clear the bits specified in flagBits.
  574.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  575.                         bits to set or clear. If a bit in flagBits is set,
  576.                         then the same bit in fdFlags is either set or
  577.                         cleared depending on the state of the setBits
  578.                         parameter.
  579. */
  580.  
  581. /*****************************************************************************/
  582.  
  583. pascal    OSErr    FSpChangeFDFlags(const FSSpec *spec,
  584.                                  Boolean setBits,
  585.                                  unsigned short flagBits);
  586. /*    Use FSpChangeFDFlags to set or clear Finder Flag bits in the fdFlags
  587.     field of a file or directory's FInfo record.
  588.     
  589.     spec        input:    An FSSpec record specifying the object.
  590.     setBits        input:    If true, then set the bits specified in flagBits.
  591.                         If false, then clear the bits specified in flagBits.
  592.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  593.                         bits to set or clear. If a bit in flagBits is set,
  594.                         then the same bit in fdFlags is either set or
  595.                         cleared depending on the state of the setBits
  596.                         parameter.
  597. */
  598.  
  599. /*****************************************************************************/
  600.  
  601. pascal    OSErr    SetIsInvisible(short vRefNum,
  602.                                long dirID,
  603.                                StringPtr name);
  604. /*    Use SetIsInvisible to set the invisible bit in the fdFlags word of the
  605.     specified file or directory's finder information.
  606.     
  607.     vRefNum    input:    Volume specification.
  608.     dirID    input:    Directory ID.
  609.     name    input:    Pointer to object name, or nil when dirID specifies
  610.                     a directory that's the object.
  611. */
  612.  
  613. /*****************************************************************************/
  614.  
  615. pascal    OSErr    FSpSetIsInvisible(const FSSpec *spec);
  616. /*    Use FSpSetIsInvisible to set the invisible bit in the fdFlags word of
  617.     the specified file or directory's finder information.
  618.     
  619.     spec    input:    An FSSpec record specifying the object.
  620. */
  621.  
  622. /*****************************************************************************/
  623.  
  624. pascal    OSErr    ClearIsInvisible(short vRefNum,
  625.                                  long dirID,
  626.                                  StringPtr name);
  627. /*    Use ClearIsInvisible to clear the invisible bit in the fdFlags word of
  628.     the specified file or directory's finder information.
  629.     
  630.     vRefNum    input:    Volume specification.
  631.     dirID    input:    Directory ID.
  632.     name    input:    Pointer to object name, or nil when dirID specifies
  633.                     a directory that's the object.
  634. */
  635.  
  636. /*****************************************************************************/
  637.  
  638. pascal    OSErr    FSpClearIsInvisible(const FSSpec *spec);
  639. /*    Use FSpClearIsInvisible to clear the invisible bit in the fdFlags word
  640.     of the specified file or directory's finder information.
  641.     
  642.     spec    input:    An FSSpec record specifying the object.
  643. */
  644.  
  645. /*****************************************************************************/
  646.  
  647. pascal    OSErr    SetNameLocked(short vRefNum,
  648.                               long dirID,
  649.                               StringPtr name);
  650. /*    Use SetNameLocked to set the nameLocked bit in the fdFlags word of the
  651.     specified file or directory's finder information.
  652.     
  653.     vRefNum    input:    Volume specification.
  654.     dirID    input:    Directory ID.
  655.     name    input:    Pointer to object name, or nil when dirID specifies
  656.                     a directory that's the object.
  657. */
  658.  
  659. /*****************************************************************************/
  660.  
  661. pascal    OSErr    FSpSetNameLocked(const FSSpec *spec);
  662. /*    Use FSpSetNameLocked to set the nameLocked bit in the fdFlags word of
  663.     the specified file or directory's finder information.
  664.     
  665.     spec    input:    An FSSpec record specifying the object.
  666. */
  667.  
  668. /*****************************************************************************/
  669.  
  670. pascal    OSErr    ClearNameLocked(short vRefNum,
  671.                                 long dirID,
  672.                                 StringPtr name);
  673. /*    Use ClearNameLocked to clear the nameLocked bit in the fdFlags word of
  674.     the specified file or directory's finder information.
  675.     
  676.     vRefNum    input:    Volume specification.
  677.     dirID    input:    Directory ID.
  678.     name    input:    Pointer to object name, or nil when dirID specifies
  679.                     a directory that's the object.
  680. */
  681.  
  682. /*****************************************************************************/
  683.  
  684. pascal    OSErr    FSpClearNameLocked(const FSSpec *spec);
  685. /*    Use FSpClearNameLocked to clear the nameLocked bit in the fdFlags word
  686.     of the specified file or directory's finder information.
  687.     
  688.     spec    input:    An FSSpec record specifying the object.
  689. */
  690.  
  691. /*****************************************************************************/
  692.  
  693. pascal    OSErr    SetIsStationery(short vRefNum,
  694.                                 long dirID,
  695.                                 const Str255 name);
  696. /*    Use SetIsStationery to set the isStationery bit in the fdFlags word
  697.     of the specified file or directory's finder information.
  698.     
  699.     vRefNum    input:    Volume specification.
  700.     dirID    input:    Directory ID.
  701.     name    input:    Pointer to object name, or nil when dirID specifies
  702.                     a directory that's the object.
  703. */
  704.  
  705. /*****************************************************************************/
  706.  
  707. pascal    OSErr    FSpSetIsStationery(const FSSpec *spec);
  708. /*    Use FSpSetIsStationery to set the isStationery bit in the fdFlags
  709.     word of the specified file or directory's finder information.
  710.     
  711.     spec    input:    An FSSpec record specifying the object.
  712. */
  713.  
  714. /*****************************************************************************/
  715.  
  716. pascal    OSErr    ClearIsStationery(short vRefNum,
  717.                                   long dirID,
  718.                                   const Str255 name);
  719. /*    Use ClearIsStationery to clear the isStationery bit in the fdFlags
  720.     word of the specified file or directory's finder information.
  721.     
  722.     vRefNum    input:    Volume specification.
  723.     dirID    input:    Directory ID.
  724.     name    input:    Pointer to object name, or nil when dirID specifies
  725.                     a directory that's the object.
  726. */
  727.  
  728. /*****************************************************************************/
  729.  
  730. pascal    OSErr    FSpClearIsStationery(const FSSpec *spec);
  731. /*    Use FSpClearIsStationery to clear the isStationery bit in the fdFlags
  732.     word of the specified file or directory's finder information.
  733.     
  734.     spec    input:    An FSSpec record specifying the object.
  735. */
  736.  
  737. /*****************************************************************************/
  738.  
  739. pascal    OSErr    SetHasCustomIcon(short vRefNum,
  740.                                  long dirID,
  741.                                  StringPtr name);
  742. /*    Use SetHasCustomIcon to set the hasCustomIcon bit in the fdFlags word
  743.     of the specified file or directory's finder information.
  744.     
  745.     vRefNum    input:    Volume specification.
  746.     dirID    input:    Directory ID.
  747.     name    input:    Pointer to object name, or nil when dirID specifies
  748.                     a directory that's the object.
  749. */
  750.  
  751. /*****************************************************************************/
  752.  
  753. pascal    OSErr    FSpSetHasCustomIcon(const FSSpec *spec);
  754. /*    Use FSpSetHasCustomIcon to set the hasCustomIcon bit in the fdFlags
  755.     word of the specified file or directory's finder information.
  756.     
  757.     spec    input:    An FSSpec record specifying the object.
  758. */
  759.  
  760. /*****************************************************************************/
  761.  
  762. pascal    OSErr    ClearHasCustomIcon(short vRefNum,
  763.                                    long dirID,
  764.                                    StringPtr name);
  765. /*    Use ClearHasCustomIcon to clear the hasCustomIcon bit in the fdFlags
  766.     word of the specified file or directory's finder information.
  767.     
  768.     vRefNum    input:    Volume specification.
  769.     dirID    input:    Directory ID.
  770.     name    input:    Pointer to object name, or nil when dirID specifies
  771.                     a directory that's the object.
  772. */
  773.  
  774. /*****************************************************************************/
  775.  
  776. pascal    OSErr    FSpClearHasCustomIcon(const FSSpec *spec);
  777. /*    Use FSpClearHasCustomIcon to clear the hasCustomIcon bit in the fdFlags
  778.     word of the specified file or directory's finder information.
  779.     
  780.     spec    input:    An FSSpec record specifying the object.
  781. */
  782.  
  783. /*****************************************************************************/
  784.  
  785. pascal    OSErr    ClearHasBeenInited(short vRefNum,
  786.                                    long dirID,
  787.                                    StringPtr name);
  788. /*    Use ClearHasBeenInited to clear the hasBeenInited bit in the fdFlags
  789.     word of the specified file or directory's finder information.
  790.     
  791.     vRefNum    input:    Volume specification.
  792.     dirID    input:    Directory ID.
  793.     name    input:    Pointer to object name, or nil when dirID specifies
  794.                     a directory that's the object.
  795. */
  796.  
  797. /*****************************************************************************/
  798.  
  799. pascal    OSErr    FSpClearHasBeenInited(const FSSpec *spec);
  800. /*    Use FSpClearHasBeenInited to clear the hasBeenInited bit in the fdFlags
  801.     word of the specified file or directory's finder information.
  802.     
  803.     spec    input:    An FSSpec record specifying the object.
  804. */
  805.  
  806. /*****************************************************************************/
  807.  
  808. pascal    OSErr    CopyFileMgrAttributes(short srcVRefNum,
  809.                                       long srcDirID,
  810.                                       StringPtr srcName,
  811.                                       short dstVRefNum,
  812.                                       long dstDirID,
  813.                                       StringPtr dstName,
  814.                                       Boolean copyLockBit);
  815. /*    Use CopyFileMgrAttributes to copy all File Manager attributes from the
  816.     source file or directory to the destination file or directory.
  817.     If copyLockBit is true, then set the locked state of the destination
  818.     to match the source.
  819.  
  820.     srcVRefNum    input:    Source volume specification.
  821.     srcDirID    input:    Source directory ID.
  822.     srcName        input:    Pointer to source object name, or nil when
  823.                         srcDirID specifies a directory that's the object.
  824.     dstVRefNum    input:    Destination volume specification.
  825.     dstDirID    input:    Destination directory ID.
  826.     dstName        input:    Pointer to destination object name, or nil when
  827.                         dstDirID specifies a directory that's the object.
  828.     copyLockBit    input:    If true, set the locked state of the destination
  829.                         to match the source.
  830. */
  831.  
  832. /*****************************************************************************/
  833.  
  834. pascal    OSErr    FSpCopyFileMgrAttributes(const FSSpec *srcSpec,
  835.                                          const FSSpec *dstSpec,
  836.                                          Boolean copyLockBit);
  837. /*    Use FSpCopyFileMgrAttributes to copy all File Manager attributes from
  838.     the source file or directory to the destination file or directory.
  839.     If copyLockBit is true, then set the locked state of the destination
  840.     to match the source.
  841.  
  842.     srcSpec        input:    An FSSpec record specifying the source object.
  843.     dstSpec        input:    An FSSpec record specifying the destination object.
  844.     copyLockBit    input:    If true, set the locked state of the destination
  845.                         to match the source.
  846. */
  847.  
  848. /*****************************************************************************/
  849.  
  850. pascal    OSErr    HOpenAware(short vRefNum,
  851.                            long dirID,
  852.                            const Str255 fileName,
  853.                            short denyModes,
  854.                            short *refNum);
  855. /*    Use HOpenAware to open the data fork of a file using deny mode
  856.     permissions instead the normal File Manager permissions.  If OpenDeny
  857.     is not available, then HOpenAware translates the deny modes to the
  858.     closest File Manager permissions and tries to open the file with
  859.     OpenDF first, and then Open if OpenDF isn't available. By using
  860.     HOpenAware with deny mode permissions, a program can be "AppleShare
  861.     aware" and fall back on the standard File Manager open calls
  862.     automatically.
  863.  
  864.     vRefNum        input:    Volume specification.
  865.     dirID        input:    Directory ID.
  866.     fileName    input:    The name of the file.
  867.     denyModes    input:    The deny modes access under which to open the file.
  868.     refNum        output:    The file reference number of the opened file.
  869. */
  870.  
  871. /*****************************************************************************/
  872.  
  873. pascal    OSErr    FSpOpenAware(const FSSpec *spec,
  874.                              short denyModes,
  875.                              short *refNum);
  876. /*    Use FSpOpenAware to open the data fork of a file using deny mode
  877.     permissions instead the normal File Manager permissions.  If OpenDeny
  878.     is not available, then FSpOpenAware translates the deny modes to the
  879.     closest File Manager permissions and tries to open the file with
  880.     OpenDF first, and then Open if OpenDF isn't available. By using
  881.     FSpOpenAware with deny mode permissions, a program can be "AppleShare
  882.     aware" and fall back on the standard File Manager open calls
  883.     automatically.
  884.  
  885.     spec        input:    An FSSpec record specifying the file.
  886.     denyModes    input:    The deny modes access under which to open the file.
  887.     refNum        output:    The file reference number of the opened file.
  888. */
  889.  
  890. /*****************************************************************************/
  891.  
  892. pascal    OSErr    HOpenRFAware(short vRefNum,
  893.                              long dirID,
  894.                              const Str255 fileName,
  895.                              short denyModes,
  896.                              short *refNum);
  897. /*    Use HOpenRFAware to open the resource fork of a file using deny mode
  898.     permissions instead the normal File Manager permissions.  If OpenRFDeny
  899.     is not available, then HOpenRFAware translates the deny modes to the
  900.     closest File Manager permissions and tries to open the file with
  901.     OpenRF. By using HOpenRFAware with deny mode permissions, a program
  902.     can be "AppleShare aware" and fall back on the standard File Manager
  903.     open calls automatically.
  904.  
  905.     vRefNum        input:    Volume specification.
  906.     dirID        input:    Directory ID.
  907.     fileName    input:    The name of the file.
  908.     denyModes    input:    The deny modes access under which to open the file.
  909.     refNum        output:    The file reference number of the opened file.
  910. */
  911.  
  912. /*****************************************************************************/
  913.  
  914. pascal    OSErr    FSpOpenRFAware(const FSSpec *spec,
  915.                                short denyModes,
  916.                                short *refNum);
  917. /*    Use FSpOpenRFAware to open the resource fork of a file using deny mode
  918.     permissions instead the normal File Manager permissions.  If OpenRFDeny
  919.     is not available, then FSpOpenRFAware translates the deny modes to the
  920.     closest File Manager permissions and tries to open the file with
  921.     OpenRF. By using FSpOpenRFAware with deny mode permissions, a program
  922.     can be "AppleShare aware" and fall back on the standard File Manager
  923.     open calls automatically.
  924.  
  925.     spec        input:    An FSSpec record specifying the file.
  926.     denyModes    input:    The deny modes access under which to open the file.
  927.     refNum        output:    The file reference number of the opened file.
  928. */
  929.  
  930. /*****************************************************************************/
  931.  
  932. pascal    OSErr    FSReadNoCache(short refNum,
  933.                               long *count,
  934.                               void *buffPtr);
  935. /*    Use FSReadNoCache to read any number of bytes from an open file while
  936.     asking the file system to bypass its cache mechanism.
  937.     
  938.     refNum    input:    The file reference number of an open file.
  939.     count    input:    The number of bytes to read.
  940.             output:    The number of bytes actually read.
  941.     buffPtr    input:    A pointer to the data buffer into which the bytes are
  942.                     to be read.
  943. */
  944.  
  945. /*****************************************************************************/
  946.  
  947. pascal    OSErr    FSWriteNoCache(short refNum,
  948.                                long *count,
  949.                                const void *buffPtr);
  950. /*    Use FSReadNoCache to write any number of bytes to an open file while
  951.     asking the file system to bypass its cache mechanism.
  952.     
  953.     refNum    input:    The file reference number of an open file.
  954.     count    input:    The number of bytes to write to the file.
  955.             output:    The number of bytes actually written.
  956.     buffPtr    input:    A pointer to the data buffer from which the bytes are
  957.                     to be written.
  958. */
  959.  
  960.  
  961. /*****************************************************************************/
  962.  
  963. pascal    OSErr    CopyFork(short srcRefNum,
  964.                          short dstRefNum,
  965.                          void *copyBufferPtr,
  966.                          long copyBufferSize);
  967. /*    Use CopyFork to copy all data from the source fork to the destination
  968.     fork of open file forks and makes sure the destination EOF is equal
  969.     to the source EOF.
  970.     
  971.     srcRefNum        input:    The source file reference number.
  972.     dstRefNum        input:    The destination file reference number.
  973.     copyBufferPtr    input:    Pointer to buffer to use during copy. The
  974.                             buffer should be at least 512-bytes minimum.
  975.                             The larger the buffer, the faster the copy.
  976.     copyBufferSize    input:    The size of the copy buffer.
  977. */
  978.  
  979. /*****************************************************************************/
  980.  
  981. pascal    OSErr    GetFileLocation(short refNum,
  982.                                 short *vRefNum,
  983.                                 long *dirID,
  984.                                 StringPtr fileName);
  985. /*    Use GetFileLocation to get the location (volume reference number,
  986.     directory ID, and fileName) of an open file.
  987.  
  988.     refNum        input:    The file reference number of an open file.
  989.     vRefNum        output:    The volume reference number.
  990.     dirID        output:    The parent directory ID.
  991.     fileName    input:    Points to a buffer (minimum Str63) where the
  992.                         filename is to be returned or must be nil.
  993.                 output:    The filename.
  994. */
  995.  
  996. /*****************************************************************************/
  997.  
  998. pascal    OSErr    FSpGetFileLocation(short refNum,
  999.                                    FSSpec *spec);
  1000. /*    Use FSpGetFileLocation to get the location of an open file in an
  1001.     FSSpec record.
  1002.  
  1003.     refNum        input:    The file reference number of an open file.
  1004.     spec        output:    FSSpec record containing the file name and location.
  1005. */
  1006.  
  1007. /*****************************************************************************/
  1008.  
  1009. pascal    OSErr    CopyDirectoryAccess(short srcVRefNum,
  1010.                                     long srcDirID,
  1011.                                     StringPtr srcName,
  1012.                                     short dstVRefNum,
  1013.                                     long dstDirID,
  1014.                                     StringPtr dstName);
  1015. /*    Use CopyDirectoryAccess to copy the AFP directory access privileges from
  1016.     one directory to another. Both directories must be on the same file server,
  1017.     but not necessarily on the same server volume.
  1018.     
  1019.     srcVRefNum    input:    Source volume specification.
  1020.     srcDirID    input:    Source directory ID.
  1021.     srcName        input:    Pointer to source directory name, or nil when
  1022.                         srcDirID specifies the directory.
  1023.     dstVRefNum    input:    Destination volume specification.
  1024.     dstDirID    input:    Destination directory ID.
  1025.     dstName        input:    Pointer to destination directory name, or nil when
  1026.                         dstDirID specifies the directory.
  1027. */
  1028.  
  1029. /*****************************************************************************/
  1030.  
  1031. pascal    OSErr    FSpCopyDirectoryAccess(const FSSpec *srcSpec,
  1032.                                        const FSSpec *dstSpec);
  1033. /*    Use FSpCopyDirectoryAccess to copy the AFP directory access privileges from
  1034.     one directory to another. Both directories must be on the same file server,
  1035.     but not necessarily on the same server volume.
  1036.  
  1037.     srcSpec        input:    An FSSpec record specifying the source directory.
  1038.     dstSpec        input:    An FSSpec record specifying the destination directory.
  1039. */
  1040.  
  1041. /*****************************************************************************/
  1042.  
  1043. pascal    OSErr    HMoveRenameCompat(short vRefNum,
  1044.                                   long srcDirID,
  1045.                                   const Str255 srcName,
  1046.                                   long dstDirID,
  1047.                                   StringPtr dstpathName,
  1048.                                   StringPtr copyName);
  1049. /*    Use HMoveRenameCompat to move a file or directory and optionally to
  1050.     rename it.  The source and destination locations must be on the same
  1051.     volume. This routine works even if the volume doesn't support MoveRename.
  1052.     
  1053.     vRefNum        input:    Volume specification.
  1054.     srcDirID    input:    Source directory ID.
  1055.     srcName        input:    The source object name.
  1056.     dstDirID    input:    Destination directory ID.
  1057.     dstName        input:    Pointer to destination directory name, or
  1058.                         nil when dstDirID specifies a directory.
  1059.     copyName    input:    Points to the new name if the object is to be
  1060.                         renamed or nil if the object isn't to be renamed.
  1061. */
  1062.  
  1063. /*****************************************************************************/
  1064.  
  1065. pascal    OSErr    FSpMoveRenameCompat(const FSSpec *srcSpec,
  1066.                                     const FSSpec *dstSpec,
  1067.                                     StringPtr copyName);
  1068. /*    Use FSpMoveRenameCompat to move a file or directory and optionally to
  1069.     rename it. The source and destination locations must be on the same
  1070.     volume. This routine works even if the volume doesn't support MoveRename.
  1071.     
  1072.     srcSpec        input:    An FSSpec record specifying the source object.
  1073.     dstSpec        input:    An FSSpec record specifying the destination
  1074.                         directory.
  1075.     copyName    input:    Points to the new name if the object is to be
  1076.                         renamed or nil if the object isn't to be renamed.
  1077. */
  1078.  
  1079. /*****************************************************************************/
  1080.  
  1081. pascal    void    BuildAFPVolMountInfo(short theFlags,
  1082.                                      char theNBPInterval,
  1083.                                      char theNBPCount,
  1084.                                      short theUAMType,
  1085.                                      Str31 theZoneName,
  1086.                                      Str31 theServerName,
  1087.                                      Str27 theVolName,
  1088.                                      Str31 theUserName,
  1089.                                      Str8 theUserPassWord,
  1090.                                      Str8 theVolPassWord,
  1091.                                      MyAFPVolMountInfoPtr theAFPInfo);
  1092. /*    Use BuildAFPVolMountInfo to initialize the fields of an AFPVolMountInfo
  1093.     record before using that record to call the VolumeMount function.
  1094.     
  1095.     theFlags        input:    The AFP mounting flags. 0 = normal mount;
  1096.                             set bit 0 to inhibit greeting messages.
  1097.     theNBPInterval    input:    The interval used for VolumeMount's
  1098.                             NBP Lookup call. 7 is a good choice.
  1099.     theNBPCount        input:    The retry count used for VolumeMount's
  1100.                             NBP Lookup call. 5 is a good choice.
  1101.     theUAMType        input:    The user authentication method to use.
  1102.     theZoneName        input:    The AppleTalk zone name of the server.
  1103.     theServerName    input:    The AFP server name.
  1104.     theVolName        input:    The AFP volume name.
  1105.     theUserName        input:    The user name (zero length Pascal string for
  1106.                             guest).
  1107.     theUserPassWord    input:    The user password (zero length Pascal string
  1108.                             if no user password)
  1109.     theVolPassWord    input:    The volume password (zero length Pascal string
  1110.                             if no volume password)
  1111.     theAFPInfo        input:    Pointer to AFPVolMountInfo record to
  1112.                             initialize.
  1113. */
  1114.  
  1115. /*****************************************************************************/
  1116.  
  1117. pascal    OSErr    RetrieveAFPVolMountInfo(AFPVolMountInfoPtr theAFPInfo,
  1118.                                         short *theFlags,
  1119.                                         short *theUAMType,
  1120.                                         StringPtr theZoneName,
  1121.                                         StringPtr theServerName,
  1122.                                         StringPtr theVolName,
  1123.                                         StringPtr theUserName);
  1124. /*    Use RetrieveAFPVolMountInfo to retrieve the AFP mounting information
  1125.     returned in an AFPVolMountInfo by the GetVolMountInfo function.
  1126.     
  1127.     theAFPInfo        input:    Pointer to AFPVolMountInfo record that contains
  1128.                             the AFP mounting information.
  1129.     theFlags        output:    The AFP mounting flags. 0 = normal mount;
  1130.                             if bit 0 is set, greeting meesages were inhibited.
  1131.     theUAMType        output:    The user authentication method used.
  1132.     theZoneName        output:    The AppleTalk zone name of the server.
  1133.     theServerName    output:    The AFP server name.
  1134.     theVolName        output:    The AFP volume name.
  1135.     theUserName        output:    The user name (zero length Pascal string for
  1136.                             guest).
  1137. */
  1138.  
  1139. /*****************************************************************************/
  1140.  
  1141. pascal    OSErr    GetUGEntries(short objType,
  1142.                              UGEntryPtr entries,
  1143.                              long reqEntryCount,
  1144.                              long *actEntryCount,
  1145.                              long *objID);
  1146. /*    Use GetUGEntries to build a list of user or group entries from the
  1147.     local file server.
  1148.  
  1149.     objType            input:    The object type: -1 = group; 0 = user
  1150.     UGEntries        input:    Pointer to array of UGEntry records where the list
  1151.                             is returned.
  1152.     reqEntryCount    input:    The number of elements in the UGEntries array.
  1153.     actEntryCount    output:    The number of entries returned.
  1154.     objID            input:    The current index position. Set to 0 to start with
  1155.                             the first entry.
  1156.                     output:    The index position to get the next entry. Pass this
  1157.                             value the next time you call GetUGEntries to start
  1158.                             where you left off.
  1159. */
  1160.  
  1161. /*****************************************************************************/
  1162.  
  1163. pascal    OSErr    CopyComment(short srcVRefNum,
  1164.                             long srcDirID,
  1165.                             StringPtr srcName,
  1166.                             short dstVRefNum,
  1167.                             long dstDirID,
  1168.                             StringPtr dstName);
  1169. /*    Use CopyComment to copy the desktop database comment from the source
  1170.     to the destination object.  Both source and the destination volumes
  1171.     must support the Desktop Manager.
  1172.     
  1173.     srcVRefNum    input:    Source volume specification.
  1174.     srcDirID    input:    Source directory ID.
  1175.     srcName        input:    Pointer to source object name, or nil when srcDirID
  1176.                         specifies a directory that's the object.
  1177.     dstVRefNum    input:    Destination volume specification.
  1178.     dstDirID    input:    Destination directory ID.
  1179.     dstName        input:    Pointer to destination object name, or nil when
  1180.                         dstDirID specifies a directory that's the object.
  1181. */
  1182.  
  1183. /*****************************************************************************/
  1184.  
  1185. pascal    OSErr    FSpCopyComment(const FSSpec *srcSpec,
  1186.                                const FSSpec *dstSpec);
  1187. /*    Use FSpCopyComment to copy the desktop database comment from the source
  1188.     to the destination object.  Both the source and the destination volumes
  1189.     must support the Desktop Manager.
  1190.     
  1191.     srcSpec        input:    An FSSpec record specifying the source object.
  1192.     dstSpec        input:    An FSSpec record specifying the destination object.
  1193. */
  1194.  
  1195. /*****************************************************************************/
  1196.  
  1197. pascal    OSErr    SetComment(short vRefNum,
  1198.                              long dirID,
  1199.                              StringPtr name,
  1200.                              const Str255 comment);
  1201. /*    Use SetComment to set a file or directory's Finder comment field.
  1202.  
  1203.     vRefNum    input:    Volume specification.
  1204.     dirID    input:    Directory ID.
  1205.     name    input:    Pointer to object name, or nil when dirID
  1206.                     specifies a directory that's the object.
  1207.     comment    input:    The comment to add. Comments are limited to 200 characters;
  1208.                     longer comments are clipped.
  1209. */
  1210.  
  1211. /*****************************************************************************/
  1212.  
  1213. pascal    OSErr    FSpSetComment(const FSSpec *spec,
  1214.                              const Str255 comment);
  1215. /*    Use FSpSetComment to set a file or directory's Finder comment field.
  1216.  
  1217.     spec    input:    An FSSpec record specifying the file or directory.
  1218.     comment    input:    The comment to add. Comments are limited to 200 characters;
  1219.                     longer comments are clipped.
  1220. */
  1221.  
  1222. /*****************************************************************************/
  1223.  
  1224. pascal    OSErr    GetComment(short vRefNum,
  1225.                              long dirID,
  1226.                              StringPtr name,
  1227.                              StringPtr comment);
  1228. /*    Use GetComment to get a file or directory's Finder comment field (if any).
  1229.  
  1230.     vRefNum    input:    Volume specification.
  1231.     dirID    input:    Directory ID.
  1232.     name    input:    Pointer to object name, or nil when dirID
  1233.                     specifies a directory that's the object.
  1234.     comment    output:    Points to a buffer (minimum STRING[200]) where the
  1235.                     comment is to be returned.
  1236. */
  1237.  
  1238. /*****************************************************************************/
  1239.  
  1240. pascal    OSErr    FSpGetComment(const FSSpec *spec,
  1241.                               StringPtr comment);
  1242. /*    Use GetComment to get a file or directory's Finder comment field (if any).
  1243.  
  1244.     spec    input:    An FSSpec record specifying the file or directory.
  1245.     comment    output:    Points to a buffer (minimum STRING[200]) where the
  1246.                     comment is to be returned.
  1247. */
  1248.  
  1249. #endif
  1250.