home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff387.lzh / H2I / H2I.Doc < prev    next >
Text File  |  1990-10-22  |  4KB  |  133 lines

  1.  
  2.      H2I V1.1                 Programmer's Manual                    Page 1
  3.  
  4.  
  5.  
  6.  
  7.  
  8.      ›1mNAME 
  9.  
  10.           ›0mH2I - Compiler C include files to assembler include files 
  11.  
  12.  
  13.  
  14.      ›1mSYNOPSIS 
  15.  
  16.           ›0mH2I <file>[.h] 
  17.  
  18.  
  19.  
  20.      ›1mDECRIPTION 
  21.  
  22.                ›0mH2I  translates C include files into assmembler include
  23.           files.  This can be a help to  all  those  programmers  that
  24.           have their own structure definitions together with assembler
  25.           parts in  their programs.  H2I has the advantage that it can
  26.           keep the structure definitions consistent for both languages
  27.           because they base on only one file.  
  28.  
  29.                <file> is the name of  the  C  include  file.    If  it
  30.           doesn't end with ".h" the suffix is appended.  The assembler
  31.           include file has the same name with the suffix ".i".  
  32.  
  33.                H2I  understands  a  small  subset  of  the  C  and the
  34.           C-preprocessor syntax.  In  fact  these  are  the  structure
  35.           definition   without   bitfields,  the  "#define",  and  the
  36.           "#include" statement.  The structure definitions may contain
  37.           all standard C type and the specific AMIGA types as they are
  38.           defined  in  "exec/types.h"   and   "libraries/dos.h".   The
  39.           structure components can be: 
  40.  
  41.                - all types 
  42.                - pointers 
  43.                - arrays 
  44.                - pointers to arrays 
  45.                - pointer to functions 
  46.  
  47.  
  48.                The contents of the function parenthesis of pointers to
  49.           function  components  is  not checked, so this can be K&R or
  50.           ANSI style functions.  
  51.  
  52.                The  syntax  for  structure  definitions  contains  two
  53.           special expressions that must be added to standard C include
  54.           files: 
  55.  
  56.                     Between the name of a structure definition and the
  57.                left  brace  the following expression must be inserted:
  58.                "/*/" <identifier> "*/".  <identifier>  is  used  as  a
  59.                prefix  to  the  C  names  of the structure components.
  60.                <identifier> should be unique to all other and standard
  61.                assembler include files.  <identifier> is also used  as
  62.                the  prefix for the LABEL statement that gives the size
  63.  
  64.  
  65.      H2I V1.1                                                    18 July 90
  66.  
  67.  
  68.      H2I V1.1                 Programmer's Manual                    Page 2
  69.  
  70.  
  71.                of a  structure.    The   generated   LABEL   name   is
  72.                <prefix>_SIZE.  
  73.  
  74.                     Between  the  name of structure definition and its
  75.                name as the structure  component  the  same  expression
  76.                must be  inserted  as descriped above.  <identifier> is
  77.                used here as  the  LABEL  name  that  is  used  in  the
  78.                assembler structure definition.  
  79.  
  80.                     The  prefix  expression  are  comments  for normal
  81.                C-compilers and only be used by H2I.  
  82.  
  83.  
  84.                The complete  syntax  that  is  understood  by  H2I  is
  85.           descriped in the file "Syntax" in this directory.  
  86.  
  87.  
  88.  
  89.      ›1mEXAMPLE 
  90.  
  91.           ›0mstruct mystruct /*/ ms */ { 
  92.              struct MsgPort /*/ MP_SIZE */ myport; 
  93.              struct Message /*/ MN_SIZE */ mymsg; 
  94.              struct Message /*/ MN_SIZE */ *mymsg2; 
  95.              char string[256]; 
  96.              long number; 
  97.              VOID (*function)(); 
  98.           }; 
  99.  
  100.  
  101.           Translated to: 
  102.  
  103.            STRUCTURE mystruct,0 
  104.               STRUCT   ms_myport,MP_SIZE 
  105.               STRUCT   ms_mymsg,MN_SIZE 
  106.               APTR     mymsg2 
  107.               ARRAY    ms_string,1,256 
  108.               LONG     ms_number 
  109.               APTR     ms_function 
  110.               LABEL    ms_SIZE 
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.      H2I V1.1                                                    18 July 90
  132.  
  133.