QRCode library C translation help needed

I have the delphi port of DelphiZXingQRCode but I need segments in my QRCode, which it doesn’t support. So I pretty much want a delphi prort of https://github.com/nayuki/QR-Code-generator/blob/master/c/qrcodegen.c. Is anyone interested in taking that on? (commercially, that is; result must be open source and work in delphi and lazarus).

1 Like

It all compiles and runs in C++Builder.
You don’t want to use them as external C routines, I guess?

can I do that from delphi?

I had a quick look and this should give you what you need to know about using external c routines in delphi.

http://rvelthuis.de/articles/articles-cobjs.html

It looks like a fun project, and I need to learn more about implementing tests in Delphi.
I have it running in CBuilder to compare against, so I’ll start by converting over the tests unit and go from there.
Paul McGee

Have a look at GitHub - WouterVanNifterick/C-To-Delphi: C To Delphi converter . It wont do 100% of the job… but it will probably get you 80%+ of the way there!

Thanks @Geoff . I had seen it was there at some stage previously. It has some binaries, but it’s pretty unsophisticated. eg :

uint8_t buf[1] = {0};  // this is initialisation to zero

translating to

var
   buf : array[0..0] of byte;
begin
   buf[1] := begin 0end; 
;
end;

instead of something like :

var
   buf : array[0..0] of int8;
begin
   buf[1] := 0;
end;  

It’s 5yrs old and showing it’s age … so … I’m interested in updating this too.
I’ve been wanting to know more about DelphiAST for a few years and never looked into it. This project uses it.

I had to do an uncomfortable amount of work to get it loading in Delphi 11. I’ll make another post about it. :slight_smile:

hi So someone else from ADUG is taking this on for me. He can volunteer himself here if he wants, but I appreciate it. thanks.

I looked at the cobj stuff… ouch. I’d rather convert it to pascal myself. Particularly since I want to use it from both delphi and lazarus on lots of platforms. Just more challenge if it’s not pure pascal code.

1 Like

There is also Chet. It only does the function declarations and not the implementations… But I am sure that it would be a better final output with a fair bit of work, as it uses the AST that Clang creates.

1 Like

Great link.