home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Utilities.h
-
- Contains: Location Manager SDK Sample Module handy routines
-
- Version: ALM SDK 2.0
- Package: Location Manager SDK 2.0
-
- Copyright: © 1996-1997 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: Please include the the file and version information (from above) with
- the problem description. Developers belonging to one of the Apple
- developer programs can submit bug reports to:
-
- devsupport@apple.com
-
- */
-
- #ifndef UTILITIES_H_
- #define UTILITIES_H_
-
- #ifndef __COMPONENTS__
- #include <Components.h>
- #endif
-
- #ifndef __LOCATIONMANAGER__
- #include <LocationManager.h>
- #endif
-
- #ifndef __PROCESSES__
- #include <Processes.h>
- #endif
-
- #ifndef __QUICKDRAW__
- #include <Quickdraw.h>
- #endif
-
- // -------------------------------------------------------------------------------------------------
-
- // Module-specific defines...
-
- #define kModuleVersion 0
-
- // We didn't actually change the setting format between SDK 1.0 and 2.0, but this was a
- // convenient way to call out the problem; see the discussion at "UseSetting" in Utilities.c...
-
- #define kOldSettingVersion 1 // From SDK 1.0
- #define kSettingVersion 2 // Current settings...
-
- // -------------------------------------------------------------------------------------------------
-
- // Types...
-
- typedef struct {
- Component self; // Reference back to ourselves for closure...
- SInt32 resFile; // Reference for our open resource fork...
- } Globals, *GlobalsPtr, **GlobalsHandle;
-
- typedef struct
- {
- UInt32 version;
- Boolean powerOn;
- Str255 network;
- } APSettingRec, *APSettingPtr, **APSettingHandle;
-
- // -------------------------------------------------------------------------------------------------
-
- extern pascal OSErr TurnSystemModeOn(void)
- FOURWORDINLINE(0x2F3C, 0x0040, 0x0000, 0xA88F);
- extern pascal OSErr TurnSystemModeOff(void)
- FOURWORDINLINE(0x2F3C, 0x0041, 0x0000, 0xA88F);
-
- // Exports...
-
- extern OSErr
- UseSetting (GlobalsHandle globals, APSettingHandle oldSetting, APSettingHandle newSetting, ALMRebootFlags* flags);
- // Make 'setting' the current setting...
-
- extern OSErr
- ReadSetting (GlobalsHandle globals, APSettingHandle setting);
- // Read the system state into setting...
-
- extern void
- InsParamStr (StringPtr matchThis, StringPtr replaceWithThis, StringPtr replaceInThis);
- // Insert 'replaceWithThis' into 'replaceInThis' at the first instance of
- // 'matchThis'...
-
- extern OSErr
- LaunchAP();
-
- extern OSErr
- LaunchAPScripting();
-
- extern OSErr
- QuitAPScripting();
-
- // -------------------------------------------------------------------------------------------------
-
- #endif // UTILITIES_H_
-