mfc9420cncups_src/0040755000000000000000000000000010303510312012713 5ustar rootrootmfc9420cncups_src/SCRIPT/0040755000000000000000000000000010303510106013720 5ustar rootrootmfc9420cncups_src/SCRIPT/cupswrapperMFC9420CN0100755000000000000000000006345410303510106017320 0ustar rootroot#! /bin/sh # # Brother Print filter # Copyright (C) 2005 Brother. Industries, Ltd. # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place, Suite 330, Boston, MA 02111-1307 USA # if [ "$1" = '-e' ]; then lpadmin -x MFC9420CN rm -f /usr/share/cups/model/brmfc9420cn.ppd rm -f /usr/lib/cups/filter/brlpdwrapperMFC9420CN rm -f /usr/lib64/cups/filter/brlpdwrapperMFC9420CN rm -f /usr/local/Brother/cupswrapper/brcupsconfcl1 if [ -e /etc/init.d/cups ]; then /etc/init.d/cups restart elif [ -e /etc/init.d/cupsys ]; then /etc/init.d/cupsys restart fi # /etc/init.d/cups restart exit 0 fi if [ "$1" = "-r" ]; then lpadmin -x MFC9420CN if [ -e /etc/init.d/cups ]; then /etc/init.d/cups restart elif [ -e /etc/init.d/cupsys ]; then /etc/init.d/cupsys restart fi # /etc/init.d/cups restart exit 0 fi if [ "$1" = "help" ] || [ "$1" = "-h" ]; then echo 'option -h : help' echo ' -i : install' echo ' -e : uninstall' echo ' -r : remove printer' exit 0 fi mkdir -p /usr/local/Brother/filter mkdir -p /usr/lib/cups/filter if [ -e "/usr/local/Brother/lpd/filterMFC9420CN" ]; then : else echo "ERROR : Brother LPD filter is not installed." fi rm -f /usr/share/cups/model/brmfc9420cn.ppd ppd_file_name=/usr/share/cups/model/brmfc9420cn.ppd cat <$ppd_file_name *PPD-Adobe: "4.3" *%================================================ *% Copyright(C) 2005 Brother Industries, Ltd. *% "Brother MFC-9420CN series CUPS" *%================================================ *%==== General Information Keywords ======================== *FormatVersion: "4.3" *FileVersion: "1.0.0" *LanguageVersion: English *LanguageEncoding: ISOLatin1 *PCFileName: "MFC9420CN.PPD" *Manufacturer: "Brother" *Product: "(MFC-9420CN series)" *1284DeviceID: "MFG:Brother;MDL:MFC-9420CN series" *cupsVersion: 1.1 *cupsManualCopies: False *cupsFilter: "application/vnd.cups-postscript 0 brlpdwrapperMFC9420CN" *cupsModelNumber: 1 *ModelName: "Brother MFC-9420CN series" *ShortNickName: "Brother MFC-9420CN series" *NickName: "Brother MFC-9420CN series CUPS v1.1" *PSVersion: "(3010.106) 3" *%==== Basic Device Capabilities ============= *LanguageLevel: "3" *ColorDevice: True *DefaultColorSpace: RGB *FileSystem: False *Throughput: "12" *LandscapeOrientation: Plus90 *VariablePaperSize: False *TTRasterizer: Type42 *FreeVM: "1700000" *%DefaultOutputOrder: Reverse *%==== Installable Options =================== *OpenGroup: InstallableOptions/Options Installed *OpenUI *OptionTrays/Number of Input Trays: PickOne *DefaultOptionTrays: 2Trays *OptionTrays 1Trays/ 1: "" *OptionTrays 2Trays/ 2: "" *?OptionTrays:" save <>setpagedevice currentpagedevice/BRFeeder get 1 eq{(2Trays)}{(1Trays)}ifelse = flush restore " *End *CloseUI: *OptionTrays *CloseGroup: InstallableOptions *UIConstraints: *OptionTrays 1Trays *InputSlot Tray2 *UIConstraints: *InputSlot Tray2 *OptionTrays 1Trays *%==== Media Selection ====================== *OpenUI *PageSize/Media Size: PickOne *OrderDependency: 11 AnySetup *PageSize *DefaultPageSize: BrLetter *PageSize BrA4/A4: "<>setpagedevice" *PageSize BrLetter/Letter: "<>setpagedevice" *PageSize BrLegal/Legal: "<>setpagedevice" *PageSize BrExecutive/Executive: "<>setpagedevice" *PageSize BrA5/A5: "<>setpagedevice" *PageSize BrJISB5/JIS B5: "<>setpagedevice" *PageSize BrB5/B5: "<>setpagedevice" *PageSize BrCom10/Com-10: "<>setpagedevice" *PageSize BrDL/DL: "<>setpagedevice" *CloseUI: *PageSize *OpenUI *PageRegion: PickOne *OrderDependency: 12 AnySetup *PageRegion *DefaultPageRegion: BrLetter *PageRegion BrA4/A4: "<>setpagedevice" *PageRegion BrLetter/Letter: "<>setpagedevice" *PageRegion BrLegal/Legal: "<>setpagedevice" *PageRegion BrExecutive/Executive: "<>setpagedevice" *PageRegion BrA5/A5: "<>setpagedevice" *PageRegion BrJISB5/JIS B5: "<>setpagedevice" *PageRegion BrB5/B5: "<>setpagedevice" *PageRegion BrCom10/Com-10: "<>setpagedevice" *PageRegion BrDL/DL: "<>setpagedevice" *CloseUI: *PageRegion *DefaultImageableArea: BrLetter *ImageableArea BrA4/A4: "12 12 583 830" *ImageableArea BrLetter/Letter: "12 12 600 780" *ImageableArea BrLegal/Legal: "12 12 600 996" *ImageableArea BrExecutive/Executive: "12 12 510 744" *ImageableArea BrA5/A5: "12 12 408 583" *ImageableArea BrJISB5/JIS B5: "12 12 504 717" *ImageableArea BrB5/B5: "12 12 487 697" *ImageableArea BrCom10/Com-10: "12 12 285 672" *ImageableArea BrDL/DL: "12 12 300 612" *%==== Information About Media Sizes ======== *DefaultPaperDimension: BrLetter *PaperDimension BrA4/A4: "595 842" *PaperDimension BrLetter/Letter: "612 792" *PaperDimension BrLegal/Legal: "612 1008" *PaperDimension BrExecutive/Executive: "522 756" *PaperDimension BrA5/A5: "420 595" *PaperDimension BrJISB5/JIS B5: "516 729" *PaperDimension BrB5/B5: "499 709" *PaperDimension BrCom10/Com-10: "297 684" *PaperDimension BrDL/DL: "312 624" *%==== Custom Page Sizes ==================== *NonUIOrderDependency: 40 AnySetup *CustomPageSize *VariablePaperSize: True *LeadingEdge Short: "" *DefaultLeadingEdge: Short *MaxMediaWidth: "612" *MaxMediaHeight: "1008" *HWMargins: 12 12 12 12 *CustomPageSize True: " <> setpagedevice pop pop pop << /PageSize [ 5 -2 roll ] /ImagingBBox null >> setpagedevice " *End *ParamCustomPageSize Width: 1 points 284 612 *ParamCustomPageSize Height: 2 points 595 1008 *ParamCustomPageSize WidthOffset: 3 points 0 0 *ParamCustomPageSize HeightOffset: 4 points 0 0 *ParamCustomPageSize Orientation: 5 int 0 3 *%=== Paper Feed================================ *OpenUI *InputSlot: PickOne *OrderDependency: 13 AnySetup *InputSlot *DefaultInputSlot: AutoSelect *InputSlot AutoSelect/Auto Select: "" *InputSlot Tray1/Tray1: "" *InputSlot Tray2/Tray2: "" *CloseUI: *InputSlot *%==== Resolution Features ================================= *OpenUI *Resolution/Media Type/Print Quality: PickOne *OrderDependency: 14 AnySetup *Resolution *DefaultResolution: Normal *Resolution Normal/Normal (600 x 600 dpi): "" *Resolution CAPT/Fine (2400 dpi class): "" *CloseUI: *Resolution *%=== CAPT ================================ *OpenUI *BRCAPT/with CAPT (2400 dpi class): PickOne *OrderDependency: 15 AnySetup *BRCAPT *DefaultBRCAPT: OFF *BRCAPT OFF/OFF: "" *BRCAPT ON/ON: "" *CloseUI: *BRCAPT *%=== MonoOrColor ================================ *OpenUI *MonoColor/Color/Mono: PickOne *OrderDependency: 16 AnySetup *MonoColor *DefaultMonoColor: BrFullColor *MonoColor BrFullColor/Full Color: "" *MonoColor BrMono/Mono: "" *MonoColor BrB&C/Black & Cyan: "" *MonoColor BrB&M/Black & Magenta: "" *MonoColor BrB&Y/Black & Yellow: "" *CloseUI: *MonoColor *%=== LandscapeAdjustment ================================ *OpenUI *LandscapeAdjustment/Landscape Adjustment: PickOne *OrderDependency: 40 AnySetup *LandscapeAdjustment *DefaultLandscapeAdjustment: BrNormal *LandscapeAdjustment BrNormal/Normal: *LandscapeAdjustment BrAdjust/Adjust: *CloseUI: *LandscapeAdjustment *%=== Media Type ================================ *OpenUI *MediaType/Media Type: PickOne *OrderDependency: 17 AnySetup *MediaType *DefaultMediaType: Plain *MediaType Plain/Plain Paper: "" *MediaType Thin/Thin Paper: "" *MediaType Thick/Thick Paper: "" *MediaType Thicker/Thicker Paper: "" *MediaType Transparencies/Transparencies: "" *MediaType Recycled/Recycled Paper: "" *CloseUI: *MediaType *%===Color Matching ================================ *OpenUI *BRColorMatching/Color Mode: PickOne *OrderDependency: 18 AnySetup *BRColorMatching *DefaultBRColorMatching: MatchMonitor *BRColorMatching MatchMonitor/Match Monitor (Recommended): "" *BRColorMatching VividText/Vivid/Text: "" *BRColorMatching None/None: "" *CloseUI: *BRColorMatching *%=== Improve Gray Color ================================ *OpenUI *BRGray/Improve Gray Color: PickOne *OrderDependency: 19 AnySetup *BRGray *DefaultBRGray: OFF *BRGray OFF/OFF: "" *BRGray ON/ON: "" *CloseUI: *BRGray *%=== Enhance Black Printing ================================ *OpenUI *BREnhanceBlkPrt/Enhance Black Printing: PickOne *OrderDependency: 20 AnySetup *BREnhanceBlkPrt *DefaultBREnhanceBlkPrt: OFF *BREnhanceBlkPrt OFF/OFF: "" *BREnhanceBlkPrt ON/ON: "" *CloseUI: *BREnhanceBlkPrt *%=== Mirror Printing ================================ *OpenUI *BRMirror/Mirror Printing: PickOne *OrderDependency: 21 AnySetup *BRMirror *DefaultBRMirror: OFF *BRMirror OFF/OFF: "" *BRMirror ON/ON: "" *CloseUI: *BRMirror *%=== Brightness ================================ *OpenUI *BRBrightness/Brightness: PickOne *OrderDependency: 22 AnySetup *BRBrightness *DefaultBRBrightness: 0 *BRBrightness -20/-20: "" *BRBrightness -19/-19: "" *BRBrightness -18/-18: "" *BRBrightness -17/-17: "" *BRBrightness -16/-16: "" *BRBrightness -15/-15: "" *BRBrightness -14/-14: "" *BRBrightness -13/-13: "" *BRBrightness -12/-12: "" *BRBrightness -11/-11: "" *BRBrightness -10/-10: "" *BRBrightness -9/-9: "" *BRBrightness -8/-8: "" *BRBrightness -7/-7: "" *BRBrightness -6/-6: "" *BRBrightness -5/-5: "" *BRBrightness -4/-4: "" *BRBrightness -3/-3: "" *BRBrightness -2/-2: "" *BRBrightness -1/-1: "" *BRBrightness 0/0: "" *BRBrightness 1/1: "" *BRBrightness 2/2: "" *BRBrightness 3/3: "" *BRBrightness 4/4: "" *BRBrightness 5/5: "" *BRBrightness 6/6: "" *BRBrightness 7/7: "" *BRBrightness 8/8: "" *BRBrightness 9/9: "" *BRBrightness 10/10: "" *BRBrightness 11/11: "" *BRBrightness 12/12: "" *BRBrightness 13/13: "" *BRBrightness 14/14: "" *BRBrightness 15/15: "" *BRBrightness 16/16: "" *BRBrightness 17/17: "" *BRBrightness 18/18: "" *BRBrightness 19/19: "" *BRBrightness 20/20: "" *CloseUI: *BRBrightness *%=== Contrast ================================ *OpenUI *BRContrast/Contrast: PickOne *OrderDependency: 23 AnySetup *BRContrast *DefaultBRContrast: 0 *BRContrast -20/-20: "" *BRContrast -19/-19: "" *BRContrast -18/-18: "" *BRContrast -17/-17: "" *BRContrast -16/-16: "" *BRContrast -15/-15: "" *BRContrast -14/-14: "" *BRContrast -13/-13: "" *BRContrast -12/-12: "" *BRContrast -11/-11: "" *BRContrast -10/-10: "" *BRContrast -9/-9: "" *BRContrast -8/-8: "" *BRContrast -7/-7: "" *BRContrast -6/-6: "" *BRContrast -5/-5: "" *BRContrast -4/-4: "" *BRContrast -3/-3: "" *BRContrast -2/-2: "" *BRContrast -1/-1: "" *BRContrast 0/0: "" *BRContrast 1/1: "" *BRContrast 2/2: "" *BRContrast 3/3: "" *BRContrast 4/4: "" *BRContrast 5/5: "" *BRContrast 6/6: "" *BRContrast 7/7: "" *BRContrast 8/8: "" *BRContrast 9/9: "" *BRContrast 10/10: "" *BRContrast 11/11: "" *BRContrast 12/12: "" *BRContrast 13/13: "" *BRContrast 14/14: "" *BRContrast 15/15: "" *BRContrast 16/16: "" *BRContrast 17/17: "" *BRContrast 18/18: "" *BRContrast 19/19: "" *BRContrast 20/20: "" *CloseUI: *BRContrast *%=== Red ================================ *OpenUI *BRRed/Red: PickOne *OrderDependency: 24 AnySetup *BRRed *DefaultBRRed: 0 *BRRed -20/-20: "" *BRRed -19/-19: "" *BRRed -18/-18: "" *BRRed -17/-17: "" *BRRed -16/-16: "" *BRRed -15/-15: "" *BRRed -14/-14: "" *BRRed -13/-13: "" *BRRed -12/-12: "" *BRRed -11/-11: "" *BRRed -10/-10: "" *BRRed -9/-9: "" *BRRed -8/-8: "" *BRRed -7/-7: "" *BRRed -6/-6: "" *BRRed -5/-5: "" *BRRed -4/-4: "" *BRRed -3/-3: "" *BRRed -2/-2: "" *BRRed -1/-1: "" *BRRed 0/0: "" *BRRed 1/1: "" *BRRed 2/2: "" *BRRed 3/3: "" *BRRed 4/4: "" *BRRed 5/5: "" *BRRed 6/6: "" *BRRed 7/7: "" *BRRed 8/8: "" *BRRed 9/9: "" *BRRed 10/10: "" *BRRed 11/11: "" *BRRed 12/12: "" *BRRed 13/13: "" *BRRed 14/14: "" *BRRed 15/15: "" *BRRed 16/16: "" *BRRed 17/17: "" *BRRed 18/18: "" *BRRed 19/19: "" *BRRed 20/20: "" *CloseUI: *BRRed *%=== Green ================================ *OpenUI *BRGreen/Green: PickOne *OrderDependency: 25 AnySetup *BRGreen *DefaultBRGreen: 0 *BRGreen -20/-20: "" *BRGreen -19/-19: "" *BRGreen -18/-18: "" *BRGreen -17/-17: "" *BRGreen -16/-16: "" *BRGreen -15/-15: "" *BRGreen -14/-14: "" *BRGreen -13/-13: "" *BRGreen -12/-12: "" *BRGreen -11/-11: "" *BRGreen -10/-10: "" *BRGreen -9/-9: "" *BRGreen -8/-8: "" *BRGreen -7/-7: "" *BRGreen -6/-6: "" *BRGreen -5/-5: "" *BRGreen -4/-4: "" *BRGreen -3/-3: "" *BRGreen -2/-2: "" *BRGreen -1/-1: "" *BRGreen 0/0: "" *BRGreen 1/1: "" *BRGreen 2/2: "" *BRGreen 3/3: "" *BRGreen 4/4: "" *BRGreen 5/5: "" *BRGreen 6/6: "" *BRGreen 7/7: "" *BRGreen 8/8: "" *BRGreen 9/9: "" *BRGreen 10/10: "" *BRGreen 11/11: "" *BRGreen 12/12: "" *BRGreen 13/13: "" *BRGreen 14/14: "" *BRGreen 15/15: "" *BRGreen 16/16: "" *BRGreen 17/17: "" *BRGreen 18/18: "" *BRGreen 19/19: "" *BRGreen 20/20: "" *CloseUI: *BRGreen *%=== Blue ================================ *OpenUI *BRBlue/Blue: PickOne *OrderDependency: 26 AnySetup *BRBlue *DefaultBRBlue: 0 *BRBlue -20/-20: "" *BRBlue -19/-19: "" *BRBlue -18/-18: "" *BRBlue -17/-17: "" *BRBlue -16/-16: "" *BRBlue -15/-15: "" *BRBlue -14/-14: "" *BRBlue -13/-13: "" *BRBlue -12/-12: "" *BRBlue -11/-11: "" *BRBlue -10/-10: "" *BRBlue -9/-9: "" *BRBlue -8/-8: "" *BRBlue -7/-7: "" *BRBlue -6/-6: "" *BRBlue -5/-5: "" *BRBlue -4/-4: "" *BRBlue -3/-3: "" *BRBlue -2/-2: "" *BRBlue -1/-1: "" *BRBlue 0/0: "" *BRBlue 1/1: "" *BRBlue 2/2: "" *BRBlue 3/3: "" *BRBlue 4/4: "" *BRBlue 5/5: "" *BRBlue 6/6: "" *BRBlue 7/7: "" *BRBlue 8/8: "" *BRBlue 9/9: "" *BRBlue 10/10: "" *BRBlue 11/11: "" *BRBlue 12/12: "" *BRBlue 13/13: "" *BRBlue 14/14: "" *BRBlue 15/15: "" *BRBlue 16/16: "" *BRBlue 17/17: "" *BRBlue 18/18: "" *BRBlue 19/19: "" *BRBlue 20/20: "" *CloseUI: *BRBlue *%=== Saturation ================================ *OpenUI *BRSaturation/Saturation: PickOne *OrderDependency: 27 AnySetup *BRSaturation *DefaultBRSaturation: 0 *BRSaturation -20/-20: "" *BRSaturation -19/-19: "" *BRSaturation -18/-18: "" *BRSaturation -17/-17: "" *BRSaturation -16/-16: "" *BRSaturation -15/-15: "" *BRSaturation -14/-14: "" *BRSaturation -13/-13: "" *BRSaturation -12/-12: "" *BRSaturation -11/-11: "" *BRSaturation -10/-10: "" *BRSaturation -9/-9: "" *BRSaturation -8/-8: "" *BRSaturation -7/-7: "" *BRSaturation -6/-6: "" *BRSaturation -5/-5: "" *BRSaturation -4/-4: "" *BRSaturation -3/-3: "" *BRSaturation -2/-2: "" *BRSaturation -1/-1: "" *BRSaturation 0/0: "" *BRSaturation 1/1: "" *BRSaturation 2/2: "" *BRSaturation 3/3: "" *BRSaturation 4/4: "" *BRSaturation 5/5: "" *BRSaturation 6/6: "" *BRSaturation 7/7: "" *BRSaturation 8/8: "" *BRSaturation 9/9: "" *BRSaturation 10/10: "" *BRSaturation 11/11: "" *BRSaturation 12/12: "" *BRSaturation 13/13: "" *BRSaturation 14/14: "" *BRSaturation 15/15: "" *BRSaturation 16/16: "" *BRSaturation 17/17: "" *BRSaturation 18/18: "" *BRSaturation 19/19: "" *BRSaturation 20/20: "" *CloseUI: *BRSaturation *OpenUI *TonerSaveMode/Toner Save Mode: PickOne *OrderDependency: 29 AnySetup *TonerSaveMode *DefaultTonerSaveMode: OFF *TonerSaveMode OFF/OFF: "statusdict begin false tonersave end" *TonerSaveMode ON/ON: "statusdict begin true tonersave end" *CloseUI: *TonerSaveMode *%==== Sleep Time ============================ *OpenUI *BRSleepTime: PickOne *OrderDependency: 30 AnySetup *BRSleepTime *DefaultBRSleepTime: 5 *BRSleepTime 5/5: "" *BRSleepTime 10/10: "" *CloseUI: *BRSleepTime *%==== Sleep Time ============================ *OpenUI *BRHRC/HRC: PickOne *OrderDependency: 31 AnySetup *BRHRC *DefaultBRHRC: Default *BRHRC Default/Printer Default: "" *BRHRC Light/Light: "" *BRHRC Medium/Medium: "" *BRHRC Dark/Dark: "" *BRHRC Off/Off: "" *CloseUI: *BRHRC *%=== Reverse Printing ================================ *%OpenUI *BRReverse/Reverse Printing: PickOne *%OrderDependency: 32 AnySetup *BRReverse *%DefaultBRReverse: OFF *%BRReverse OFF/OFF: "" *%BRReverse ON/ON: "" *%CloseUI: *BRReverse *DefaultFont: Courier *Font AvantGarde-Book: Standard "(001.006S)" Standard ROM *Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM *Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM *Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM *Font Bookman-Demi: Standard "(001.004S)" Standard ROM *Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM *Font Bookman-Light: Standard "(001.004S)" Standard ROM *Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM *Font Courier: Standard "(002.004S)" Standard ROM *Font Courier-Bold: Standard "(002.004S)" Standard ROM *Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM *Font Courier-Oblique: Standard "(002.004S)" Standard ROM *Font Helvetica: Standard "(001.006S)" Standard ROM *Font Helvetica-Bold: Standard "(001.007S)" Standard ROM *Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM *Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM *Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM *Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM *Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM *Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM *Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM *Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM *Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM *Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM *Font Palatino-Bold: Standard "(001.005S)" Standard ROM *Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM *Font Palatino-Italic: Standard "(001.005S)" Standard ROM *Font Palatino-Roman: Standard "(001.005S)" Standard ROM *Font Times-Bold: Standard "(001.007S)" Standard ROM *Font Times-BoldItalic: Standard "(001.009S)" Standard ROM *Font Times-Italic: Standard "(001.007S)" Standard ROM *Font Times-Roman: Standard "(001.007S)" Standard ROM *Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM *Font ZapfDingbats: Special "(001.004S)" Special ROM *Font Symbol: Special "(001.007S)" Special ROM *Font Alaska: Standard "(001.005)" Standard ROM *Font AlaskaExtrabold: Standard "(001.005)" Standard ROM *Font AntiqueOakland: Standard "(001.005)" Standard ROM *Font AntiqueOakland-Bold: Standard "(001.005)" Standard ROM *Font AntiqueOakland-Oblique: Standard "(001.005)" Standard ROM *Font ClevelandCondensed: Standard "(001.005)" Standard ROM *Font Connecticut: Standard "(001.005)" Standard ROM *Font Guatemala-Antique: Standard "(001.005)" Standard ROM *Font Guatemala-Bold: Standard "(001.005)" Standard ROM *Font Guatemala-Italic: Standard "(001.005)" Standard ROM *Font Guatemala-BoldItalic: Standard "(001.005)" Standard ROM *Font LetterGothic: Standard "(001.005)" Standard ROM *Font LetterGothic-Bold: Standard "(001.005)" Standard ROM *Font LetterGothic-Oblique: Standard "(001.005)" Standard ROM *Font Maryland: Standard "(001.005)" Standard ROM *Font Oklahoma: Standard "(001.005)" Standard ROM *Font Oklahoma-Bold: Standard "(001.005)" Standard ROM *Font Oklahoma-Oblique: Standard "(001.005)" Standard ROM *Font Oklahoma-BoldOblique: Standard "(001.005)" Standard ROM *Font Utah: Standard "(001.005)" Standard ROM *Font Utah-Bold: Standard "(001.005)" Standard ROM *Font Utah-Oblique: Standard "(001.005)" Standard ROM *Font Utah-BoldOblique: Standard "(001.005)" Standard ROM *Font UtahCondensed: Standard "(001.005)" Standard ROM *Font UtahCondensed-Bold: Standard "(001.005)" Standard ROM *Font UtahCondensed-Oblique: Standard "(001.004)" Standard ROM *Font UtahCondensed-BoldOblique: Standard "(001.005)" Standard ROM *Font BermudaScript: Standard "(001.005)" Standard ROM *Font Germany: Standard "(001.005)" Standard ROM *Font SanDiego: Standard "(001.005)" Standard ROM *Font US-Roman: Standard "(001.005)" Standard ROM *?FontQuery: " save count 1 gt {exch dup dup =string cvs (/) print print (:) print FontDirectory exch known {pop(Yes)} {(fonts/)AppendName exch pop mark exch {}=string filenameforall counttomark 0 gt {cleartomark(Yes)} {cleartomark(No)}ifelse }ifelse = }if (*) = flush restore " *End *?FontList: " save FontDirectory{pop ==}forall (fonts/*) {dup length 6 sub 6 exch getinterval cvn == }=string filenameforall (*) = flush restore " *End ENDOFPPDFILE brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapperMFC9420CN brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapperMFC9420CN rm -f $brotherlpdwrapper #echo 'rm -f /usr/lib/cups/filter/brlpdwrapperMFC9420CN' cat <$brotherlpdwrapper #! /bin/sh # # Brother Print filter >> $brotherlpdwrapper # Copyright (C) 2005 Brother. Industries, Ltd. # Ver1.10 # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place, Suite 330, Boston, MA 02111-1307 USA # LOGFILE="/dev/null" LOGLEVEL="1" LOGCLEVEL="7" DEBUG=0 NUPENABLE=1 LOG_LATESTONLY=1 errorcode=0 if [ \$DEBUG != 0 ]; then LOGFILE=/tmp/br_cupsfilter_debug_log fi PRINTER=MFC9420CN PPDC=\`printenv | grep "PPD="\` \$PPDC if [ "\$PPD" = "" ]; then PPD="/usr/share/cups/model/brmfc9420cn.ppd" fi if [ \$LOGFILE != "/dev/null" ]; then if [ \$LOG_LATESTONLY == "1" ]; then rm -f \$LOGFILE date >\$LOGFILE else if [ -e \$LOGFILE ]; then date >>\$LOGFILE else date >\$LOGFILE fi fi echo "arg0 = \$0" >>\$LOGFILE echo "arg1 = \$1" >>\$LOGFILE echo "arg2 = \$2" >>\$LOGFILE echo "arg3 = \$3" >>\$LOGFILE echo "arg4 = \$4" >>\$LOGFILE echo "arg5 = \$5" >>\$LOGFILE echo "arg6 = \$6" >>\$LOGFILE echo "PPD = \$PPD" >>\$LOGFILE fi INPUT_TEMP_PS=\`mktemp /tmp/br_input_ps.XXXXXX\` nup="cat" if [ "\`echo \$5 | grep 'Nup='\`" != '' ] && [ \$NUPENABLE != 0 ]; then if [ "\`echo \$5 | grep 'Nup=64'\`" != '' ]; then nup="psnup -64" elif [ "\`echo \$5 | grep 'Nup=32'\`" != '' ]; then nup="psnup -32" elif [ "\`echo \$5 | grep 'Nup=25'\`" != '' ]; then nup="psnup -25" elif [ "\`echo \$5 | grep 'Nup=16'\`" != '' ]; then nup="psnup -16" elif [ "\`echo \$5 | grep 'Nup=8'\`" != '' ]; then nup="psnup -8" elif [ "\`echo \$5 | grep 'Nup=6'\`" != '' ]; then nup="psnup -6" elif [ "\`echo \$5 | grep 'Nup=4'\`" != '' ]; then nup="psnup -4" elif [ "\`echo \$5 | grep 'Nup=2'\`" != '' ]; then nup="psnup -2" elif [ "\`echo \$5 | grep 'Nup=1'\`" != '' ]; then nup="cat" fi echo "NUP=\$nup" >>\$LOGFILE if [ -e /usr/bin/psnup ]; then if [ \$# -ge 7 ]; then cat \$6 | \$nup > \$INPUT_TEMP_PS else cat | \$nup > \$INPUT_TEMP_PS fi else if [ \$# -ge 7 ]; then cp \$6 \$INPUT_TEMP_PS else cat > \$INPUT_TEMP_PS fi fi else if [ \$# -ge 7 ]; then cp \$6 \$INPUT_TEMP_PS else cat > \$INPUT_TEMP_PS fi fi if [ -e "/usr/local/Brother/lpd/filter\$PRINTER" ]; then : else echo "ERROR: /usr/local/Brother/lpd/filter\$PRINTER does not exist" >>\$LOGFILE errorcode=30 exit $errorcode fi if [ -e "/usr/local/Brother/cupswrapper/brcupsconfcl1" ]; then if [ \$DEBUG = 0 ]; then /usr/local/Brother/cupswrapper/brcupsconfcl1 \$PRINTER \$PPD 0 "\$5" >> /dev/null else /usr/local/Brother/cupswrapper/brcupsconfcl1 \$PRINTER \$PPD \$LOGCLEVEL "\$5" >>\$LOGFILE fi fi if [ \$DEBUG -lt 10 ]; then cat \$INPUT_TEMP_PS | /usr/local/Brother/lpd/filter\$PRINTER if [ \$LOGLEVEL -gt 2 ]; then if [ \$LOGFILE != "/dev/null" ]; then echo "" >>\$LOGFILE echo " ------PostScript Data-------" >>\$LOGFILE cat \$INPUT_TEMP_PS >>\$LOGFILE fi fi fi rm -f \$INPUT_TEMP_PS exit \$errorcode !ENDOFWFILTER! chmod a+x $brotherlpdwrapper if [ -e /usr/lib64/cups/filter ]; then cp $brotherlpdwrapper $brotherlpdwrapper64 fi chmod a+w /usr/local/Brother/inf/brMFC9420CNrc chmod a+w /usr/local/Brother/inf if [ -e /etc/init.d/lpd ]; then /etc/init.d/lpd stop fi if [ -e /etc/init.d/lprng ]; then /etc/init.d/lprng stop fi if [ -e /etc/init.d/cups ]; then /etc/init.d/cups restart elif [ -e /etc/init.d/cupsys ]; then /etc/init.d/cupsys restart fi sleep 2s lpadmin -p MFC9420CN -E -v usb:/dev/usb/lp0 -m brmfc9420cn.ppd exit 0 mfc9420cncups_src/Copying0100744000000000000000000004365710303510312014263 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. mfc9420cncups_src/brcupsconfigcl1/0040755000000000000000000000000010303510030015774 5ustar rootrootmfc9420cncups_src/brcupsconfigcl1/brcups_commands.h0100644000000000000000000005235310303476557021362 0ustar rootroot/* * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef _BRCUPS_COMMANDS_H_ #define _BRCUPS_COMMANDS_H_ #define _SL4C_ char brprintconf[30]="brprintconfcl1"; char *default_setting[] = { "brprintconfcl1 -P BROTHERPRINTER_XXX -pt A4" , "brprintconfcl1 -P BROTHERPRINTER_XXX -feed AUTO", "brprintconfcl1 -P BROTHERPRINTER_XXX -reso 600" , "brprintconfcl1 -P BROTHERPRINTER_XXX -capt OFF", "brprintconfcl1 -P BROTHERPRINTER_XXX -corm FULLCOLOR" , "brprintconfcl1 -P BROTHERPRINTER_XXX -md PLAIN" , "brprintconfcl1 -P BROTHERPRINTER_XXX -cm MATCHMONITOR" , "brprintconfcl1 -P BROTHERPRINTER_XXX -impg OFF" , "brprintconfcl1 -P BROTHERPRINTER_XXX -ebp OFF", "brprintconfcl1 -P BROTHERPRINTER_XXX -mirro OFF" , "brprintconfcl1 -P BROTHERPRINTER_XXX -brit 0" , "brprintconfcl1 -P BROTHERPRINTER_XXX -cont 0" , "brprintconfcl1 -P BROTHERPRINTER_XXX -red 0" , "brprintconfcl1 -P BROTHERPRINTER_XXX -green 0" , "brprintconfcl1 -P BROTHERPRINTER_XXX -blue 0" , "brprintconfcl1 -P BROTHERPRINTER_XXX -saturation 0" , "brprintconfcl1 -P BROTHERPRINTER_XXX -tsm OFF" , "brprintconfcl1 -P BROTHERPRINTER_XXX -hrc PRINTERDEFAULT", "brprintconfcl1 -P BROTHERPRINTER_XXX -copy 1" , "brprintconfcl1 -P BROTHERPRINTER_XXX -adj NORMAL", NULL }; typedef struct { char *option; char *value; } CMDLINELIST; CMDLINELIST commandlinelist[] = { { "PaperType=A4" , "-pt A4" }, { "PaperType=Letter" , "-pt LT" }, { "PaperType=Legal" , "-pt LGL" }, { "PaperType=Executive" , "-pt EXE" }, { "PaperType=A5" , "-pt A5" }, { "PaperType=B5" , "-pt B5" }, { "PaperType=JISB5" , "-pt B5" }, { "PaperType=com10" , "-pt COM-10" }, { "PaperType=Com10" , "-pt COM-10" }, { "PaperType=COM10" , "-pt COM-10" }, { "PaperType=COM-10" , "-pt COM-10" }, { "PaperType=Com-10" , "-pt COM-10" }, { "PaperType=com-10" , "-pt COM-10" }, { "PaperType=DL" , "-pt DL" }, { "PaperSource=Tray1" , "-feed TRAY1" }, { "PaperSource=Tray2" , "-feed TRAY2" }, { "PaperSource=AutoSelect", "-feed AUTO" }, { "PaperSource=Manul" , "-feed MANUL" }, { "Resolution=600" , "-reso 600" }, { "Resolution=2400" , "-reso 2400" }, { "CAPT=OFF" , "-capt OFF" }, { "CAPT=ON" , "-capt ON" }, { "noCAPT" , "-capt OFF" }, { "CAPT" , "-capt ON" }, { "ColorOrMono=Mono" , "-corm MONO" }, { "ColorOrMono=FullColor" , "-corm FULLCOLOR" }, { "ColorOrMono=BlackCyan" , "-corm BLACKCYAN" }, { "ColorOrMono=BlackMagenta", "-corm BLACKMAGENTA" }, { "ColorOrMono=BlackYellow" , "-corm BLACKYELLOW" }, { "Media=PlainPaper" , "-md PLAIN" }, { "Media=ThinPaper" , "-md THIN" }, { "Media=ThickPaper" , "-md THICK" }, { "Media=ThickerPaper" , "-md THICKER" }, { "Media=Transparencies" , "-md TRANS" }, { "Media=Recycled" , "-md RECY" }, { "ColorMatching=MatchMonitor" , "-cm MATCHMONITOR" }, { "ColorMatching=Vivid" , "-cm VIVID" }, { "ColorMatching=None" , "-cm NONE" }, { "ImproveGray=OFF" , "-impg OFF" }, { "ImproveGray=ON" , "-impg ON" }, { "noImproveGray" , "-impg OFF" }, { "ImproveGray" , "-impg ON" }, { "EnBlkPrinting=OFF" , "-ebp OFF" }, { "EnBlkPrinting=ON" , "-ebp ON" }, { "noEnBlkPrinting" , "-ebp OFF" }, { "EnBlkPrinting" , "-ebp ON" }, { "MirrorPrint=OFF" , "-mirro OFF" }, { "MirrorPrint=ON" , "-mirro ON" }, { "noMirrorPrint" , "-mirro OFF" }, { "MirrorPrint" , "-mirro ON" }, { "TonerSaveMode=OFF" , "-tsm OFF" }, { "TonerSaveMode=ON" , "-tsm ON" }, { "noTonerSaveMode" , "-tsm OFF" }, { "TonerSaveMode" , "-tsm ON" }, { "HRC=PrinterDefault" , "-hrc PRINTERDEFAULT" }, { "HRC=Light" , "-hrc LIGHT" }, { "HRC=Medium" , "-hrc MEDIUM" }, { "HRC=Dark" , "-hrc DARK" }, { "HRC=Off" , "-hrc OFF" }, { "LandscapeAdjustment=Normal" , "-adj NORMAL" }, { "LandscapeAdjustment=Adjust" , "-adj ADJUST" }, { NULL , NULL }, }; CMDLINELIST standard_commandlinelist[] = { { "media=A4" , "-pt A4" }, { "media=Letter" , "-pt LT" }, { "media=Legal" , "-pt LGL" }, { "media=Executive" , "-pt EXE" }, { "media=A5" , "-pt A5" }, { "media=B5" , "-pt B5" }, { "media=JISB5" , "-pt B5" }, { "media=Com10" , "-pt COM-10" }, { "media=com10" , "-pt COM-10" }, { "media=COM10" , "-pt COM-10" }, { "media=COM-10" , "-pt COM-10" }, { "media=com-10" , "-pt COM-10" }, { "media=Com-10" , "-pt COM-10" }, { "media=DL" , "-pt DL" }, { "media=PlainPaper" , "-md PLAIN" }, { "media=ThinPaper" , "-md THIN" }, { "media=ThickPaper" , "-md THICK" }, { "media=ThickerPaper" , "-md THICKER" }, { "media=Transparencies" , "-md TRANS" }, { "media=Recycled" , "-md RECY" }, { "media=Tray1" , "-feed TRAY1" }, { "media=Tray2" , "-feed TRAY2" }, { "media=AutoSelect", "-feed AUTO" }, { "media=Manul" , "-feed MANUL" }, { "media=.*,A4" , "-pt A4" }, { "media=.*,Letter" , "-pt LT" }, { "media=.*,Legal" , "-pt LGL" }, { "media=.*,Executive" , "-pt EXE" }, { "media=.*,A5" , "-pt A5" }, { "media=.*,B5" , "-pt B5" }, { "media=.*,JISB5" , "-pt B5" }, { "media=.*,COM10" , "-pt COM-10" }, { "media=.*,Com10" , "-pt COM-10" }, { "media=.*,com10" , "-pt COM-10" }, { "media=.*,COM-10" , "-pt COM-10" }, { "media=.*,Com-10" , "-pt COM-10" }, { "media=.*,com-10" , "-pt COM-10" }, { "media=.*,DL" , "-pt DL" }, { "media=.*,PlainPaper" , "-md PLAIN" }, { "media=.*,ThinPaper" , "-md THIN" }, { "media=.*,ThickPaper" , "-md THICK" }, { "media=.*,ThickerPaper" , "-md THICKER" }, { "media=.*,Transparencies" , "-md TRANS" }, { "media=.*,Recycled" , "-md RECY" }, { "media=.*,Tray1" , "-feed TRAY1" }, { "media=.*,Tray2" , "-feed TRAY2" }, { "media=.*,AutoSelect", "-feed AUTO" }, { "media=.*,Manul" , "-feed MANUL" }, { NULL , NULL }, }; CMDLINELIST commandlinelist2[] = { { "Copies=" , "-copy " }, { "Brightness=" , "-brit " }, { "Contrast=" , "-cont " }, { "RedKey=" , "-red " }, { "GreenKey=" , "-green " }, { "BlueKey=" , "-blue " }, { "Saturation=" , "-saturation "}, { NULL , NULL }, }; typedef struct { char *value; char *brcommand; } PPDCOMMANDLIST; typedef struct { char *label; PPDCOMMANDLIST ppdcommandlist[]; } PPDCOMMAND; PPDCOMMAND DefaultResolution={ "DefaultResolution", { { "Normal" , "-reso 600" }, { "CAPT" , "-reso 2400" }, { NULL , NULL } } }; PPDCOMMAND DefaultPageSize={ "DefaultPageSize", { { "BrA4" , "-pt A4" }, { "BrLetter" , "-pt LT" }, { "BrLegal" , "-pt LGL" }, { "BrExecutive" , "-pt EXE" }, { "BrA5" , "-pt A5" }, { "BrB5" , "-pt B5" }, { "BrJISB5" , "-pt B5" }, { "BrCom10" , "-pt COM-10" }, { "BrDL" , "-pt DL" }, { NULL , NULL } } }; PPDCOMMAND DefaultInputSlot={ "DefaultInputSlot", { { "Tray1" , "-feed TRAY1" }, { "Tray2" , "-feed TRAY2" }, { "AutoSelect" , "-feed AUTO" }, { NULL , NULL } } }; PPDCOMMAND DefaultBRCAPT={ "DefaultBRCAPT", { { NULL, NULL } } }; PPDCOMMAND DefaultMediaType={ "DefaultMediaType", { { "Plain" , "-md PLAIN" }, { "Thin" , "-md THIN" }, { "Thick" , "-md THICK" }, { "Thicker" , "-md THICKER" }, { "Transparencies" , "-md TRANS" }, { "Recycled" , "-md RECY" }, { NULL , NULL } } }; PPDCOMMAND DefaultBRColorMatching={ "DefaultBRColorMatching", { { "MatchMonitor", "-cm MATCHMONITOR" }, { "VividText", "-cm VIVID" }, { "None", "-cm NONE" }, { NULL , NULL } } }; PPDCOMMAND DefaultBRGray={ "DefaultBRGray", { { "OFF", "-impg OFF" }, { "ON" , "-impg ON" }, { NULL , NULL } } }; PPDCOMMAND DefaultBREnhanceBlkPrt={ "DefaultBREnhanceBlkPrt", { { "OFF", "-ebp OFF" }, { "ON" , "-ebp ON" }, { NULL , NULL } } }; PPDCOMMAND DefaultBRMirror={ "DefaultBRMirror", { { "OFF", "-mirro OFF" }, { "ON" , "-mirro ON" }, { NULL , NULL } } }; PPDCOMMAND DefaultTonerSaveMode={ "DefaultTonerSaveMode", { { "OFF" , "-tsm OFF" }, { "ON" , "-tsm ON" }, { NULL , NULL } } }; PPDCOMMAND DefaultMonoColor={ "DefaultMonoColor", { { "BrFullColor" , "-corm FULLCOLOR" }, { "BrMono" , "-corm MONO" }, { "BrB&C" , "-corm BLACKCYAN" }, { "BrB&M" , "-corm BLACKMAGENTA" }, { "BrB&Y" , "-corm BLACKYELLOW" }, { NULL , NULL } } }; PPDCOMMAND DefaultBRSaturation={ "DefaultBRSaturation", { { "-1" , "-saturation \\-1" }, { "-2" , "-saturation \\-2" }, { "-3" , "-saturation \\-3" }, { "-4" , "-saturation \\-4" }, { "-5" , "-saturation \\-5" }, { "-6" , "-saturation \\-6" }, { "-7" , "-saturation \\-7" }, { "-8" , "-saturation \\-8" }, { "-9" , "-saturation \\-9" }, { "-10" , "-saturation \\-10" }, { "-11" , "-saturation \\-11" }, { "-12" , "-saturation \\-12" }, { "-13" , "-saturation \\-13" }, { "-14" , "-saturation \\-14" }, { "-15" , "-saturation \\-15" }, { "-16" , "-saturation \\-16" }, { "-17" , "-saturation \\-17" }, { "-18" , "-saturation \\-18" }, { "-19" , "-saturation \\-19" }, { "-20" , "-saturation \\-20" }, { "0" , "-saturation 0" }, { "1" , "-saturation 1" }, { "2" , "-saturation 2" }, { "3" , "-saturation 3" }, { "4" , "-saturation 4" }, { "5" , "-saturation 5" }, { "6" , "-saturation 6" }, { "7" , "-saturation 7" }, { "8" , "-saturation 8" }, { "9" , "-saturation 9" }, { "10" , "-saturation 10" }, { "11" , "-saturation 11" }, { "12" , "-saturation 12" }, { "13" , "-saturation 13" }, { "14" , "-saturation 14" }, { "15" , "-saturation 15" }, { "16" , "-saturation 16" }, { "17" , "-saturation 17" }, { "18" , "-saturation 18" }, { "19" , "-saturation 19" }, { "20" , "-saturation 20" }, { NULL , NULL } } }; PPDCOMMAND DefaultBRBlue={ "DefaultBRBlue", { { "-1" , "-blue \\-1" }, { "-2" , "-blue \\-2" }, { "-3" , "-blue \\-3" }, { "-4" , "-blue \\-4" }, { "-5" , "-blue \\-5" }, { "-6" , "-blue \\-6" }, { "-7" , "-blue \\-7" }, { "-8" , "-blue \\-8" }, { "-9" , "-blue \\-9" }, { "-10" , "-blue \\-10" }, { "-11" , "-blue \\-11" }, { "-12" , "-blue \\-12" }, { "-13" , "-blue \\-13" }, { "-14" , "-blue \\-14" }, { "-15" , "-blue \\-15" }, { "-16" , "-blue \\-16" }, { "-17" , "-blue \\-17" }, { "-18" , "-blue \\-18" }, { "-19" , "-blue \\-19" }, { "-20" , "-blue \\-20" }, { "0" , "-blue 0" }, { "1" , "-blue 1" }, { "2" , "-blue 2" }, { "3" , "-blue 3" }, { "4" , "-blue 4" }, { "5" , "-blue 5" }, { "6" , "-blue 6" }, { "7" , "-blue 7" }, { "8" , "-blue 8" }, { "9" , "-blue 9" }, { "10" , "-blue 10" }, { "11" , "-blue 11" }, { "12" , "-blue 12" }, { "13" , "-blue 13" }, { "14" , "-blue 14" }, { "15" , "-blue 15" }, { "16" , "-blue 16" }, { "17" , "-blue 17" }, { "18" , "-blue 18" }, { "19" , "-blue 19" }, { "20" , "-blue 20" }, { NULL , NULL } } }; PPDCOMMAND DefaultBRGreen={ "DefaultBRGreen", { { "-1" , "-green \\-1" }, { "-2" , "-green \\-2" }, { "-3" , "-green \\-3" }, { "-4" , "-green \\-4" }, { "-5" , "-green \\-5" }, { "-6" , "-green \\-6" }, { "-7" , "-green \\-7" }, { "-8" , "-green \\-8" }, { "-9" , "-green \\-9" }, { "-10" , "-green \\-10" }, { "-11" , "-green \\-11" }, { "-12" , "-green \\-12" }, { "-13" , "-green \\-13" }, { "-14" , "-green \\-14" }, { "-15" , "-green \\-15" }, { "-16" , "-green \\-16" }, { "-17" , "-green \\-17" }, { "-18" , "-green \\-18" }, { "-19" , "-green \\-19" }, { "-20" , "-green \\-20" }, { "0" , "-green 0" }, { "1" , "-green 1" }, { "2" , "-green 2" }, { "3" , "-green 3" }, { "4" , "-green 4" }, { "5" , "-green 5" }, { "6" , "-green 6" }, { "7" , "-green 7" }, { "8" , "-green 8" }, { "9" , "-green 9" }, { "10" , "-green 10" }, { "11" , "-green 11" }, { "12" , "-green 12" }, { "13" , "-green 13" }, { "14" , "-green 14" }, { "15" , "-green 15" }, { "16" , "-green 16" }, { "17" , "-green 17" }, { "18" , "-green 18" }, { "19" , "-green 19" }, { "20" , "-green 20" }, { NULL , NULL } } }; PPDCOMMAND DefaultBRRed={ "DefaultBRRed", { { "-1" , "-red \\-1" }, { "-2" , "-red \\-2" }, { "-3" , "-red \\-3" }, { "-4" , "-red \\-4" }, { "-5" , "-red \\-5" }, { "-6" , "-red \\-6" }, { "-7" , "-red \\-7" }, { "-8" , "-red \\-8" }, { "-9" , "-red \\-9" }, { "-10" , "-red \\-10" }, { "-11" , "-red \\-11" }, { "-12" , "-red \\-12" }, { "-13" , "-red \\-13" }, { "-14" , "-red \\-14" }, { "-15" , "-red \\-15" }, { "-16" , "-red \\-16" }, { "-17" , "-red \\-17" }, { "-18" , "-red \\-18" }, { "-19" , "-red \\-19" }, { "-20" , "-red \\-20" }, { "0" , "-red 0" }, { "1" , "-red 1" }, { "2" , "-red 2" }, { "3" , "-red 3" }, { "4" , "-red 4" }, { "5" , "-red 5" }, { "6" , "-red 6" }, { "7" , "-red 7" }, { "8" , "-red 8" }, { "9" , "-red 9" }, { "10" , "-red 10" }, { "11" , "-red 11" }, { "12" , "-red 12" }, { "13" , "-red 13" }, { "14" , "-red 14" }, { "15" , "-red 15" }, { "16" , "-red 16" }, { "17" , "-red 17" }, { "18" , "-red 18" }, { "19" , "-red 19" }, { "20" , "-red 20" }, { NULL , NULL } } }; PPDCOMMAND DefaultBRContrast={ "DefaultBRContrast", { { "-1" , "-cont \\-1" }, { "-2" , "-cont \\-2" }, { "-3" , "-cont \\-3" }, { "-4" , "-cont \\-4" }, { "-5" , "-cont \\-5" }, { "-6" , "-cont \\-6" }, { "-7" , "-cont \\-7" }, { "-8" , "-cont \\-8" }, { "-9" , "-cont \\-9" }, { "-10" , "-cont \\-10" }, { "-11" , "-cont \\-11" }, { "-12" , "-cont \\-12" }, { "-13" , "-cont \\-13" }, { "-14" , "-cont \\-14" }, { "-15" , "-cont \\-15" }, { "-16" , "-cont /\\-16" }, { "-17" , "-cont \\-17" }, { "-18" , "-cont \\-18" }, { "-19" , "-cont \\-19" }, { "-20" , "-cont \\-20" }, { "0" , "-cont 0" }, { "1" , "-cont 1" }, { "2" , "-cont 2" }, { "3" , "-cont 3" }, { "4" , "-cont 4" }, { "5" , "-cont 5" }, { "6" , "-cont 6" }, { "7" , "-cont 7" }, { "8" , "-cont 8" }, { "9" , "-cont 9" }, { "10" , "-cont 10" }, { "11" , "-cont 11" }, { "12" , "-cont 12" }, { "13" , "-cont 13" }, { "14" , "-cont 14" }, { "15" , "-cont 15" }, { "16" , "-cont 16" }, { "17" , "-cont 17" }, { "18" , "-cont 18" }, { "19" , "-cont 19" }, { "20" , "-cont 20" }, { NULL , NULL } } }; PPDCOMMAND DefaultBRBrightness={ "DefaultBRBrightness", { { "-1" , "-brit \\-1" }, { "-2" , "-brit \\-2" }, { "-3" , "-brit \\-3" }, { "-4" , "-brit \\-4" }, { "-5" , "-brit \\-5" }, { "-6" , "-brit \\-6" }, { "-7" , "-brit \\-7" }, { "-8" , "-brit \\-8" }, { "-9" , "-brit \\-9" }, { "-10" , "-brit \\-10" }, { "-11" , "-brit \\-11" }, { "-12" , "-brit \\-12" }, { "-13" , "-brit \\-13" }, { "-14" , "-brit \\-14" }, { "-15" , "-brit \\-15" }, { "-16" , "-brit \\-16" }, { "-17" , "-brit \\-17" }, { "-18" , "-brit \\-18" }, { "-19" , "-brit \\-19" }, { "-20" , "-brit \\-20" }, { "0" , "-brit 0" }, { "1" , "-brit 1" }, { "2" , "-brit 2" }, { "3" , "-brit 3" }, { "4" , "-brit 4" }, { "5" , "-brit 5" }, { "6" , "-brit 6" }, { "7" , "-brit 7" }, { "8" , "-brit 8" }, { "9" , "-brit 9" }, { "10" , "-brit 10" }, { "11" , "-brit 11" }, { "12" , "-brit 12" }, { "13" , "-brit 13" }, { "14" , "-brit 14" }, { "15" , "-brit 15" }, { "16" , "-brit 16" }, { "17" , "-brit 17" }, { "18" , "-brit 18" }, { "19" , "-brit 19" }, { "20" , "-brit 20" }, { NULL , NULL } } }; PPDCOMMAND DefaultLandscapeAdjustment={ "DefaultLandscapeAdjustment", { { "BrNormal" , "-adj NORMAL" }, { "BrAdjust" , "-adj ADJUST" }, { NULL , NULL } } }; PPDCOMMAND DefaultBRSleepTime={ "DefaultBRSleepTime", { { NULL , NULL } } }; PPDCOMMAND *ppdcommand_all_list[] = { &DefaultResolution, &DefaultPageSize, &DefaultInputSlot, &DefaultBRCAPT, &DefaultMediaType, &DefaultBRColorMatching, &DefaultMonoColor, &DefaultBRGray, &DefaultBREnhanceBlkPrt, &DefaultBRMirror, &DefaultTonerSaveMode, &DefaultBRSaturation, &DefaultBRBlue, &DefaultBRGreen, &DefaultBRRed, &DefaultBRContrast, &DefaultBRBrightness, &DefaultLandscapeAdjustment, NULL }; CMDLINELIST PPDdefaultN[] = { { NULL , NULL }, }; CMDLINELIST PPDdefaultNValue[] = { {"DefaultBRBrightness", "-brit "}, {"DefaultBRContrast", "-cont "}, {"DefaultBRRed", "-red "}, {"DefaultBRGreen", "-green "}, {"DefaultBRBlue", "-blue "}, {"DefaultBRSaturation", "-saturation "}, { NULL , NULL }, }; CMDLINELIST standard_media_commandlinelist[] = { { "A4" , "-pt A4" }, { "Letter" , "-pt LT" }, { "Legal" , "-pt LGL" }, { "Executive" , "-pt EXE" }, { "A5" , "-pt A5" }, { "B5" , "-pt B5" }, { "DL" , "-pt DL" }, { "EnvDL" , "-pt DL" }, { "Com10" , "-pt COM-10" }, { "COM10" , "-pt COM-10" }, { "Com-10" , "-pt COM-10" }, { "COM-10" , "-pt COM-10" }, { "EnvCOM10" , "-pt COM-10" }, { "Env10" , "-pt COM-10" }, { "PlainPaper" , "-md PLAIN" }, { "ThinPaper" , "-md THIN" }, { "ThickPaper" , "-md THICK" }, { "ThickerPaper" , "-md THICKER" }, { "Transparencies" , "-md TRANS" }, { "Recycled" , "-md RECY" }, { "Manual" , "-feed MANUAL" }, { "Tray1" , "-feed TRAY1" }, { "Tray2" , "-feed TRAY2" }, { "AutoSelect" , "-feed AUTO" }, { NULL , NULL } }; #endif mfc9420cncups_src/brcupsconfigcl1/brcupsconfig.c0100644000000000000000000002640410303476553020654 0ustar rootroot/* * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * */ #include #include #include "brcups_commands.h" CMDLINELIST standard_side_commandlinelist[]; int divide_media_token(char *input,char output[5][30]); #if 0 #define DEBUGPRINT(a) fprintf(stderr,a);fflush(stdout) #define DEBUGPRINT1(a1,a2) fprintf(stderr,a1,a2);fflush(stdout) #define DEBUGPRINT2(a1,a2,a3) fprintf(stderr,a1,a2,a3);fflush(stdout) #define DEBUGPRINT3(a1,a2,a3,a4) fprintf(stderr,a1,a2,a3,a4);fflush(stdout) #define DEBUGPRINT4(a1,a2,a3,a4,a5) fprintf(stderr,a1,a2,a3,a4,a5);fflush(stdout) #define DEBUGPRINT5(a1,a2,a3,a4,a5,a6) fprintf(stderr,a1,a2,a3,a4,a5,a6);fflush(stdout) #else #define DEBUGPRINT(a) #define DEBUGPRINT1(a1,a2) #define DEBUGPRINT2(a1,a2,a3) #define DEBUGPRINT3(a1,a2,a3,a4) #define DEBUGPRINT4(a1,a2,a3,a4,a5) #define DEBUGPRINT5(a1,a2,a3,a4,a5,a6) #endif #define SETTINGFILE "/usr/local/Brother/cupswrapper/cupswrapperc" int log_level = 0; typedef struct { char value[50]; char option[50]; } SETCOMMAND; SETCOMMAND command_array[100]; int initialize_command_list(); int add_command_list(char *option,char *command); int add_command_list_brcommand(char *command); int exec_brprintconf(char *brprintconf,char *printer); char *strstr_ex(char *data , char *serch_data); char *delete_ppd_comment(char *line); char *chk_ppd_default_setting_line(char *ppd_line); char *get_token(char *input,char *output); void write_log_file(int level,char *format,...); int main(int argc,char * argv[]) { char *printer; char ppd_line[500],tmp[500],*p_tmp,tmp_n[10],tmp_op[500]; FILE *fp_ppd; char *p; char *commandline,*ppdfile; int i,ii; DEBUGPRINT("main:start\n"); if(argc < 1){ return 0; } printer = argv[1]; if(argc > 2){ ppdfile= argv[2]; } else{ ppdfile=""; } if(argc > 3){ if(argv[3][0] >= '0' && argv[3][0] <= '9'){ log_level = argv[3][0] -'0'; } else{ log_level = 0; } } else{ log_level = 0; } if(argc > 4){ commandline = argv[4]; } else{ commandline = "NULL COMMAND LINE"; } fp_ppd = fopen(ppdfile , "r"); if( fp_ppd == NULL) return 0; initialize_command_list(); DEBUGPRINT("main:set default setting\n"); write_log_file(5,"DEFAULT SETTING\n"); for ( i = 0; default_setting[i] != NULL; i ++){ p = strstr_ex(default_setting[i],"BROTHERPRINTER_XXX"); if(p){ p = strchr(p,'-'); if(p){ add_command_list_brcommand(p); } } } DEBUGPRINT("main:set PPD option (string)\n"); write_log_file(5,"PPD SETTING\n"); while(fgets(ppd_line,sizeof(ppd_line),fp_ppd)){ if(NULL == delete_ppd_comment(ppd_line))continue; if(NULL == chk_ppd_default_setting_line(ppd_line))continue; for ( i = 0; ppdcommand_all_list[i]!= NULL; i ++){ p = strstr_ex(ppd_line,ppdcommand_all_list[i]->label); if(p){ for (ii = 0; ppdcommand_all_list[i]->ppdcommandlist[ii].value != NULL; ii++){ p = strstr_ex(ppd_line,ppdcommand_all_list[i]->ppdcommandlist[ii].value); if(p){ add_command_list_brcommand(ppdcommand_all_list[i]->ppdcommandlist[ii].brcommand); break; } } } } for ( i = 0; PPDdefaultN[i].option!= NULL; i ++){ strcpy(tmp,PPDdefaultN[i].option); p_tmp = tmp; if(tmp[0] == '^')p_tmp ++; p = strstr_ex(ppd_line,p_tmp); if(p){ sprintf(tmp,"%s %s",PPDdefaultN[i].value, p + strlen(PPDdefaultN[i].option)); get_token(PPDdefaultN[i].value ,tmp_op); get_token(p + strlen(PPDdefaultN[i].option) ,tmp_n); add_command_list(tmp_op,tmp_n); } } } DEBUGPRINT("main:set brother command line option (string)\n"); write_log_file(5,"BROTHER COMMAND LINE SETTING(S)\n"); for ( i = 0; commandlinelist[i].value != NULL; i ++){ p = strstr_ex(commandline,commandlinelist[i].option); if(p){ add_command_list_brcommand(commandlinelist[i].value); } } DEBUGPRINT("main:set standard command line option (duplex)\n"); write_log_file(5,"STANDARD COMMAND LINE SETTING(DUPLEX)\n"); for ( i = 0; standard_side_commandlinelist[i].value != NULL; i ++){ p = strstr_ex(commandline,standard_side_commandlinelist[i].option); if(p){ add_command_list_brcommand(standard_side_commandlinelist[i].value); } } DEBUGPRINT("main:set standard command line option (media)\n"); write_log_file(5,"STANDARD COMMAND LINE SETTING(MEDIA)\n"); { char output[5][30]; int max; max = divide_media_token(commandline,output); for ( ii=0; ii < max; ii++){ for ( i = 0; standard_media_commandlinelist[i].value != NULL; i ++){ p = strstr_ex(output[ii],standard_media_commandlinelist[i].option); if(p){ add_command_list_brcommand(standard_media_commandlinelist[i].value); } } } } DEBUGPRINT("main:set command line option (numerical)\n"); write_log_file(5,"COMMAND LINE SETTING(N)\n"); for(i = 0; commandlinelist2[i].option != NULL; i ++){ p = strstr_ex(commandline,commandlinelist2[i].option); if(p){ get_token(commandlinelist2[i].value ,tmp_op); get_token(p + strlen(commandlinelist2[i].option) ,tmp_n); sprintf(tmp,"%s %s",tmp_op,tmp_n ); add_command_list(tmp_op,tmp_n); } } exec_brprintconf(brprintconf,printer); } int initialize_command_list(){ int i; char *p; p = (char *)command_array; for ( i = 0; i < sizeof(command_array) ; i ++){ *p = 0; p ++; } return i; } int exec_brprintconf(char *brprintconf,char *printer){ int i; char exec[300]; DEBUGPRINT("exec_brprintconf:start\n"); for ( i = 0; command_array[i].value[0] != 0; i ++ ){ sprintf(exec,"%s -P %s %s %s",brprintconf,printer, command_array[i].option, command_array[i].value); write_log_file(1,"%s\n",exec); system(exec); } } int add_command_list(char *option,char *value){ char *p; int i,ii; if(!option || !value || !option[0] || !value[0]){ return 0; } for ( i = 0; command_array[i].option[0] != 0; i ++ ){ p = strstr_ex(command_array[i].option , option); if(p){ write_log_file(3," C %s %s\n",option,value); strcpy(command_array[i].value, value); break; } } if(command_array[i].option[0] == 0){ strcpy( command_array[i].option ,option); strcpy( command_array[i].value ,value); write_log_file(3," A %s %s\n",option,value); } return 1; } int add_command_list_brcommand_sub(char *command){ char option[100],*p1,*p2; char value[100]; strncpy(option,command,sizeof(option)-1); option[sizeof(option)] = 0; p1 = strchr(option, ' '); p2 = strchr(option, '\t'); if(p1 > p2 && p2 != NULL)p1 = p2; if(p1 == NULL){ return 0; } *p1 = 0; p1 ++; while(*p1 == ' ' || *p1 == '\t') p1 ++; strcpy(value , p1); return add_command_list(option,value); } int add_command_list_brcommand(char *command){ char multi_brcommands[500]; char *p,*start; int i; strcpy(multi_brcommands,command); start = multi_brcommands; while(p = strchr(start+1,'-')){ if(p > multi_brcommands+1){ if(*(p-1) == ' ' || *(p-1) == '\t'){ *(p-1) = 0; } } add_command_list_brcommand_sub(start); start = p; } add_command_list_brcommand_sub(start); return i; } char *get_next_element(char *data,char *search_word){ char *p; p = strstr(data,search_word); if(!p)return p; p += strlen(search_word); while(*p == ' '|| *p == '\t' || *p == ';' || *p == ':')p++; return p; } char *strstr_ex(char *data , char *search_data){ char *p , *pp; p = strstr(data,search_data); if(!p)return p; pp = p; p += strlen(search_data); if(p > search_data){ if ( ! ((*(p-1) == ' '|| *(p-1) == '\t' || *(p-1) == ';' || *(p-1) == ':' || *(p-1) == 0 || *(p-1) == '\n' || *(p-1) == '*') || *(p-1) == '=' )){ if( ! (*p == ' '|| *p == '\t' || *p == ';' || *p == ':' || *p == 0 || *p == '\n' || *p == '*')) return NULL; } } if(pp > data){ p = pp-1; if( ! (*p == ' '|| *p == '\t' || *p == ';' || *p == ':' || *p == 0 || *p == '\n' || *p == '*')) return NULL; } return pp; } char *delete_ppd_comment(char *line){ char *p; p = strchr(line , '%'); if(p)*p = 0; p = strchr(line , 0x0a); if(p)*p = 0; p = strchr(line , 0x0d); if(p)*p = 0; p = strchr(line , 0x0c); if(p)*p = 0; if(line[0] == 0)return NULL; return line; } char *chk_ppd_default_setting_line(char *ppd_line){ char *p; p=strstr(ppd_line,"*Default"); if(p != ppd_line)return NULL; return p; } char *get_token(char *input,char *output){ char c,*pi,*po; po = output; pi = input; while(c = *pi){ switch(c){ case ' ': case '\t': case '=': case 0x0d: case 0x0a: case 0x0c: pi++; continue; case 0x00: break; } break; } while(c = *pi){ switch(c){ case ' ': case '\t': case '=': case 0x0d: case 0x0a: case 0x0c: case 0x00: *po = 0; return output; break; } *po = c; po ++; pi ++; } *po = 0; return output; } void write_log_file(int level,char *format,...){ FILE *fp_logfile; char logdata[300]; va_list argp; va_start(argp,format); if(log_level == 0)return; if(level > log_level)return; vsprintf(logdata,format,argp); fputs(logdata , stdout); fflush(stdout); return ; } #define MEDIAEQ "media=" int divide_media_token(char *input,char output[5][30]){ char media_command[100]; char *media,*p,*pp; int i; p = strstr(input,MEDIAEQ); if(p){ strcpy(media_command,p+strlen(MEDIAEQ)); } else{ return 0; } media_command[sizeof(media_command)-1] = 0; media_command[sizeof(media_command)-2] = 0; media_command[sizeof(media_command)-3] = 0; p = strchr(media_command,' '); if(p)*p =0; p = strchr(media_command,'\t'); if(p)*p =0; p = strchr(media_command,'\n'); if(p)*p =0; p = media_command; for (i = 0; i < 5; ){ if(*p == 0)break; pp = strchr(p , ','); if(pp) *pp = 0; strcpy(output[i],p); i ++; if(pp == NULL)break; p = pp+1; } return i; } CMDLINELIST standard_side_commandlinelist[] = { { "sides=two-sided-long-edge" , "-dx ON -dxt LONG" }, { "sides=two-sided-short-edge" , "-dx ON -dxt SHORT" }, { "sides=one-side" , "-dx OFF" }, { NULL , NULL } };