home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
WININET.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-02-28
|
47KB
|
1,028 lines
{*******************************************************}
{ }
{ Delphi Run-time Library }
{ Windows 32bit API Interface Unit }
{ }
{ Copyright (c) 1996 Borland International }
{ }
{*******************************************************}
unit WinInet;
interface
uses Windows;
{ Contains manifests, functions, types and prototypes for
Microsoft Windows Internet Extensions }
{ internet types }
type
HINTERNET = Pointer;
PHINTERNET = ^HINTERNET;
INTERNET_PORT = Word;
PINTERNET_PORT = ^INTERNET_PORT;
{ Internet APIs }
{ manifests }
const
INTERNET_INVALID_PORT_NUMBER = 0; { use the protocol-specific default }
INTERNET_DEFAULT_FTP_PORT = 21; { default for FTP servers }
INTERNET_DEFAULT_GOPHER_PORT = 70; { " " gopher " }
INTERNET_DEFAULT_HTTP_PORT = 80; { " " HTTP " }
{ maximum field lengths (arbitrary) }
INTERNET_MAX_HOST_NAME_LENGTH = 256;
INTERNET_MAX_USER_NAME_LENGTH = 128;
INTERNET_MAX_PASSWORD_LENGTH = 128;
INTERNET_MAX_PORT_NUMBER_LENGTH = 5; { INTERNET_PORT is unsigned short }
INTERNET_MAX_PORT_NUMBER_VALUE = 65535; { maximum unsigned short value }
INTERNET_MAX_PATH_LENGTH = 1024;
INTERNET_MAX_PROTOCOL_NAME = 'gopher'; { longest protocol name }
INTERNET_MAX_URL_LENGTH = ((SizeOf(INTERNET_MAX_PROTOCOL_NAME) - 1)
+ SizeOf('://')
+ INTERNET_MAX_PATH_LENGTH);
{ values returned by InternetQueryOption() with INTERNET_OPTION_KEEP_CONNECTION: }
INTERNET_KEEP_ALIVE_UNKNOWN = -1;
INTERNET_KEEP_ALIVE_ENABLED = 1;
INTERNET_KEEP_ALIVE_DISABLED = 0;
{ flags returned by InternetQueryOption() with INTERNET_OPTION_REQUEST_FLAGS }
INTERNET_REQFLAG_FROM_CACHE = $00000001;
INTERNET_REQFLAG_ASYNC = $00000002;
{ flags common to open functions (not InternetOpen()): }
INTERNET_FLAG_RELOAD = $80000000; { retrieve the original item }
{ flags for InternetOpenUrl(): }
INTERNET_FLAG_RAW_DATA = $40000000; { receive the item as raw data }
INTERNET_FLAG_EXISTING_CONNECT = $20000000; { do not create new connection object }
{ flags for InternetOpen(): }
INTERNET_FLAG_ASYNC = $10000000; { this request is asynchronous (where supported) }
{ protocol-specific flags: }
INTERNET_FLAG_PASSIVE = $08000000; { used for FTP connections }
{ additional cache flags }
INTERNET_FLAG_DONT_CACHE = $04000000; { don't add this item to the cache }
INTERNET_FLAG_MAKE_PERSISTENT = $02000000; { make this item persistent in cache }
{ flags field masks }
INTERNET_FLAGS_MASK = INTERNET_FLAG_RELOAD
or INTERNET_FLAG_RAW_DATA
or INTERNET_FLAG_EXISTING_CONNECT
or INTERNET_FLAG_ASYNC
or INTERNET_FLAG_PASSIVE
or INTERNET_FLAG_DONT_CACHE
or INTERNET_FLAG_MAKE_PERSISTENT
;
INTERNET_OPTIONS_MASK = not INTERNET_FLAGS_MASK;
{ INTERNET_NO_CALLBACK - if this value is presented as the dwContext parameter }
{ then no call-backs will be made for that API }
INTERNET_NO_CALLBACK = 0;
{ structures/types }
{ INTERNET_ASYNC_RESULT - this structure is returned to the application via }
{ the callback with INTERNET_STATUS_REQUEST_COMPLETE. It is not sufficient to }
{ just return the result of the async operation. If the API failed then the }
{ app cannot call GetLastError() because the thread context will be incorrect. }
{ Both the value returned by the async API and any resultant error code are }
{ made available. The app need not check dwError if dwResult indicates that }
{ the API succeeded (it will be ERROR_SUCCESS) }
type
PInternetAsyncResult = ^TInternetAsyncResult;
TInternetAsyncResult = packed record
dwResult: DWORD; { the HINTERNET, DWORD or BOOL return code from an async API }
dwError: DWORD; { dwError - the error code if the API failed }
end;
{ prototypes }
function InternetOpenA(lpszCallerName: PAnsiChar; dwAccessType: DWORD;
lpszServerName: PAnsiChar; nServerPort: INTERNET_PORT;
dwFlags: DWORD): HINTERNET; stdcall;
function InternetOpenW(lpszCallerName: PWideChar; dwAccessType: DWORD;
lpszServerName: PWideChar; nServerPort: INTERNET_PORT;
dwFlags: DWORD): HINTERNET; stdcall;
function InternetOpen(lpszCallerName: PChar; dwAccessType: DWORD;
lpszServerName: PChar; nServerPort: INTERNET_PORT;
dwFlags: DWORD): HINTERNET; stdcall;
{ access types for InternetOpen() }
const
PRE_CONFIG_INTERNET_ACCESS = 0; { use default }
LOCAL_INTERNET_ACCESS = 1; { direct to Internet }
GATEWAY_INTERNET_ACCESS = 2; { Internet via gateway }
CERN_PROXY_INTERNET_ACCESS = 3; { Internet via CERN proxy }
function InternetCloseHandle(hInet: HINTERNET): BOOL; stdcall;
function InternetConnectA(hInet: HINTERNET; lpszServerName: PAnsiChar;
nServerPort: INTERNET_PORT; lpszUsername: PAnsiChar; lpszPassword: PAnsiChar;
dwService: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
function InternetConnectW(hInet: HINTERNET; lpszServerName: PWideChar;
nServerPort: INTERNET_PORT; lpszUsername: PWideChar; lpszPassword: PWideChar;
dwService: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
function InternetConnect(hInet: HINTERNET; lpszServerName: PChar;
nServerPort: INTERNET_PORT; lpszUsername: PChar; lpszPassword: PChar;
dwService: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
{ service types for InternetConnect() }
const
INTERNET_SERVICE_FTP = 1;
INTERNET_SERVICE_GOPHER = 2;
INTERNET_SERVICE_HTTP = 3;
function InternetOpenUrlA(hInet: HINTERNET; lpszUrl: PAnsiChar;
lpszHeaders: PAnsiChar; dwHeadersLength: DWORD; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall;
function InternetOpenUrlW(hInet: HINTERNET; lpszUrl: PWideChar;
lpszHeaders: PWideChar; dwHeadersLength: DWORD; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall;
function InternetOpenUrl(hInet: HINTERNET; lpszUrl: PChar;
lpszHeaders: PChar; dwHeadersLength: DWORD; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall;
function InternetReadFile(hFile: HINTERNET; lpBuffer: Pointer;
dwNumberOfBytesToRead: DWORD; var lpdwNumberOfBytesRead: DWORD): BOOL; stdcall;
function InternetWriteFile(hFile: HINTERNET; lpBuffer: Pointer;
dwNumberOfBytesToWrite: DWORD;
var lpdwNumberOfBytesWritten: DWORD): BOOL; stdcall;
function InternetFindNextFileA(hFind: HINTERNET; lpvFindData: Pointer): BOOL; stdcall;
function InternetFindNextFileW(hFind: HINTERNET; lpvFindData: Pointer): BOOL; stdcall;
function InternetFindNextFile(hFind: HINTERNET; lpvFindData: Pointer): BOOL; stdcall;
function InternetQueryOption(hInet: HINTERNET; dwOption: DWORD;
lpBuffer: Pointer; var lpdwBufferLength: DWORD): BOOL; stdcall;
function InternetSetOption(hInet: HINTERNET; dwOption: DWORD;
lpBuffer: Pointer; dwBufferLength: DWORD): BOOL; stdcall;
{ options manifests for Internet(Query or Set)Option }
const
INTERNET_OPTION_CALLBACK = 1;
INTERNET_OPTION_CONNECT_TIMEOUT = 2;
INTERNET_OPTION_CONNECT_RETRIES = 3;
INTERNET_OPTION_CONNECT_BACKOFF = 4;
INTERNET_OPTION_SEND_TIMEOUT = 5;
INTERNET_OPTION_CONTROL_SEND_TIMEOUT = INTERNET_OPTION_SEND_TIMEOUT;
INTERNET_OPTION_RECEIVE_TIMEOUT = 6;
INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT = INTERNET_OPTION_RECEIVE_TIMEOUT;
INTERNET_OPTION_DATA_SEND_TIMEOUT = 7;
INTERNET_OPTION_DATA_RECEIVE_TIMEOUT = 8;
INTERNET_OPTION_HANDLE_TYPE = 9;
INTERNET_OPTION_CONTEXT_VALUE = 10;
INTERNET_OPTION_NAME_RES_THREAD = 11;
INTERNET_OPTION_READ_BUFFER_SIZE = 12;
INTERNET_OPTION_WRITE_BUFFER_SIZE = 13;
INTERNET_OPTION_GATEWAY_NAME = 14;
INTERNET_OPTION_ASYNC_ID = 15;
INTERNET_OPTION_ASYNC_PRIORITY = 16;
INTERNET_OPTION_ASYNC_REQUEST_COUNT = 17;
INTERNET_OPTION_MAXIMUM_WORKER_THREADS = 18;
INTERNET_OPTION_ASYNC_QUEUE_DEPTH = 19;
INTERNET_OPTION_WORKER_THREAD_TIMEOUT = 20;
INTERNET_OPTION_PARENT_HANDLE = 21;
INTERNET_OPTION_KEEP_CONNECTION = 22;
INTERNET_OPTION_REQUEST_FLAGS = 23;
INTERNET_FIRST_OPTION = INTERNET_OPTION_CALLBACK;
INTERNET_LAST_OPTION = INTERNET_OPTION_KEEP_CONNECTION;
{ values for INTERNET_OPTION_PRIORITY }
INTERNET_PRIORITY_FOREGROUND = 1000;
{ handle types }
INTERNET_HANDLE_TYPE_INTERNET = 1;
INTERNET_HANDLE_TYPE_CONNECT_FTP = 2;
INTERNET_HANDLE_TYPE_CONNECT_GOPHER = 3;
INTERNET_HANDLE_TYPE_CONNECT_HTTP = 4;
INTERNET_HANDLE_TYPE_FTP_FIND = 5;
INTERNET_HANDLE_TYPE_FTP_FIND_HTML = 6;
INTERNET_HANDLE_TYPE_FTP_FILE = 7;
INTERNET_HANDLE_TYPE_FTP_FILE_HTML = 8;
INTERNET_HANDLE_TYPE_GOPHER_FIND = 9;
INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML = 10;
INTERNET_HANDLE_TYPE_GOPHER_FILE = 11;
INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML = 12;
INTERNET_HANDLE_TYPE_HTTP_REQUEST = 13;
function InternetGetLastResponseInfoA(var lpdwError: DWORD; lpszBuffer: PAnsiChar;
var lpdwBufferLength: DWORD): BOOL; stdcall;
function InternetGetLastResponseInfoW(var lpdwError: DWORD; lpszBuffer: PWideChar;
var lpdwBufferLength: DWORD): BOOL; stdcall;
function InternetGetLastResponseInfo(var lpdwError: DWORD; lpszBuffer: PChar;
var lpdwBufferLength: DWORD): BOOL; stdcall;
{ callback function for InternetSetStatusCallback }
type
TFNInternetStatusCallback = TFarProc;
PFNInternetStatusCallback = ^TFNInternetStatusCallback;
function InternetSetStatusCallback(hInet: HINTERNET;
lpfnInternetCallback: PFNInternetStatusCallback): PFNInternetStatusCallback; stdcall;
{ status manifests for Internet status callback }
const
INTERNET_STATUS_RESOLVING_NAME = 10;
INTERNET_STATUS_NAME_RESOLVED = 11;
INTERNET_STATUS_CONNECTING_TO_SERVER = 20;
INTERNET_STATUS_CONNECTED_TO_SERVER = 21;
INTERNET_STATUS_SENDING_REQUEST = 30;
INTERNET_STATUS_REQUEST_SENT = 31;
INTERNET_STATUS_RECEIVING_RESPONSE = 40;
INTERNET_STATUS_RESPONSE_RECEIVED = 41;
INTERNET_STATUS_CTL_RESPONSE_RECEIVED = 42; { FTP-only: response on control channel }
INTERNET_STATUS_CLOSING_CONNECTION = 50;
INTERNET_STATUS_CONNECTION_CLOSED = 51;
INTERNET_STATUS_HANDLE_CREATED = 60;
INTERNET_STATUS_REQUEST_COMPLETE = 100;
{ if the following value is returned by InternetSetStatusCallback, then }
{ probably an invalid (non-code) address was supplied for the callback }
INTERNET_INVALID_STATUS_CALLBACK = (-1);
function InternetCancelAsyncRequest(dwAsyncId: DWORD): BOOL; stdcall;
{ FTP }
{ manifests }
const
FTP_TRANSFER_TYPE_UNKNOWN = $00000000;
FTP_TRANSFER_TYPE_ASCII = $00000001;
FTP_TRANSFER_TYPE_BINARY = $00000002;
FTP_TRANSFER_TYPE_MASK = $00000003;
{ prototypes }
function FtpFindFirstFileA(hFtpSession: HINTERNET; lpszSearchFile: PAnsiChar;
var lpFindFileData: TWin32FindDataA; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall;
function FtpFindFirstFileW(hFtpSession: HINTERNET; lpszSearchFile: PWideChar;
var lpFindFileData: TWin32FindDataW; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall;
function FtpFindFirstFile(hFtpSession: HINTERNET; lpszSearchFile: PChar;
var lpFindFileData: TWin32FindData; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall;
function FtpGetFileA(hFtpSession: HINTERNET; lpszRemoteFile: PAnsiChar;
lpszNewFile: PAnsiChar; fFailIfExists: BOOL; dwFlagsAndAttributes: DWORD;
dwFlags: DWORD; dwContext: DWORD): BOOL stdcall;
function FtpGetFileW(hFtpSession: HINTERNET; lpszRemoteFile: PWideChar;
lpszNewFile: PWideChar; fFailIfExists: BOOL; dwFlagsAndAttributes: DWORD;
dwFlags: DWORD; dwContext: DWORD): BOOL stdcall;
function FtpGetFile(hFtpSession: HINTERNET; lpszRemoteFile: PChar;
lpszNewFile: PChar; fFailIfExists: BOOL; dwFlagsAndAttributes: DWORD;
dwFlags: DWORD; dwContext: DWORD): BOOL stdcall;
function FtpPutFileA(hFtpSession: HINTERNET; lpszLocalFile: PAnsiChar;
lpszNewRemoteFile: PAnsiChar; dwFlags: DWORD; dwContext: DWORD): BOOL; stdcall;
function FtpPutFileW(hFtpSession: HINTERNET; lpszLocalFile: PWideChar;
lpszNewRemoteFile: PWideChar; dwFlags: DWORD; dwContext: DWORD): BOOL; stdcall;
function FtpPutFile(hFtpSession: HINTERNET; lpszLocalFile: PChar;
lpszNewRemoteFile: PChar; dwFlags: DWORD; dwContext: DWORD): BOOL; stdcall;
function FtpDeleteFileA(hFtpSession: HINTERNET; lpszFileName: PAnsiChar): BOOL; stdcall;
function FtpDeleteFileW(hFtpSession: HINTERNET; lpszFileName: PWideChar): BOOL; stdcall;
function FtpDeleteFile(hFtpSession: HINTERNET; lpszFileName: PChar): BOOL; stdcall;
function FtpRenameFileA(hFtpSession: HINTERNET; lpszExisting: PAnsiChar;
lpszNew: PAnsiChar): BOOL; stdcall;
function FtpRenameFileW(hFtpSession: HINTERNET; lpszExisting: PWideChar;
lpszNew: PWideChar): BOOL; stdcall;
function FtpRenameFile(hFtpSession: HINTERNET; lpszExisting: PChar;
lpszNew: PChar): BOOL; stdcall;
function FtpOpenFileA(hFtpSession: HINTERNET; lpszFileName: PAnsiChar;
dwAccess: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
function FtpOpenFileW(hFtpSession: HINTERNET; lpszFileName: PWideChar;
dwAccess: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
function FtpOpenFile(hFtpSession: HINTERNET; lpszFileName: PChar;
dwAccess: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
function FtpCreateDirectoryA(hFtpSession: HINTERNET; lpszDirectory: PAnsiChar): BOOL; stdcall;
function FtpCreateDirectoryW(hFtpSession: HINTERNET; lpszDirectory: PWideChar): BOOL; stdcall;
function FtpCreateDirectory(hFtpSession: HINTERNET; lpszDirectory: PChar): BOOL; stdcall;
function FtpRemoveDirectoryA(hFtpSession: HINTERNET; lpszDirectory: PAnsiChar): BOOL; stdcall;
function FtpRemoveDirectoryW(hFtpSession: HINTERNET; lpszDirectory: PWideChar): BOOL; stdcall;
function FtpRemoveDirectory(hFtpSession: HINTERNET; lpszDirectory: PChar): BOOL; stdcall;
function FtpSetCurrentDirectoryA(hFtpSession: HINTERNET; lpszDirectory: PAnsiChar): BOOL; stdcall;
function FtpSetCurrentDirectoryW(hFtpSession: HINTERNET; lpszDirectory: PWideChar): BOOL; stdcall;
function FtpSetCurrentDirectory(hFtpSession: HINTERNET; lpszDirectory: PChar): BOOL; stdcall;
function FtpGetCurrentDirectoryA(hFtpSession: HINTERNET;
lpszCurrentDirectory: PAnsiChar; var lpdwCurrentDirectory: DWORD): BOOL; stdcall;
function FtpGetCurrentDirectoryW(hFtpSession: HINTERNET;
lpszCurrentDirectory: PWideChar; var lpdwCurrentDirectory: DWORD): BOOL; stdcall;
function FtpGetCurrentDirectory(hFtpSession: HINTERNET;
lpszCurrentDirectory: PChar; var lpdwCurrentDirectory: DWORD): BOOL; stdcall;
function FtpCommandA(hFtpSession: HINTERNET; fExpectResponse: BOOL;
dwFlags: DWORD; lpszCommand: PAnsiChar; dwContext: DWORD): BOOL; stdcall;
function FtpCommandW(hFtpSession: HINTERNET; fExpectResponse: BOOL;
dwFlags: DWORD; lpszCommand: PWideChar; dwContext: DWORD): BOOL; stdcall;
function FtpCommand(hFtpSession: HINTERNET; fExpectResponse: BOOL;
dwFlags: DWORD; lpszCommand: PChar; dwContext: DWORD): BOOL; stdcall;
{ Gopher }
{ manifests }
{ string field lengths (in characters, not bytes) }
const
MAX_GOPHER_DISPLAY_TEXT = 128;
MAX_GOPHER_SELECTOR_TEXT = 256;
MAX_GOPHER_HOST_NAME = INTERNET_MAX_HOST_NAME_LENGTH;
MAX_GOPHER_LOCATOR_LENGTH = 1
+ MAX_GOPHER_DISPLAY_TEXT
+ 1
+ MAX_GOPHER_SELECTOR_TEXT
+ 1
+ MAX_GOPHER_HOST_NAME
+ 1
+ INTERNET_MAX_PORT_NUMBER_LENGTH
+ 1
+ 1
+ 2;
{ structures/types }
{ GOPHER_FIND_DATA - returns the results of a GopherFindFirstFile()/ }
{ InternetFindNextFile() request }
type
PGopherFindData = ^TGopherFindData;
TGopherFindData = packed record
{ DisplayString - points to the string to be displayed by the client (i.e. }
{ the file or directory name) }
DisplayString: packed array[0..MAX_GOPHER_DISPLAY_TEXT-1] of WCHAR;
GopherType: DWORD; { GopherType - bitmap which describes the item returned. See below }
{ SizeLow and SizeHigh - (approximate) size of the item, if the gopher }
{ server reports it }
SizeLow: DWORD;
SizeHigh: DWORD;
{ LastModificationTime - time in Win32 format that this item was last }
{ modified, if the gopher server reports it }
LastModificationTime: TFileTime;
{ Locator - the gopher locator string returned from the server, or created }
{ via GopherCreateLocator }
Locator: packed array[0..MAX_GOPHER_LOCATOR_LENGTH-1] of WCHAR;
end;
{ manifests for GopherType }
const
GOPHER_TYPE_TEXT_FILE = $00000001;
GOPHER_TYPE_DIRECTORY = $00000002;
GOPHER_TYPE_CSO = $00000004;
GOPHER_TYPE_ERROR = $00000008;
GOPHER_TYPE_MAC_BINHEX = $00000010;
GOPHER_TYPE_DOS_ARCHIVE = $00000020;
GOPHER_TYPE_UNIX_UUENCODED = $00000040;
GOPHER_TYPE_INDEX_SERVER = $00000080;
GOPHER_TYPE_TELNET = $00000100;
GOPHER_TYPE_BINARY = $00000200;
GOPHER_TYPE_REDUNDANT = $00000400;
GOPHER_TYPE_TN3270 = $00000800;
GOPHER_TYPE_GIF = $00001000;
GOPHER_TYPE_IMAGE = $00002000;
GOPHER_TYPE_BITMAP = $00004000;
GOPHER_TYPE_MOVIE = $00008000;
GOPHER_TYPE_SOUND = $00010000;
GOPHER_TYPE_HTML = $00020000;
GOPHER_TYPE_PDF = $00040000;
GOPHER_TYPE_CALENDAR = $00080000;
GOPHER_TYPE_INLINE = $00100000;
GOPHER_TYPE_UNKNOWN = $20000000;
GOPHER_TYPE_ASK = $40000000;
GOPHER_TYPE_GOPHER_PLUS = $80000000;
{ Gopher Type functions }
function IS_GOPHER_FILE(GopherType: DWORD): BOOL;
function IS_GOPHER_DIRECTORY(GopherType: DWORD): BOOL;
function IS_GOPHER_PHONE_SERVER(GopherType: DWORD): BOOL;
function IS_GOPHER_ERROR(GopherType: DWORD): BOOL;
function IS_GOPHER_INDEX_SERVER(GopherType: DWORD): BOOL;
function IS_GOPHER_TELNET_SESSION(GopherType: DWORD): BOOL;
function IS_GOPHER_BACKUP_SERVER(GopherType: DWORD): BOOL;
function IS_GOPHER_TN3270_SESSION(GopherType: DWORD): BOOL;
function IS_GOPHER_ASK(GopherType: DWORD): BOOL;
function IS_GOPHER_PLUS(GopherType: DWORD): BOOL;
function IS_GOPHER_TYPE_KNOWN(GopherType: DWORD): BOOL;
{ GOPHER_TYPE_FILE_MASK - use this to determine if a locator identifies a }
{ (known) file type }
const
GOPHER_TYPE_FILE_MASK = GOPHER_TYPE_TEXT_FILE
or GOPHER_TYPE_MAC_BINHEX
or GOPHER_TYPE_DOS_ARCHIVE
or GOPHER_TYPE_UNIX_UUENCODED
or GOPHER_TYPE_BINARY
or GOPHER_TYPE_GIF
or GOPHER_TYPE_IMAGE
or GOPHER_TYPE_BITMAP
or GOPHER_TYPE_MOVIE
or GOPHER_TYPE_SOUND
or GOPHER_TYPE_HTML
or GOPHER_TYPE_PDF
or GOPHER_TYPE_CALENDAR
or GOPHER_TYPE_INLINE;
{ structured gopher attributes (as defined in gopher+ protocol document) }
type
PGopherAdminAttributeType = ^TGopherAdminAttributeType;
TGopherAdminAttributeType = packed record
Comment: LPCSTR;
EmailAddress: LPCSTR;
end;
PGopherModDateAttributeType = ^TGopherModDateAttributeType;
TGopherModDateAttributeType = packed record
DateAndTime: TFileTime;
end;
PGopherTtlAttributeType = ^TGopherTtlAttributeType;
TGopherTtlAttributeType = packed record
Ttl: DWORD;
end;
PGopherScoreAttributeType = ^TGopherScoreAttributeType;
TGopherScoreAttributeType = packed record
Score: Integer;
end;
PGopherScoreRangeAttributeType = ^TGopherScoreRangeAttributeType;
TGopherScoreRangeAttributeType = packed record
LowerBound: Integer;
UpperBound: Integer;
end;
PGopherSiteAttributeType = ^TGopherSiteAttributeType;
TGopherSiteAttributeType = packed record
Site: LPCSTR;
end;
PGopherOrganizationAttributeType = ^TGopherOrganizationAttributeType;
TGopherOrganizationAttributeType = packed record
Organization: LPCSTR;
end;
PGopherLocationAttributeType = ^TGopherLocationAttributeType;
TGopherLocationAttributeType = packed record
Location: LPCSTR;
end;
PGopherGeographicalLocationAttributeType = ^TGopherGeographicalLocationAttributeType;
TGopherGeographicalLocationAttributeType = packed record
DegreesNorth: Integer;
MinutesNorth: Integer;
SecondsNorth: Integer;
DegreesEast: Integer;
MinutesEast: Integer;
SecondsEast: Integer;
end;
PGopherTimezoneAttributeType = ^TGopherTimezoneAttributeType;
TGopherTimezoneAttributeType = packed record
Zone: Integer;
end;
PGopherProviderAttributeType = ^TGopherProviderAttributeType;
TGopherProviderAttributeType = packed record
Provider: LPCSTR;
end;
PGopherVersionAttributeType = ^TGopherVersionAttributeType;
TGopherVersionAttributeType = packed record
Version: LPCSTR;
end;
PGopherAbstractAttributeType = ^TGopherAbstractAttributeType;
TGopherAbstractAttributeType = packed record
ShortAbstract: LPCSTR;
AbstractFile: LPCSTR;
end;
PGopherViewAttributeType = ^TGopherViewAttributeType;
TGopherViewAttributeType = packed record
ContentType: LPCSTR;
Language: LPCSTR;
Size: DWORD;
end;
PGopherVeronicaAttributeType = ^TGopherVeronicaAttributeType;
TGopherVeronicaAttributeType = packed record
TreeWalk: BOOL;
end;
PGopherAskAttributeType = ^TGopherAskAttributeType;
TGopherAskAttributeType = packed record
QuestionType: LPCSTR;
QuestionText: LPCSTR;
end;
{ GOPHER_UNKNOWN_ATTRIBUTE_TYPE - this is returned if we retrieve an attribute }
{ that is not specified in the current gopher/gopher+ documentation. It is up }
{ to the application to parse the information }
PGopherUnknownAttributeType = ^TGopherUnknownAttributeType;
TGopherUnknownAttributeType = packed record
Text: LPCSTR;
end;
{ GOPHER_ATTRIBUTE_TYPE - returned in the user's buffer when an enumerated }
{ GopherGetAttribute call is made }
PGopherAttributeType = ^TGopherAttributeType;
TGopherAttributeType = packed record
CategoryId: DWORD; { e.g. GOPHER_CATEGORY_ID_ADMIN }
AttributeId: DWORD; { e.g. GOPHER_ATTRIBUTE_ID_ADMIN }
case Integer of
0: (Admin: TGopherAdminAttributeType);
1: (ModDate: TGopherModDateAttributeType);
2: (Ttl: TGopherTtlAttributeType);
3: (Score: TGopherScoreAttributeType);
4: (ScoreRange: TGopherScoreRangeAttributeType);
5: (Site: TGopherSiteAttributeType);
6: (Organization: TGopherOrganizationAttributeType);
7: (Location: TGopherLocationAttributeType);
8: (GeographicalLocation: TGopherGeographicalLocationAttributeType);
9: (TimeZone: TGopherTimezoneAttributeType);
10: (Provider: TGopherProviderAttributeType);
11: (Version: TGopherVersionAttributeType);
12: (Abstract: TGopherAbstractAttributeType);
13: (View: TGopherViewAttributeType);
14: (Veronica: TGopherVeronicaAttributeType);
15: (Ask: TGopherAskAttributeType);
16: (Unknown: TGopherUnknownAttributeType);
end;
const
MAX_GOPHER_CATEGORY_NAME = 128; { arbitrary }
MAX_GOPHER_ATTRIBUTE_NAME = 128; { " }
MIN_GOPHER_ATTRIBUTE_LENGTH = 256; { " }
{ known gopher attribute categories. See below for ordinals }
GOPHER_INFO_CATEGORY = '+INFO';
GOPHER_ADMIN_CATEGORY = '+ADMIN';
GOPHER_VIEWS_CATEGORY = '+VIEWS';
GOPHER_ABSTRACT_CATEGORY = '+ABSTRACT';
GOPHER_VERONICA_CATEGORY = '+VERONICA';
{ known gopher attributes. These are the attribute names as defined in the }
{ gopher+ protocol document }
GOPHER_ADMIN_ATTRIBUTE = 'Admin';
GOPHER_MOD_DATE_ATTRIBUTE = 'Mod-Date';
GOPHER_TTL_ATTRIBUTE = 'TTL';
GOPHER_SCORE_ATTRIBUTE = 'Score';
GOPHER_RANGE_ATTRIBUTE = 'Score-range';
GOPHER_SITE_ATTRIBUTE = 'Site';
GOPHER_ORG_ATTRIBUTE = 'Org';
GOPHER_LOCATION_ATTRIBUTE = 'Loc';
GOPHER_GEOG_ATTRIBUTE = 'Geog';
GOPHER_TIMEZONE_ATTRIBUTE = 'TZ';
GOPHER_PROVIDER_ATTRIBUTE = 'Provider';
GOPHER_VERSION_ATTRIBUTE = 'Version';
GOPHER_ABSTRACT_ATTRIBUTE = 'Abstract';
GOPHER_VIEW_ATTRIBUTE = 'View';
GOPHER_TREEWALK_ATTRIBUTE = 'treewalk';
{ identifiers for attribute strings }
GOPHER_ATTRIBUTE_ID_BASE = $abcccc00;
GOPHER_CATEGORY_ID_ALL = GOPHER_ATTRIBUTE_ID_BASE + 1;
GOPHER_CATEGORY_ID_INFO = GOPHER_ATTRIBUTE_ID_BASE + 2;
GOPHER_CATEGORY_ID_ADMIN = GOPHER_ATTRIBUTE_ID_BASE + 3;
GOPHER_CATEGORY_ID_VIEWS = GOPHER_ATTRIBUTE_ID_BASE + 4;
GOPHER_CATEGORY_ID_ABSTRACT = GOPHER_ATTRIBUTE_ID_BASE + 5;
GOPHER_CATEGORY_ID_VERONICA = GOPHER_ATTRIBUTE_ID_BASE + 6;
GOPHER_CATEGORY_ID_ASK = GOPHER_ATTRIBUTE_ID_BASE + 7;
GOPHER_CATEGORY_ID_UNKNOWN = GOPHER_ATTRIBUTE_ID_BASE + 8;
GOPHER_ATTRIBUTE_ID_ALL = GOPHER_ATTRIBUTE_ID_BASE + 9;
GOPHER_ATTRIBUTE_ID_ADMIN = GOPHER_ATTRIBUTE_ID_BASE + 10;
GOPHER_ATTRIBUTE_ID_MOD_DATE = GOPHER_ATTRIBUTE_ID_BASE + 11;
GOPHER_ATTRIBUTE_ID_TTL = GOPHER_ATTRIBUTE_ID_BASE + 12;
GOPHER_ATTRIBUTE_ID_SCORE = GOPHER_ATTRIBUTE_ID_BASE + 13;
GOPHER_ATTRIBUTE_ID_RANGE = GOPHER_ATTRIBUTE_ID_BASE + 14;
GOPHER_ATTRIBUTE_ID_SITE = GOPHER_ATTRIBUTE_ID_BASE + 15;
GOPHER_ATTRIBUTE_ID_ORG = GOPHER_ATTRIBUTE_ID_BASE + 16;
GOPHER_ATTRIBUTE_ID_LOCATION = GOPHER_ATTRIBUTE_ID_BASE + 17;
GOPHER_ATTRIBUTE_ID_GEOG = GOPHER_ATTRIBUTE_ID_BASE + 18;
GOPHER_ATTRIBUTE_ID_TIMEZONE = GOPHER_ATTRIBUTE_ID_BASE + 19;
GOPHER_ATTRIBUTE_ID_PROVIDER = GOPHER_ATTRIBUTE_ID_BASE + 20;
GOPHER_ATTRIBUTE_ID_VERSION = GOPHER_ATTRIBUTE_ID_BASE + 21;
GOPHER_ATTRIBUTE_ID_ABSTRACT = GOPHER_ATTRIBUTE_ID_BASE + 22;
GOPHER_ATTRIBUTE_ID_VIEW = GOPHER_ATTRIBUTE_ID_BASE + 23;
GOPHER_ATTRIBUTE_ID_TREEWALK = GOPHER_ATTRIBUTE_ID_BASE + 24;
GOPHER_ATTRIBUTE_ID_UNKNOWN = GOPHER_ATTRIBUTE_ID_BASE + 25;
{ prototypes }
function GopherCreateLocatorA(lpszHost: PAnsiChar; nServerPort: INTERNET_PORT;
lpszDisplayString: PAnsiChar; lpszSelectorString: PAnsiChar; dwGopherType: DWORD;
lpszLocator: PAnsiChar; var lpdwBufferLength: DWORD): BOOL; stdcall;
function GopherCreateLocatorW(lpszHost: PWideChar; nServerPort: INTERNET_PORT;
lpszDisplayString: PWideChar; lpszSelectorString: PWideChar; dwGopherType: DWORD;
lpszLocator: PWideChar; var lpdwBufferLength: DWORD): BOOL; stdcall;
function GopherCreateLocator(lpszHost: PChar; nServerPort: INTERNET_PORT;
lpszDisplayString: PChar; lpszSelectorString: PChar; dwGopherType: DWORD;
lpszLocator: PChar; var lpdwBufferLength: DWORD): BOOL; stdcall;
function GopherGetLocatorTypeA(lpszLocator: PAnsiChar;
var lpdwGopherType: DWORD): BOOL; stdcall;
function GopherGetLocatorTypeW(lpszLocator: PWideChar;
var lpdwGopherType: DWORD): BOOL; stdcall;
function GopherGetLocatorType(lpszLocator: PChar;
var lpdwGopherType: DWORD): BOOL; stdcall;
function GopherFindFirstFileA(hGopherSession: HINTERNET; lpszLocator: PAnsiChar;
lpszSearchString: PAnsiChar; var lpFindData: TGopherFindData; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall;
function GopherFindFirstFileW(hGopherSession: HINTERNET; lpszLocator: PWideChar;
lpszSearchString: PWideChar; var lpFindData: TGopherFindData; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall;
function GopherFindFirstFile(hGopherSession: HINTERNET; lpszLocator: PChar;
lpszSearchString: PChar; var lpFindData: TGopherFindData; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall;
function GopherOpenFileA(hGopherSession: HINTERNET; lpszLocator: PAnsiChar;
lpszView: PAnsiChar; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
function GopherOpenFileW(hGopherSession: HINTERNET; lpszLocator: PWideChar;
lpszView: PWideChar; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
function GopherOpenFile(hGopherSession: HINTERNET; lpszLocator: PChar;
lpszView: PChar; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
type
TFNGopherAttributeEnumerator = TFarProc;
PFNGopherAttributeEnumerator = ^TFNGopherAttributeEnumerator;
function GopherGetAttributeA(hGopherSession: HINTERNET; lpszLocator: PAnsiChar;
lpszAttributeName: PAnsiChar; lpBuffer: Pointer; dwBufferLength: DWORD;
var lpdwCharactersReturned: DWORD; lpfnEnumerator: PFNGopherAttributeEnumerator;
dwContext: DWORD): BOOL; stdcall;
function GopherGetAttributeW(hGopherSession: HINTERNET; lpszLocator: PWideChar;
lpszAttributeName: PWideChar; lpBuffer: Pointer; dwBufferLength: DWORD;
var lpdwCharactersReturned: DWORD; lpfnEnumerator: PFNGopherAttributeEnumerator;
dwContext: DWORD): BOOL; stdcall;
function GopherGetAttribute(hGopherSession: HINTERNET; lpszLocator: PChar;
lpszAttributeName: PChar; lpBuffer: Pointer; dwBufferLength: DWORD;
var lpdwCharactersReturned: DWORD; lpfnEnumerator: PFNGopherAttributeEnumerator;
dwContext: DWORD): BOOL; stdcall;
function GopherSendDataA(hGopherSession: HINTERNET; lpszLocator: PAnsiChar;
lpszBuffer: PAnsiChar; dwNumberOfCharactersToSend: DWORD;
var lpdwNumberOfCharactersSent: DWORD; dwContext: DWORD): BOOL; stdcall;
function GopherSendDataW(hGopherSession: HINTERNET; lpszLocator: PWideChar;
lpszBuffer: PWideChar; dwNumberOfCharactersToSend: DWORD;
var lpdwNumberOfCharactersSent: DWORD; dwContext: DWORD): BOOL; stdcall;
function GopherSendData(hGopherSession: HINTERNET; lpszLocator: PChar;
lpszBuffer: PChar; dwNumberOfCharactersToSend: DWORD;
var lpdwNumberOfCharactersSent: DWORD; dwContext: DWORD): BOOL; stdcall;
{ HTTP }
{ manifests }
const
HTTP_TCPIP_PORT = 80; { The default HTTP port for TCP/IP connections. }
{ The default major/minor HTTP version numbers. }
HTTP_MAJOR_VERSION = 1;
HTTP_MINOR_VERSION = 0;
HTTP_VERSION = 'HTTP/1';
{ HttpQueryInfo info levels. Generally, there is one info level }
{ for each potential RFC822/HTTP/MIME header that an HTTP server }
{ may send as part of a request response. }
{ The HTTP_QUERY_RAW_HEADERS info level is provided for clients }
{ that choose to perform their own header parsing. }
HTTP_QUERY_MIN = $0000;
HTTP_QUERY_MIME_VERSION = $0000;
HTTP_QUERY_CONTENT_TYPE = $0001;
HTTP_QUERY_CONTENT_TRANSFER_ENCODING = $0002;
HTTP_QUERY_CONTENT_ID = $0003;
HTTP_QUERY_CONTENT_DESCRIPTION = $0004;
HTTP_QUERY_CONTENT_LENGTH = $0005;
HTTP_QUERY_CONTENT_LANGUAGE = $0006;
HTTP_QUERY_ALLOW = $0007;
HTTP_QUERY_PUBLIC = $0008;
HTTP_QUERY_DATE = $0009;
HTTP_QUERY_EXPIRES = $000A;
HTTP_QUERY_LAST_MODIFIED = $000B;
HTTP_QUERY_MESSAGE_ID = $000C;
HTTP_QUERY_URI = $000D;
HTTP_QUERY_DERIVED_FROM = $000E;
HTTP_QUERY_COST = $000F;
HTTP_QUERY_LINK = $0010;
HTTP_QUERY_PRAGMA = $0011;
HTTP_QUERY_VERSION = $0012;
HTTP_QUERY_STATUS_CODE = $0013;
HTTP_QUERY_STATUS_TEXT = $0014;
HTTP_QUERY_RAW_HEADERS = $0015;
HTTP_QUERY_RAW_HEADERS_CRLF = $0016;
HTTP_QUERY_CONNECTION = $0017;
HTTP_QUERY_MAX = $0017;
{ HTTP Response Status Codes: }
HTTP_STATUS_OK = 200; { request completed }
HTTP_STATUS_CREATED = 201; { object created, reason = new URI }
HTTP_STATUS_ACCEPTED = 202; { async completion (TBS) }
HTTP_STATUS_PARTIAL = 203; { partial completion }
HTTP_STATUS_MOVED = 301; { object permanently moved }
HTTP_STATUS_REDIRECT = 302; { object temporarily moved }
HTTP_STATUS_REDIRECT_METHOD = 303; { redirection w/ new access method }
HTTP_STATUS_BAD_REQUEST = 400; { invalid syntax }
HTTP_STATUS_DENIED = 401; { access denied }
HTTP_STATUS_PAYMENT_REQ = 402; { payment required }
HTTP_STATUS_FORBIDDEN = 403; { request forbidden }
HTTP_STATUS_NOT_FOUND = 404; { object not found }
HTTP_STATUS_SERVER_ERROR = 500; { internal server error }
HTTP_STATUS_NOT_SUPPORTED = 501; { required not supported }
{ prototypes }
function HttpOpenRequestA(hHttpSession: HINTERNET; lpszVerb: PAnsiChar;
lpszObjectName: PAnsiChar; lpszVersion: PAnsiChar; lpszReferrer: PAnsiChar;
lplpszAcceptTypes: PAnsiChar; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall;
function HttpOpenRequestW(hHttpSession: HINTERNET; lpszVerb: PWideChar;
lpszObjectName: PWideChar; lpszVersion: PWideChar; lpszReferrer: PWideChar;
lplpszAcceptTypes: PWideChar; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall;
function HttpOpenRequest(hHttpSession: HINTERNET; lpszVerb: PChar;
lpszObjectName: PChar; lpszVersion: PChar; lpszReferrer: PChar;
lplpszAcceptTypes: PChar; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall;
function HttpAddRequestHeadersA(hHttpRequest: HINTERNET; lpszHeaders: PAnsiChar;
dwHeadersLength: DWORD; dwReserved: DWORD): BOOL; stdcall;
function HttpAddRequestHeadersW(hHttpRequest: HINTERNET; lpszHeaders: PWideChar;
dwHeadersLength: DWORD; dwReserved: DWORD): BOOL; stdcall;
function HttpAddRequestHeaders(hHttpRequest: HINTERNET; lpszHeaders: PChar;
dwHeadersLength: DWORD; dwReserved: DWORD): BOOL; stdcall;
function HttpSendRequestA(hHttpRequest: HINTERNET; lpszHeaders: PAnsiChar;
dwHeadersLength: DWORD; lpOptional: Pointer;
dwOptionalLength: DWORD): BOOL; stdcall;
function HttpSendRequestW(hHttpRequest: HINTERNET; lpszHeaders: PWideChar;
dwHeadersLength: DWORD; lpOptional: Pointer;
dwOptionalLength: DWORD): BOOL; stdcall;
function HttpSendRequest(hHttpRequest: HINTERNET; lpszHeaders: PChar;
dwHeadersLength: DWORD; lpOptional: Pointer;
dwOptionalLength: DWORD): BOOL; stdcall;
function HttpQueryInfoA(hHttpRequest: HINTERNET; dwInfoLevel: DWORD;
lpvBuffer: Pointer; var lpdwBufferLength: DWORD;
var lpdwReserved: DWORD): BOOL; stdcall;
function HttpQueryInfoW(hHttpRequest: HINTERNET; dwInfoLevel: DWORD;
lpvBuffer: Pointer; var lpdwBufferLength: DWORD;
var lpdwReserved: DWORD): BOOL; stdcall;
function HttpQueryInfo(hHttpRequest: HINTERNET; dwInfoLevel: DWORD;
lpvBuffer: Pointer; var lpdwBufferLength: DWORD;
var lpdwReserved: DWORD): BOOL; stdcall;
{ Internet API error returns }
const
INTERNET_ERROR_BASE = 12000;
ERROR_INTERNET_OUT_OF_HANDLES = INTERNET_ERROR_BASE + 1;
ERROR_INTERNET_TIMEOUT = INTERNET_ERROR_BASE + 2;
ERROR_INTERNET_EXTENDED_ERROR = INTERNET_ERROR_BASE + 3;
ERROR_INTERNET_INTERNAL_ERROR = INTERNET_ERROR_BASE + 4;
ERROR_INTERNET_INVALID_URL = INTERNET_ERROR_BASE + 5;
ERROR_INTERNET_UNRECOGNIZED_SCHEME = INTERNET_ERROR_BASE + 6;
ERROR_INTERNET_NAME_NOT_RESOLVED = INTERNET_ERROR_BASE + 7;
ERROR_INTERNET_PROTOCOL_NOT_FOUND = INTERNET_ERROR_BASE + 8;
ERROR_INTERNET_INVALID_OPTION = INTERNET_ERROR_BASE + 9;
ERROR_INTERNET_BAD_OPTION_LENGTH = INTERNET_ERROR_BASE + 10;
ERROR_INTERNET_OPTION_NOT_SETTABLE = INTERNET_ERROR_BASE + 11;
ERROR_INTERNET_SHUTDOWN = INTERNET_ERROR_BASE + 12;
ERROR_INTERNET_INCORRECT_USER_NAME = INTERNET_ERROR_BASE + 13;
ERROR_INTERNET_INCORRECT_PASSWORD = INTERNET_ERROR_BASE + 14;
ERROR_INTERNET_LOGIN_FAILURE = INTERNET_ERROR_BASE + 15;
ERROR_INTERNET_INVALID_OPERATION = INTERNET_ERROR_BASE + 16;
ERROR_INTERNET_OPERATION_CANCELLED = INTERNET_ERROR_BASE + 17;
ERROR_INTERNET_INCORRECT_HANDLE_TYPE = INTERNET_ERROR_BASE + 18;
ERROR_INTERNET_NOT_PROXY_REQUEST = INTERNET_ERROR_BASE + 20;
ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND = INTERNET_ERROR_BASE + 21;
ERROR_INTERNET_BAD_REGISTRY_PARAMETER = INTERNET_ERROR_BASE + 22;
ERROR_INTERNET_NO_DIRECT_ACCESS = INTERNET_ERROR_BASE + 23;
ERROR_INTERNET_NO_CONTEXT = INTERNET_ERROR_BASE + 24;
ERROR_INTERNET_NO_CALLBACK = INTERNET_ERROR_BASE + 25;
ERROR_INTERNET_REQUEST_PENDING = INTERNET_ERROR_BASE + 26;
{ FTP API errors }
ERROR_FTP_TRANSFER_IN_PROGRESS = INTERNET_ERROR_BASE + 28;
ERROR_FTP_DROPPED = INTERNET_ERROR_BASE + 29;
{ gopher API errors }
ERROR_GOPHER_PROTOCOL_ERROR = INTERNET_ERROR_BASE + 30;
ERROR_GOPHER_NOT_FILE = INTERNET_ERROR_BASE + 31;
ERROR_GOPHER_DATA_ERROR = INTERNET_ERROR_BASE + 32;
ERROR_GOPHER_END_OF_DATA = INTERNET_ERROR_BASE + 33;
ERROR_GOPHER_INVALID_LOCATOR = INTERNET_ERROR_BASE + 34;
ERROR_GOPHER_INCORRECT_LOCATOR_TYPE = INTERNET_ERROR_BASE + 35;
ERROR_GOPHER_NOT_GOPHER_PLUS = INTERNET_ERROR_BASE + 36;
ERROR_GOPHER_ATTRIBUTE_NOT_FOUND = INTERNET_ERROR_BASE + 37;
ERROR_GOPHER_UNKNOWN_LOCATOR = INTERNET_ERROR_BASE + 38;
{ HTTP API errors }
ERROR_HTTP_HEADER_NOT_FOUND = INTERNET_ERROR_BASE + 40;
ERROR_HTTP_DOWNLEVEL_SERVER = INTERNET_ERROR_BASE + 41;
ERROR_HTTP_INVALID_SERVER_RESPONSE = INTERNET_ERROR_BASE + 42;
implementation
const
winetdll = 'wininet.dll';
function FtpCommandA; external winetdll name 'FtpCommandA';
function FtpCommandW; external winetdll name 'FtpCommandW';
function FtpCommand; external winetdll name 'FtpCommandA';
function FtpCreateDirectoryA; external winetdll name 'FtpCreateDirectoryA';
function FtpCreateDirectoryW; external winetdll name 'FtpCreateDirectoryW';
function FtpCreateDirectory; external winetdll name 'FtpCreateDirectoryA';
function FtpDeleteFileA; external winetdll name 'FtpDeleteFileA';
function FtpDeleteFileW; external winetdll name 'FtpDeleteFileW';
function FtpDeleteFile; external winetdll name 'FtpDeleteFileA';
function FtpFindFirstFileA; external winetdll name 'FtpFindFirstFileA';
function FtpFindFirstFileW; external winetdll name 'FtpFindFirstFileW';
function FtpFindFirstFile; external winetdll name 'FtpFindFirstFileA';
function FtpGetCurrentDirectoryA; external winetdll name 'FtpGetCurrentDirectoryA';
function FtpGetCurrentDirectoryW; external winetdll name 'FtpGetCurrentDirectoryW';
function FtpGetCurrentDirectory; external winetdll name 'FtpGetCurrentDirectoryA';
function FtpGetFileA; external winetdll name 'FtpGetFileA';
function FtpGetFileW; external winetdll name 'FtpGetFileW';
function FtpGetFile; external winetdll name 'FtpGetFileA';
function FtpOpenFileA; external winetdll name 'FtpOpenFileA';
function FtpOpenFileW; external winetdll name 'FtpOpenFileW';
function FtpOpenFile; external winetdll name 'FtpOpenFileA';
function FtpPutFileA; external winetdll name 'FtpPutFileA';
function FtpPutFileW; external winetdll name 'FtpPutFileW';
function FtpPutFile; external winetdll name 'FtpPutFileA';
function FtpRemoveDirectoryA; external winetdll name 'FtpRemoveDirectoryA';
function FtpRemoveDirectoryW; external winetdll name 'FtpRemoveDirectoryW';
function FtpRemoveDirectory; external winetdll name 'FtpRemoveDirectoryA';
function FtpRenameFileA; external winetdll name 'FtpRenameFileA';
function FtpRenameFileW; external winetdll name 'FtpRenameFileW';
function FtpRenameFile; external winetdll name 'FtpRenameFileA';
function FtpSetCurrentDirectoryA; external winetdll name 'FtpSetCurrentDirectoryA';
function FtpSetCurrentDirectoryW; external winetdll name 'FtpSetCurrentDirectoryW';
function FtpSetCurrentDirectory; external winetdll name 'FtpSetCurrentDirectoryA';
function GopherCreateLocatorA; external winetdll name 'GopherCreateLocatorA';
function GopherCreateLocatorW; external winetdll name 'GopherCreateLocatorW';
function GopherCreateLocator; external winetdll name 'GopherCreateLocatorA';
function GopherFindFirstFileA; external winetdll name 'GopherFindFirstFileA';
function GopherFindFirstFileW; external winetdll name 'GopherFindFirstFileW';
function GopherFindFirstFile; external winetdll name 'GopherFindFirstFileA';
function GopherGetAttributeA; external winetdll name 'GopherGetAttributeA';
function GopherGetAttributeW; external winetdll name 'GopherGetAttributeW';
function GopherGetAttribute; external winetdll name 'GopherGetAttributeA';
function GopherGetLocatorTypeA; external winetdll name 'GopherGetLocatorTypeA';
function GopherGetLocatorTypeW; external winetdll name 'GopherGetLocatorTypeW';
function GopherGetLocatorType; external winetdll name 'GopherGetLocatorTypeA';
function GopherOpenFileA; external winetdll name 'GopherOpenFileA';
function GopherOpenFileW; external winetdll name 'GopherOpenFileW';
function GopherOpenFile; external winetdll name 'GopherOpenFileA';
function GopherSendDataA; external winetdll name 'GopherSendDataA';
function GopherSendDataW; external winetdll name 'GopherSendDataW';
function GopherSendData; external winetdll name 'GopherSendDataA';
function HttpAddRequestHeadersA; external winetdll name 'HttpAddRequestHeadersA';
function HttpAddRequestHeadersW; external winetdll name 'HttpAddRequestHeadersW';
function HttpAddRequestHeaders; external winetdll name 'HttpAddRequestHeadersA';
function HttpOpenRequestA; external winetdll name 'HttpOpenRequestA';
function HttpOpenRequestW; external winetdll name 'HttpOpenRequestW';
function HttpOpenRequest; external winetdll name 'HttpOpenRequestA';
function HttpQueryInfoA; external winetdll name 'HttpQueryInfoA';
function HttpQueryInfoW; external winetdll name 'HttpQueryInfoW';
function HttpQueryInfo; external winetdll name 'HttpQueryInfoA';
function HttpSendRequestA; external winetdll name 'HttpSendRequestA';
function HttpSendRequestW; external winetdll name 'HttpSendRequestW';
function HttpSendRequest; external winetdll name 'HttpSendRequestA';
function InternetCancelAsyncRequest; external winetdll name 'InternetCancelAsyncRequest';
function InternetCloseHandle; external winetdll name 'InternetCloseHandle';
function InternetConnectA; external winetdll name 'InternetConnectA';
function InternetConnectW; external winetdll name 'InternetConnectW';
function InternetConnect; external winetdll name 'InternetConnectA';
function InternetFindNextFileA; external winetdll name 'InternetFindNextFileA';
function InternetFindNextFileW; external winetdll name 'InternetFindNextFileW';
function InternetFindNextFile; external winetdll name 'InternetFindNextFileA';
function InternetGetLastResponseInfoA; external winetdll name 'InternetGetLastResponseInfoA';
function InternetGetLastResponseInfoW; external winetdll name 'InternetGetLastResponseInfoW';
function InternetGetLastResponseInfo; external winetdll name 'InternetGetLastResponseInfoA';
function InternetOpenA; external winetdll name 'InternetOpenA';
function InternetOpenW; external winetdll name 'InternetOpenW';
function InternetOpen; external winetdll name 'InternetOpenA';
function InternetOpenUrlA; external winetdll name 'InternetOpenUrlA';
function InternetOpenUrlW; external winetdll name 'InternetOpenUrlW';
function InternetOpenUrl; external winetdll name 'InternetOpenUrlA';
function InternetQueryOption; external winetdll name 'InternetQueryOption';
function InternetReadFile; external winetdll name 'InternetReadFile';
function InternetSetOption; external winetdll name 'InternetSetOption';
function InternetSetStatusCallback; external winetdll name 'InternetSetStatusCallback';
function InternetWriteFile; external winetdll name 'InternetWriteFile';
function IS_GOPHER_FILE(GopherType: DWORD): BOOL;
begin
Result := GopherType and GOPHER_TYPE_FILE_MASK = 0;
end;
function IS_GOPHER_DIRECTORY(GopherType: DWORD): BOOL;
begin
Result := GopherType and GOPHER_TYPE_DIRECTORY = 0;
end;
function IS_GOPHER_PHONE_SERVER(GopherType: DWORD): BOOL;
begin
Result := GopherType and GOPHER_TYPE_CSO = 0;
end;
function IS_GOPHER_ERROR(GopherType: DWORD): BOOL;
begin
Result := GopherType and GOPHER_TYPE_ERROR = 0;
end;
function IS_GOPHER_INDEX_SERVER(GopherType: DWORD): BOOL;
begin
Result := GopherType and GOPHER_TYPE_INDEX_SERVER = 0;
end;
function IS_GOPHER_TELNET_SESSION(GopherType: DWORD): BOOL;
begin
Result := GopherType and GOPHER_TYPE_TELNET = 0;
end;
function IS_GOPHER_BACKUP_SERVER(GopherType: DWORD): BOOL;
begin
Result := GopherType and GOPHER_TYPE_REDUNDANT = 0;
end;
function IS_GOPHER_TN3270_SESSION(GopherType: DWORD): BOOL;
begin
Result := GopherType and GOPHER_TYPE_TN3270 = 0;
end;
function IS_GOPHER_ASK(GopherType: DWORD): BOOL;
begin
Result := GopherType and GOPHER_TYPE_ASK = 0;
end;
function IS_GOPHER_PLUS(GopherType: DWORD): BOOL;
begin
Result := GopherType and GOPHER_TYPE_GOPHER_PLUS = 0;
end;
function IS_GOPHER_TYPE_KNOWN(GopherType: DWORD): BOOL;
begin
Result := GopherType and GOPHER_TYPE_UNKNOWN = 0;
end;
end.