Making Library's that use direct port manipulation?

Recently Ive been working on a new project, a digital Constant Current SYNC, and Constant Current Source. This is the first real Arduino project Ive built. Ive written my own custom code/drivers for all the hardware/chips im using. I plan on turning this code in to Librarys I can use for the main project. Id also like to upload it so other people can use it if they would like.

The issue is Im using alot of direct port manipulation and other general AVR stuff to make my code much smaller/faster. The problem is I would like to let the user of the library select what pins they would like to use. Is there anyway to do this via direct port manipulation? For example I would like the user to be able to call a function to set the pin they want to use, with arduino you would just past there chosen pin to pinMode and digitalWrite, using direct port manipulation I dont see how this is possible with out writing a bunch of code to translate a pin number in to a port and bit pattern

Yes you can, using non-typed templates is one way.
In fact if you used templates, you could simply pass the pin number to fat16libs DigitalIO lib which does the pin translation for you. Fast digital I/O, software I2C, and software SPI libraries - Libraries - Arduino Forum