#include handling limitations

Dmitry Sharov dsharov at mackiev.com
Tue Sep 11 09:58:19 PDT 2007


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?

Thank you in advance.




More information about the cups-devel mailing list