macosx
Documentation
Very incomplete MacOS X Core API.
Environment Query
Usage
(require-extension macosx-env)machine-name
- (machine-name) => STRING procedure
The machine name from core services. Probably not the same as (get-host-name).
short-user-name
- (short-user-name) => STRING procedure
The short name for the user. Based on the current process uid.
long-user-name
- (long-user-name) => STRING procedure
The long name for the user. Based on the current process uid.
machine-location
- (machine-location) => VECTOR/4 procedure
Returns a 4 element vector:
- LATITUDE
- Latitude in degrees north to 2 decimal places.
- LONGITUDE
- Longitude in degrees east to 2 decimal places.
- DLS-OFFSET
- Number of seconds to add for daylight saving time.
- GMT-OFFSET
- Number of seconds east of GMT, includes daylight saving time status.
metric?
- (metric?) => BOOLEAN procedure
Using the metric system?
DEPERECATED
computer-name
- (computer-name [STORE]) => STRING procedure
The computer name from system configuration.
console-user
- (console-user [STORE]) => VECTOR/3 procedure
Returns a 3 element vector:
- NAME
- The (short) name of the console user.
- UID
- The user id of the console user.
- GID
- The group id of the console user.
local-host-name
- (local-host-name [STORE]) => STRING procedure
The local host name from system configuration. Probably not the same as (get-host-name).
location-name
- (location-name [STORE]) => STRING procedure
The location.
session-info
- (session-info) => VECTOR/10 procedure
Returns a 10 element vector:
- SESSION-ID
- The security session identifier number.
- IS-ROOT
- A root session?
- HAS-GRAPHICS
- Has graphics access?
- HAS-TTY
- Has tty?
- IS-REMOTE
- Is a remote session?
- WAS-INITIALIZED
- Initialized? (see note below)
- SHORT-USER-NAME
- Short user name.
- USER-ID
- User identification number.
- CONSOLE-SET
- Console hardware number.
- LOGIN-COMPLETED
- Login operations complete?
- IS-USER-ACTIVE
- On console?
The OS API behind WAS-INITIALIZED is unsupported in MacOS 10.7 so to indicate the value is (void).
main-bundle-path
- (main-bundle-path) => STRING procedure
The full pathname of the currently running executable, including the program name.
tick-count
- (tick-count) => INTEGER procedure
Returns an unsigned 32-bit integer that indicates the current number of ticks (1/60th of a second) since the system last started up.
delay
- (delay TICKS) => INTEGER procedure
Suspend execution for the specified number of TICKS. Returns an unsigned integer that indicates the ticks after the delay.
gestalt
- (gestalt SELECTOR) => INTEGER procedure
Calls the Gestalt Manager with specified SELECTOR and returns an unsigned 32-bit integer.
The SELECTOR can be a string, symbol, or an unsigned integer. When a string or symbol it is converted to a Macintosh 4-byte character value - an unsigned 32-bit integer. The string length may not be greater than 4 but can be less; space padding will be performed.
osstatus-condition?
- (osstatus-condition? OBJECT) => boolean procedure
oserr-condition?
- (oserr-condition? OBJECT) => boolean procedure
URL Support
Usage
(require-extension macosx-url)open-url
- (open-url URL-STRING) procedure
Opens the URL-STRING using the system-dependent default application.
osstatus-condition?
- (osstatus-condition? OBJECT) => boolean procedure
Notes
- The MacOS APIs are not properly tracked & this extension is out-of-date.
- The utility of gestalt is almost none now.
- sessionWasInitialized was removed as of MacOS 10.7 (Lion).
Requirements
dollar check-errors condition-utils
Author
Version history
- 2.1.3
- Gestalt defunct & sessionWasInitialized not Lion.
- 2.1.2
- Uses condition-utils.
: 2.1.1 :
- 2.1.0
- Needs "check-errors" extension.
- 2.0.0
- Chicken 4 release.
License
Copyright (C) 2009 Kon Lovett. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.