#include handling limitations

Michael R Sweet msweet at apple.com
Tue Sep 11 10:03:57 PDT 2007


Dmitry Sharov wrote:
> Greetings,
> 
> I tried to group definitions (like Attribute, CustomMedia, some UI options, etc.) common to several .drv files (say A.drv and B.drv) into another file (say C.drv) replacing them with #include "C.drv" in both A.drv and B.drv (to include those definitions), but failed to create 'same' ppd files after this 'refactoring'.
> Definitions grouped this way just disappeared from generated ppd files.
> 
> I looked at ppdc-source.cxx and found that #include is handled just like another {...} block, in other words contents is parsed into a temporary ppdcFile which is then deleted (unless contents included defines PCFileName, ModelName, Manufacturer, Version and at least one page size, if so, a separate ppd file is created).
> 
> Is this an intended behavior of #include where it just throws away contents of included file, or is this just a bug?
> If this is intended behavior, is there any other way to share such definitions between .drv files?

That's how the feature was designed, but it could be refactored to
support "insert here" type behavior.

Go ahead and file a feature request - I'll see if we can update it
for the next minor release.

-- 
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer





More information about the cups-devel mailing list