ITK Programmer's Guide |
|||||||||
Table of contents |
Intro | General
| TCP Low Level |
TCP High Level |
UDP | DNS
| PPP
|
These routines can be used to accurately measure elapsed time in
some critical code portions.
Under MacOS, these routines use the Time Manager to get a high level
of accuracy (up to the millisecond).
ITK_TimerStart |
|||||||||||
Syntax: |
timerRef := ITK_TimerStart
|
||||||||||
Description: |
Start a timer and returns a reference to it. These reference will be used when calling ITK_TimerLap and ITK_TimerStop.
|
||||||||||
Params: |
|
||||||||||
Example: |
$timer := ITK_TimerStart ... $elapsedTime := ITK_TimerStop($timer) |
ITK_TimerLap |
||||||||||||||||
Syntax: |
lapTime := ITK_TimerLap(timerRef)
|
|||||||||||||||
Description: |
Returns the number of milliseconds since ITK_TimerStart was called without stopping the timer.
|
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$timer := ITK_TimerStart ... $lapTime1 := ITK_TimerLap($timer) ... $lapTime2 := ITK_TimerLap($timer) ... $totalTime := ITK_TimerStop($timer) |
ITK_TimerStop |
||||||||||||||||
Syntax: |
totalTime := ITK_TimerStop(timerRef)
|
|||||||||||||||
Description: |
Returns the number of milliseconds since ITK_TimerStart was called and then stops the timer.
|
|||||||||||||||
Note: |
After calling ITK_TimerStop, the Timer Reference number returned by ITK_TimerStart is not valid anymore.
|
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$timer := ITK_TimerStart ... $totalTime := ITK_TimerStop($timer) |
ITK's IPC routines are useful to exchange data between processes through communications channels. These channels are memory based to provide speed efficient communications.
The number of channels and the number of messages queued in a channel are limited by the available memory.
ITK_NbIPCMsg |
||||||||||||||||
Syntax: |
nbMsg := ITK_NbIPCMsg(ipcChannel)
|
|||||||||||||||
Description: |
Returns the number of messages currently stored on the specified IPC channel.
|
|||||||||||||||
Note: |
IPC channel number are used to create as many IPC
channels as you need.
|
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
While (ITK_NbIPCMsg(1)>0) ` process IPC messages ... End While |
ITK_SendIPCMsg |
||||||||||||||||
Syntax: |
ITK_SendIPCMsg(ipcChannel;message)
|
|||||||||||||||
Description: |
Sends a message on the specified IPC channel.
|
|||||||||||||||
Note: |
IPC channel number are used to create as many IPC
channels as you need.
|
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
ITK_SendIPCMsg(1;"quit") |
ITK_RcvIPCMsg |
|||||||||||||||||||||
Syntax: |
message := ITK_RcvIPCMsg(ipcChannel;option)
|
||||||||||||||||||||
Description: |
Reads a message from the specified IPC channel. If no message is available, returns an empty string. The option parameter can be used to keep the message in
the IPC channel queue.
|
||||||||||||||||||||
Note: |
IPC channel number are used to create as many IPC
channels as you need.
|
||||||||||||||||||||
Params: |
|
||||||||||||||||||||
Example: |
$msg := ITK_RcvIPCMsg(1;0) If ($msg = "quit") QUIT 4D End If |
ITK_ResetIPCMsg |
|||||||||||
Syntax: |
ITK_ResetIPCMsg(ipcChannel)
|
||||||||||
Description: |
Removes all the messages stored on the specified IPC channel.
|
||||||||||
Note: |
IPC channel number are used to create as many IPC
channels as you need.
|
||||||||||
Params: |
|
||||||||||
Example: |
ITK_ResetIPCMsg(1) |
ITK_PictSize |
|||||||||||||||||||||||||||||||||||||||||
Syntax: |
pictSize := ITK_PictSize(pict; top; left; bottom; right; type)
|
||||||||||||||||||||||||||||||||||||||||
Description: |
This routines extracts size informations from a given picture.
|
||||||||||||||||||||||||||||||||||||||||
Params: |
|
||||||||||||||||||||||||||||||||||||||||
Example: |
$size := ITK_PictSize($pict;$top;$left;$bottom;$right;$type) $height := $bottom-$top $width := $right-$left |
ITK_PictSave |
|||||||||||||||||||||
Syntax: |
error := ITK_PictSave(pict; filePath)
|
||||||||||||||||||||
Description: |
Saves the content of a picture field or variable into a file. If the picture is encoded in the GIF format, a standard GIF file will be saved. If the picture contains a JPEG portion, this portion will be save as a JPEG/JFIF file. Otherwise, the picture will be saved as a standard Picture (PICT). |
||||||||||||||||||||
Params: |
|
||||||||||||||||||||
Example: |
$err := ITK_PictSave($pict;"MyHD:MyFolder:MyPict") |
ITK_PictRead |
||||||||||||||||
Syntax: |
pict := ITK_PictRead(filePath)
|
|||||||||||||||
Description: |
Reads a picture file (PICT, GIF or JFIF/JPEG) and returns it as a 4D pict.
|
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$pict := ITK_PictRead("MyHD:MyFolder:MyPict") $err := ITK_TCPSendPict($stream; $pict) |
ITK_ICMPEcho |
||||||||||||||||||||||||||
Syntax: |
time := ITK_ICMPEcho(IPaddr; timeout; size) |
|||||||||||||||||||||||||
Description: |
This routines sends an "ICMP Echo" packet to the remote IP address and measures the time needed for the echo to come back. It is an equivallent to the famous "ping" function.
|
|||||||||||||||||||||||||
Params: |
|
|||||||||||||||||||||||||
Example: |
$pingtime := ITK_ICMPEcho(ITK_Name2Addr("www.internet-toolkit.com");2000;64) |
ITK_OpenFile |
||||||||||||||||
Syntax: |
fileRef := ITK_OpenFile(pathname)
|
|||||||||||||||
Description: |
Opens a file in read-only mode.
|
|||||||||||||||
Note: |
The variable used to store the fileRef value must be types as C_TIME when compiled.
|
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$file := ITK_OpenFile("C:\MyFile.TXT") If ($file#0) RECEIVE PACKET($file;$data;32000) ... CLOSE DOCUMENT($file) End If |
ITK_SetPriority |
||||||||||||||||
Syntax: |
error := ITK_SetPriority(newPriority)
|
|||||||||||||||
Description: |
Changes 4D's priority level in Windows multitasking.
|
|||||||||||||||
Note: |
This routines currently does nothing under MacOS.
|
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$err := ITK_SetPriority(4) ` go in Idle mode |
ITK_GetPriority |
|||||||||||
Syntax: |
priority := ITK_GetPriority
|
||||||||||
Description: |
Retrieves 4D's priority level in Windows multitasking.
|
||||||||||
Note: |
This routines currently does nothing under MacOS.
|
||||||||||
Params: |
|
||||||||||
Example: |
` Set 4D's at least in "normal" priority If (ITK_GetPriority<9) $err := ITK_SetPriority(9) End If |
ITK_Pict2Blob |
|||||||||||||||||||||
Syntax: |
blob := ITK_Pict2Blob(pict) |
||||||||||||||||||||
Description: |
Converts a picture value (variable or field) into a blob. |
||||||||||||||||||||
Note: |
The content in not changed by this routine which simply does some typecasting.
|
||||||||||||||||||||
Params: |
|
||||||||||||||||||||
Example: |
$myBlob := ITK_Pict2Blob($myBlob) |
ITK_Blob2Pict |
|||||||||||||||||||||
Syntax: |
pict := ITK_Blob2Pict(blob) |
||||||||||||||||||||
Description: |
Converts a blob value (variable or field) into a picture. |
||||||||||||||||||||
Note: |
The content in not changed by this routine which simply does some typecasting.
|
||||||||||||||||||||
Params: |
|
||||||||||||||||||||
Example: |
$myBlob := ITK_Pict2Blob($myPict) ` return a copy (uses more memory) $myBlob := ITK_Pict2Blob($myPict;1) ` "transfers" the pict into a blob, the original pict is emptied |