Don't use port and pin names like portA or pin_a5 in your great library, because someone may (will) want to use your library on another port or pin. It also helps to make your great library PIC independent.
Name your pins according to the context, to what your library is doing. Client code, ie. users, will have to define those variables before actually include your great library.
Let the user set the pin directions, except if the library is supposed to modify direction during execution.
Ex: how to use your library (doing amazing things with the GP2D02 IR ranger)
-- declare in/out pins for the ranger
alias ranger_pin_in is pin_A0
alias ranger_pin_out is pin_A1
and make sure the pins work as required:
-- specify the direction of the pins
-- Since directions won't change during execution, this is
-- done here, during the setup, before including the library
pin_A0_direction = input
pin_A1_direction = output
and now include the library:
-- now include the library which uses ranger_pin_in and ranger_pin_out
include gp2d02 -- ranger library
Exception: if your library uses a special PIC feature, it may use the name defined in the device files / datasheet. Not so much an exception, as you'll use the pin name given the context (feature, peripheral)no
Note: syntax "var ... is ..." is now deprecated in favor of "alias ... is ..." and must not be used anymore. "alias" keyword is more powerful as it allows to create synonyms for any type of names (variables, constants, procedures, functions, psdeudo-variables)
Ex: a i2c hardware library (using built-in PIC i2c) may refer to SCK and SDA. Those pin names are set into the device include file (prefixed with the portname!).