Am I able to call functions in my custom module from other modules? I would like to integrate the Barcode (http://drupal.org/project/barcode) module functionality into a custom shipping module that I am creating.

I would like to make calls the genBarCode method or something similar so I may generate barcodes within my module.

Is this ok within the context or custom/contrib modules and if so how can it be done?
There are two issues:


Is the function you're going to call intended to be an API function? In general, functions that are not intended to be called by other modules are prefixed by an underscore as in _mymodule_private_function().
Is the function in a file that is guaranteed to be loaded when you need it to be.  If it's in a .module file and the module is enabled, then it will be available. If it's in a class that's declared in a file listed in a files[] declaration of an enabled module's .info file, it will also be available. If it's a regular function in a .inc file, you may have to force it to be loaded with module_load_include() or require_once() or similar techniques.


How do you do it? Just call the function the same way as that module calls the function, the same way as you call any Drupal core function.

Don't forget to make the module a dependency of your module.