Adapt and Compile C
-------------------

ACC is a little tool I tossed together to make it much easier to take existing
source code written to compile with my 16 bit DOS Micro-C compiler, and adapt
to compile with LCCwin32 a 32-bit Windows compiler.

Although I normally use Micro-C/DVM to run such software under Win64,
Acc has been very useful to build this software to be native Windows .EXEs

LCC.ACC contains the "adjustments" I've needed so far, but no doubt more will
be required for more-complex programs. Check back from time to time to see what
I've added!

To see command line options, run ACC with no arguments: ACC

note: ACC is a DOS program (runs under DosBox), and replies on my WCMD tool
    (on my site) to be able to run LccWin32 under Windows

------------------------------------------------------------------------------

In the following    ?1=sourceName ?2=accName
    discussions:    R:\=output location (for me it's a Ramdrive)

ACC takes a Micro-C compatible ?1.C file and writes an LCC compatible R:\?1.C
along with R:\?1.H containing necessary Micro-C library functions and other
adaption definitions.


ACC uses ?2.ACC to perform the conversion, which it looks for in:
    The current directory
    The directory where ACC.COM exists
    %DDCDATA%   (environment variable)

The adapted ?1.C and ?1.H are written to an output path determined by:
    -=      Command line argument
    ==      in ?2.ACC
    %TEMP%  (environment variable)

?2.ACC contains:
----------------
       Lines beginning with  =  have special meaning:

=;                      Ignored (comment)

=>compile command string
    ~P  don't include Path      in next:        ~S=?1.C     ~O=R:\?1.C
    ~E      ""        Extension ""              ~I=?2.ACC   ~H=R:\~1.H
    ~~  single ~

==outputpath            set output path

note:   Text elements are parsed based on '"~ (you can use any of the these).
        Parsed text must begin and end with the same ^^.

=#'string1'string2'     change string1 to string2 whenever it occurs

='name'['...']          'name' is symbol to process             ' could be " or `
      '=newname'            Change name in R:\?1.C
      'name1'               also process (include) 'name1'
  if 'name' is called in ?1.C, following lines are inserted into R:\?.H until
  the next ='  line (those before first =' are always inserted)

=1string                insert string at //=1   \
=2  ""                          ""       //=2    >  ='name' must be active
=3  ""                          ""       //=3    >          ""
=4  ""                          ""       //=4   /
=?printfargs            insert printf(printfargs); if -D enabled


------------------------------------------------------------------------------

Special "control" comments which can be placed in ?1.C

    //=#        insert      #include "R:\?1.H"      here
    //=1        \               =1
    //=2         > Insert .ACC  =2s here
    //=3         >              =3
    //=4        /               =4
    //=name     include following lines only if     name.ACC
    //=!name                    ""              not     ""
    //=         always include following lines
    //=!        never           ""

Although these are valid 'C' comments (in case you sometimes compile
without ACC), they won't actually appear in the generated R:\?1.C


Dave Dunfield   -   https://dunfield.themindfactory.com
