1 /* $Copyright:
\r *
\r * Copyright © 2000 by the Massachusetts Institute of Technology.
\r *
\r * All rights reserved.
\r *
\r * Permission to use, copy, modify, and distribute this software and its
\r * documentation for any purpose and without fee is hereby granted,
\r * provided that the above copyright notice appear in all copies and that
\r * both that copyright notice and this permission notice appear in
\r * supporting documentation, and that the name of M.I.T. not be used in
\r * advertising or publicity pertaining to distribution of the software
\r * without specific, written prior permission. Furthermore if you modify
\r * this software you must label your software as modified software and not
\r * distribute it in such a fashion that it might be confused with the
\r * original MIT software. M.I.T. makes no representations about the
\r * suitability of this software for any purpose. It is provided "as is"
\r * without express or implied warranty.
\r *
\r * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
\r * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
\r * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
\r *
\r * Individual source code files are copyright MIT, Cygnus Support,
\r * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
\r *
\r * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
\r * and Zephyr are trademarks of the Massachusetts Institute of Technology
\r * (MIT). No commercial use of these trademarks may be made without prior
\r * written permission of MIT.
\r *
\r * "Commercial use" means use of a name in a product or other for-profit
\r * manner. It does NOT prevent a commercial firm from referring to the MIT
\r * trademarks in order to convey information (although in doing so,
\r * recognition of their trademark status should be given).
\r * $
\r */
\r\r/* $Header: /afs/andrew/system/cvs/src/sasl/mac/CommonKClient/mac_kclient3/Headers/KerberosPreferences/KerberosPreferences.h,v 1.2 2001/12/04 02:05:54 rjs3 Exp $ */
\r\r/*
\r *
\r * PreferenceLib.h -- Functions to handle Kerberos Preference file access.
\r *
\r */
\r\r\r#ifndef __KERBEROSPREFERENCES__
\r#define __KERBEROSPREFERENCES__
\r\r#include <KerberosSupport/KerberosConditionalMacros.h>
\r\r#if TARGET_API_MAC_OSX && TARGET_API_MAC_CARBON
\r #include <CoreServices/CoreServices.h>
\r#elif TARGET_API_MAC_OS8 || TARGET_API_MAC_CARBON
\r #include <MacTypes.h>
\r #include <Files.h>
\r#else
\r #error "Unknown OS"
\r#endif
\r\r#if PRAGMA_ONCE
\r#pragma once
\r#endif
\r\r#ifdef __cplusplus
\rextern "C" {
\r#endif
\r\r#if PRAGMA_IMPORT
\r#pragma import on
\r#endif
\r\r#if PRAGMA_STRUCT_ALIGN
\r #pragma options align=mac68k
\r#elif PRAGMA_STRUCT_PACKPUSH
\r #pragma pack(push, 2)
\r#elif PRAGMA_STRUCT_PACK
\r #pragma pack(2)
\r#endif
\r\r/* ************************************************ */
\r/* Locations for where to look for preference files */
\r/* ************************************************ */
\renum
\r{
\r kpUserPreferences = 0x00000001,
\r kpSystemPreferences = 0x00000002
\r};
\r\r/* ********************** */
\r/* Name, Creator and Type */
\r/* ********************** */
\r\r#define kerberosPreferences_FileType FOUR_CHAR_CODE ('pref')
\r#define kerberosPreferences_Creator FOUR_CHAR_CODE ('Krb ')
\r#define kerberosPreferences_FileName "\pKerberos Preferences"
\r\r/* ******************* */
\r/* Function prototypes */
\r/* ******************* */
\r\r/* ********************************************************* */
\r/* Creates a valid preference file at the location specified */
\r/* ********************************************************* */
\rOSErr KPInitializeWithDefaultKerberosLibraryPreferences (
\r const FSSpec* prefLocation);
\r\r/* ****************************************************************************** */
\r/* File the array with list of preferences that match the options provided */
\r/* ****************************************************************************** */
\rOSErr KPGetListOfPreferencesFiles (
\r UInt32 userSystemFlags,
\r FSSpecPtr* thePrefFiles,
\r UInt32* outNumberOfFiles);
\r\r/* ********************************************************* */
\r/* Free the array containing the list of preference files */
\r/* ********************************************************* */
\rvoid KPFreeListOfPreferencesFiles (
\r FSSpecPtr thePrefFiles);
\r\r/* ********************************************************* */
\r/* Check if file exists and is readable */
\r/* ********************************************************* */
\rOSErr KPPreferencesFileIsReadable (
\r const FSSpec* inPrefsFile);
\r\r/* ********************************************************* */
\r/* Check if file is writable */
\r/* ********************************************************* */
\rOSErr KPPreferencesFileIsWritable (
\r const FSSpec* inPrefsFile);
\r\r/* ********************************************************* */
\r/* Create an empty file */
\r/* ********************************************************* */
\rOSErr KPCreatePreferencesFile (
\r const FSSpec* inPrefsFile);
\r\r\r#if PRAGMA_STRUCT_ALIGN
\r #pragma options align=reset
\r#elif PRAGMA_STRUCT_PACKPUSH
\r #pragma pack(pop)
\r#elif PRAGMA_STRUCT_PACK
\r #pragma pack()
\r#endif
\r\r#ifdef PRAGMA_IMPORT_OFF
\r#pragma import off
\r#elif PRAGMA_IMPORT
\r#pragma import reset
\r#endif
\r\r#ifdef __cplusplus
\r}
\r#endif
\r\r#endif /* __KERBEROSPREFERENCES__ */
\r