Mac OSX Build and Run!

OSX上でのプログラミングの初歩について、情報共有ができればと思います。

スポンサーサイト

上記の広告は1ヶ月以上更新のないブログに表示されています。
新しい記事を書く事で広告が消せます。

CarbonCore Frameworksへのパス

Carbonの核となるヘッダーファイルがこの中にあります。

Carboncore.gif


例えば、システム情報を得る関数があります。
File: CarbonCore/Gestalt.h
Contains: Gestalt Interfaces.

/*
* Gestalt()
*
* Summary:
* Gestalt returns information about the operating environment.
*
* Discussion:
* The Gestalt function places the information requested by the
* selector parameter in the variable parameter response . Note that
* Gestalt returns the response from all selectors in a long word,
* which occupies 4 bytes. When not all 4 bytes are needed, the
* significant information appears in the low-order byte or bytes.
* Although the response parameter is declared as a variable
* parameter, you cannot use it to pass information to Gestalt or to
* a Gestalt selector function. Gestalt interprets the response
* parameter as an address at which it is to place the result
* returned by the selector function specified by the selector
* parameter. Gestalt ignores any information already at that
* address.
*
* The Apple-defined selector codes fall into two categories:
* environmental selectors, which supply specific environmental
* information you can use to control the behavior of your
* application, and informational selectors, which supply
* information you can't use to determine what hardware or software
* features are available. You can use one of the selector codes
* defined by Apple (listed in the "Constants" section beginning on
* page 1-14 ) or a selector code defined by a third-party
* product.
*
* The meaning of the value that Gestalt returns in the response
* parameter depends on the selector code with which it was called.
* For example, if you call Gestalt using the gestaltTimeMgrVersion
* selector, it returns a version code in the response parameter. In
* this case, a returned value of 3 indicates that the extended Time
* Manager is available.
*
* In most cases, the last few characters in the selector's symbolic
* name form a suffix that indicates what type of value you can
* expect Gestalt to place in the response parameter. For example,
* if the suffix in a Gestalt selector is Size , then Gestalt
* returns a size in the response parameter.
*
* Attr: A range of 32 bits, the meanings of which are defined by a
* list of constants. Bit 0 is the least significant bit of the long
* word.
* Count: A number indicating how many of the indicated type of item
* exist.
* Size: A size, usually in bytes.
* Table: The base address of a table.
* Type: An index to a list of feature descriptions.
* Version: A version number, which can be either a constant with a
* defined meaning or an actual version number, usually stored as
* four hexadecimal digits in the low-order word of the return
* value. Implied decimal points may separate digits. The value
* $0701, for example, returned in response to the
* gestaltSystemVersion selector, represents system software version
* 7.0.1.
*
* Selectors that have the suffix Attr deserve special attention.
* They cause Gestalt to return a bit field that your application
* must interpret to determine whether a desired feature is present.
* For example, the application-defined sample function
* MyGetSoundAttr , defined in Listing 1-2 on page 1-6 , returns a
* LongInt that contains the Sound Manager attributes field
* retrieved from Gestalt . To determine whether a particular
* feature is available, you need to look at the designated bit.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* selector:
* The selector to return information for
*
* response:
* On exit, the requested information whose format depends on the
* selector specified.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
*/
extern OSErr
Gestalt(
OSType selector,
long * response) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
スポンサーサイト
上記広告は1ヶ月以上更新のないブログに表示されています。新しい記事を書くことで広告を消せます。