Note: I NEED A LIBRARY not links to documentation about extensions my host doesn't have or want installed.
The subject says it all.
I don't need to extract any files for the moment (although that might be a nice addition to my web app later) I just need to list the contents of rar and zip archives.
phpinfo(); you webhost
if you see this Rar support the you can use PECL's rar functions.
This class can make things simple
Or else I don't know if this is possible
PHP Compression Functions
everything you need (installation, usage examples) is included in that page.
listing rar files is as easy as
I honestly don't think you'll find one. What you're asking for is a library that includes the rar extension (giving php access and usability to the filesystem and compressed files: rar) itself if I'm understanding correctly. I really don't think anyone would go through the trouble of rebuilding/porting/moving/extracting/etc the rar extension when it's easier to install it. If I were you I'd contact the host to see if they'll install it and/or migrate to a new host.
http://us2.php.net/manual/en/ref.zip.php for zip-files.
http://us2.php.net/manual/en/rararchive.getentries.php for rar-files.