|  |  |  |  | 
 61
 Internet Library
  
61
 Internet LibraryINetMgr.h declares the Internet library API. For more information on the Internet library, see the chapter "Network Communication" in the Palm OS Programmer's Companion.
 
NOTE:  The information in this chapter applies only to version 3.2 or later of the Palm OS® on Palm VII® devices. These features are implemented only if the Wireless Internet Feature Set is present.
WARNING!In future OS versions, Palm Computing® does not intend to support or provide backward compatibility for the Internet library API documented in this chapter.
INetCompressionTypeEnum enum indicates the type of compression used for data exchanged via a socket. One of these enumerated types is set as the value of the inetSockSettingCompressionTypeID socket setting (a read-only setting).
typedef enum {inetCompressionTypeNone = 0,inetCompressionTypeBitPacked,inetCompressionTypeLZ77} INetCompressionTypeEnum;
| Custom 5-bit compression scheme. This is typically used for data sent from the Palm Web Clipping Proxy server. | |
INetConfigNameType structure holds the name of an Internet library network configuration. A configuration is a set of specific values for the Internet library settings. The Internet library defines a set of built-in configuration aliases for common network setups. These aliases point to configurations instead of holding the actual values themselves. You can use an alias anywhere in the API you would use a configuration. System-defined configuration aliases are listed in "Configuration Aliases" .
 
#define inetConfigNameSize 32;typedef struct {Char name[inetConfigNameSize]; // name of configuration} INetConfigNameType, *INetConfigNamePtr;
INetContentTypeEnum enum specifies the type of content to be exchanged via a socket. One of these enumerated types is set as the value of the inetSockSettingContentTypeID socket setting (a read-only setting).
typedef enum {inetContentTypeTextPlain = 0,inetContentTypeTextHTML,inetContentTypeImageGIF,inetContentTypeImageJPEG,inetContentTypeApplicationCML,inetContentTypeImagePalmOS,inetContentTypeOther} INetContentTypeEnum;
INetHTTPAttrEnum enum specifies HTTP request and response attributes that are set by typedef enum {//-----------------------------------------------------------// Request only attributes//-----------------------------------------------------------// The following are ignored unless going through a CTP proxyinetHTTPAttrWhichPart, // (W) UInt32 (0 -> N)inetHTTPAttrIncHTTP, // (W) UInt32 (Boolean) only applicable
	 	 	 	 // when inetHTTPAttrConvAlgorithm set to ctpConvNoneinetHTTPAttrCheckMailHi, // (W) UInt32inetHTTPAttrCheckMailLo, // (W) UInt32inetHTTPAttrReqContentVersion, // (W) UInt32, desired content 
	 	 	 	 // version. Represented as 2 low bytes. Lowest byte is
	 	 	 	 // minor version, next higher byte is major version.//--------------------------------------------------------------// Response only attributes//--------------------------------------------------------------// Server response infoinetHTTPAttrRspSize, // (R) UInt32, entire HTTP Response size 
	 	 	 	 // including header and datainetHTTPAttrResult, // (R) UInt32 (ctpErrXXX when using CTP Proxy)inetHTTPAttrErrDetail, // (R) UInt32 (server/proxy err code when
	 	 	 	 // using CTP Proxy)inetHTTPAttrReason, // (R) Char[]// Returned entity attributesinetHTTPAttrContentLength, // (R) UInt32inetHTTPAttrContentLengthUncompressed, // (R) UInt32 (in bytes)inetHTTPAttrContentLengthUntruncated, //(R) UInt32inetHTTPAttrContentVersion, // (R) UInt32, actual content version.
	 	 	 	 // Represented as 2 low bytes. Lowest byte is minor
	 	 	 	 // version, next higher byte is major version. inetHTTPAttrContentCacheID, // (R) UInt32, cacheID for this iteminetHTTPAttrReqSize // (R) UInt32 size of request sent} INetHTTPAttrEnum;
INetSchemeEnum enum specifies a protocol (http, https, etc.) used by a socket. Specify one of these enumerated types for the INetSockSettingScheme socket setting and for the scheme parameter to the typedef enum {inetSchemeUnknown = -1,inetSchemeDefault = 0,inetSchemeHTTP, // http:inetSchemeHTTPS, // https:inetSchemeFTP, // ftp:inetSchemeGopher, // gopher:inetSchemeFile, // file:inetSchemeNews, // news:inetSchemeMailTo, // mailto:inetSchemePalm, // palm:inetSchemePalmCall, // palmcall:inetSchemeMail, // not applicable to URLs, but used    	 	 	 	 	 	 	 //  for the INetLibSockOpen call when    	 	 	 	 	 	 	 //  creating a socket for mail IOinetSchemeMac, // mac: - Mac file system HTMLinetSchemeFirst = inetSchemeHTTP, // first oneinetSchemeLast = inetSchemeMail // last one} INetSchemeEnum;
INetSettingEnum enum specifies a setting to be returned or set by the typedef enum {inetSettingCacheSize, // (RW) UInt32, max size of cacheinetSettingCacheRef, // (R) DmOpenRef, ref of cache DBinetSettingNetLibConfig, // (RW) UInt32, NetLib config to useinetSettingRadioID, // (R) UInt32[2], the 64-bit radio IDinetSettingBaseStationID, // (R)  UInt32, the radio base station IdinetSettingMaxRspSize, // (W) UInt32 (in bytes)inetSettingConvAlgorithm, // (W) UInt32 (CTPConvEnum)inetSettingContentWidth, // (W) UInt32 (in pixels)inetSettingContentVersion, // (W) UInt32, content version (encoder 
	 	 	 	 	 	 	 	 	 	 	 	 	 	 // version)inetSettingNoPersonalInfo, // (RW) UInt32, send no deviceID/zipcodeinetSettingUserName,inetSettingLast} INetSettingEnum;
INetSockSettingEnum enum specifies a socket setting to be returned or set by the typedef enum {inetSockSettingScheme, // (R) UInt32, INetSchemeEnuminetSockSettingSockContext, // (RW) UInt32,inetSockSettingCompressionType, // (R) Char[]inetSockSettingCompressionTypeID, // (R) UInt32 
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 // (INetCompressionTypeEnum)inetSockSettingContentType, // (R) Char[]inetSockSettingContentTypeID, // (R) UInt32 (INetContentTypeEnum)inetSockSettingData, // (R) UInt32, pointer to datainetSockSettingDataHandle,// (R) UInt32, handle to datainetSockSettingDataOffset,// (R) UInt32, offset to data from handleinetSockSettingTitle, // (W) Char[]inetSockSettingURL, // (R) Char[]inetSockSettingIndexURL, // (RW) Char[]inetSockSettingFlags, // (RW) UInt16, one or more of
	 	 	 	 	 	 	 	 	 	 	 // inetOpenURLFlagXXX flagsinetSockSettingReadTimeout, // (RW) UInt32, read timeout in ticksinetSockSettingContentVersion,// (R) UInt32, content version numberinetSockSettingLast} INetSockSettingEnum;
| inetSockSettingScheme  | Requested scheme; one of the INetSchemeEnumvalues. Read-only. | 
| inetSockSettingSockContext  | Not used. | 
| inetSockSettingCompressionType  | Name of requested compression type. Read-only. | 
| inetSockSettingCompressionTypeID  | Requested compression type; one of the INetCompressionTypeEnumvalues. Read-only. | 
| inetSockSettingContentType  | String containing the MIME type of the content. Used only on received raw data. Read-only. | 
| inetSockSettingContentTypeID  | Content type of socket data; one of the INetContentTypeEnumvalues. Read-only. | 
| inetSockSettingData | Pointer to socket data. Read-only. | 
| inetSockSettingDataHandle | Handle to socket data. Read-only. | 
| inetSockSettingDataOffset | Offset to socket data from handle. Read-only. | 
| inetSockSettingTitle | Web page title. This value is written to the cache (and Clipper uses it later in a history list of cache entries). Write-only. | 
| inetSockSettingURL  | URL of requested data. Read-only. | 
| inetSockSettingIndexURL | Index (or master) URL of requested data (for cache indexing). This is the topmost web page in a group of hierarchical pages; it serves to group the pages together and to filter cache list results. Clipper sets this to the URL of the active PQA, for all pages linked from the PQA. | 
| inetSockSettingFlags | URL request flags; one or more of inetOpenURLFlag... flags (see URL Open Constants). | 
| inetSockSettingReadTimeout | The default timeout value for reads when the application uses the event mechanism. The time since last receiving data from a socket is monitored and a timeout error status event is returned from INetLibGetEventif the timeout is exceeded. | 
| inetSockSettingContentVersion | Content version number. Read-only.  | 
INetStatusEnum enum specifies the status of the socket. The status is returned in the typedef enum {inetStatusNew, // just openedinetStatusResolvingName, // looking up host addressinetStatusNameResolved, // found host addressinetStatusConnecting, // connecting to hostinetStatusConnected, // connected to hostinetStatusSendingRequest, // sending requestinetStatusWaitingForResponse, // waiting for responseinetStatusReceivingResponse, // receiving responseinetStatusResponseReceived, // response receivedinetStatusClosingConnection, // closing connectioninetStatusClosed, // closedinetStatusAcquiringNetwork, // network temporarily
	 	 	 	 	 	 	 	 	 	 	 	 	 // unreachable; socket on holdinetStatusPrvInvalid = 30 // internal value, not returned by 
	 	 	 	 	 	 	 	 	 	 	 	 	 // INetMgr. Should be last.} INetStatusEnum;
inetURLInfoFlag... constants convey information about a URL and are returned by the function 
inetOpenURLFlag... constants control how the 
Err INetLibCacheGetObject (UInt16 libRefnum, MemHandle clientParamH, UInt8 * urlTextP, UInt32 uniqueID, INetCacheInfoPtr cacheInfoP)
|   |  | Refnum of the Internet library. | 
|   |  | Inet handle allocated by INetLibOpen. | 
|   |  | Pointer to URL text string to find. If this parameter is NULL, thenuniqueIDis used to find the entry. | 
|   |  | Unique ID of the cache entry to find. This value can be obtained by calling INetLibCacheList. This parameter is ignored ifurlTextPis specified. | 
|   |  | Pointer to a structure where information about the cache entry is returned. See the Comments section for details. | 
INetCacheInfoPtr type returned from this function is defined as a pointer to an INetCacheInfoType structure, which has the following definition: 
typedef struct {MemHandle recordH; // handle to the cache recordINetContentTypeEnum contentType;INetCompressionTypeEnum encodingType;UInt32 uncompressedDataSize;UInt8 flags; // unusedUInt8 reserved;UInt16 dataOffset; // offset to contentUInt16 dataLength; // size of contentUInt16 urlOffset; // offset to URLUInt32 viewTime; // time last viewedUInt32 createTime; // time entry was createdUInt16 murlOffset; // offset to master URL} INetCacheInfoType, *INetCacheInfoPtr;Err INetLibCacheList (UInt16 libRefnum, MemHandle inetH, UInt8 * cacheIndexURLP, UInt16 * indexP, UInt32 * uidP, INetCacheEntryP cacheP)
|   |  | Refnum of the Internet library. | 
|   |  | Inet handle allocated by INetLibOpen. | 
|   |  | Pointer to a long value where the unique ID of the found cache entry is returned. | 
|   |  | Pointer to a structure where information about the found cache entry is returned. See the Comments section for details. | 
uidP the unique ID of the first cache entry with an index equal to or greater than indexP. The indexP value is updated to point to the next entry upon return.
 
index, until it returns the error inetErrTypeNotCached.
 
uidP value.
 
typedef struct {UInt8 * urlP; // ptr to URL stringUInt16 urlLen; // length of URL stringUInt8 * titleP; // ptr to title stringUInt16 titleLen; // length of title stringUInt32 lastViewed; // time last viewed    	 	 	 	 	 	 	 	 // seconds since 1/1/1904UInt32 firstViewed; // time first viewed    	 	 	 	 	 	 	 	 // seconds since 1/1/1904} INetCacheEntryType, *INetCacheEntryP;Err INetLibCheckAntennaState(UInt16 Refnum)
Err INetLibClose (UInt16 libRefnum, MemHandle inetH)
|   |  | Refnum of the Internet library. | 
|   |  | Inet handle allocated by INetLibOpen. | 
NetLibClose, if necessary, to close the net Library or decrement its open count.
Err INetLibConfigAliasGet (UInt16 refNum, UInt16 aliasIndex, UInt16 * indexP, Boolean * isAnotherAliasP)
|   |  | Refnum of the Internet library. | 
|   |  | Pointer where the index of the configuration pointed to by aliasIndexis returned. 0 is returned ifaliasIndexdoes not point to another configuration. | 
|   |  | If *indexPis the index of another alias configuration, this Boolean is set totrue. | 
Err INetLibConfigAliasSet (UInt16 refNum, UInt16 configIndex, UInt16 aliasToIndex)
|   |  | Refnum of the Internet library. | 
|   |  | Index of configuration that the alias identified by configIndexis to point to. Specify 0 to remove an existing alias assignment. | 
Err INetLibConfigDelete (UInt16 refNum, UInt16 index)
|   |  | Refnum of the Internet library. | 
Err INetLibConfigIndexFromName (UInt16 refNum, INetConfigNamePtr nameP, UInt16 * indexP)
|   |  | Refnum of the Internet library. | 
|   |  | Pointer to an INetConfigNameTypestructure that names the configuration whose index you want to get. | 
|   |  | Pointer where the index of the configuration identified in namePis returned. | 
Err INetLibConfigList (UInt16 refNum, INetConfigNameType nameArray[], UInt16 * arrayEntriesP)
|   |  | Refnum of the Internet library. | 
|   |  | Pointer to an array of INetConfigNameTypestructs that is to be filled in by this routine. | 
INetLibOpen.
Err INetLibConfigMakeActive (UInt16 refNum, MemHandle inetH, UInt16 configIndex)
|   |  | Refnum of the Internet library. | 
|   |  | Inet handle allocated by INetLibOpen. | 
, INetLibConfigIndexFromNameErr INetLibConfigRename (UInt16 refNum, UInt16 index, INetConfigNamePtr newNameP)
|   |  | Refnum of the Internet library. | 
|   |  | Pointer to an INetConfigNameTypestructure holding the new name of the configuration. The name cannot start with a period or an underscore. | 
Err INetLibConfigSaveAs (UInt16 refNum, MemHandle inetH, INetConfigNamePtr nameP)
|   |  | Refnum of the Internet library. | 
|   |  | Inet handle allocated by INetLibOpen. | 
|   |  | Pointer to an INetConfigNameTypestructure holding the name of the configuration. The name cannot start with a period or an underscore. | 
EvtGetEvent that informs an application of status changes to Internet sockets as well as user interface events.
void INetLibGetEvent (UInt16  libRefnum, MemHandle inetH, INetEventType* eventP, Int32 timeout)
|   |  | Refnum of the Internet library. | 
|   |  | Inet handle allocated by INetLibOpen, orNULL. | 
|   |  | The event structure is returned via this pointer. | 
|   |  | Timeout in ticks. Specify evtWaitForeverto wait forever. | 
inetH is NULL, INetLibGetEvent is equivalent to EvtGetEvent.
 
INetLibGetEvent returns two additional events besides those returned by EvtGetEvent: Err INetLibOpen (UInt16 libRefnum, UInt16 config, UInt32 flags, DmOpenRef cacheRef, UInt32 cacheSize, MemHandle* inetHP)
|   |  | Refnum of the Internet library. Pass the value "INet.lib" to SysLibFindto return this refnum. | 
|   |  | Indicates the type of network service desired by the application. Returned by INetLibConfigIndexFromName. | 
|   |  | Currently unused; set to 0. | 
|   |  | Document cache database reference. Obtain this by using one of the DmOpenDatabase... calls. PassNULLif you don't want to use a cache. | 
|   |  | Maximum size of the document cache (in bytes). This is ignored if you pass NULLforcacheRef. | 
|   |  | Pointer to a handle variable. | 
Err INetLibSettingGet (UInt16 libRefnum, MemHandle inetH, UInt16 /*INetSettingEnum */ setting, void * bufP, UInt16 * bufLenP)
|   |  | Refnum of the Internet library. | 
|   |  | Inet handle allocated by INetLibOpen. | 
|   |  | The setting to get. Specify one of the INetSettingEnumenumerated types. | 
|   |  | Pointer to buffer where the return value is to be put. | 
|   |  | Size of bufPon entry. Size of setting value on exit. | 
Err INetLibSettingSet (UInt16 libRefnum, MemHandle inetH, UInt16 /*INetSettingEnum*/ setting, void * bufP, UInt16 * bufLen)
|   |  | Refnum of the Internet library. | 
|   |  | Inet handle allocated by INetLibOpen. | 
|   |  | The setting to set. Specify one of the INetSettingEnumenumerated types. | 
|   |  | Pointer to the new setting value. | 
|   |  | Size of the value in bufP. | 
inetH is around (until Err INetLibSockClose (UInt16 libRefnum, MemHandle socketH)
|   |  | Refnum of the Internet library. | 
|   |  | Handle of the socket to close. | 
INetLibSockOpen or INetLibURLOpen.
Err INetLibSockConnect (UInt16 libRefnum, MemHandle sockH, UInt8 * hostnameP, UInt16 port, Int32 timeout)
|   |  | Refnum of the Internet library. | 
|   |  | Handle (allocated by INetLibSockOpenorINetLibURLOpen) of the socket to connect. | 
|   |  | Pointer to host name string; can be dotted decimal text string. | 
|   |  | Port number, or 0 for default port. | 
|   |  | Timeout in ticks; -1 means wait forever. | 
INetLibSockRead, or it may wait for the connect to complete by either polling INetLibSockStatus until the socket status is inetStatusConnected (not recommended), or by waiting for an inetSockStatusChangeEvent event from INetLibGetEvent and checking the status then (preferred).
Err INetLibSockHTTPAttrGet (UInt16 libRefnum, MemHandle sockH, UInt16 /*inetHTTPAttrEnum*/ attr, UInt16 attrIndex, void * bufP, UInt32 * bufLenP)
|   |  | Refnum of the Internet library. | 
|   |  | Handle (allocated by INetLibSockOpenorINetLibURLOpen) of the socket. | 
|   |  | The attribute to get. Specify one of the INetHTTPAttrEnumvalues. | 
|   |  | The attribute index (if any). Currently unused. | 
|   |  | Pointer to the address where the result is returned. | 
|   |  | Pointer to the size of bufPon entry; size of returned value on exit. | 
INetLibSockHTTPReqCreate and INetLibSockHTTPAttrSet, or the response header returned by the remote host. 
Err INetLibSockHTTPAttrSet (UInt16 libRefnum, MemHandle sockH, UInt16 /*inetHTTPAttrEnum*/ attr, UInt16 attrIndex, UInt8 * bufP, UInt16 bufLen, UInt16 flags)
|   |  | Refnum of the Internet library. | 
|   |  | Handle (allocated by INetLibSockOpenorINetLibURLOpen) of the socket. | 
|   |  | The attribute to set. Specify one of the INetHTTPAttrEnumvalues. | 
|   |  | The attribute index (if any). Currently unused. | 
|   |  | Pointer to additional header text to add. | 
|   |  | Length of bufP. | 
|   |  | Flags that control the addition of new headers. Currently unused. | 
INetLibSockHTTPReqCreate. Generally, attributes are set only before calling INetLibSockHTTPReqSend.
Err INetLibSockHTTPReqCreate (UInt16 libRefnum, MemHandle sockH, UInt8 * verbP, UInt8 * resNameP, UInt8 * refererP)
|   |  | Refnum of the Internet library. | 
|   |  | Handle (allocated by INetLibSockOpenorINetLibURLOpen) of the socket. | 
|   |  | Pointer to a string holding an HTTP verb; most likely "GET". | 
|   |  | Pointer to a string holding the name of the resource to get or put. | 
|   |  | Pointer to a string holding the name of the referring URL, or NULLif none. | 
 
 This call forms an HTTP request for the socket. The request is not actually sent to the remote host until INetLibSockHTTPReqSend is called. After this call, the application can add additional HTTP request headers using INetLibSockHTTPAttrSet. 
Err INetLibSockHTTPReqSend (UInt16 libRefnum, MemHandle sockH, void * writeP, UInt32 writeLen, Int32 timeout)
|   |  | Refnum of the Internet library. | 
|   |  | Handle (allocated by INetLibSockOpenorINetLibURLOpen) of the socket. | 
|   |  | Pointer to additional data to send after the request headers. Usually used for POSTandPUToperations. | 
|   |  | Number of bytes in writeP. | 
|   |  | Timeout in ticks. | 
INetLibSockHTTPReqCreate and INetLibSockHTTPAttrSet to the remote host. If this is an POST or PUT operation, the data to write can be specified in writeP. 
 
INetLibSockHTTPReqSend doesn't always do network I/O. If the proper socket flag is set, it checks first to see if the requested data is already in the cache. If it is, then a pointer to the cached data is stored in the socket and the socket status is updated to show that data is ready to be read. This will trigger an inetOpenURLFlagLookInCache) that causes the cache to be checked first can be set via the flags parameter to inetSockSettingFlags).
 
INetLibSockStatus until the inputReady boolean is set (not recommended), or by waiting for an inetSockReadyEvent event from INetLibGetEvent (preferred). 
Err INetLibSockOpen (UInt16 libRefnum, MemHandle inetH, UInt16 /*INetSchemeEnum*/ scheme, MemHandle* sockHP)
|   |  | Refnum of the Internet library. | 
|   |  | Inet handle allocated by INetLibOpen. | 
|   |  | The protocol scheme to use. Specify one of the INetSchemeEnumtypes. | 
|   |  | Pointer to the address where the socket handle is returned. | 
INetLibURLOpen when finer control over the socket settings is required. 
 
INetLibURLOpen, an HTTP request can be handled with the simple sequence: INetLibURLOpen, INetLibSockRead, and INetLibSockClose. When using INetLibSockOpen, the same HTTP request would be handled by replacing the INetLibURLOpen call with the sequence: INetLibSockOpen, INetLibSockSettingSet (optional), INetLibSockConnect, INetLibSockHTTPReqCreate, INetLibSockHTTPAttrSet (optional), and INetLibSockHTTPReqSend. 
 
INetLibSockOpen allows an application finer control over the socket settings (by calling INetLibSockSettingSet) and the HTTP request headers (by calling INetLibSockHTTPAttrSet). 
Err INetLibSockRead (UInt16 libRefnum, MemHandle sockH, void * bufP, UInt32 reqBytes, UInt32 * actBytesP, Int32 timeout)
|   |  | Refnum of the Internet library. | 
|   |  | Inet handle allocated by INetLibOpen. | 
|   |  | Pointer to buffer where the data is placed. | 
|   |  | Requested number of bytes. | 
|   |  | Pointer to the actual number of bytes read. | 
|   |  | Timeout in ticks; -1 means wait forever. | 
reqBytes bytes from the given socket. It returns the actual number of bytes read in *actBytesP. If the connection with the remote host has been closed, *actBytesP contains 0 on exit.
 
*actBytesP contains 0, indicating the connection has been closed, or until an error is returned.
 
INetLibSockRead. Alternatively, the application could call INetLibSockRead to block until at least one byte is available to read. If no data is available before the timeout expires, inetErrReadTimeout error is returned. 
, INetLibGetEventErr INetLibSockSettingGet (UInt16 libRefnum, MemHandle socketH, UInt16 /*INetSockSettingEnum*/ setting, void * bufP, UInt16 * bufLenP)
|   |  | Refnum of the Internet library. | 
|   |  | Handle (allocated by INetLibSockOpenorINetLibURLOpen) of the socket to get a setting from. | 
|   |  | The setting to get. Specify one of the INetSockSettingEnumvalues. | 
|   |  | Pointer to buffer where the setting value is to be placed. | 
|   |  | Size of bufPon entry; size of returned value on exit. | 
Err INetLibSockSettingSet (UInt16 libRefnum, MemHandle socketH, UInt16 /*INetSockSettingEnum*/ setting, void * bufP, UInt16 bufLen)
|   |  | Refnum of the Internet library. | 
|   |  | Handle (allocated by INetLibSockOpenorINetLibURLOpen) of the socket to set. | 
|   |  | The setting to set. Specify one of the INetSockSettingEnumvalues. | 
|   |  | Pointer to buffer containing the new setting value. | 
|   |  | Size of new setting in bufP. | 
Err INetLibSockStatus (UInt16 libRefnum, MemHandle socketH, UInt16 * statusP, Err* sockErrP, Boolean* inputReadyP, Boolean* outputReadyP)
|   |  | Refnum of the Internet library. | 
|   |  | Handle (allocated by INetLibSockOpenorINetLibURLOpen) of the socket to get status on. | 
|   |  | Pointer to the address where the status is returned. The status will be one of the INetStatusEnumvalues. | 
|   |  | Currently unused. | 
|   |  | Pointer to a Boolean; trueis returned if the socket has data available to read. | 
|   |  | Pointer to a Boolean; trueis returned if the socket can accept data for writing. | 
INetLibGetEvent will rarely need to use this call since socket status changes are returned in the event structure.
, INetLibGetEventErr INetLibURLCrack (UInt16 libRefnum, UInt8 * urlTextP, INetURLType* urlP)
|   |  | Refnum of the Internet library. | 
|   |  | Pointer to URL text string. | 
|   |  | Pointer to address where the URL information block is to be returned. | 
urlP is set to NULL on entry, then on exit it will point to the start of that component within the original urlTextP string; the associated member length is set to the length of that URL component. If a pointer member of urlP is not NULL on entry, then it must point to a buffer of sufficient size to hold the member data, and on exit the component string will be copied into this buffer and the associated member length will be updated with the actual size. Note that the returned strings are not NULL terminated, so the length values are important.
 
InetURLType block to zeros and let this function fill in all the information about the URL components.
 
InetURLType block returned from this function has the following structure: 
typedef struct {UInt16 version; // 0, for future compatibilityUInt8 * schemeP; // ptr to scheme portionUInt16 schemeLen; // size of scheme portionUInt16 schemeEnum; // INetSchemeEnum; the schemeUInt8 * usernameP; // ptr to username portionUInt16 usernameLen; // size of usernameUInt8 * passwordP; // ptr to password portionUInt16 passwordLen; // size of passwordUInt8 * hostnameP; // ptr to host name portionUInt16 hostnameLen; // size of host nameUInt16 port; // port numberUInt8 * pathP; // ptr to path portionUInt16 pathLen; // size of pathUInt8 * paramP; // ptr to param (;param)UInt16 paramLen; // size of paramUInt8 * queryP; // ptr to query (?query)UInt16 queryLen; // size of queryUInt8 * fragP; // ptr to fragment (#frag)UInt16 fragLen; // size of fragment} INetURLTypeErr INetLibURLGetInfo (UInt16 libRefnum, MemHandle inetH, UInt8 * urlTextP, INetURLInfoType* urlInfoP)
|   |  | Refnum of the Internet library. | 
|   |  | Inet handle allocated by INetLibOpen. | 
|   |  | Pointer to URL text string. | 
|   |  | Pointer to address where the URL information structure is to be returned. | 
InetURLInfo block returned from this function has the following structure: 
typedef struct {UInt16 version; // 0, for future compatibilityUInt16 flags; // flags wordUInt32 undefined; // reserved for future use} INetURLInfoflags word can consist of some combination of these values: 
inetURLInfoFlagIsSecure // URL was encryptedinetURLInfoFlagIsRemote // URL was retrieved from the netinetURLInfoFlagIsInCache // URL is stored in the cacheErr INetLibURLOpen (UInt16 libRefnum, MemHandle inetH, UInt8 * urlP, UInt8 * cacheIndexURLP, MemHandle* sockHP, Int32 timeout, UInt16 flags)
|   |  | Refnum of the Internet library. | 
|   |  | Inet handle allocated by INetLibOpen. | 
|   |  | Pointer to string containing the URL to access. | 
|   |  | Pointer to address where the socket handle is returned. | 
|   |  | Timeout in ticks; -1 means wait forever. | 
|   |  | Flags indicating caching and encryption                    options desired. Specify zero, one, or more of the URL open flags (see URL Open Constants). | 
urlP and returns a socket handle. Note that if you specify that the cache should be searched first, and if the data is found in the cache, no network I/O occurs. The application can then read that socket resource through the INetLibSockOpen, INetLibSockConnect, INetLibSockHTTPReqCreate, and INetLibSockHTTPReqSend.
 
INetLibSockRead, or to use INetLibGetEvent is the preferred way of performing network I/O since it maximizes battery life and user-interface responsiveness. 
Err INetLibURLsAdd (UInt16 libRefnum, Char * baseURLStr, Char * embeddedURLStr, Char * resultURLStr, UInt16 * resultLenP)
|   |  | Refnum of the Internet library. | 
|   |  | Pointer to base URL string. | 
|   |  | Pointer to URL text string to append. | 
|   |  | Pointer to resulting URL string. | 
|   |  | Pointer to size of resultURLStrbuffer on entry. On exit, pointer to resulting URL length (includingNULLterminator). | 
Boolean INetLibWiCmd (UInt16 refNum, UInt16 /*WiCmdEnum*/ cmd, int enableOrX, int y)
|   |  | Refnum of the Internet library. | 
|   |  | The command to invoke. Specify one of the WiCmdEnum values (see Comments section). | 
|   |  | If cmdiswiCmdSetEnabled, specify 1 to enable the wireless indicator or 0 to disable it. IfcmdiswiCmdSetLocation, this specifies the x coordinate of the location. | 
|   |  | The y coordinate of the location. Used only if cmdiswiCmdSetLocation. | 
cmd is wiCmdEnabled, this function returns true if the wireless indicator is enabled or false if it is not. For other command types, the return value is undefined.
INetLibGetEvent. It should be shown on screen while a wireless transaction is in progress. It may also be shown when the user has nothing useful to do next but initiate a wireless transaction, and there isn't much other useful information being displayed.
 
WiCmdEnum enum specifies a command that operates on the wireless indicator in the user interface. The definition of this type is found in WirelessIndicator.h and is as follows:
typedef enum {wiCmdInit =0,wiCmdClear,wiCmdSetEnabled,wiCmdDraw,wiCmdEnabled,wiCmdSetLocation,wiCmdErase} WiCmdEnum;
|   |  |  |  |  |   |