home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
648a.lha
/
Hextract_v1.1
/
Hextract.doc
< prev
next >
Wrap
Text File
|
1992-06-29
|
7KB
|
176 lines
H E X T R A C T V1.1
Hextract
provides a means of quickly and easily referencing the mass of
information contained in header files.
For programmers in C it can give you:
Definition of any symbol
Name of header file containing the symbol.
Composition of any structure.
Definitions of structure members.
Function definitions and arguments.
Library contents.
Include.h macros.
Additionally for programmers in Assembler, and to help dis-assembly:
Library offsets & arg registers.
Structure offsets.
The data file in this release (headers.z) was constructed mainly from the
Commodore and Lattice Include_h header files issued with Version 5 of the
Lattice compiler, with additional data added from the Include_i files.
Detail of the Arp library is also included.
OPERATION
Hextract
can be called from both Workbench and the CLI. There are no
switches or variations. The only requirement is that the executable
Hextract
and the data file
headers.z
must be in the same directory.
The data file at 281 KBytes is pretty substantial and to save space it
has been compressed (P-Compress) down to only 69K. Decompression is done
automatically when Hextract is loaded. The other effect of the size of the
file is that searching it while on a floppy disk drive would be unaccept-
ably slow (and none too quick on hard disk either); to overcome this a
temporary file
(headers.
t) is opened in RAM and headers.z is copied to this.
If you have plenty of space on a hard disk and prefer to hold the data file
in uncompressed form to eliminate decompression time when loading, copy the
file ram:headers.t to your hard disk (while Hextract is open), rename it
headers.z
and copy Hextract and Hextract.info to the same drawer.
Hextract
opens a window and shows the prompt "Enter symbol". Type in the
word to be identified and press
return
. Hextract is not case-sensitive,
and recognises the AmigaDOS wildcards
?
and
#
. While searching the pointer
changes to a
W
. A complete search will take about 30 secs on an A500, and
about 5 secs on an A3000.
Note that ALL entries should be stripped of everything except the bare
name. Enter *()Apple[24] as Apple.
To quit the programme type
QUIT
at the "Enter Symbol" prompt. To quit
while a search is in progress press
CONTROL_C
.
Defines, Typedefs, structure members
If the word appears in the relevant .h file as a #define or #typedef you
will get something like: (
MEMF_PUBLIC
typed in).
"#define MEMF_PUBLIC (1<<0)" exec/memory.h
The entry extracted is shown within inverted commas, and the name of the
header file added.
If the word is a member of a structure you get: (
BufBuffer
typed in)
WORD *BufBuffer 8 struct DBufPacket
The figure 8 is the member's offset in the structure.
Structures
To get the composition of a structure, type in the structure name;
for example typing in
DBufPacket
produces:
struct DBufPacket dbp_ 12 graphics/gels.h
{
WORD BufY 0
WORD BufX 2
struct VSprite *BufPath 4
WORD *BufBuffer 8
};
The top line gives the full name of the structure, the prefix used when
writing in assembler, where this differs from any .h file prefix, (for
example the .i file would show
dbp_BufY
) the size in bytes, and the
parent header file. In the line for each member the last figure shows the
structure offset.
Structures with nested unions or structures are a bit more complicated. an
example is the structure
MemEntry
:
struct MemEntry 8 exec/memory.h
{
union {
ULONG meu_Regs 0
APTR meu_Addr 0
} me_Un ;
"union me_Un" exec/memory.h
ULONG me_Length 4
};
This shows a structure with two members - the union me_Un and the ULONG
me_Length. The full name of meu_Regs will be
me_Un.meu_Regs
.
Functions
If the word is a function the form of the output will vary according to
whether it is a Lattice or Amiga library function. Entering
Open
will
produce:
"extern int open __Args((char*,int, ))" fcntl.h
-30 $fffe2 -$001e Open(name,accessMode)(D1/D2) dos.library.h
The equivalent ARP library entry is also given. The first line details
the function
open()
in the Lattice file fcntl.h, inverted commas show that
it is a direct quote from the file. The second line shows the DOS function
Open()
and gives the library offset in decimal, hex(complement), and hex.
Libraries
If the name of the Library is entered - such as
Dos.library
or
Console.
device
- the full list of functions in the library will be output.
If you are not sure of the spelling of the word you want to find the data
file can be decompressed and loaded into an editor for examination (if you
have sufficient memory). You can also add any definitions of your own that
you might want to reference, or shorten the file by deleting sections
that are of no value to you. Note the line FFFFFF (line 4924) - this marks
the start of the library functions section and any additions must be
inserted before it.
Some header file details have necessarily been omitted from
headers.z
.
These include:
Comments.
Macros given in the include.i files.
Proto files.
Lines beginning #IF, #IFDEF, #IFNDEF, #ENDIF, #ELSE.
The latter may result in two or more apparently conflicting definitions
of the same item being shown - the various header files will be named so
that you can find any further information needed.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Hextract is Freeware. It may be copied and distributed freely and used
without charge for non_profit-making purposes. Authority for profit-making use should be obtained from the author below.
No responsibility can be accepted for any loss occasioned by use of the
programme.
This release only covers the V1.3 operating system and a V2.0 version may
be expected in due course. Also if someone cares to send me a complete set
of Manx header files, a Manx version of headers.z could appear.
Comments, suggestions, bug-reports all welcome.
Chas A. Wyndham,
1265 Canning Mills Road,
Roleystone,
WA 6111.
Australia