H2J by Phil Burk of Delta Research H2J converts 'C' style .h include files to JForth style .j files. H2J is hereby placed in the Public Domain and may be freely redistributed. What is H2J? H2J is handy if you want to interface to an Amiga Library that has an associated ".h" file. An example might be the A-Squared Live library or the ARP library. The ".h" file will contain the definitions of constants and structures to be used with the Library. To use the Library from JForth you will need a ".j" file containing JForth style structure and constant definitions. When we developed JForth 1.2, we needed something that would convert the Amiga include files. Thus H2J was born. An early version of H2J was released on the JForth disk. When JForth 2.0 came out, we didn't have room to put H2J on the disks so we are releasing it as Public Domain. This new version support SIGNED and UNSIGNED structure members and is more robust then the first version. How to Use H2J You can either use the Cloned version of H2J or compile it and use it from direct from JForth. To compile H2J, run JForth and execute the ASSIGNS files as you normally would. Then enter: CD JGOODIES_1:H2J INCLUDE H2J.f This will load ODE and whatever else it needs. H2J takes two filenames, an input and an output filename. You may use full pathnames. H2J infile outfile To convert newlib.h to JForth style, enter: H2J newlib.h newlib.j H2J will prompt you at various times for one of two things. When it encounters a new structure definition, it will ask you to enter a prefix to add to the member names to make them unique. Like Assembly, Forth requires you to use unique names for the structure members. For a Window structure, for example, we use "wd_". If the structure members already has a prefix, just hit return. H2J will also ask you to verify it's conversion if it encounters an unusually tricky line. It is usually correct so unless you know it is wrong, just hit return. If it is wrong, type in the line the way it should be. Don't panic if some little thing goes wrong. You can always go back and edit the file. We find that H2J will convert about 80% of the files completely. The other 20% will require minor tweaking. For more information refer to the chapter on Amiga Structures in the JForth manual.