[gopher] Pascal/Delphi Gopher Unit/Library
Hello everyone!
Tonight I just started work on a Pascal/Delphi Unit which can be placed into
any Pascal/Delphi application to immediately enable gopher support!
I am building it in FreePascal, which claims compatibility with the Delphi
programming language. I choose to build a Pascal unit for Gopher, as Pascal
is a very very incredibly cross-platform language, and is easier to work with
and compile than say the GCC toolkit. For example, the same .pas file should
easily compile on Linux, Windows, Classic Mac, MS-DOS/FreeDOS, OS X, Nintendo
Wii, Nintendo DS, Gameboy Advanced(although no networking), and even PalmOS!
So having a native Pascal Unit for Gopher is the ultimate choice to have
gopher support on as many platforms as you could imagine.
Of course, my work will be saved into my gopherspace, as all my other gopher
related libraries are:
gopher://gopher.veroneau.net/0library/PascalGopher/gopher.pas
All you need is a copy of FreePascal for whatever OS you are on to play
around: http://www.freepascal.org/
FreePascal even brought back classic 16-bit DOS support in their recent
release! So we can even build a gopher client for really old 286 machines
with a 16-bit networking stack! Wow! Talk about being able to make gopher
reach further than ever before.
Once you have the gopher.pas downloaded somewhere, just run: fpc gopher.pas
This will create gopher.ppu, and a binary library file, like gopher.o which
the linker will link your own code against.
FreePascal can even build pure libraries which other languages like C can
link against, like libgopher.so and gopher.dll.
Here's a test program that should compile and work:
Program GopherTest;
Uses Gopher, strings;
Var
result: PChar;
Begin
result := GopherRequest('gopher.floodgap.com',70,'gopher/welcome');
WriteLn(result);
End.
I currently capped the library heap buffer to 1k, so anything over 1k may
cause an issue. This Pascal Unit is still a work in progress, so look forward
to even more updated and support for various gopher types.
If anybody else here has worked with Pascal and Delphi before, and you want to
help out, do let me know.
Once I have a stable enough Pascal Unit, I will go ahead a build a gopher
client, which should even compile into an MS-DOS environment.
_______________________________________________
Gopher-Project mailing list
Gopher-Project@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/gopher-project
Reply to: