What would be the best way to do an `scp` or `sftp` copy in a Unix environment using C?

I'm interested in knowing the best library to use and an example if at all possible. I'm working on a [Solaris](https://en.wikipedia.org/wiki/Solaris_%28operating_system%29) server with the *[Sun](https://en.wikipedia.org/wiki/Sun_Microsystems) tools* installed.