Mac OS 9
URLAccess.h File Reference

URL Access Interfaces. More...

#include <MacTypes.h>
#include <Files.h>
#include <CodeFragments.h>
#include <MacErrors.h>
#include <Events.h>

Go to the source code of this file.

Data Structures

struct  URLCallbackInfo
 

Macros

#define kURLURL   "URLString"
 
#define kURLResourceSize   "URLResourceSize"
 
#define kURLLastModifiedTime   "URLLastModifiedTime"
 
#define kURLMIMEType   "URLMIMEType"
 
#define kURLFileType   "URLFileType"
 
#define kURLFileCreator   "URLFileCreator"
 
#define kURLCharacterSet   "URLCharacterSet"
 
#define kURLResourceName   "URLResourceName"
 
#define kURLHost   "URLHost"
 
#define kURLAuthType   "URLAuthType"
 
#define kURLUserName   "URLUserName"
 
#define kURLPassword   "URLPassword"
 
#define kURLStatusString   "URLStatusString"
 
#define kURLIsSecure   "URLIsSecure"
 
#define kURLCertificate   "URLCertificate"
 
#define kURLTotalItems   "URLTotalItems"
 
#define kURLConnectTimeout   "URLConnectTimeout"
 
#define kURLHTTPRequestMethod   "URLHTTPRequestMethod"
 
#define kURLHTTPRequestHeader   "URLHTTPRequestHeader"
 
#define kURLHTTPRequestBody   "URLHTTPRequestBody"
 
#define kURLHTTPRespHeader   "URLHTTPRespHeader"
 
#define kURLHTTPUserAgent   "URLHTTPUserAgent"
 
#define kURLHTTPRedirectedURL   "URLHTTPRedirectedURL"
 
#define kURLSSLCipherSuite   "URLSSLCipherSuite"
 
#define NewURLNotifyUPP(userRoutine)   (userRoutine)
 
#define NewURLSystemEventUPP(userRoutine)   (userRoutine)
 
#define DisposeURLNotifyUPP(userUPP)
 
#define DisposeURLSystemEventUPP(userUPP)
 
#define InvokeURLNotifyUPP(userContext, event, callbackInfo, userUPP)    (*userUPP)(userContext, event, callbackInfo)
 
#define InvokeURLSystemEventUPP(userContext, event, userUPP)    (*userUPP)(userContext, event)
 

Typedefs

typedef struct OpaqueURLReference * URLReference
 
typedef UInt32 URLOpenFlags
 
typedef UInt32 URLState
 
typedef UInt32 URLEvent
 
typedef unsigned long URLEventMask
 
typedef struct URLCallbackInfo URLCallbackInfo
 
typedef URLEvent event
 
typedef URLEvent URLCallbackInfocallbackInfo
 

Enumerations

enum  {
  kURLReplaceExistingFlag = 1 << 0 , kURLBinHexFileFlag = 1 << 1 , kURLExpandFileFlag , kURLDisplayProgressFlag = 1 << 3 ,
  kURLDisplayAuthFlag , kURLUploadFlag = 1 << 5 , kURLIsDirectoryHintFlag = 1 << 6 , kURLDoNotTryAnonymousFlag ,
  kURLDirectoryListingFlag , kURLExpandAndVerifyFlag , kURLNoAutoRedirectFlag , kURLDebinhexOnlyFlag ,
  kURLDoNotDeleteOnErrorFlag = 1 << 12 , kURLResumeDownloadFlag , kURLReservedFlag
}
 
enum  {
  kURLNullState = 0 , kURLInitiatingState = 1 , kURLLookingUpHostState = 2 , kURLConnectingState = 3 ,
  kURLResourceFoundState = 4 , kURLDownloadingState = 5 , kURLDataAvailableState = 0x10 + kURLDownloadingState , kURLTransactionCompleteState = 6 ,
  kURLErrorOccurredState = 7 , kURLAbortingState = 8 , kURLCompletedState = 9 , kURLUploadingState = 10
}
 
enum  {
  kURLInitiatedEvent = kURLInitiatingState , kURLResourceFoundEvent = kURLResourceFoundState , kURLDownloadingEvent = kURLDownloadingState , kURLAbortInitiatedEvent = kURLAbortingState ,
  kURLCompletedEvent = kURLCompletedState , kURLErrorOccurredEvent = kURLErrorOccurredState , kURLDataAvailableEvent = kURLDataAvailableState , kURLTransactionCompleteEvent = kURLTransactionCompleteState ,
  kURLUploadingEvent = kURLUploadingState , kURLSystemEvent = 29 , kURLPercentEvent = 30 , kURLPeriodicEvent = 31 ,
  kURLPropertyChangedEvent = 32
}
 
enum  {
  kURLInitiatedEventMask = 1 << (kURLInitiatedEvent - 1) , kURLResourceFoundEventMask = 1 << (kURLResourceFoundEvent - 1) , kURLDownloadingMask = 1 << (kURLDownloadingEvent - 1) , kURLUploadingMask = 1 << (kURLUploadingEvent - 1) ,
  kURLAbortInitiatedMask = 1 << (kURLAbortInitiatedEvent - 1) , kURLCompletedEventMask = 1 << (kURLCompletedEvent - 1) , kURLErrorOccurredEventMask = 1 << (kURLErrorOccurredEvent - 1) , kURLDataAvailableEventMask = 1 << (kURLDataAvailableEvent - 1) ,
  kURLTransactionCompleteEventMask = 1 << (kURLTransactionCompleteEvent - 1) , kURLSystemEventMask = 1 << (kURLSystemEvent - 1) , kURLPercentEventMask = 1 << (kURLPercentEvent - 1) , kURLPeriodicEventMask = 1 << (kURLPeriodicEvent - 1) ,
  kURLPropertyChangedEventMask = 1 << (kURLPropertyChangedEvent - 1) , kURLAllBufferEventsMask , kURLAllNonBufferEventsMask , kURLAllEventsMask = (long)0xFFFFFFFF
}
 
enum  { kUserNameAndPasswordFlag = 0x00000001 }
 
enum  { uppURLNotifyProcInfo = 0x00000FF0 }
 
enum  { uppURLSystemEventProcInfo = 0x000003F0 }
 

Functions

OSStatus URLGetURLAccessVersion (UInt32 *returnVers)
 
typedef CALLBACK_API (OSStatus, URLNotifyProcPtr)(void *userContext
 
typedef CALLBACK_API (OSStatus, URLSystemEventProcPtr)(void *userContext
 
typedef TVECTOR_UPP_TYPE (URLNotifyProcPtr) URLNotifyUPP
 
typedef TVECTOR_UPP_TYPE (URLSystemEventProcPtr) URLSystemEventUPP
 
URLNotifyUPP NewURLNotifyUPP (URLNotifyProcPtr userRoutine)
 
URLSystemEventUPP NewURLSystemEventUPP (URLSystemEventProcPtr userRoutine)
 
void DisposeURLNotifyUPP (URLNotifyUPP userUPP)
 
void DisposeURLSystemEventUPP (URLSystemEventUPP userUPP)
 
OSStatus InvokeURLNotifyUPP (void *userContext, URLEvent event, URLCallbackInfo *callbackInfo, URLNotifyUPP userUPP)
 
OSStatus InvokeURLSystemEventUPP (void *userContext, EventRecord *event, URLSystemEventUPP userUPP)
 
OSStatus URLSimpleDownload (const char *url, FSSpec *destination, Handle destinationHandle, URLOpenFlags openFlags, URLSystemEventUPP eventProc, void *userContext)
 
OSStatus URLDownload (URLReference urlRef, FSSpec *destination, Handle destinationHandle, URLOpenFlags openFlags, URLSystemEventUPP eventProc, void *userContext)
 
OSStatus URLSimpleUpload (const char *url, const FSSpec *source, URLOpenFlags openFlags, URLSystemEventUPP eventProc, void *userContext)
 
OSStatus URLUpload (URLReference urlRef, const FSSpec *source, URLOpenFlags openFlags, URLSystemEventUPP eventProc, void *userContext)
 
OSStatus URLNewReference (const char *url, URLReference *urlRef)
 
OSStatus URLDisposeReference (URLReference urlRef)
 
OSStatus URLOpen (URLReference urlRef, FSSpec *fileSpec, URLOpenFlags openFlags, URLNotifyUPP notifyProc, URLEventMask eventRegister, void *userContext)
 
OSStatus URLAbort (URLReference urlRef)
 
OSStatus URLGetDataAvailable (URLReference urlRef, Size *dataSize)
 
OSStatus URLGetBuffer (URLReference urlRef, void **buffer, Size *bufferSize)
 
OSStatus URLReleaseBuffer (URLReference urlRef, void *buffer)
 
OSStatus URLGetProperty (URLReference urlRef, const char *property, void *propertyBuffer, Size bufferSize)
 
OSStatus URLGetPropertySize (URLReference urlRef, const char *property, Size *propertySize)
 
OSStatus URLSetProperty (URLReference urlRef, const char *property, void *propertyBuffer, Size bufferSize)
 
OSStatus URLGetCurrentState (URLReference urlRef, URLState *state)
 
OSStatus URLGetError (URLReference urlRef, OSStatus *urlError)
 
OSStatus URLIdle (void)
 
OSStatus URLGetFileInfo (StringPtr fName, OSType *fType, OSType *fCreator)
 

Detailed Description

URL Access Interfaces.

Introduced In: URLAccess 2.0
Avaliable From: Universal Interfaces 3.4.1
Copyright: © 1994-2001 by Apple Computer, Inc., all rights reserved

For bug reports, consult the following page on the World Wide Web:

http://developer.apple.com/bugreporter/

Macro Definition Documentation

◆ kURLHTTPRequestMethod

#define kURLHTTPRequestMethod   "URLHTTPRequestMethod"

http and https properties

◆ NewURLNotifyUPP

#define NewURLNotifyUPP (   userRoutine)    (userRoutine)

pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes)

◆ NewURLSystemEventUPP

#define NewURLSystemEventUPP (   userRoutine)    (userRoutine)

pascal 4_bytes Func(4_bytes, 4_bytes)

Typedef Documentation

◆ URLReference

typedef struct OpaqueURLReference* URLReference

Data structures and types

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kURLExpandFileFlag 

Binhex before uploading if necessary

kURLDisplayProgressFlag 

Use StuffIt engine to expand file if necessary

kURLUploadFlag 

Display auth dialog if guest connection fails

kURLIsDirectoryHintFlag 

Do an upload instead of a download

kURLDoNotTryAnonymousFlag 

Hint: the URL is a directory

kURLDirectoryListingFlag 

Don't try to connect anonymously before getting logon info

kURLExpandAndVerifyFlag 

Download the directory listing, not the whole directory

kURLNoAutoRedirectFlag 

Expand file and then verify using signature resource

kURLDebinhexOnlyFlag 

Do not automatically redirect to new URL

kURLDoNotDeleteOnErrorFlag 

Do not use Stuffit Expander - just internal debinhex engine

kURLResumeDownloadFlag 

Do not delete the downloaded file if an error or abort occurs. This flag applies to downloading only and should be used if interested in later resuming the download.

kURLReservedFlag 

The passed in file is partially downloaded, attempt to resume it. Currently works for HTTP only. If no FSSpec passed in, this flag will be ignored. Overriden by kURLReplaceExistingFlag.

◆ anonymous enum

anonymous enum

authentication type flags

Function Documentation

◆ DisposeURLNotifyUPP()

void DisposeURLNotifyUPP ( URLNotifyUPP  userUPP)

DisposeURLNotifyUPP()

Non-Carbon CFM: available as macro/inline
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ DisposeURLSystemEventUPP()

void DisposeURLSystemEventUPP ( URLSystemEventUPP  userUPP)

DisposeURLSystemEventUPP()

Non-Carbon CFM: available as macro/inline
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ InvokeURLNotifyUPP()

OSStatus InvokeURLNotifyUPP ( void *  userContext,
URLEvent  event,
URLCallbackInfo callbackInfo,
URLNotifyUPP  userUPP 
)

InvokeURLNotifyUPP()

Non-Carbon CFM: available as macro/inline
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ InvokeURLSystemEventUPP()

OSStatus InvokeURLSystemEventUPP ( void *  userContext,
EventRecord event,
URLSystemEventUPP  userUPP 
)

InvokeURLSystemEventUPP()

Non-Carbon CFM: available as macro/inline
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ NewURLNotifyUPP()

URLNotifyUPP NewURLNotifyUPP ( URLNotifyProcPtr  userRoutine)

NewURLNotifyUPP()

Non-Carbon CFM: available as macro/inline
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ NewURLSystemEventUPP()

URLSystemEventUPP NewURLSystemEventUPP ( URLSystemEventProcPtr  userRoutine)

NewURLSystemEventUPP()

Non-Carbon CFM: available as macro/inline
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLAbort()

OSStatus URLAbort ( URLReference  urlRef)

can be NULL URLAbort()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLDisposeReference()

OSStatus URLDisposeReference ( URLReference  urlRef)

URLDisposeReference()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLDownload()

OSStatus URLDownload ( URLReference  urlRef,
FSSpec *  destination,
Handle  destinationHandle,
URLOpenFlags  openFlags,
URLSystemEventUPP  eventProc,
void *  userContext 
)

can be NULL URLDownload()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later
Parameters
destinationHandlecan be NULL
openFlagscan be NULL
userContextcan be NULL

◆ URLGetBuffer()

OSStatus URLGetBuffer ( URLReference  urlRef,
void **  buffer,
Size *  bufferSize 
)

URLGetBuffer()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLGetCurrentState()

OSStatus URLGetCurrentState ( URLReference  urlRef,
URLState *  state 
)

URLGetCurrentState()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLGetDataAvailable()

OSStatus URLGetDataAvailable ( URLReference  urlRef,
Size *  dataSize 
)

URLGetDataAvailable()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLGetError()

OSStatus URLGetError ( URLReference  urlRef,
OSStatus *  urlError 
)

URLGetError()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLGetFileInfo()

OSStatus URLGetFileInfo ( StringPtr  fName,
OSType *  fType,
OSType *  fCreator 
)

URLGetFileInfo()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLGetProperty()

OSStatus URLGetProperty ( URLReference  urlRef,
const char *  property,
void *  propertyBuffer,
Size  bufferSize 
)

URLGetProperty()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLGetPropertySize()

OSStatus URLGetPropertySize ( URLReference  urlRef,
const char *  property,
Size *  propertySize 
)

URLGetPropertySize()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLGetURLAccessVersion()

OSStatus URLGetURLAccessVersion ( UInt32 *  returnVers)

URLGetURLAccessVersion()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLIdle()

OSStatus URLIdle ( void  )

URLIdle()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLNewReference()

OSStatus URLNewReference ( const char *  url,
URLReference urlRef 
)

can be NULL URLNewReference()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLOpen()

OSStatus URLOpen ( URLReference  urlRef,
FSSpec *  fileSpec,
URLOpenFlags  openFlags,
URLNotifyUPP  notifyProc,
URLEventMask  eventRegister,
void *  userContext 
)

URLOpen()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later
Parameters
openFlagscan be NULL
eventRegistercan be NULL

◆ URLReleaseBuffer()

OSStatus URLReleaseBuffer ( URLReference  urlRef,
void *  buffer 
)

URLReleaseBuffer()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLSetProperty()

OSStatus URLSetProperty ( URLReference  urlRef,
const char *  property,
void *  propertyBuffer,
Size  bufferSize 
)

URLSetProperty()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ URLSimpleDownload()

OSStatus URLSimpleDownload ( const char *  url,
FSSpec *  destination,
Handle  destinationHandle,
URLOpenFlags  openFlags,
URLSystemEventUPP  eventProc,
void *  userContext 
)

URLSimpleDownload()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later
Parameters
destinationHandlecan be NULL
openFlagscan be NULL
userContextcan be NULL

◆ URLSimpleUpload()

OSStatus URLSimpleUpload ( const char *  url,
const FSSpec *  source,
URLOpenFlags  openFlags,
URLSystemEventUPP  eventProc,
void *  userContext 
)

can be NULL URLSimpleUpload()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later
Parameters
userContextcan be NULL

◆ URLUpload()

OSStatus URLUpload ( URLReference  urlRef,
const FSSpec *  source,
URLOpenFlags  openFlags,
URLSystemEventUPP  eventProc,
void *  userContext 
)

can be NULL URLUpload()

Non-Carbon CFM: in URLAccessLib 1.0 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later
Parameters
userContextcan be NULL