There are a large number of DP4 C header files. However, most programs will only need to include dp4capi.h. DP4 programs written before 4.620 will use datafit.h (which is the name for old versions of dp4capi.h). Very old DP4 programs may include dp4.h instead. Although the header files are primarily designed for C they also work with C++. In fact parts of the 4.620 C library are written using C++, so there should not be any problems with this.
Owing to the fact that the DP4 C API has existed for many years (parts of it predate the 1989 ANSI C standard), there are one or two minor conflicts with the standard. For example the file dp4macro.h defines abs() as a macro that does the same thing as the ANSI C abs() function but it works with any numeric type. Unfortunately it usually evaluates its arguments twice (unless there is a compiler intrinsic _abs()), and this may potentially cause problems. dp4capi.h also #defines malloc() to call the DP4 equivalent mallocp(). If you don't want any namespace pollution put #define NO_ANSI_POLLUTE before including any DP4 header files. On Win32 platforms there are also one or two clashes with the windows.h. These have never caused any problems so far as we know. Compilation with an option that enforces strict ANSI conformance helps (-Za with Microsoft compilers), though you will probably need to fix Microsoft's header files to make them work with this option!
The table below gives a brief description of each DP4 header file. Most files conditionally include any other files they require, so you can include any of them in any order.
| bcdreal.h | Contains definitions for internal real number structure used for number to character conversion |
|
bitset.h
btrees.h |
These two header files are used by DBMS programs. You only need to use them if you write programs that access database files at this level. As an indication of how unlikly this is, none of the data dictionary maintenance programs, and none of QAB need these files. |
| ccown.h | Contains private functions and variables used by the DP4 library routines |
| cdata.h | Contains locale information about the character set being used by DP4. DP4 utilities rely on this file rather than the vagaries of the manufacturer supplied equivalent |
| cexits.h | File to be included in QAB C exit modules. |
| database.h | File containing type definitions for DP4 data dictionary tables. These definitions are different from what LIBMAKE would produce for these tables. You only need to include this if you are manipulating these tables. |
| datafit.h | Legacy file - now just includes dp4capi.h |
| dbflags.h | Contains various definitions relevant to internal features of DP4 databases. Most of the information formerly in this file has been moved to datafit.h |
| dp4.h | File containing defines and prototypes for the 'old name' dp4 functions. If you are used to using these old names then you should include this file rather than datafit.h. |
| dp4capi.h | The header file for the DP4 C library. This file includes some ANSI C header files and several other DP4 header files. You can find out more about this header file, and how it differs from the old datafit.h here . |
| dp4cc.h | Compiler recognition file. It also defines things like cdecl pascal etc, appropriately |
| dp4ci.h | Contains internal details of the DP4 interface |
| dp4clib.h | Header file used by DP4 C library routines. |
| dp4dbapi.h | Header file prototyping the interface level DP4 database API. If you only want to use the DP4 database API, and no other parts of the DP4 API, you only need to include this file. If you are want to use the interface with the same #define names as were used with DP4DYN rather than the C library versions then you also need to include dp4flags.h. |
| dp4dbflg.h | Header file containing flags and used by the DP4 database API functions using names from the "traditional" DP4 C library. |
| dp4far.h | File containing various macros and functions to allow programs that need to use mixed memory model features to be written in a portable way. |
| dp4macro.h | File containing various allegedly "useful" macros. Included by dp4capi.h |
| dp4pal.h | File containing internal details of the palette used by the 4.6xx terminal manger |
| dp4port.h | File containing byte swapping macros for portability between different processor architectures. |
| dp4types.h | File containing definitions of base types used by DP4 programs. Regrettably a few of these clash with Microsoft Windows definitions, mainly because we got there first! |
| dp4uiapi.h | Contains the interface level terminal manager functions (exported directly from the DP4 terminal manager on Windows) |
| interact.h | Legacy file - just includes dp4.h |
| interfce.h | Another private file used by the C library. Most of the interesting stuff in this file is now in dp4ci.h |
| lru.h | Implements functions to do with doubly linked lists used by some functions in the DP4 C library |
| mapcon.h | Functions that programs that want low level access to the 4.6xx Terminal manager can use |
| mapedlk.h | Used by programs that want to call the 4.6xx Map Editor. |
| maps.h | Declares 4.6xx or 4.5xx map data structures. |
| maputil.h | Functions for manipulating 4.6xx maps |
| network.h | This file is used by DBMS in networking environment. |
| newmenu.h | File containing definitions used by dp4 program. The only likely cause for needing this file is if you wish to write your own program to maintain the @menu_user table. If you do this you will have to be prepared to update this program with each new version of DP4, as new preferences are added almost continually. [There is no kit for building a replacement DP4 menu program, though help in this area is available if required] |
| oldmaps.h | File containing type definitions for DP4 4.5xx map tables. These definitions are different from what LIBMAKE would produce for these tables. You only need to include this if you are manipulating these tables. |
| printers.h | This contains the structures of the printers and device tables as set up by DFSETUP. You only need this file if you are modifying these records. You do NOT need it just because you are using print functions |
| proghead.h | This file contains definition used by KENTCURS PROGDATE and OS conversion programs such as EXE2CMD. |
| sysdata.h | You need to include this file if you want to reference file locations stored in the DP4 licence file, in which case you need to call tf_read_sysdata() first. [This will be done for you if you are writing QAB C exits.]. |
| userdata.h | You need to include this file if you want to reference fields from userdata.sys, in which case you need to call trm_readuser() first. [This will be done for you if you are writing QAB C exits.] |
| verstamp.h | Declares functions that DP4 programs use to print their own version information and secure information added using kentcurs |
|
cdos286.h
msdos.h os2call.h unix.h wincall.h |
These files are used by DP4 OS dependent modules. |