[cups.development] How to create custom filter using CUPS source?

Michael Sweet msweet at apple.com
Wed Feb 15 08:07:00 PST 2012


Gurmeet,

You really don't want to build custom filters within a specific version of CUPS.  The sample filters in the CUPS source code make use of private API (anything starting with the underscore, e.g. _cupsLangPrintFilter) that often changes from release to release, even within patch releases.

That said, you can easily make a copy of rastertoepson and replace all usage of a given private API or header with the corresponding public functions, for example:

    #include <cups/string-private.h>    ->     #include <string.h>
    #include <cups/language-private.h>  ->     remove

    _cupsLangPrintFilter(stderr, "LEVEL", _("string"), ...)
                                        ->     fprintf(stderr, "LEVEL: string\n", ...)

These small changes (along with changing the name of the filter) will ensure that your filter will work with pretty much any version of CUPS out there (since CUPS 1.2 for the code in rastertoepson).


On Feb 14, 2012, at 11:12 PM, Gurmeet Singh <gurmeet.janjua at yahoo.in> wrote:

> Hi Experts,
> 
> I want to do some addition in rastertoepson filter. I have compiled source code of cups-1.5.0. How i can link rastertoepson.c file during compilation with cups-1.5.0 source code so that i will be able to do some addition in rastertoepson filter's functinality?
> 
> Thanks in advance.
> _______________________________________________
> cups-dev mailing list
> cups-dev at easysw.com
> http://lists.easysw.com/mailman/listinfo/cups-dev

__________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair





More information about the cups-devel mailing list