ListFn    Lists C source funcs for headers etc

by P.D.Miller


ListFn is a DDE (Desktop Debugging Environment) tool for use with C programs. It allows you to create header files consisting of C function prototypes by searching through the program source file for function definitions, then converting them to function declarations and outputting these to a text file. It can only do this for ANSI style function declarations. Traditional C declarations of the form:
     int foo(a,s)
     int a;
     char *s;
     {
     }
are therefore not acceptable, but the following is:
     int foo(int a, char *s)
     {
     }
Further to this, ListFn expects source files to use character code 10 as a line terminator, not 13 or both 10 and 13.

The application, and an example file to try it out with can be accessed by clicking on the icon in the RISC User Menu system or by double-clicking on the icon in the RISC User disc, though you may need to double-click on the System application on this disc first if you do not have DDE installed on your machine, which may be the case if you use RISC Developments' Easy C for instance. The program will load and open a directory display containing an example file. It is a good idea to update your own copy of System using SysMerge, if necessary, so that it contains copies of all the necessary DDE modules.

When the application is loaded, it will display its icon on the icon bar, which you can click on to open the search window. You can drag C source files on to the icon labelled Files: to register them with the program. Like all DDE programs, the process will not start when you drag the icons into the window, but when you have dragged in all the files you wish to search, you should press the Run button and they will all be searched at once. A via file can be used instead, in which case, it should be dragged to the Via icon before pressing Run. A via file is a file containing a list of the filenames you want the program to operate on, the files in this list will therefore be searched, though the via file itself will not be searched.

There are three options available in the search window. One of these is Throwback, which enables error messages to be displayed in the window of a text editor like DeskEdit, from where they can be double-clicked on to display the original source line in the text editor. A full description of the others can be found by selecting Help from the icon bar menu. The icon bar menu is a standard DDE tool menu, so you can save all the program options by selecting Save options and you can set all the normal DDE tool options in the Options submenu:
	Auto Run
	Auto Save
These options are not used by ListFn.

Display
This leads to a small submenu which allows you to display full text in the output window (opened when the program is run), or just a summary of the output. Either way, the full text can be saved from the output menu window.

A menu option in both the search window and in the output window menus allows you to re-run the command. The editable text shows the command that will be executed. This can also be typed in at a normal command line.

The output file produced contains both static and extern functions. If you want to use the output file as a header file, you will therefore have to edit out any static prototypes by hand.


 Copyright RISC User 1994
