File indexing completed on 2018-03-02 18:44:48 UTC
view on githubraw file Latest commit ec6cf3b0 on 2003-08-26 20:45:25 UTC
ec6cf3b09d Ed H*0001 /* (C) Copyright 1995 by Carnegie Mellon University
0002 * All Rights Reserved.
0003 *
0004 * Permission to use, copy, modify, distribute, and sell this software
0005 * and its documentation for any purpose is hereby granted without
0006 * fee, provided that the above copyright notice appear in all copies
0007 * and that both that copyright notice and this permission notice
0008 * appear in supporting documentation, and that the name of Carnegie
0009 * Mellon University not be used in advertising or publicity
0010 * pertaining to distribution of the software without specific,
0011 * written prior permission. Carnegie Mellon University makes no
0012 * representations about the suitability of this software for any
0013 * purpose. It is provided "as is" without express or implied
0014 * warranty.
0015 *
0016 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
0017 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
0018 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
0019 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
0020 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
0021 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
0022 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
0023 * SOFTWARE.
0024 */
0025 /*
0026 The canonical Internet Config interface is defined in Pascal. These headers have
0027 not been thoroughly tested. If there is a conflict between these headers and the
0028 Pascal interfaces, the Pascal should take precedence.
0029
0030
0031 /* ///////////////////////////////////////////////////////////////////////////////// */
0032
0033 #ifndef __ICAPI__
0034 #define __ICAPI__
0035
0036 #ifndef __TYPES__
0037 #include <Types.h>
0038 #endif
0039
0040 #ifndef __FILES__
0041 #include <Files.h>
0042 #endif
0043
0044 #ifndef __ICTYPES__
0045 #include <ICTypes.h>
0046 #endif
0047
0048 /* ///////////////////////////////////////////////////////////////////////////////// */
0049
0050 #ifdef __cplusplus
0051 extern "C" {
0052 #endif
0053
0054 pascal ICError ICStart(ICInstance *inst, OSType creator);
0055 /* call at application initialisation */
0056
0057 pascal ICError ICStop(ICInstance inst);
0058 /* call at application termination */
0059
0060 pascal ICError ICFindConfigFile(ICInstance inst, short count, ICDirSpecArrayPtr folders);
0061 /* count is the number of ICDirSpecs that are valid in folders */
0062 /* searches the specified folders first, then backs out to preferences folder */
0063 /* don't you worry about how it finds the file (; */
0064 /* you can pass nil to folders if count is 0 */
0065
0066 pascal ICError ICSpecifyConfigFile(ICInstance inst, FSSpec *config);
0067 /* for use *only* by Internet Configuration application */
0068
0069 pascal ICError ICGetSeed(ICInstance inst, long *seed);
0070 /* returns current seed for prefs file */
0071 /* this seed changes every time a preference is modified */
0072 /* poll this to detect preference changes by other applications */
0073
0074 pascal ICError ICGetPerm(ICInstance inst, ICPerm *perm);
0075 /* returns the permissions currently associated with this file */
0076 /* mainly used by overriding components, applications normally */
0077 /* know what permissions they have */
0078
0079 pascal ICError ICBegin(ICInstance inst, ICPerm perm);
0080 /* start reading/writing the preferences */
0081 /* must be balanaced by a ICEnd */
0082 /* do not call WaitNextEvent between this pair */
0083 /* specify either icReadOnlyPerm or icReadWritePerm */
0084 /* note that this may open resource files and leave them open until ICEnd */
0085
0086 pascal ICError ICGetPref(ICInstance inst, ConstStr255Param key, ICAttr *attr, Ptr buf, long *size);
0087 /* this routine may be called without a ICBegin/ICEnd pair, in which case */
0088 /* it implicitly calls ICBegin(inst, icReadOnlyPerm */
0089 /* given a key string, returns the attributes and the (optionally) the data for a preference */
0090 /* key must not be the empty string */
0091 /* if buf is nil then no data fetched and incoming size is ignored*/
0092 /* size must be non-negative, is size of allocated space for data at buf */
0093 /* attr and size and always set on return */
0094 /* size is actual size of data (if key present); */
0095 /* attr is pref attributes */
0096 /* if icTruncatedErr then everything is valid, except you lost some data, size is size of real data*/
0097 /* on other errors, attr is ICattr_no_change and size is 0 */
0098
0099 pascal ICError ICSetPref(ICInstance inst, ConstStr255Param key, ICAttr attr, Ptr buf, long size);
0100 /* this routine may be called without a ICBegin/ICEnd pair, in which case */
0101 /* it implicitly calls ICBegin(inst, icReadWritePerm */
0102 /* given a key string, sets the attributes and the data for a preference (either is optional); */
0103 /* key must not be the empty string */
0104 /* if buf is nil then no data stored and size is ignored, used for setting attr */
0105 /* size must be non-negative, is size of the data at buf to store */
0106 /* icPermErr if ICBegin was given icReadOnlyPerm */
0107 /* icPermErr if current attr is locked, new attr is locked and buf <> nil */
0108
0109 pascal ICError ICCountPref(ICInstance inst, long *count);
0110 /* count total number of preferences */
0111 /* if error then count is 0 */
0112
0113 pascal ICError ICGetIndPref(ICInstance inst, long n, Str255 key);
0114 /* return the key of the Nth preference */
0115 /* n must be positive */
0116 /* icPrefNotFoundErr if n is beyond the last preference */
0117
0118 pascal ICError ICDeletePref(ICInstance inst, ConstStr255Param key);
0119 /* delete the preference specified by key */
0120 /* key must not be the empty string */
0121 /* preference specified by key must be present */
0122 /* icPrefNotFoundErr if it isn't */
0123
0124 pascal ICError ICEnd(ICInstance inst);
0125 /* stop reading/writing the preferences */
0126
0127 pascal ICError ICDefaultFileName(ICInstance inst, Str63 name);
0128 /* return the default file name */
0129 /* the component calls this routine to set up the default internet configuration file name*/
0130 /* this allows this operation to be intercepted by a component that has captured us */
0131 /* it currently gets it from the component resource file */
0132 /* the glue version is hardwired */
0133
0134 pascal ICError ICGetComponentInstance(ICInstance inst, Ptr *component_inst);
0135 /* returns noErr and the component instance that we're talking to, if we're using the component */
0136 /* returns an error and nil if we're doing it with glue */
0137
0138 #ifdef __cplusplus
0139 }
0140 #endif __cplusplus
0141
0142 #endif