Jump to content

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

From EDM2
Prokushev (talk | contribs)
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
(22 intermediate revisions by 6 users not shown)
Line 1: Line 1:
by [[Prokushev]], [[Daniel.Lee.Kruse]]
by [[Prokushev]], [[User:daniel.lee.kruse|Daniel Lee Kruse]], [[Anakor]], [[User:Martini|Martin Iturbide]]


== Introduction ==
== Introduction ==
OS/2 and eComStation API not available for public domain. If for OS/2 users is only
The OS/2 API is not available for public domain. A range of OS/2 products includes API documentation. Latest OS/2 Toolkit is part of Convenience Packages and eComStation.
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,
Anyway, OS/2 Toolkit documentation contains errors, not all API documented etc. Lot of parts just not included.
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 [http://www.edm2.com/os2api/Various/Copyright.html copyright] issues not allowed to extend project after maintainers lost interest in it.
In 1996 The OS/2 API project was started. But [http://www.edm2.com/os2api/Various/Copyright.html copyright] issues not allowed to extend project after maintainers lost interest in it.
So, all work from the OS/2 API project was lost.
So, all work from the OS/2 API project was never completed.


After EDM/2 was relaunched in 2004 [[Daniel.Lee.Kruse]] started [[OS2 API|OS/2 API Documentation]] pages. Wiki provided good chance to make this project live.
After EDM/2 was relaunched, in 2004 [[User:daniel.lee.kruse|Daniel Lee Kruse]] started [[:Category:The OS/2 API Project|OS/2 API Documentation]] pages. Wiki provided good chance to make this project live.


This article describes how eny API entry must be described.
This article describes how any API entry must be described.


== API entry definition ==
== 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}):
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 as Page Name}===
== DosBeep {function name}==
; DosBeep(frequency, duration) : {function definition. No types described here}
Generates the specified frequency on the computer's speaker. {general function description}
Generates the specified frequency on the computer's speaker. {general function description}


=== Parameters ===
==== Syntax ====
; frequency - [[OS2_API:DataType:ULONG|ULONG]] - input : {parameter description with type and stream direction}
DosBeep(frequency, duration) : {function definition. No types described here}
 
==== Parameters ====
;frequency - [[ULONG]] - input : {parameter description with type and stream direction}
Frequency as Hertz with valid values from 37 through 32767. {parameter description}
Frequency as Hertz with valid values from 37 through 32767. {parameter description}
; duration - [[OS2_API:DataType:ULONG|ULONG]] - input :
;duration - ULONG - input : Length of the sound in milliseconds.
Length of the sound in milliseconds.


=== Constants ===
==== Constants ====
None. {list of used constants}
None. {list of used constants}


=== Returns ===
==== Returns ====
[[OS2_API:Constant:NO_ERROR|NO_ERROR]] {list of return codes}<br>
NO_ERROR  {list of return codes}
[[OS2_API:Constant:ERROR_INVALID_FREQUENCY|ERROR_INVALID_FREQUENCY]]<br>
ERROR_INVALID_FREQUENCY


=== Module ===
==== Module ====
DOSCALLS {name of export module}
DOSCALLS {name of export module}


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


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


=== Calling convention ===
==== Calling convention ====
[[Cdecl32]] {Calling convertion of function. Possible values are [[Cdecl32]], [[Cdecl16]], [[Pascal32]] & [[Pascal16]]}
[[Cdecl32]] {Calling convention of function. Possible values are: Cdecl32, Cdecl16, Pascal32 & Pascal16}


=== Example Code ===
==== Remarks ====
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}
I don't have any. {Function specific comments}


=== OS Version Introduced ===
==== Example Code ====
OS/2 2.1<br>
Not needed for this example listing.


-----
{Here example code. Preferred 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}


==== OS Version Introduced ====
OS/2 2.1


== Messages definition ==
== Messages definition ==
Messages also can be interpreted as API entry. Usually you call API function '''WinSendMsg''' and receive the result. Each message has some specific parameters and return codes. So, message also must be represented in some form.


Messages also can be interpreted as API entry. Usually you calls API function
==SOM Interface definition==
[[WinSendMsg]] and recieves result. Each message has some specific parameters
SOM interfaces defined via [[the SOM Interface Definition Language]]. Module name not known all the time, so no module information. Calling convention is always [[Cdecl32]].
and return codes. So, message also must be represented in some form.
 
== [[SOM]] Interface definition ==
 
SOM interfaces defined via [[Interface Definition Language]]. Module name not known all the time, so no module information. Calling convention is always [[Cdecl32]].
----


=== Interface ===
=== Interface ===
  interface WPShadow : [[SOM:Classes:WPAbstract|WPAbstract]]
  interface WPShadow : [[WPAbstract]]
  {
  {
   [[SOM:Classes:WPObject|WPObject]] [[SOM:ObjectMethods:wpQueryShadowedObject|wpQueryShadowedObject]](in [[BOOL]] fLock);
   [[WPObject]] wpQueryShadowedObject]](in [[BOOL]] fLock);
   [[BOOL]] [[SOM:ObjectMethods:wpSetShadowTitle|wpSetShadowTitle]](in [[PSZ]] pszNewTitle);
   BOOL wpSetShadowTitle (in [[PSZ]] pszNewTitle);
   [[BOOL]] [[SOM:ObjectMethods:wpSetLinkToObject|wpSetLinkToObject]](in [[SOM:Classes:WPObject|WPObject]] FromObject);
   BOOL wpSetLinkToObject (in WPObject FromObject);
   
   
  #ifdef __SOMIDL__
  #ifdef __SOMIDL__
Line 96: Line 84:
     minorversion = 2;
     minorversion = 2;
     filestem = wpshadow;
     filestem = wpshadow;
     metaclass = [[SOM:Metaclasses:M_WPShadow|M_WPShadow]];
     metaclass = M_WPShadow;
     callstyle = [[SOM:Call styles|oidl]];
     callstyle = oidl;
     dllname = "pmwp.dll";              
     dllname = "pmwp.dll";
    [[SOM:ObjectMethods:wpQueryTitle|wpQueryTitle]]: override;
    [[SOM:ObjectMethods:wpSetup|wpSetup]]: override;
    [[SOM:ObjectMethods:wpSaveState|wpSaveState]]: override;
    [[SOM:ObjectMethods:wpRestoreState|wpRestoreState]]: override;
    [[SOM:ObjectMethods:wpQueryStyle|wpQueryStyle]]: override;
    [[SOM:ObjectMethods:wpInitData|wpInitData]]: override;
    [[SOM:ObjectMethods:wpUnInitData|wpUnInitData]]: override;
    [[SOM:ObjectMethods:wpSetTitle|wpSetTitle]]: override;
    [[SOM:ObjectMethods:wpFilterPopupMenu|wpFilterPopupMenu]]: override;
    [[SOM:ObjectMethods:wpModifyPopupMenu|wpModifyPopupMenu]]: override;
    [[SOM:ObjectMethods:wpMenuItemSelected|wpMenuItemSelected]]: override;
    [[SOM:ObjectMethods:wpViewObject|wpViewObject]]: override;
    [[SOM:ObjectMethods:wpMenuItemHelpSelected|wpMenuItemHelpSelected]]: override;
    [[SOM:ObjectMethods:wpCreateFromTemplate|wpCreateFromTemplate]]: override;
    [[SOM:ObjectMethods:wpOpen|wpOpen]]: override;
    [[SOM:ObjectMethods:wpInsertPopupMenuItems|wpInsertPopupMenuItems]]: override;
    [[SOM:ObjectMethods:wpInsertMenuItems|wpInsertMenuItems]]: override;                                               
    [[SOM:ObjectMethods:wpCreateShadowObject|wpCreateShadowObject]]: override;
    [[SOM:ObjectMethods:wpDragOver|wpDragOver]]: override;
    [[SOM:ObjectMethods:wpDrop|wpDrop]]: override;
    [[SOM:ObjectMethods:wpQueryDefaultHelp|wpQueryDefaultHelp]]: override;
    [[SOM:ObjectMethods:wpConfirmDelete|wpConfirmDelete]]: override;
    [[SOM:ObjectMethods:wpConfirmObjectTitle|wpConfirmObjectTitle]]: override;
    [[SOM:ObjectMethods:wpPrintObject|wpPrintObject]]: override;
    [[SOM:ObjectMethods:wpFormatDragItem|wpFormatDragItem]]: override;
    [[SOM:ObjectMethods:wpDraggedOverObject|wpDraggedOverObject]]: override;
    [[SOM:ObjectMethods:wpDroppedOnObject|wpDroppedOnObject]]: override;
    [[SOM:ObjectMethods:wpQueryNameClashOptions|wpQueryNameClashOptions]]: override;
    [[SOM:ObjectMethods:wpFilterMenu|wpFilterMenu]]: override;                                                   
    [[SOM:ObjectMethods:wpModifyMenu|wpModifyMenu]]: override;                                                   
    [[SOM:ObjectMethods:somDefaultInit|somDefaultInit]]: override;         
    [[SOM:ObjectMethods:somDestruct|somDestruct]]: override;           
   
   
    [[wpQueryTitle]]: override;
    wpSetup: override;
    wpSaveState: override;
    wpRestoreState: override;
    wpQueryStyle: override;
    wpInitData: override;
    wpUnInitData: override;
    wpSetTitle: override;
    wpFilterPopupMenu: override;
    wpModifyPopupMenu: override;
    wpMenuItemSelected: override;
    wpViewObject: override;
    wpMenuItemHelpSelected: override;
    wpCreateFromTemplate: override;
    wpOpen: override;
    wpInsertPopupMenuItems: override;
    wpInsertMenuItems: override;
    wpCreateShadowObject: override;
    wpDragOver: override;
    wpDrop: override;
    wpQueryDefaultHelp: override;
    wpConfirmDelete: override;
    wpConfirmObjectTitle: override;
    wpPrintObject: override;
    wpFormatDragItem: override;
    wpDraggedOverObject: override;
    wpDroppedOnObject: override;
    wpQueryNameClashOptions: override;
    wpFilterMenu: override;
    wpModifyMenu: override;
    somDefaultInit: override;
    somDestruct: override;
   };
   };
  #endif /* __SOMIDL__ */
  #endif /* __SOMIDL__ */
Line 141: Line 128:


=== OS Version Introduced ===
=== OS Version Introduced ===
OS/2 2.1<br>
OS/2 2.1
----
 
== Types definition ==
=== MyType {DataType Name as Page Name} ===
MyType description
 
==== Type ====
List of the types fields, e.g.
[[ULONG]]  oNextEntryOffset
[[FDATE]]  fdateCreation
===== C Declaration Method =====
One of the following:
* typedef
* typedef struct
* typedef const
* macro or #define
 
==== Fields ====
Explanation of the fields under type, e.g.
oNextEntryOffset  Offset of next entry.
fdateCreation      Date of file creation.
 
==== Remarks ====
Additional comments where applicable.


If anything in the type can't be done yet then leave a message in the talk page of the corresponding type, like this:


=== ToDo ===
Link to MB_OK can't be done yet


== Types definition ==
==== Example Code ====
If there is any sample on how to use/declare the data type.


----
----
== Constants definition ==
== Constants definition ==
== TRUE {Constant name }==
=== [[TRUE]] {Constant name }===
=== Type ===
==== Type ====
[[BOOL]] {Constant type}
[[BOOL]] {Constant type}
=== Value ===
==== Value ====
1 {Constant value}
1 {Constant value}
----
 
[[Category:The OS/2 API Project]]

Latest revision as of 01:19, 17 February 2020

by Prokushev, Daniel Lee Kruse, Anakor, Martin Iturbide

Introduction

The OS/2 API is not available for public domain. A range of OS/2 products includes API documentation. Latest OS/2 Toolkit is part of Convenience Packages and eComStation.

Anyway, OS/2 Toolkit documentation contains errors, not all API documented etc. Lot of parts just not included.

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 never completed.

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 any 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 as Page Name}

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

Syntax

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

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 convention of function. Possible values are: Cdecl32, Cdecl16, Pascal32 & Pascal16}

Remarks

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

Example Code

Not needed for this example listing.

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

Related Functions

OS Version Introduced

OS/2 2.1

Messages definition

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

SOM Interface definition

SOM interfaces defined via the SOM Interface Definition Language. Module name not known all the time, so no module information. Calling convention is always Cdecl32.

Interface

interface WPShadow : WPAbstract
{
 WPObject wpQueryShadowedObject]](in BOOL fLock);
 BOOL wpSetShadowTitle (in PSZ pszNewTitle);
 BOOL wpSetLinkToObject (in WPObject FromObject);

#ifdef __SOMIDL__
 implementation {

   releaseorder: wpSetLinkToObject,withdrawn,wpSetShadowTitle,wpQueryShadowedObject;

   externalstem = wplink;
   local;
   externalprefix = shd_;
   majorversion = 1;
   minorversion = 2;
   filestem = wpshadow;
   metaclass = M_WPShadow;
   callstyle = oidl;
   dllname = "pmwp.dll";

   wpQueryTitle: override;
   wpSetup: override;
   wpSaveState: override;
   wpRestoreState: override;
   wpQueryStyle: override;
   wpInitData: override;
   wpUnInitData: override;
   wpSetTitle: override;
   wpFilterPopupMenu: override;
   wpModifyPopupMenu: override;
   wpMenuItemSelected: override;
   wpViewObject: override;
   wpMenuItemHelpSelected: override;
   wpCreateFromTemplate: override;
   wpOpen: override;
   wpInsertPopupMenuItems: override;
   wpInsertMenuItems: override;
   wpCreateShadowObject: override;
   wpDragOver: override;
   wpDrop: override;
   wpQueryDefaultHelp: override;
   wpConfirmDelete: override;
   wpConfirmObjectTitle: override;
   wpPrintObject: override;
   wpFormatDragItem: override;
   wpDraggedOverObject: override;
   wpDroppedOnObject: override;
   wpQueryNameClashOptions: override;
   wpFilterMenu: override;
   wpModifyMenu: override;
   somDefaultInit: override;
   somDestruct: override;
 };
#endif /* __SOMIDL__ */
};

Comments

I don't have any.

OS Version Introduced

OS/2 2.1

Types definition

MyType {DataType Name as Page Name}

MyType description

Type

List of the types fields, e.g.

ULONG  oNextEntryOffset
FDATE  fdateCreation

C Declaration Method

One of the following:

  • typedef
  • typedef struct
  • typedef const
  • macro or #define

Fields

Explanation of the fields under type, e.g.

oNextEntryOffset   Offset of next entry.
fdateCreation      Date of file creation.

Remarks

Additional comments where applicable.

If anything in the type can't be done yet then leave a message in the talk page of the corresponding type, like this:

ToDo

Link to MB_OK can't be done yet

Example Code

If there is any sample on how to use/declare the data type.


Constants definition

TRUE {Constant name }

Type

BOOL {Constant type}

Value

1 {Constant value}