Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 3.47 KB

api_files_howto_create_api.md

File metadata and controls

41 lines (30 loc) · 3.47 KB

back

How to make an api file

An api file is a plain text file with one entry per line.

For example, an api file for the C standard library could look like this,

abort();
abs(int n);
acos(double x);
asctime(const struct tm* tp);

If use.escapes is enabled, information can span multiple lines, for example,

abort() Param: ()\t\nDesc: Abort current process
abs(double x) Param: (Value whose absolute value is returned.)\t\nDesc: Compute absolute value
acos(double x) Param: (Value whose arc cosine is computed, in the interval [-1,+1].)\t\nDesc: Compute arc cosine

To generate api files for your own source code, one of these tools may be helpful:

  • For C/C++ headers, an api file can be generated using ctags and then the tags2api Python script (which assumes C/C++ source) on the tags file to grab complete multiple line function prototypes. Some common headers surround parameter lists with a __P macro and may have comments. The cleanapi utility may be used on these files
  • For Python, there is a gen_python_3_api script (and older scripts for python3 and python2.)
  • For Java classes, there is a java_apibuilder.zip program
  • For C# classes, use genapi.cs
  • For PHP, use php-api-generator or phpapi.php
  • API files for the latest PHP standard libraries can be generated with the tool here, contributed by arjunae
  • API files for the latest C++ standard can be generated with the script here
  • API files for the latest jquery can be generated with the script here
  • API files for the latest javascript (from MSDN) can be generated with the script here
  • API files for the latest wsh/vbs/vba (from MSDN) can be generated with the script here

Activate an api file by following the instructions here.

To see more advanced settings, search for "calltip" in the SciTE Documentation.