Next Up Previous Contents Index
Next: The AutoCAD Database Up: Implementation Notes Previous: Using IGES Modules

Extracting Core Routines

The AutoCAD core provides a rich set of tools for linear algebra, geometry, storage and list management, file I/O, and manipulation of objects used within AutoCAD. Any code removed from the core must either be provided with versions of these functions or converted to get along without them. Fortunately, most of the heavily-used service functions are reasonably self-contained and easily extracted from their homes in the core. As I worked to get IGES running outside the core, I simply made a list of the functions it used, and for all true support functions (i.e. those not used to access the database or other state-containing parts of AutoCAD), collected the required functions into a module I named autocore.c performing, as I went, transitive closure to pull in functions used by those I included.

At the moment, the functions implemented within autocore.c are:

addvec alloc angle angle2 arbaxis aschand atwt cfclose cfunlink cndfre cross distan distan2 distan3 distsq distsq2 dot dotp eqv fabsv fcirceq fcirceq2 fixangle flineq fmax fmin fuzzeq g2pilc ga2p gd2p gdpl gdsq2p gl2p handasc hashandle hmabort identv intconic is1bcode is2bcode makerot matxmat mfv napln nulvec pconvt rswap scal setflags setpos sqabsv strsave subvec sumvec ucase unimat unisub univec vconvt vecxmat wtat

Function prototypes, data type declarations, and other definitions required by these functions are in autocad.h, which is included in the compilation of every module extracted from the AutoCAD core. In addition to the routines collected into autocore.c, the following AutoCAD core modules are used, essentially unchanged: dxf.h, erstruc.h, erstruc.c, lstsubs.c.


Editor: John Walker