Jump to content

Introduction to the OS/2 API Documentation: Difference between revisions

From EDM2
Prokushev (talk | contribs)
No edit summary
Prokushev (talk | contribs)
No edit summary
Line 17: Line 17:
== API entry definition ==
== API entry definition ==


Each API entry must be described and documented in common and standard representation form.
Each API entry must be described and documented in common and standard representation form. Here is example of API function definition as used in the project ({this is comment}):
 
----
== DosBeep {function name}==
; DosBeep(frequency, duration) : {function definition. No types described here}
Generates the specified frequency on the computer's speaker. {general function description}
 
=== Parameters ===
; frequency - [[ULONG]] - input : {parameter description with type and stream direction}
Frequency as Hertz with valid values from 37 through 32767. {parameter description}
; duration - [[ULONG]] - input :
Length of the sound in milliseconds.
 
=== Constants ===
None. {list of used constants}
 
=== Returns ===
[[NO_ERROR]]<br>  {list of return codes}
[[ERROR_INVALID_FREQUENCY]]<br>
 
=== Module ===
DOSCALLS {name of export module}
 
=== Define (C/C++) ===
DOS_PROCESS {This entry optional and actual only for OS/2 Toolkit compatible C/C++ section. Controls include sequence}
 
=== Ordinal/Export name ===
286 {Ordinal and/or export name of function. Can be detected by LxLite, NeLite, etc.}
 
=== Calling convention ===
Cdecl32 {Calling convertion of function. Possible values are Cdecl32, Cdecl16, Pascal32 & Pascal16}
 
=== Example Code ===
Not needed for this example listing.
 
{Here example code. Preffered language - C. But various language-specific voodoo (like C/C++ += -= ++ --) must not used. Minimal pointers<->ULONG conversions because potential error points.}
 
=== Related Functions ===
[[WinAlarm]] {Link to related functions}
 
=== Comments ===
I don't have any. {Function specific comments}
 
=== OS Version Introduced ===
OS/2 2.1<br>
 
-----





Revision as of 09:05, 12 November 2005

by Prokushev, Daniel.Lee.Kruse

Introduction

OS/2 and eComStation API not available for public domain. If for OS/2 users is only possible way to get API documentation via buying OS/2 Toolkit then eComStation users in better situation - OS/2 Toolkit shipped in the box. Anyway, OS/2 Toolkit documentation contain errors, not all API documented etc. Lot of parts just missed. eComStation comes with newer interfaces, but they not described in any eComStation official documentation.

In 1996 The OS/2 API project was started. But copyright issues not allowed to extend project after maintainers lost interest in it. So, all work from the OS/2 API project was lost.

After EDM/2 was relaunched in 2004 Daniel.Lee.Kruse started OS/2 API Documentation pages. Wiki provided good chance to make this project live.

This article describes how eny API entry must be described.

API entry definition

Each API entry must be described and documented in common and standard representation form. Here is example of API function definition as used in the project ({this is comment}):


DosBeep {function name}

DosBeep(frequency, duration)
{function definition. No types described here}

Generates the specified frequency on the computer's speaker. {general function description}

Parameters

frequency - ULONG - input
{parameter description with type and stream direction}

Frequency as Hertz with valid values from 37 through 32767. {parameter description}

duration - ULONG - input

Length of the sound in milliseconds.

Constants

None. {list of used constants}

Returns

NO_ERROR
{list of return codes} ERROR_INVALID_FREQUENCY

Module

DOSCALLS {name of export module}

Define (C/C++)

DOS_PROCESS {This entry optional and actual only for OS/2 Toolkit compatible C/C++ section. Controls include sequence}

Ordinal/Export name

286 {Ordinal and/or export name of function. Can be detected by LxLite, NeLite, etc.}

Calling convention

Cdecl32 {Calling convertion of function. Possible values are Cdecl32, Cdecl16, Pascal32 & Pascal16}

Example Code

Not needed for this example listing.

{Here example code. Preffered language - C. But various language-specific voodoo (like C/C++ += -= ++ --) must not used. Minimal pointers<->ULONG conversions because potential error points.}

Related Functions

WinAlarm {Link to related functions}

Comments

I don't have any. {Function specific comments}

OS Version Introduced

OS/2 2.1



Messages definition

Messages also can be interpreted as API entry. Usually you calls API function WinSendMsg and recieves result. Each message has some specific parameters and return codes. So, message also must be represented in some form.

SOM Interface definition

SOM interfaces has different description format. Mainly, Interface Definition Language describes SOM interface fully, but not in easy to understand form (without IDL background knowlidges). Also another specifig things, like no export entries for methods, no exact known location, etc.

Types definition

Constants definition