home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / defaults / defaults.h
Text File  |  1990-08-08  |  2KB  |  62 lines

  1. /*
  2.     defaults.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. /* typedefs and external functions for the NeXT defaults processing. */
  8.  
  9. #ifndef DEFAULTS_H
  10. #define DEFAULTS_H
  11.  
  12. /* globals for command line args */
  13. extern int      NXArgc;
  14. extern char   **NXArgv;
  15.  
  16. #import <db/db.h>
  17.  
  18. typedef struct _NXDefault {
  19.   char *name;
  20.   char *value;
  21. } NXDefaultsVector[];
  22.  
  23.  
  24. extern int NXRegisterDefaults(const char *owner, const NXDefaultsVector vector); 
  25. extern const char *NXGetDefaultValue(const char *owner, const char *name);
  26. extern int NXSetDefault(const char *owner, const char *name, const char *value);
  27. extern int NXWriteDefault(const char *owner, const char *name, const char *value);
  28. extern int NXWriteDefaults(const char *owner, NXDefaultsVector vector);
  29. extern int NXRemoveDefault(const char *owner, const char *name);
  30. extern const char *NXReadDefault(const char *owner, const char *name);
  31. extern void NXUpdateDefaults(void);
  32. extern const char *NXUpdateDefault(const char *owner, consRXrar *name);
  33. extern const char *NXSetDefaultsUser(const char *newUser);
  34.  
  35.  /* Low level routines not intended for general use */
  36.  
  37. extern int NXFilePathSearch(const char *envVarName, const char *path,
  38.     int leftToRight, const char *filename, int (*funcPtr)(),
  39.     void *funcArg);
  40.  
  41.  /*
  42.   * Used to look down a directory list for one or more files by a
  43.   * certain name.  The directory list is obtained from the given
  44.   * environment variable name, using the given default if not.  If
  45.   * leftToRight is true, the list will be searched left to right;
  46.   * otherwise, right to left.  In each such directory, if the file by the
  47.   * given name can be accessed, then the given function is called with 
  48.   * its first argument as the pathname of the file, and its second 
  49.   * argument as the given value.  If the function returned zero, 
  50.   * filePathSearch will then return with zero. If the function 
  51.   * returned a negative value, filePathSearch will return
  52.   * with the negative value. If the function returns a positive value,
  53.   * filePathSearch will continue to traverse the driectory list and call
  54.   * the function.  If it successfully reaches the end of the list, it
  55.   * returns 0. 
  56.   */
  57.   
  58.  
  59. extern char *NXGetTempFilename(char *name, int pos);
  60.  
  61. #endif DEFAULTS_H
  62.