From Newsgroup: comp.infosystems.gemini
I've been playing with gemini for a while now (a year or two?). In
some of my spare time I've been working on a C/ncurses based browser
(using gmi100 as a starting point), which I hope to release in some
form soon.
While working on that, I ran into a bit of a problem. Often a capsule
will have links to non-gemini pages (gopher, https, etc.) and I didn't
know what to do with them.
So I wrote a very small library to look up handlers in a file,
/etc/schemecap, similar to the MIME /etc/mailcap file. Now, if my
gemini client finds a non-gemini URL, it can find what to hand it off
to.
I've since found that xdg-open does something similar, but is
restricted to use in a desktop environment and not terminals/consoles,
so it might not be ideal for an ncurses client that might be running
without X or Wayland.
Anyway, the info/download page is at:
https://www.turnquist.name/software/libschemecap/
It includes man pages for the functions and the /etc/schemecap format.
There's one main function, scheme_handler() to look up the handler for
a given scheme or URL. It also takes an arguement for the type of
handler (graphic, text, or cli).
You can either "./configure && make && make install" and use the shared library, or just copy schemecap.[ch] into your own project directory.
It should be easy (trivial?) to port to other languages.
I've released this under the MIT license in hopes of wider adoption.
Feedback, suggestions, bug reports and patches are all welcome.
I should probably post this on c.i.gopher and somewhere else as
well...
Cheers,
--Andrew
--
Andrew Turnquist, Glorious Downtown Short Tract, New York, USA
... wandering the streets of Usenet ...
(Remove numbers and .invalid for email address)
"Do what you can with what you have where you are." -T Roosevelt
--- Synchronet 3.21f-Linux NewsLink 1.2