Announcement

Collapse
No announcement yet.

Convert C Headers (*.H) to PowerBASIC code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Convert C Headers (*.H) to PowerBASIC code

    I have been working on a program over the last week that converts most C header code to PB.

    Download here (included with PBUTILS):
    http://myweb.tiscali.co.uk/kgpsoftwa...ds/pbutils.zip
    (Read "file_id.diz" for futher details)

    Please post comments here rather than e-mail, thanks.

    [Edit: Updated link to current]
    ------------------
    Kev G Peel
    KGP Software, Bridgwater, UK.
    mailto:[email protected][email protected]</A> http://www.kgpsoftware.com

    [This message has been edited by Kev Peel (edited December 09, 2004).]
    kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

  • #2
    Kev,

    Thanks Kev, another great tool to add to my collection. I haven't
    had the chance to try it just yet, but will sometime tonight!

    Regards
    MWM




    ------------------
    mwm
    mwm

    Comment


    • #3
      Thanks Mike!

      I just uploaded a new version which covers multi-line comments better, and includes an example C header that shows UDT, Function, Sub, Constant and Comment conversion, it converts to 100% compilable source.

      Regards,

      Kev.

      [This message has been edited by Kev Peel (edited July 24, 2001).]
      kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

      Comment


      • #4
        Kev;

        Very nice !

        I did try it on the win.h file that comes with the freeware LCC
        C compiler and about half way through the file, the conversion got messed
        up. The win.h file is over 500 KB in size and it handled it well
        but there must have been some particular code that it didn't like
        that confused it.

        You might want to download the freeware LCC compiler since it has lots
        of header files for the entire API. If you can get your tool to
        convert all of them without any problem then you have a "hit" on your hands.

        By testing it with the Win.h file with LCC, you can then compare
        the converted file to the win32api.inc file we use now to see how
        well it did.



        ------------------
        Chris Boss
        Computer Workshop
        Developer of "EZGUI"
        http://cwsof.com
        http://twitter.com/EZGUIProGuy

        Comment


        • #5

          Thanks Chris, I'll download LCC tonight and start testing.

          (For lurkers, the LCC url is here.)

          Regards,

          ------------------
          Kev G Peel
          KGP Software, Bridgwater, UK.
          mailto:[email protected][email protected]</A> http://www.kgpsoftware.com
          kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

          Comment


          • #6
            Thanks Kevin.

            I am looking forward to trying it out on some C for PDF generation
            that I am wanting to test. Unfortunately, I cannot start for maybe
            a week.

            Regards

            David

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

            Comment


            • #7
              Kevin,

              Thanks for the program, the link in this posting is not longer valid but found it on your site in the library of usefull powerbasic programs.

              Any change the sources are public since the program chokes on multi line comments..
              like:

              Code:
              /*
                * Similar to CVVIDCAPSYSTEM, this handle is used to track information during
                * a capture run.  It must be passed when calling Stop() on the
                * capture.
              */
              
              becomes:
              Declare Function Stop Alias "Stop" (the As ) on) CVVIDCAPSYSTEM''  * Similar to CVVIDCAPSYSTEM, this handle is used to track information during'  * a capture run.  It must be passed when calling As Long Ptr
              
              
              ========================
              an other failure is:
              /* Prevent symbol decoration */
              #ifdef __cplusplus
              extern "C"
              {
              #endif
              
              into:
              '  Prevent symbol decoration
              #If %Def(%__cplusplus)
              'extern "C"
              '#endif
              
              (note the commented #endif (oops)....)
              Thanks Jan Vooijs


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

              No Loce (I do not know)
              No Loce (I do not know)

              Comment


              • #8
                Hello Jan, I have this down on my "todo" list for the new year.
                The trouble with C\C++ though is that you need to write a whole
                preprocessor just to translate it right. I did start work on a
                C2PB translator but I got stalled due to work commitments.

                I will resume the project one day!

                ------------------
                email
                http://www.kgpsoftware.com

                [This message has been edited by Kev Peel (edited December 09, 2004).]
                kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

                Comment


                • #9
                  Kev,
                  Thanks for the speedy answer, pity than i have to do this job manualy.
                  About 100k of header files to convert.

                  Well here i go...

                  Jan Vooijs


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

                  No Loce (I do not know)
                  No Loce (I do not know)

                  Comment


                  • #10
                    Jan, I'm sorry the program doesn't work properly for you, I will endeavor to get these problems fixed soon.

                    [shameless!]

                    If you're stuck and need professional help with your project, I can offer conversion assistance at a reasonably low rate.
                    If interested please email me at: [email protected]

                    [/shameless!]

                    Best Regards,

                    ------------------
                    email
                    http://www.kgpsoftware.com

                    [This message has been edited by Kev Peel (edited December 10, 2004).]
                    kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

                    Comment

                    Working...
                    X