This document serves as a full documentation of HTML Athlete SDK. First you get a brief general overview, in which all assets will be summarized. Then these assets will be described in detail.
Availability
HTML Athlete SDK 0.1
Describtion
Orders the caller to block while compression is in progress. This type of behaviour is set in default. See the ATHSetCallerBehaviour function for further information.
Availability
HTML Athlete SDK 0.1
Describtion
Orders the caller not to block while compression is in progress. See the ATHSetCallerBehaviour function for further information.
Availability
HTML Athlete SDK 0.1
Describtion
Orders the caller to wait for a message specified in the ATHTCompressionDoneMessage structure. See the ATHSetCallerBehaviour function for further information.
Availability
HTML Athlete SDK 0.1
Describtion
Specifies, that the input contains correct Cascade Style Sheet document.
Note
In the case the document is not correct, you can not expect a correct functionality of compression routines. For instance, when the document contains a non-ended multiline comment, the routine may be broken down because of unexpected content error.
Availability
HTML Athlete SDK 0.1
Describtion
Specifies, that the input contains correct HTML document.
Note
In the case the document is not correct, you can not expect a correct functionality of compression routines. For instance, when the document contains a non-ended multiline comment, the routine may be broken down because of unexpected content error.
Availability
HTML Athlete SDK 0.1
Describtion
Specifies, that the input contains correct ECMAScript-based document (JScript/JavaScript).
Note
In the case the document is not correct, you can not expect a correct functionality of compression routines. For instance, when the document contains a non-ended multiline comment, the routine may be broken down because of unexpected content error.
Availability
HTML Athlete SDK 0.2
Describtion
Indicates that the instance should be transformed into czech language mutation.
Availability
HTML Athlete SDK 0.3
Describtion
Indicates that the instance should be transformed into german language mutation.
Availability
HTML Athlete SDK 0.2
Describtion
Indicates that the instance should be transformed into english language mutation, which is the default setting when creating a new instance.
Availability
HTML Athlete SDK 0.1
Describtion
Defines the neccessary memory left padding of the document (of any supported kind). See the ATHCompressRawData function for further information.
Availability
HTML Athlete SDK 0.1
Describtion
Defines the neccessary memory right padding of the document (of any supported kind). See the ATHCompressRawData function for further information.
Availability
HTML Athlete SDK 0.1
Describtion
Enables or disables (according the value set in the ATHSetProperty function) the beep at the end of document compression. Setting this property to false
the compression routine does not beep signaling the compression was finished successfully. This property is in default set to true
.
Availability
HTML Athlete SDK 0.1
Describtion
Enables or disables (according the value set in the ATHSetProperty function) the Cascade Sheets compression routine. Having it disabled while compression, all CSS fragments will be copied as they are to the output. This property is in default set to false
.
Availability
HTML Athlete SDK 0.1
Describtion
Enables or disables (according the value set in the ATHSetProperty function) the HTML comments blanking. Having it disabled while compression, all HTML comments will be copied as they are to the output. This property is in default set to false
.
Availability
HTML Athlete SDK 0.1
Describtion
Enables or disables (according the value set in the ATHSetProperty function) the leaving or blanking of hiding of unsupported contents in older web browser versions. As the hiding command there is ment the "" pair. This property is in default set to false
.
Example
Keep this property set to true
in order to view the following web page even after compression in Internet Explorer 1.0 properly.
<html><body> <script language=javascript><!-- function Welcome(){/*...*/} //--></script> Welcome to my homepage. </body></html>
Availability
HTML Athlete SDK 0.1
Describtion
Enables or disables (according the value set in the ATHSetProperty function) the JavaScript compression routine. Having it disabled while compression, all JS fragments will be copied as they are to the output. This property is in default set to false
.
Availability
HTML Athlete SDK 0.1
Describtion
Enables or disables (according the value set in the ATHSetProperty function) the HTML event protection. Having it enabled, all events (like onmousemove
or onload
) will be kept with quotas around their values (only if the quotas are already present in the original, i.e. in the input document). When problems occur while viewing the compressed web page, try to disable this property (set it to true
). This property is in default set to true
.
Availability
HTML Athlete SDK 0.1
Describtion
Informs the caller, that the worker thread is not ready to receive its commands. Obviously this return code is obtained while compressing the document.
Availability
HTML Athlete SDK 0.1
Describtion
The specified file can not be read or does not exist at all. Check the file path in order to ensure, it is correct.
Note
On Windows 9x/Me the string must not exceed MAX_PATH characters. For more information, see Naming a File on the MSDN portal.
Availability
HTML Athlete SDK 0.1
Describtion
The compressed document could not be written to the specified file. Check the file path in order to ensure, it is correct.
Note
On Windows 9x/Me the string must not exceed MAX_PATH characters. For more information, see Naming a File on the MSDN portal.
Availability
HTML Athlete SDK 0.2
Describtion
The dialogue was closed up negative wise (i.e. either the Escape or the Cancel button was pressed).
Availability
HTML Athlete SDK 0.1
Describtion
An error arose while attempting to create a new HTML Athlete instance. Try to free a bit of memory and then try again.
Availability
HTML Athlete SDK 0.1
Describtion
An unknown error arose while attempting to compress the document. This error certainly occurs when the input document contains fatal errors, among which one can range the un-ended comment, for instance. Please try to ensure that your web page (when you wrote it in hand) is as errorless as possible!
Availability
HTML Athlete SDK 0.1
Describtion
Informs the caller, that the worker thread is idle. For instance, this return code is obtained when trying to take chars of the document compressed so far.
Availability
HTML Athlete SDK 0.1
Describtion
Returned when function call succeedes or when a dialog is positively closed up (i.e. by pressing the OK).
Availability
HTML Athlete SDK 0.1
Describtion
This return code informs the caller that the specified instance has not been authorized yet, or that the authorization failed.
Recommendation
It is highly recommended rather to copy the obtained authorization code from the mail than trying it to put down character by character per hand into your application source code.
Availability
HTML Athlete SDK 0.1
Describtion
The specified caller behaviour was not recognized and therefore could not be set. The prime caller behaviour is maintained by the instance.
Availability
HTML Athlete SDK 0.1
Describtion
The specified content type was not recognized and therefore could not be set.
Availability
HTML Athlete SDK 0.1
Describtion
The specified instance was not found. Please check whether you do not destroy the instance before you pass it in another HTML Athlete's function as parameter.
Availability
HTML Athlete SDK 0.2
Describtion
The specified language does not exist. Please see the ATH_LANGUAGE_* constants to elicit which languages are currently available.
Availability
HTML Athlete SDK 0.1
Describtion
The specified instance's property does not exist and therefore could not be changed. The failure does not affect any of instance's legal properties.
Availability
HTML Athlete SDK 0.1
Describtion
The specified thread priority is not a legal Windows thread priority. Please refer the ATHSetWorkerThreadPriority function for further information.
Availability
HTML Athlete SDK 0.1
Describtion
Function parameter of this type expects a caller behaviour constant to be put in. In this case, ATH_BEHAVIOUR_*
constants come in play.
Availability
HTML Athlete SDK 0.1
Describtion
Function parameter of this type expects a document content type specification to be put in. In this case, all ATH_CONTENT_TYPE_*
constants are relevant.
Availability
HTML Athlete SDK 0.1
Describtion
Function parameter of this type expects a HTML Athlete's instance handler to be put in. See the tutorial to get familiar with instances.
Availability
HTML Athlete SDK 0.2
Describtion
Function parameter of this type expects a language specifier to be put in. In this case, ATH_LANGUAGE_*
constants are expected.
Availability
HTML Athlete SDK 0.1
Describtion
Function parameter of this type expects a pointer to the ATHTCompressionDoneMessage structure to be put in. Click the link for further information.
Availability
HTML Athlete SDK 0.1
Describtion
Function parameter of this type expects a property identifier to be put in. In this case, all ATH_PROPERTY_*
constants are relevant.
Availability
HTML Athlete SDK 0.1
Describtion
Function parameter of this type expects a property value to be put in. In this case, ATHPropertyValue type is defined as boolean, therefore true
, or false
are the only relevant values expected.
Availability
HTML Athlete SDK 0.1
Describtion
Every HTML Athlete function returns a value of this type. Returning a value the function tries to inform about the inner state. In this case, all ATH_RESULT_*
constants are relevant. For instance, when everything goes right, the function returns ATH_RESULT_OK
code.
Availability
HTML Athlete SDK 0.1
Definition
struct { HWND window; uint messageId; } ATHTCompressionDoneMessage;
Describtion
Function parameter of this type informs the function about window which is responsible for receiving the "Compression Done" message. This message is sent when caller behaviour is set to ATH_BEHAVIOUR_NOTIFY_SENDING_A_MESSAGE
and compression is done (we do not explicitly say that the compression must be successful in order this message to be sent). For further information see the ATHSetCallerBehaviour function.
Availability
HTML Athlete SDK 0.1
Prototype
ATHResult ATHAuthorizeInstance ( ATHInstance instance, char *authKey, char *authCode )
Parameters
instance
[in] - the handle of the instance you want to authorize,authKey
[in] - the authorization key you sent me ("MY_KEY", for instance),authCode
[in] - the authorization code you received from me ("xFjSjdoeSlwq", for instance).Describtion
The function tries to authorize the specified instance. Authorization is required because of two reasons:
When the instance is not authorized or the authorization has expiried, a message box appears informing you that you should authorize again or download the newest (and more errorless) version of HTML Athlete SDK. When this is the case, please visit HTML Athlete SDK's home page (see Contact on the index page).
Possible return codes
ATH_RESULT_OK, ATH_RESULT_UNKNOWN_INSTANCE, ATH_RESULT_BUSY, ATH_RESULT_STILL_UNAUTHORIZED
Availability
HTML Athlete SDK 0.1
Prototype
ATHResult ATHCompressFile ( ATHInstance instance, ATHContentType contentType, pchar *fileName )
Parameters
instance
[in] - the handle of the instance you want the compression will be accomplished on,contentType
[in] - the constant representing the document content type,fileName
[in] - the pointer to the string representing the name of the file to be compressed; note, that on Windows 9x/ME platforms the string may take only MAX_PATH characters. For more information see Naming a File on the MSDN portal.Describtion
This top-level function does three thinks:
contentType
was chosen correctly - when it fails to compress, the output file may be empty or an ATH_RESULT_GENERAL_COMPRESSION_ERROR error may appear,Note, that calling this function the caller behaves always blocking no matter what behaviour is set to the specified instance.
Possible return codes
ATH_RESULT_OK, ATH_RESULT_UNKNOWN_INSTANCE, ATH_RESULT_CAN_NOT_READ_FILE, ATH_RESULT_CAN_NOT_WRITE_FILE, ATH_RESULT_BUSY, ATH_RESULT_GENERAL_COMPRESSION_ERROR
Availability
HTML Athlete SDK 0.1
Prototype
ATHResult ATHCompressRawData ( ATHInstance instance, ATHContentType contentType, char *content, char **endOfContent, void *params )
Parameters
instance
[in] - the handle of the instance you want the compression will be accomplished on,contentType
[in] - the constant representing the document content type,content
[in] - the pointer to the first character of the document content,endOfContent
[out] - the pointer to the first character after document content,params
[in] - the pointer to additional parameters.Describtion
This low-level function tries to compress the content specified by its first character (content
). When it succeeds, the endOfContent
points to the first character after the compressed content, which is obviously the zero character (0x00).
Let's make two essential notes:
ATH_PADDING
characters. This must be done because of having HTML Athlete's compressed routines optimized.params
parameter set to NULL.Possible return codes
ATH_RESULT_OK, ATH_RESULT_UNKNOWN_INSTANCE, ATH_RESULT_BUSY, ATH_RESULT_UNKNOWN_CONTENT_TYPE, ATH_RESULT_UNKNOWN_INSTANCE, ATH_RESULT_GENERAL_COMPRESSION_ERROR
Availability
HTML Athlete SDK 0.1
Prototype
ATHResult ATHCreateInstance ( ATHInstance *instance )
Parameters
instance
[out] - the handle of the newly created instance.Describtion
The function attempts to create the new HTML Athlete instance. When circumstances are set so it can not succeed, it returns the ATH_RESULT_ERROR_CREATING_AN_INSTANCE error code. However during intensive testing of this SDK, the function never returned it (maybe because of always enough of free memory was available). For a simple example how to create and manage instance see the starting tutorial of this SDK.
Newly created instance has its properties set to default. These defaults are (stated in brackets):
true
)ATH_BEHAVIOUR_BLOCK
)false
)true
)false
)false
)true
)false
)english
)Possible return codes
ATH_RESULT_OK, ATH_RESULT_ERROR_CREATING_AN_INSTANCE
Availability
HTML Athlete SDK 0.1
Prototype
ATHResult ATHDestroyInstance ( ATHInstance instance )
Parameters
instance
[in] - the handle of the instance to be destroyed.Describtion
The function attempts to destroy an existing HTML Athlete instance. When wrong or no longer relevant handler is passed as instance
parameter, the function fails and returns ATH_RESULT_UNKNOWN_INSTANCE error code.
Possible return codes
ATH_RESULT_OK, ATH_RESULT_UNKNOWN_INSTANCE, ATH_RESULT_BUSY
Availability
HTML Athlete SDK 0.1
Prototype
ATHResult ATHGetCharsProcessed ( ATHInstance instance, int *charsProcessed )
Parameters
instance
[in] - the handle of the instance you want to get the characters processed so far,charsProcessed
[out] - the pointer to the integer which should hold the number of characters processed so far.Describtion
The function attempts to obtain the characters processed during a compression process so far. Obviously, to make use of this function you must set the caller thread behaviour to non-blocking one when calling any of compression functions, or having another parallel thread created, which serves for pediodical sampling of characters processed. However, when the instance's worker thread is idle (not compressing), the ATH_RESULT_IDLE error code is returned.
Possible return codes
ATH_RESULT_OK, ATH_RESULT_UNKNOWN_INSTANCE, ATH_RESULT_IDLE
Availability
HTML Athlete SDK 0.1
Prototype
int ATHGetVersion ( )
Parameters
Describtion
This function returns HTML Athlete SDK's version.
Possible return codes
This function does not return any error codes, it always succedes. Instead, it returns the double-word with HTML Athlete SDK's version record where on the highest byte, there is recorded the main version and on the second highest byte, there is located the subversion. Other two bytes of returned double-word are unused and set to zero.
Availability
HTML Athlete SDK 0.2
Prototype
ATHResult ATHShowAboutDialogue ( ATHInstance instance, HWND parentWnd )
Parameters
instance
[in] - this parameter is reserved; always set it to zero,parentWnd
[in] - handle to the window that owns the dialog box.Describtion
This function invokes the HTML Athlete's standard About dialogue for the instance specified by instance
parameter. The dialog shown is always modal, which means the caller thread is suspended until the dialog is closed (the Close button).
Possible return codes
ATH_RESULT_OK, ATH_RESULT_UNKNOWN_INSTANCE
Availability
HTML Athlete SDK 0.2
Prototype
ATHResult ATHShowSettingDialogue ( ATHInstance instance, HWND parentWnd )
Parameters
instance
[in] - the handle of the instance which you want to change the caller thread behaviour on,parentWnd
[in] - handle to the window that owns the dialog box.Describtion
This function invokes the HTML Athlete's standard setting dialogue for the instance specified by instance
parameter and sets up the controls in order to reflect the instance's state. The shown dialog is always modal, which means the caller thread is suspended until the dialog is closed (in any of two possible ways - either confirming the current setting (the OK button), or refusing them (the Cancel button)).
On this dialogue, there are shown only essential and most safe instance properties - safe in meaning of Windows safety - for example, you can not change the worker thread priority. Such privileges are granted only to the programmers employing the HTML Athlete in their applications. To be able to set up all of the properties you must create and manage your own dialogue.
Possible return codes
ATH_RESULT_OK, ATH_RESULT_UNKNOWN_INSTANCE, ATH_RESULT_BUSY, ATH_RESULT_CANCEL
Availability
HTML Athlete SDK 0.1
Prototype
ATHResult ATHSetCallerBehaviour ( ATHInstance instance, ATHBehaviour behaviour, void *params )
Parameters
instance
[in] - the handle of the instance which you want to change the caller thread behaviour on,behaviour
[in] - specifies the behaviour of the caller thread,params
[in] - additional parameters which meaning changes according the behaviour
parameter.Describtion
Tries to change the caller thread behaviour during a compression process. In this case, the caller thread is the thread triggering the compression (the callee is the instance's worker thread).
Behaviours available:
params
parameter may take any value, it is not regarded.ATHResult
error code. In this case of behaviour the params
parameter may take any value, it is not regarded.params
must point to the correctly filled ATHTCompressionDoneMessage structure. As soon as the compression is done, the caller is sent the message ATHTCompressionDoneMessage.messageId
having the wParam
set to 0 and the lparam
set to a pointer to the end of compressed document, which is obviously the zero character (0x00).Possible return codes
ATH_RESULT_OK, ATH_RESULT_UNKNOWN_INSTANCE, ATH_RESULT_BUSY, ATH_RESULT_UNKNOWN_BEHAVIOUR
Availability
HTML Athlete SDK 0.2
Prototype
ATHResult ATHSetLanguage ( ATHInstance instance, ATHLanguage language, )
Parameters
instance
[in] - the handle of the instance which you want to change the caller thread behaviour on,language
[in] - specifies the language mutation the given instance should be come over,Describtion
Tries to change the instance's language mutation. When the function can not recognize the given language, it fails and returns the ATH_RESULT_UNKNOWN_LANGUAGE constant.
Possible return codes
ATH_RESULT_OK, ATH_RESULT_UNKNOWN_INSTANCE, ATH_RESULT_BUSY, ATH_RESULT_UNKNOWN_LANGUAGE
Availability
HTML Athlete SDK 0.1
Prototype
ATHResult ATHSetProperty ( ATHInstance instance, ATHProperty properties, ATHPropertyValue value )
Parameters
instance
[in] - the handle of the instance which you want to change the property on,properties
[in] - the properties to be changedvalue
[in] - the specified value which should be the property changed to.Describtion
The function tries to change the specified properties to the given value. When the function can not recognize though one of the properties, it returns the ATH_RESULT_UNKNOWN_PROPERTY error code.
Instance properties currently available (here enabled means set to true
):
ATH_PROPERTY_DELETE_HTML_COMMENTS
- enabled forces the HTML comments to get thrown away anytime they are found in the document. The rule's exceptions are the special comments in the single-line form <![...] ...>
or the multi-line equivalent <!--[...] ... -->
. Disabled forces all comments stay in the document as they are.ATH_PROPERTY_PROTECT_EVENTS
- enabled forces the compression routine not to delete commas around HTML events (like onmousemove
or onload
and another ones). What it does not prevent from is the compression of the JavaScript embedded as the value of the event. Disabled forces all unnecessary comma pair around event value to blank.ATH_PROPERTY_JS_COMPRESSION_ENABLED
- enabled forces the embedded JavaScript code blocks to be compressed. All comments and unnecessary white characters are blanked. Disabled forces all JavaScript code blocks to be copied to the output as they appear in the input.ATH_PROPERTY_CSS_COMPRESSION_ENABLED
- enabled forces the embedded Cascade Style Sheets blocks to be compressed. All comments and unnecessary white characters are blanked. Disabled forces all Cascade Style Sheets blocks to be copied to the output as they appear in the input.ATH_PROPERTY_HIDE_JS_IN_OLDER_BROWSERS
- enabled forces the HTML Athlete's JavaScript compression routine not to omit the HTML-based tag of JavaScript enabling hiding of JavaScript in older web browser versions in the output file. Disabled forces the HTML-based tag to be always omited in the output.ATH_PROPERTY_BEEP_WHEN_FINISHED
- enabled forces all compression routines to beep after the finish the compression. Disabled forces all routines to be quiet when they finish their job.Possible return codes
ATH_RESULT_OK, ATH_RESULT_UNKNOWN_INSTANCE, ATH_RESULT_BUSY, ATH_RESULT_UNKNOWN_PROPERTY
Availability
HTML Athlete SDK 0.1
Prototype
ATHResult ATHSetWorkerThreadPriority ( ATHInstance instance, int priority )
Parameters
instance
[in] - the handle of the instance which you want to set up the priority on,priority
[in] - the Windows thread priority identifier.Describtion
The function tries to change the instance's worker thread priority to the specified one. When incorrect thread priority is passed, the function returns the ATH_RESULT_UNKNOWN_THREAD_PRIORITY error code. Look at the MSDN portal for which thread priorities are available before using this function.
Possible return codes
ATH_RESULT_OK, ATH_RESULT_UNKNOWN_INSTANCE, ATH_RESULT_UNKNOWN_THREAD_PRIORITY
EOF