home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / StdPrefs 1.0 / StdPrefs.h < prev   
Encoding:
C/C++ Source or Header  |  1997-07-24  |  2.2 KB  |  56 lines  |  [TEXT/MPS ]

  1. #ifndef __STDPREFS__
  2. #define __STDPREFS__
  3.  
  4. /* File StdPrefs.h
  5.     Standard preferences file handling routines, interface.
  6.     System 6 or better requires HFS
  7.     Copyright (c) 1996, 1997 by John Montbriand.  All Rights Reserved.
  8.     Permission hereby granted for public use.
  9.         Distribute freely in areas where the laws of copyright apply.
  10.     USE AT YOUR OWN RISK.
  11.     DO NOT DISTRIBUTE MODIFIED COPIES.
  12.     Comments/questions/postcards* to the author at the address:
  13.       John Montbriand
  14.       P.O. Box. 1133
  15.       Saskatoon Saskatchewan Canada
  16.       S7K 3N2
  17.     or by email at:
  18.       tinyjohn@sk.sympatico.ca
  19.     *if you mail a postcard, then I will provide you with technical support
  20.     regarding questions you may have about this file.
  21.           see also: <http://www3.sk.sympatico.ca/tinyjohn>
  22. */
  23.  
  24. #include <Types.h>
  25. #include <Files.h>
  26.  
  27. /* FindPreferencesFolder finds the preferences folder
  28.     returning its volume reference number and directory id. */
  29. OSErr FindPreferencesFolder(short *pvol, long *pdir);
  30.  
  31. /* PrefsDirSearch searches the preferences folder for a file
  32.     with the given creator and type.  If such a file exists, then
  33.     fvol, fdir, and fname are set to refer to the file. */
  34. OSErr PrefsDirSearch(OSType creator, OSType type,
  35.         short *fvol, long *fdir, StringPtr fname);
  36.  
  37. /* FSpPrefsDirSearch is identical to PrefsDirSearch except it returns
  38.     information about the file's location in a file specification record. */
  39. OSErr FSpPrefsDirSearch(OSType creator, OSType type, FSSpec *spec);
  40.  
  41. /* PrefsCreate creates a file in the prefs folder with the given creator
  42.     type and defaultname.  If a file already exists with the name defaultname,
  43.     then a digit (1 2 3...) is appended to defaultname until a unique name
  44.     is found.  This routine creates a resource fork for the file too.  Once
  45.     the file has been successfully created,  fvol, fdir, and fname are set
  46.     to refer to the file.  */
  47. OSErr PrefsCreate(OSType creator, OSType type, StringPtr defaultname,
  48.     short *fvol, long *fdir, StringPtr fname);
  49.  
  50. /* FSpPrefsCreate is identical to PrefsCreate except it returns
  51.     information about the created file's location in a file specification record. */
  52. OSErr FSpPrefsCreate(OSType creator, OSType type, StringPtr defaultname,
  53.     FSSpec *spec);
  54.  
  55. #endif
  56.