Re: providing perl api for C library

[email protected] (sisyphus)
Newsgroups perl.beginners
Message-ID <CADZSBj3NN4Ebd2-PdYTckvXMk5cqDnJ6mrznGOX21EZFQwOF0A@mail.gmail.com>
On Sat, Dec 10, 2022 at 2:19 PM Henry R <[email protected]> wrote:

> Hello list,
>
> I have written a C library which encrypts the data stored in object
> storage like S3.
> If I want to provide it with a perl OO interface what's the right way?
> such methods like:
>
> $data->encrypt("input.sth");
> $data->decrypt("input.sth");
>

I generally use Inline::C to access C libraries. (Take a look at the
Cookbook that ships with the Inline::C source distro and see what you
think.)

For something similar, but with a steeper learning curve and a few extra
complications, there's also XS (perldoc perlxs) - but I think Inline::C is
a good starting point from which you can migrate to XS if you so desire.

Cheers,
Rob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.