diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2010-03-23 21:42:49 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2010-03-23 21:42:49 +0000 |
commit | 54afec335014303dba3c6eabe5393adce9e660ad (patch) | |
tree | 70f154e946d87bf089351ef08b66d4170f023db6 /scheduler | |
parent | ba55dc12de9ef3103d220a332ad7d26c54e397fa (diff) |
Merge changes from CUPS 1.5svn-r9041.
(all of the media changes)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1987 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'scheduler')
-rw-r--r-- | scheduler/Dependencies | 115 | ||||
-rw-r--r-- | scheduler/ipp.c | 89 | ||||
-rw-r--r-- | scheduler/printers.c | 480 | ||||
-rw-r--r-- | scheduler/printers.h | 3 |
4 files changed, 528 insertions, 159 deletions
diff --git a/scheduler/Dependencies b/scheduler/Dependencies index 1a8e7c325..381a1ca32 100644 --- a/scheduler/Dependencies +++ b/scheduler/Dependencies @@ -6,104 +6,107 @@ auth.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h auth.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h auth.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h auth.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h auth.h -auth.o: client.h policy.h printers.h classes.h job.h conf.h banners.h -auth.o: dirsvc.h network.h subscriptions.h +auth.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h job.h +auth.o: conf.h banners.h dirsvc.h network.h subscriptions.h banners.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h banners.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h banners.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h banners.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h banners.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h banners.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h -banners.o: auth.h client.h policy.h printers.h classes.h job.h conf.h -banners.o: banners.h dirsvc.h network.h subscriptions.h ../cups/dir.h +banners.o: auth.h client.h policy.h printers.h ../cups/pwg-private.h +banners.o: classes.h job.h conf.h banners.h dirsvc.h network.h +banners.o: subscriptions.h ../cups/dir.h cert.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h cert.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h cert.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h cert.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h cert.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h cert.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h auth.h -cert.o: client.h policy.h printers.h classes.h job.h conf.h banners.h -cert.o: dirsvc.h network.h subscriptions.h +cert.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h job.h +cert.o: conf.h banners.h dirsvc.h network.h subscriptions.h classes.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h classes.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h classes.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h classes.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h classes.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h classes.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h -classes.o: auth.h client.h policy.h printers.h classes.h job.h conf.h -classes.o: banners.h dirsvc.h network.h subscriptions.h +classes.o: auth.h client.h policy.h printers.h ../cups/pwg-private.h +classes.o: classes.h job.h conf.h banners.h dirsvc.h network.h +classes.o: subscriptions.h client.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h client.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h client.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h client.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h client.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h client.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h -client.o: auth.h client.h policy.h printers.h classes.h job.h conf.h -client.o: banners.h dirsvc.h network.h subscriptions.h +client.o: auth.h client.h policy.h printers.h ../cups/pwg-private.h classes.h +client.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h conf.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h conf.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h conf.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h conf.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h conf.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h conf.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h auth.h -conf.o: client.h policy.h printers.h classes.h job.h conf.h banners.h -conf.o: dirsvc.h network.h subscriptions.h +conf.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h job.h +conf.o: conf.h banners.h dirsvc.h network.h subscriptions.h dirsvc.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h dirsvc.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h dirsvc.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h dirsvc.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h dirsvc.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h dirsvc.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h -dirsvc.o: auth.h client.h policy.h printers.h classes.h job.h conf.h -dirsvc.o: banners.h dirsvc.h network.h subscriptions.h +dirsvc.o: auth.h client.h policy.h printers.h ../cups/pwg-private.h classes.h +dirsvc.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h env.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h env.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h env.o: ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h env.o: ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h env.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h env.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h -env.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h -env.o: subscriptions.h +env.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h +env.o: dirsvc.h network.h subscriptions.h main.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h main.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h main.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h main.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h main.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h main.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h auth.h -main.o: client.h policy.h printers.h classes.h job.h conf.h banners.h -main.o: dirsvc.h network.h subscriptions.h ../cups/dir.h +main.o: client.h policy.h printers.h ../cups/pwg-private.h classes.h job.h +main.o: conf.h banners.h dirsvc.h network.h subscriptions.h ../cups/dir.h ipp.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h ipp.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ipp.o: ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h ipp.o: ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h ipp.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h ipp.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h -ipp.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h -ipp.o: subscriptions.h ../cups/ppd-private.h ../cups/cups.h +ipp.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h +ipp.o: dirsvc.h network.h subscriptions.h ../cups/ppd-private.h +ipp.o: ../cups/cups.h listen.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h listen.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h listen.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h listen.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h listen.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h listen.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h -listen.o: auth.h client.h policy.h printers.h classes.h job.h conf.h -listen.o: banners.h dirsvc.h network.h subscriptions.h +listen.o: auth.h client.h policy.h printers.h ../cups/pwg-private.h classes.h +listen.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h job.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h job.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h job.o: ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h job.o: ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h job.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h job.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h -job.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h -job.o: subscriptions.h ../cups/backend.h ../cups/dir.h +job.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h +job.o: dirsvc.h network.h subscriptions.h ../cups/backend.h ../cups/dir.h log.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h log.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h log.o: ../cups/string.h ../cups/array.h ../cups/cups.h ../cups/ppd.h log.o: ../cups/array.h ../cups/file.h ../cups/language.h mime.h ../cups/ipp.h log.o: ../cups/file.h ../cups/http.h ../cups/i18n.h ../cups/transcode.h log.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h policy.h -log.o: printers.h classes.h job.h conf.h banners.h dirsvc.h network.h -log.o: subscriptions.h +log.o: printers.h ../cups/pwg-private.h classes.h job.h conf.h banners.h +log.o: dirsvc.h network.h subscriptions.h network.o: ../cups/http-private.h ../config.h ../cups/http.h network.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h network.o: ../cups/ipp.h cupsd.h ../cups/string.h ../cups/array.h @@ -111,57 +114,59 @@ network.o: ../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h network.o: ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h network.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h network.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h -network.o: classes.h job.h conf.h banners.h dirsvc.h network.h -network.o: subscriptions.h +network.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +network.o: network.h subscriptions.h policy.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h policy.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h policy.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h policy.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h policy.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h policy.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h -policy.o: auth.h client.h policy.h printers.h classes.h job.h conf.h -policy.o: banners.h dirsvc.h network.h subscriptions.h +policy.o: auth.h client.h policy.h printers.h ../cups/pwg-private.h classes.h +policy.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h printers.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h printers.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h printers.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h printers.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h printers.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h printers.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h -printers.o: auth.h client.h policy.h printers.h classes.h job.h conf.h -printers.o: banners.h dirsvc.h network.h subscriptions.h ../cups/dir.h -printers.o: ../cups/pwgmedia.h +printers.o: auth.h client.h policy.h printers.h ../cups/pwg-private.h +printers.o: classes.h job.h conf.h banners.h dirsvc.h network.h +printers.o: subscriptions.h ../cups/dir.h process.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h process.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h process.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h process.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h process.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h process.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h -process.o: auth.h client.h policy.h printers.h classes.h job.h conf.h -process.o: banners.h dirsvc.h network.h subscriptions.h +process.o: auth.h client.h policy.h printers.h ../cups/pwg-private.h +process.o: classes.h job.h conf.h banners.h dirsvc.h network.h +process.o: subscriptions.h quotas.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h quotas.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h quotas.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h quotas.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h quotas.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h quotas.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h -quotas.o: auth.h client.h policy.h printers.h classes.h job.h conf.h -quotas.o: banners.h dirsvc.h network.h subscriptions.h +quotas.o: auth.h client.h policy.h printers.h ../cups/pwg-private.h classes.h +quotas.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h removefile.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h removefile.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h removefile.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h removefile.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h removefile.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h removefile.o: ../cups/i18n.h ../cups/transcode.h ../cups/debug.h sysman.h -removefile.o: statbuf.h cert.h auth.h client.h policy.h printers.h classes.h -removefile.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h +removefile.o: statbuf.h cert.h auth.h client.h policy.h printers.h +removefile.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +removefile.o: network.h subscriptions.h select.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h select.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h select.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h select.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h select.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h select.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h -select.o: auth.h client.h policy.h printers.h classes.h job.h conf.h -select.o: banners.h dirsvc.h network.h subscriptions.h +select.o: auth.h client.h policy.h printers.h ../cups/pwg-private.h classes.h +select.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h server.o: ../cups/http-private.h ../config.h ../cups/http.h server.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h server.o: ../cups/ipp.h cupsd.h ../cups/string.h ../cups/array.h @@ -169,15 +174,17 @@ server.o: ../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h server.o: ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h server.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h ../cups/debug.h server.o: sysman.h statbuf.h cert.h auth.h client.h policy.h printers.h -server.o: classes.h job.h conf.h banners.h dirsvc.h network.h subscriptions.h +server.o: ../cups/pwg-private.h classes.h job.h conf.h banners.h dirsvc.h +server.o: network.h subscriptions.h statbuf.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h statbuf.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h statbuf.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h statbuf.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h statbuf.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h statbuf.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h -statbuf.o: auth.h client.h policy.h printers.h classes.h job.h conf.h -statbuf.o: banners.h dirsvc.h network.h subscriptions.h +statbuf.o: auth.h client.h policy.h printers.h ../cups/pwg-private.h +statbuf.o: classes.h job.h conf.h banners.h dirsvc.h network.h +statbuf.o: subscriptions.h subscriptions.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h subscriptions.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h subscriptions.o: ../cups/ipp.h ../cups/string.h ../cups/array.h @@ -185,16 +192,16 @@ subscriptions.o: ../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h subscriptions.o: ../cups/language.h mime.h ../cups/ipp.h ../cups/file.h subscriptions.o: ../cups/http.h ../cups/i18n.h ../cups/transcode.h subscriptions.o: ../cups/debug.h sysman.h statbuf.h cert.h auth.h client.h -subscriptions.o: policy.h printers.h classes.h job.h conf.h banners.h -subscriptions.o: dirsvc.h network.h subscriptions.h +subscriptions.o: policy.h printers.h ../cups/pwg-private.h classes.h job.h +subscriptions.o: conf.h banners.h dirsvc.h network.h subscriptions.h sysman.o: cupsd.h ../cups/http-private.h ../config.h ../cups/http.h sysman.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h sysman.o: ../cups/ipp.h ../cups/string.h ../cups/array.h ../cups/cups.h sysman.o: ../cups/ppd.h ../cups/array.h ../cups/file.h ../cups/language.h sysman.o: mime.h ../cups/ipp.h ../cups/file.h ../cups/http.h ../cups/i18n.h sysman.o: ../cups/transcode.h ../cups/debug.h sysman.h statbuf.h cert.h -sysman.o: auth.h client.h policy.h printers.h classes.h job.h conf.h -sysman.o: banners.h dirsvc.h network.h subscriptions.h +sysman.o: auth.h client.h policy.h printers.h ../cups/pwg-private.h classes.h +sysman.o: job.h conf.h banners.h dirsvc.h network.h subscriptions.h filter.o: ../cups/debug.h ../cups/string.h ../config.h mime.h ../cups/array.h filter.o: ../cups/versioning.h ../cups/ipp.h ../cups/file.h mime.o: ../cups/debug.h ../cups/dir.h ../cups/versioning.h ../cups/string.h @@ -211,7 +218,8 @@ cups-deviced.o: ../config.h ../cups/http.h ../cups/versioning.h ../cups/md5.h cups-deviced.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/globals.h cups-deviced.o: ../cups/string.h ../cups/cups.h ../cups/i18n.h cups-deviced.o: ../cups/transcode.h ../cups/language.h ../cups/array.h -cups-deviced.o: ../cups/debug.h ../cups/array.h ../cups/dir.h +cups-deviced.o: ../cups/pwg-private.h ../cups/cups.h ../cups/ppd.h +cups-deviced.o: ../cups/file.h ../cups/debug.h ../cups/array.h ../cups/dir.h cups-lpd.o: ../cups/http-private.h ../config.h ../cups/http.h cups-lpd.o: ../cups/versioning.h ../cups/md5.h ../cups/ipp-private.h cups-lpd.o: ../cups/ipp.h ../cups/cups.h ../cups/ppd.h ../cups/array.h @@ -241,11 +249,14 @@ util.o: util.h ../cups/file-private.h ../cups/http-private.h ../config.h util.o: ../cups/http.h ../cups/versioning.h ../cups/md5.h util.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/globals.h util.o: ../cups/string.h ../cups/cups.h ../cups/i18n.h ../cups/transcode.h -util.o: ../cups/language.h ../cups/array.h ../cups/debug.h +util.o: ../cups/language.h ../cups/array.h ../cups/pwg-private.h +util.o: ../cups/cups.h ../cups/ppd.h ../cups/file.h ../cups/debug.h cups-driverd.o: util.h ../cups/file-private.h ../cups/http-private.h cups-driverd.o: ../config.h ../cups/http.h ../cups/versioning.h ../cups/md5.h cups-driverd.o: ../cups/ipp-private.h ../cups/ipp.h ../cups/globals.h cups-driverd.o: ../cups/string.h ../cups/cups.h ../cups/i18n.h cups-driverd.o: ../cups/transcode.h ../cups/language.h ../cups/array.h -cups-driverd.o: ../cups/debug.h ../cups/dir.h ../cups/transcode.h -cups-driverd.o: ../cups/ppd-private.h ../ppdc/ppdc.h ../cups/file.h +cups-driverd.o: ../cups/pwg-private.h ../cups/cups.h ../cups/ppd.h +cups-driverd.o: ../cups/file.h ../cups/debug.h ../cups/dir.h +cups-driverd.o: ../cups/transcode.h ../cups/ppd-private.h ../ppdc/ppdc.h +cups-driverd.o: ../cups/file.h diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 58a1ab493..c4604fc61 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -1347,6 +1347,11 @@ add_job(cupsd_client_t *con, /* I - Client connection */ int kbytes; /* Size of print file */ int i; /* Looping var */ int lowerpagerange; /* Page range bound */ + const char *ppd; /* PPD keyword for media selection */ + int exact; /* Did we have an exact match? */ + ipp_attribute_t *media_col, /* media-col attribute */ + *media_margin; /* media-*-margin attribute */ + ipp_t *unsup_col; /* media-col in unsupported response */ cupsdLogMessage(CUPSD_LOG_DEBUG2, "add_job(%p[%d], %p(%s), %p(%s/%s))", @@ -1513,6 +1518,62 @@ add_job(cupsd_client_t *con, /* I - Client connection */ } /* + * Do media selection as needed... + */ + + if (!ippFindAttribute(con->request, "InputSlot", IPP_TAG_ZERO) && + (ppd = _pwgGetInputSlot(printer->pwg, con->request, NULL)) != NULL) + ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "InputSlot", NULL, + ppd); + + if (!ippFindAttribute(con->request, "MediaType", IPP_TAG_ZERO) && + (ppd = _pwgGetMediaType(printer->pwg, con->request, NULL)) != NULL) + ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "MediaType", NULL, + ppd); + + if (!ippFindAttribute(con->request, "PageSize", IPP_TAG_ZERO) && + (ppd = _pwgGetPageSize(printer->pwg, con->request, NULL, &exact)) != NULL) + { + ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "PageSize", NULL, + ppd); + + if (!exact && + (media_col = ippFindAttribute(con->request, "media-col", + IPP_TAG_BEGIN_COLLECTION)) != NULL) + { + send_ipp_status(con, IPP_OK_SUBST, _("Unsupported margins.")); + + unsup_col = ippNew(); + ippAddCollection(con->response, IPP_TAG_UNSUPPORTED_GROUP, "media-col", + unsup_col); + + if ((media_margin = ippFindAttribute(media_col->values[0].collection, + "media-bottom-margin", + IPP_TAG_INTEGER)) != NULL) + ippAddInteger(unsup_col, IPP_TAG_ZERO, IPP_TAG_INTEGER, + "media-bottom-margin", media_margin->values[0].integer); + + if ((media_margin = ippFindAttribute(media_col->values[0].collection, + "media-left-margin", + IPP_TAG_INTEGER)) != NULL) + ippAddInteger(unsup_col, IPP_TAG_ZERO, IPP_TAG_INTEGER, + "media-left-margin", media_margin->values[0].integer); + + if ((media_margin = ippFindAttribute(media_col->values[0].collection, + "media-right-margin", + IPP_TAG_INTEGER)) != NULL) + ippAddInteger(unsup_col, IPP_TAG_ZERO, IPP_TAG_INTEGER, + "media-right-margin", media_margin->values[0].integer); + + if ((media_margin = ippFindAttribute(media_col->values[0].collection, + "media-top-margin", + IPP_TAG_INTEGER)) != NULL) + ippAddInteger(unsup_col, IPP_TAG_ZERO, IPP_TAG_INTEGER, + "media-top-margin", media_margin->values[0].integer); + } + } + + /* * Make sure we aren't over our limit... */ @@ -2883,6 +2944,10 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ printer->name); unlink(cache_name); + snprintf(cache_name, sizeof(cache_name), "%s/%s.pwg", CacheDir, + printer->name); + unlink(cache_name); + #ifdef __APPLE__ /* * (Re)register color profiles... @@ -4617,8 +4682,9 @@ copy_attribute( for (i = 0; i < attr->num_values; i ++) { toattr->values[i].collection = ippNew(); + toattr->values[i].collection->request.status.version[0] = 2; copy_attrs(toattr->values[i].collection, attr->values[i].collection, - NULL, IPP_TAG_ZERO, 0); + NULL, IPP_TAG_ZERO, quickcopy); } break; @@ -4683,11 +4749,14 @@ copy_attrs(ipp_t *to, /* I - Destination request */ { /* * Don't send collection attributes by default to IPP/1.x clients - * since many do not support collections... + * since many do not support collections. Also don't send + * media-col-database unless specifically requested by the client. */ if (fromattr->value_tag == IPP_TAG_BEGIN_COLLECTION && - !ra && to->request.status.version[0] == 1) + !ra && + (to->request.status.version[0] == 1 || + !strcmp(fromattr->name, "media-col-database"))) continue; copy_attribute(to, fromattr, quickcopy); @@ -5052,6 +5121,7 @@ copy_model(cupsd_client_t *con, /* I - Client connection */ int i; /* Looping var */ char option[PPD_MAX_NAME], /* Option name */ choice[PPD_MAX_NAME]; /* Choice name */ + ppd_size_t *size; /* Default size */ int num_defaults; /* Number of default options */ cups_option_t *defaults; /* Default options */ char cups_protocol[PPD_MAX_LINE]; @@ -5224,19 +5294,19 @@ copy_model(cupsd_client_t *con, /* I - Client connection */ cupsFileClose(dst); } - else if (ppdPageSize(ppd, DefaultPaperSize)) + else if ((size = ppdPageSize(ppd, DefaultPaperSize)) != NULL) { /* * Add the default media sizes... */ - num_defaults = cupsAddOption("PageSize", DefaultPaperSize, + num_defaults = cupsAddOption("PageSize", size->name, num_defaults, &defaults); - num_defaults = cupsAddOption("PageRegion", DefaultPaperSize, + num_defaults = cupsAddOption("PageRegion", size->name, num_defaults, &defaults); - num_defaults = cupsAddOption("PaperDimension", DefaultPaperSize, + num_defaults = cupsAddOption("PaperDimension", size->name, num_defaults, &defaults); - num_defaults = cupsAddOption("ImageableArea", DefaultPaperSize, + num_defaults = cupsAddOption("ImageableArea", size->name, num_defaults, &defaults); } @@ -6373,6 +6443,9 @@ delete_printer(cupsd_client_t *con, /* I - Client connection */ snprintf(filename, sizeof(filename), "%s/%s.ipp2", CacheDir, printer->name); unlink(filename); + snprintf(filename, sizeof(filename), "%s/%s.pwg", CacheDir, printer->name); + unlink(filename); + #ifdef __APPLE__ /* * Unregister color profiles... diff --git a/scheduler/printers.c b/scheduler/printers.c index b77885cf2..1823e697f 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -51,6 +51,7 @@ * delete_string_array() - Delete an array of CUPS strings. * load_ppd() - Load a cached PPD file, updating the cache as * needed. + * new_media_col() - Create a media-col collection value. * write_irix_config() - Update the config files used by the IRIX * desktop tools. * write_irix_state() - Update the status files used by IRIX printing @@ -64,7 +65,6 @@ #include "cupsd.h" #include <cups/dir.h> -#include <cups/pwgmedia.h> /* @@ -80,6 +80,8 @@ static int compare_printers(void *first, void *second, void *data); static void delete_printer_filters(cupsd_printer_t *p); static void delete_string_array(cups_array_t **a); static void load_ppd(cupsd_printer_t *p); +static ipp_t *new_media_col(_pwg_size_t *size, const char *source, + const char *type); #ifdef __sgi static void write_irix_config(cupsd_printer_t *p); static void write_irix_state(cupsd_printer_t *p); @@ -356,9 +358,12 @@ cupsdCreateCommonData(void) }; static const char * const media_col_supported[] = { /* media-col-supported values */ + "media-bottom-margin", "media-color", - "media-key", + "media-left-margin", + "media-right-margin", "media-size", + "media-top-margin", "media-type" }; static const char * const multiple_document_handling[] = @@ -396,15 +401,37 @@ cupsdCreateCommonData(void) "server-started", "server-stopped" }; + static const char * const job_creation[] = + { /* job-creation-attributes-supported */ + "copies", + "finishings", + "job-hold-until", + "job-name", + "job-priority", + "job-sheets", + "media", + "media-col", + "multiple-document-handling", + "number-up", + "output-bin", + "orientation-requested", + "page-ranges", + "print-quality", + "printer-resolution", + "sides" + }; static const char * const job_settable[] = { /* job-settable-attributes-supported */ "copies", "finishings", "job-hold-until", + "job-name", "job-priority", "media", + "media-col", "multiple-document-handling", "number-up", + "output-bin", "orientation-requested", "page-ranges", "print-quality", @@ -459,6 +486,12 @@ cupsdCreateCommonData(void) "ipp-versions-supported", sizeof(versions) / sizeof(versions[0]), NULL, versions); + /* job-creation-attributes-supported */ + ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_COPY, + "job-creation-attributes-supported", + sizeof(job_creation) / sizeof(job_creation[0]), + NULL, job_creation); + /* job-hold-until-supported */ ippAddStrings(CommonData, IPP_TAG_PRINTER, IPP_TAG_KEYWORD | IPP_TAG_COPY, "job-hold-until-supported", sizeof(holds) / sizeof(holds[0]), @@ -3432,6 +3465,7 @@ add_printer_defaults(cupsd_printer_t *p)/* I - Printer */ cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-priority-default")); cupsArrayAdd(CommonDefaults, _cupsStrAlloc("job-sheets-default")); cupsArrayAdd(CommonDefaults, _cupsStrAlloc("media-default")); + cupsArrayAdd(CommonDefaults, _cupsStrAlloc("media-col-default")); cupsArrayAdd(CommonDefaults, _cupsStrAlloc("number-up-default")); cupsArrayAdd(CommonDefaults, _cupsStrAlloc("orientation-requested-default")); @@ -3890,35 +3924,39 @@ delete_string_array(cups_array_t **a) /* I - Array */ static void load_ppd(cupsd_printer_t *p) /* I - Printer */ { - int i; /* Looping var */ - cups_file_t *cache; /* Cache file */ - char cache_name[1024]; /* Cache filename */ - struct stat cache_info; /* Cache file info */ + int i, j, k; /* Looping vars */ + cups_file_t *cache; /* IPP cache file */ + char cache_name[1024]; /* IPP cache filename */ + struct stat cache_info; /* IPP cache file info */ + char pwg_name[1024]; /* PWG cache filename */ + struct stat pwg_info; /* PWG cache file info */ ppd_file_t *ppd; /* PPD file */ char ppd_name[1024]; /* PPD filename */ struct stat ppd_info; /* PPD file info */ int num_media; /* Number of media options */ - char custom_in[256], /* Custom size name in inches */ - custom_mm[256]; /* Custom size name in millimeters */ - ppd_size_t *size; /* Current size */ + ppd_size_t *size; /* Current PPD size */ ppd_option_t *duplex, /* Duplex option */ *output_bin, /* OutputBin option */ *output_mode, /* OutputMode option */ *resolution; /* (Set|JCL|)Resolution option */ - ppd_choice_t *choice; /* Current PPD choice */ + ppd_choice_t *choice, /* Current PPD choice */ + *input_slot, /* Current input slot */ + *media_type; /* Current media type */ ppd_attr_t *ppd_attr; /* PPD attribute */ int xdpi, /* Horizontal resolution */ ydpi; /* Vertical resolution */ const char *resptr; /* Pointer into resolution keyword */ - _cups_pwg_media_t *pwgmedia; /* Matching PWG size name */ + _pwg_size_t *pwgsize; /* Current PWG size */ + _pwg_map_t *pwgsource, /* Current PWG source */ + *pwgtype; /* Current PWG type */ ipp_attribute_t *attr; /* Attribute data */ - ipp_t *media_col_default, /* media-col-default collection value */ - *media_size; /* media-size collection value */ ipp_value_t *val; /* Attribute value */ int num_finishings, /* Number of finishings */ finishings[5]; /* finishings-supported values */ int num_qualities, /* Number of print-quality values */ qualities[3]; /* print-quality values */ + int num_margins, /* Number of media-*-margin-supported values */ + margins[16]; /* media-*-margin-supported values */ static const char * const sides[3] = /* sides-supported values */ { "one-sided", @@ -3941,6 +3979,10 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ if (stat(cache_name, &cache_info)) cache_info.st_mtime = 0; + snprintf(pwg_name, sizeof(pwg_name), "%s/%s.pwg", CacheDir, p->name); + if (stat(pwg_name, &pwg_info)) + pwg_info.st_mtime = 0; + snprintf(ppd_name, sizeof(ppd_name), "%s/ppd/%s.ppd", ServerRoot, p->name); if (stat(ppd_name, &ppd_info)) ppd_info.st_mtime = 1; @@ -3948,7 +3990,13 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ ippDelete(p->ppd_attrs); p->ppd_attrs = ippNew(); - if (cache_info.st_mtime >= ppd_info.st_mtime && + _pwgDestroy(p->pwg); + p->pwg = NULL; + + if (pwg_info.st_mtime >= ppd_info.st_mtime) + p->pwg = _pwgCreateWithFile(pwg_name); + + if (cache_info.st_mtime >= ppd_info.st_mtime && p->pwg && (cache = cupsFileOpen(cache_name, "r")) != NULL) { /* @@ -3973,6 +4021,9 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ cupsdMarkDirty(CUPSD_DIRTY_PRINTERS); + _pwgDestroy(p->pwg); + p->pwg = NULL; + cupsdLogMessage(CUPSD_LOG_DEBUG, "load_ppd: Loading %s...", ppd_name); delete_string_array(&(p->filters)); @@ -3990,6 +4041,8 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ * Add make/model and other various attributes... */ + p->pwg = _pwgCreateWithPPD(ppd); + ppdMarkDefaults(ppd); if (ppd->color_device) @@ -4080,7 +4133,7 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ * Add media options from the PPD file... */ - if (ppd->num_sizes == 0) + if (ppd->num_sizes == 0 || !p->pwg) { if (!ppdFindAttr(ppd, "APScannerOnly", NULL)) cupsdLogMessage(CUPSD_LOG_CRIT, @@ -4088,104 +4141,284 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ "options and is therefore invalid!", p->name); ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, + "media-default", NULL, "unknown"); + ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-supported", NULL, "unknown"); } else { - num_media = ppd->num_sizes; - if (ppd->variable_sizes) - num_media ++; + /* + * media-default + */ - attr = ippAddStrings(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, - "media-supported", num_media, NULL, NULL); - if (attr != NULL) + if ((size = ppdPageSize(ppd, NULL)) != NULL) + pwgsize = _pwgGetSize(p->pwg, size->name); + else + pwgsize = NULL; + + ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, + "media-default", NULL, + pwgsize ? pwgsize->map.pwg : "unknown"); + + /* + * media-col-default + */ + + if (pwgsize) + { + input_slot = ppdFindMarkedChoice(ppd, "InputSlot"); + media_type = ppdFindMarkedChoice(ppd, "MediaType"); + + ippAddCollection(p->ppd_attrs, IPP_TAG_PRINTER, "media-col-default", + new_media_col(pwgsize, + input_slot ? + _pwgGetSource(p->pwg, + input_slot->choice) : + NULL, + media_type ? + _pwgGetType(p->pwg, + media_type->choice) : + NULL)); + } + + /* + * media-supported + */ + + num_media = p->pwg->num_sizes; + if (p->pwg->custom_min_keyword) + num_media += 2; + + if ((attr = ippAddStrings(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, + "media-supported", num_media, NULL, + NULL)) != NULL) { val = attr->values; - for (i = ppd->num_sizes, size = ppd->sizes; i > 0; i --, size ++) + for (i = p->pwg->num_sizes, pwgsize = p->pwg->sizes; + i > 0; + i --, pwgsize ++, val ++) + val->string.text = _cupsStrRetain(pwgsize->map.pwg); + + if (p->pwg->custom_min_keyword) + { + val->string.text = _cupsStrRetain(p->pwg->custom_min_keyword); + val ++; + val->string.text = _cupsStrRetain(p->pwg->custom_max_keyword); + } + } + + /* + * media-source-supported + */ + + if (p->pwg->num_sources > 0 && + (attr = ippAddStrings(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, + "media-source-supported", p->pwg->num_sources, + NULL, NULL)) != NULL) + { + for (i = p->pwg->num_sources, pwgsource = p->pwg->sources, + val = attr->values; + i > 0; + i --, pwgsource ++, val ++) + val->string.text = _cupsStrRetain(pwgsource->pwg); + } + + /* + * media-type-supported + */ + + if (p->pwg->num_types > 0 && + (attr = ippAddStrings(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, + "media-type-supported", p->pwg->num_types, + NULL, NULL)) != NULL) + { + for (i = p->pwg->num_types, pwgtype = p->pwg->types, + val = attr->values; + i > 0; + i --, pwgtype ++, val ++) + val->string.text = _cupsStrRetain(pwgtype->pwg); + } + + /* + * media-*-margin-supported + */ + + for (i = p->pwg->num_sizes, pwgsize = p->pwg->sizes, num_margins = 0; + i > 0 && num_margins < (int)(sizeof(margins) / sizeof(margins[0])); + i --, pwgsize ++) + { + for (j = 0; j < num_margins; j ++) + if (pwgsize->bottom == margins[j]) + break; + + if (j >= num_margins) + { + margins[num_margins] = pwgsize->bottom; + num_margins ++; + } + } + + if (num_margins > 0) + ippAddIntegers(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "media-bottom-margin-supported", num_margins, margins); + else + ippAddInteger(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "media-bottom-margin-supported", 0); + + for (i = p->pwg->num_sizes, pwgsize = p->pwg->sizes, num_margins = 0; + i > 0 && num_margins < (int)(sizeof(margins) / sizeof(margins[0])); + i --, pwgsize ++) + { + for (j = 0; j < num_margins; j ++) + if (pwgsize->left == margins[j]) + break; + + if (j >= num_margins) { - if (strcasecmp(size->name, "Custom")) + margins[num_margins] = pwgsize->left; + num_margins ++; + } + } + + if (num_margins > 0) + ippAddIntegers(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "media-left-margin-supported", num_margins, margins); + else + ippAddInteger(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "media-left-margin-supported", 0); + + for (i = p->pwg->num_sizes, pwgsize = p->pwg->sizes, num_margins = 0; + i > 0 && num_margins < (int)(sizeof(margins) / sizeof(margins[0])); + i --, pwgsize ++) + { + for (j = 0; j < num_margins; j ++) + if (pwgsize->right == margins[j]) + break; + + if (j >= num_margins) + { + margins[num_margins] = pwgsize->right; + num_margins ++; + } + } + + if (num_margins > 0) + ippAddIntegers(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "media-right-margin-supported", num_margins, margins); + else + ippAddInteger(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "media-right-margin-supported", 0); + + for (i = p->pwg->num_sizes, pwgsize = p->pwg->sizes, num_margins = 0; + i > 0 && num_margins < (int)(sizeof(margins) / sizeof(margins[0])); + i --, pwgsize ++) + { + for (j = 0; j < num_margins; j ++) + if (pwgsize->top == margins[j]) + break; + + if (j >= num_margins) + { + margins[num_margins] = pwgsize->top; + num_margins ++; + } + } + + if (num_margins > 0) + ippAddIntegers(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "media-top-margin-supported", num_margins, margins); + else + ippAddInteger(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "media-top-margin-supported", 0); + + /* + * media-col-database + */ + + num_media = p->pwg->num_sizes; + if (p->pwg->num_sources) + { + if (p->pwg->num_types > 0) + num_media += p->pwg->num_sizes * p->pwg->num_sources * + p->pwg->num_types; + else + num_media += p->pwg->num_sizes * p->pwg->num_sources; + } + else if (p->pwg->num_types) + num_media += p->pwg->num_sizes * p->pwg->num_types; + + if ((attr = ippAddCollections(p->ppd_attrs, IPP_TAG_PRINTER, + "media-col-database", num_media, + NULL)) != NULL) + { + for (i = p->pwg->num_sizes, pwgsize = p->pwg->sizes, val = attr->values; + i > 0; + i --, pwgsize ++) + { + /* + * Start by adding the page size without source or type... + */ + + ppdMarkOption(ppd, "PageSize", pwgsize->map.ppd); + + val->collection = new_media_col(pwgsize, NULL, NULL); + val ++; + + /* + * Then add the specific, supported combinations of size, source, and + * type... + */ + + if (p->pwg->num_sources > 0) { - if ((pwgmedia = _cupsPWGMediaBySize(size->width, - size->length)) != NULL) - { - val->string.text = _cupsStrAlloc(pwgmedia->pwg); - } - else + for (j = p->pwg->num_sources, pwgsource = p->pwg->sources; + j > 0; + j --, pwgsource ++) { - snprintf(custom_in, sizeof(custom_in), "adobe_%s_%gx%gin", - size->name, size->width / 72.0, size->length / 72.0); - snprintf(custom_mm, sizeof(custom_mm), "adobe_%s_%gx%gmm", - size->name, size->width * 25.4 / 72.0, - size->length * 25.4 / 72.0); - if (strlen(custom_in) < strlen(custom_mm)) - val->string.text = _cupsStrAlloc(custom_in); - else - val->string.text = _cupsStrAlloc(custom_mm); - } + ppdMarkOption(ppd, "InputSlot", pwgsource->ppd); - if (size->marked) + if (p->pwg->num_types > 0) + { + for (k = p->pwg->num_types, pwgtype = p->pwg->types; + k > 0; + k --, pwgtype ++) + { + if (!ppdMarkOption(ppd, "MediaType", pwgtype->ppd)) + { + val->collection = new_media_col(pwgsize, pwgsource->pwg, + pwgtype->pwg); + val ++; + } + } + } + else if (!ppdConflicts(ppd)) + { + val->collection = new_media_col(pwgsize, pwgsource->pwg, NULL); + val ++; + } + } + } + else if (p->pwg->num_types > 0) + { + for (j = p->pwg->num_types, pwgtype = p->pwg->types; + j > 0; + j --, pwgtype ++) { - /* - * Add media-default... - */ - - ippAddString(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, - "media-default", NULL, val->string.text); - - /* - * Add media-col-default... - */ - - media_size = ippNew(); - ippAddInteger(media_size, IPP_TAG_PRINTER, IPP_TAG_INTEGER, - "x-dimension", (int)(size->width * 2540.0 / 72.0)); - ippAddInteger(media_size, IPP_TAG_PRINTER, IPP_TAG_INTEGER, - "y-dimension", (int)(size->length * 2540.0 / 72.0)); - - media_col_default = ippNew(); - ippAddString(media_col_default, IPP_TAG_PRINTER, - IPP_TAG_KEYWORD | IPP_TAG_COPY, "media-color", NULL, - "white"); - ippAddString(media_col_default, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, - "media-key", NULL,val->string.text); - ippAddCollection(media_col_default, IPP_TAG_PRINTER, "media-size", - media_size); - ippAddString(media_col_default, IPP_TAG_PRINTER, - IPP_TAG_KEYWORD | IPP_TAG_COPY, "media-type", NULL, - "stationary"); - - ippAddCollection(p->ppd_attrs, IPP_TAG_PRINTER, - "media-col-default", media_col_default); + if (!ppdMarkOption(ppd, "MediaType", pwgtype->ppd)) + { + val->collection = new_media_col(pwgsize, NULL, pwgtype->pwg); + val ++; + } } - - val ++; } } - if (ppd->variable_sizes) - { - snprintf(custom_in, sizeof(custom_in), "custom_min_%gx%gin", - ppd->custom_min[0] / 72.0, ppd->custom_min[1] / 72.0); - snprintf(custom_mm, sizeof(custom_mm), "custom_min_%gx%gmm", - ppd->custom_min[0] * 25.4 / 72.0, - ppd->custom_min[1] * 25.4 / 72.0); - if (strlen(custom_in) < strlen(custom_mm)) - val->string.text = _cupsStrAlloc(custom_in); - else - val->string.text = _cupsStrAlloc(custom_mm); - val ++; + /* + * Update the number of media-col-database values... + */ - snprintf(custom_in, sizeof(custom_in), "custom_max_%gx%gin", - ppd->custom_max[0] / 72.0, ppd->custom_max[1] / 72.0); - snprintf(custom_mm, sizeof(custom_mm), "custom_max_%gx%gmm", - ppd->custom_max[0] * 25.4 / 72.0, - ppd->custom_max[1] * 25.4 / 72.0); - if (strlen(custom_in) < strlen(custom_mm)) - val->string.text = _cupsStrAlloc(custom_in); - else - val->string.text = _cupsStrAlloc(custom_mm); - } + attr->num_values = val - attr->values; } } @@ -4684,7 +4917,7 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ ippAddInteger(p->ppd_attrs, IPP_TAG_PRINTER, IPP_TAG_ENUM, "finishings-default", IPP_FINISHINGS_NONE); - if (ppd && (cache = cupsFileOpen(cache_name, "w")) != NULL) + if (ppd && (cache = cupsFileOpen(cache_name, "w9")) != NULL) { /* * Save cached PPD attributes to disk... @@ -4704,18 +4937,67 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ } cupsFileClose(cache); + + _pwgWriteFile(p->pwg, pwg_name); } - else if (cache_info.st_mtime) + else { /* - * Remove cache file... + * Remove cache files... */ - unlink(cache_name); + if (cache_info.st_mtime) + unlink(cache_name); + + if (pwg_info.st_mtime) + unlink(pwg_name); } } +/* + * 'new_media_col()' - Create a media-col collection value. + */ + +static ipp_t * /* O - Collection value */ +new_media_col(_pwg_size_t *size, /* I - media-size/margin values */ + const char *source, /* I - media-source value */ + const char *type) /* I - media-type value */ +{ + ipp_t *media_col, /* Collection value */ + *media_size; /* media-size value */ + + + media_col = ippNew(); + + media_size = ippNew(); + ippAddInteger(media_size, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "x-dimension", size->width); + ippAddInteger(media_size, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "y-dimension", size->length); + + ippAddCollection(media_col, IPP_TAG_PRINTER, "media-size", media_size); + ippAddInteger(media_col, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "media-bottom-margin", size->bottom); + ippAddInteger(media_col, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "media-left-margin", size->left); + ippAddInteger(media_col, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "media-right-margin", size->right); + ippAddInteger(media_col, IPP_TAG_PRINTER, IPP_TAG_INTEGER, + "media-top-margin", size->top); + + if (source) + ippAddString(media_col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-source", + NULL, source); + + if (type) + ippAddString(media_col, IPP_TAG_PRINTER, IPP_TAG_KEYWORD, "media-type", + NULL, type); + + return (media_col); +} + + #ifdef __sgi /* * 'write_irix_config()' - Update the config files used by the IRIX diff --git a/scheduler/printers.h b/scheduler/printers.h index 327909240..f594a2492 100644 --- a/scheduler/printers.h +++ b/scheduler/printers.h @@ -16,6 +16,8 @@ #ifdef HAVE_DNSSD # include <dns_sd.h> #endif /* HAVE_DNSSD */ +#include <cups/pwg-private.h> + /* * Quota data... @@ -94,6 +96,7 @@ typedef struct cupsd_printer_s time_t marker_time; /* Last time marker attributes were updated */ cups_array_t *filters, /* Filters for queue */ *pre_filters; /* Pre-filters for queue */ + _pwg_t *pwg; /* PWG<->PPD mapping data */ #ifdef HAVE_DNSSD char *reg_name, /* Name used for service registration */ |