|
1.
|
Copy an existing API file and rename the file according to its new function.
|
|
|
2.
|
Name the API function
api_<sentinel>_<function> where
<sentinel> is the two- or three-letter code unique to the component or application (refer to the
Sentinels section).
|
|
|
3.
|
Create a comment header block that describes the API in the standardized format.
|
|
|
4.
|
Include standard API
.hxx header files and your API-specific header files.
|
|
|
5.
|
Declare the API function as returning an
outcome.
|
|
|
6.
|
Declare all output arguments to be passed by reference, not by value.
|
|
|
7.
|
Check arguments to the function using standard argument checking functions. Refer to the
Argument Error Checking section.
|
|
|
"if (api_checking_on){check_body(arg)...};".
|
|
|
8.
|
Bracket the body of the API function with macros
API_BEGIN and
API_END,
API_SYS_BEGIN and
API_SYS_END, or
API_NOP_BEGIN and
API_NOP_END.
|
|
|
9.
|
Perform the specific functions for which this API was created.
|
|
|
10.
|
Return a result.
|