• Home
Name Date Size #Lines LOC

..--

backend/22-Oct-2025-18,07211,556

berkeley/22-Oct-2025-2,0061,312

cgi-bin/22-Oct-2025-12,2707,508

conf/22-Oct-2025-695519

config-scripts/22-Oct-2025-2,7492,417

cups/22-Oct-2025-105,48767,674

data/22-Oct-2025-514375

desktop/22-Oct-2025-252167

doc/22-Oct-2025-37,31730,983

examples/22-Oct-2025-16,99214,468

filter/22-Oct-2025-12,2867,780

locale/22-Oct-2025-218,584163,706

man/22-Oct-2025-8,6307,385

monitor/22-Oct-2025-690363

move_files/22-Oct-2025-888776

notifier/22-Oct-2025-2,3181,361

packaging/22-Oct-2025-1,5761,329

ppdc/22-Oct-2025-11,8638,579

scheduler/22-Oct-2025-63,97840,612

systemv/22-Oct-2025-11,0457,931

templates/22-Oct-2025-8,9297,287

test/22-Oct-2025-3,2782,544

tools/22-Oct-2025-23,00017,144

vcnet/22-Oct-2025-11,6618,029

xcode/22-Oct-2025-13,59713,027

BUILD.gnD22-Oct-202514 KiB566514

CHANGES.mdD22-Oct-202517.1 KiB358312

CONTRIBUTING.mdD22-Oct-2025399 118

CREDITS.mdD22-Oct-20253 KiB5551

DEVELOPING.mdD22-Oct-202522.5 KiB637472

INSTALL.mdD22-Oct-20256.3 KiB188126

LICENSED22-Oct-202511.1 KiB203169

Makedefs.inD22-Oct-20256.1 KiB276230

MakefileD22-Oct-20255.9 KiB301152

NOTICED22-Oct-20252.3 KiB5339

OAT.xmlD22-Oct-20257.4 KiB11156

README.OpenSourceD22-Oct-2025588 1211

README.mdD22-Oct-20256.9 KiB170121

README_zh.mdD22-Oct-20253.9 KiB10391

REPORTING_ISSUES.mdD22-Oct-20258.1 KiB177119

SECURITY.mdD22-Oct-20252.2 KiB6344

backport-Also-fix-cupsfilter.patchD22-Oct-20251.2 KiB3228

backport-CVE-2022-26691.patchD22-Oct-20251.1 KiB3529

backport-CVE-2023-32324.patchD22-Oct-2025944 3831

backport-CVE-2023-34241.patchD22-Oct-20252.1 KiB6657

backport-CVE-2023-4504.patchD22-Oct-20251.2 KiB4536

backport-CVE-2024-35235.patchD22-Oct-20252.9 KiB9787

backport-Remove-legacy-code-for-RIP_MAX_CACHE-environment-variable.patchD22-Oct-20251.6 KiB4740

bundle.jsonD22-Oct-20251.5 KiB5353

config.guessD22-Oct-202548.8 KiB1,7751,548

config.hD22-Oct-20253.1 KiB10682

config.h.inD22-Oct-20259.4 KiB723456

config.subD22-Oct-202535 KiB1,9081,720

configureD22-Oct-2025319.4 KiB13,70110,369

configure.acD22-Oct-20252.9 KiB9686

cups-banners.patchD22-Oct-2025532 1311

cups-config.inD22-Oct-20252.6 KiB133104

cups-direct-usb.patchD22-Oct-2025912 2826

cups-driverd-timeout.patchD22-Oct-2025741 2217

cups-freebind.patchD22-Oct-2025704 1614

cups-ipp-multifile.patchD22-Oct-2025700 1613

cups-multilib.patchD22-Oct-2025580 1514

cups-system-auth.patchD22-Oct-20251.7 KiB3937

cups-uri-compat.patchD22-Oct-20251.5 KiB5246

cups-usb-job-state-monitor.patchD22-Oct-20253 KiB9994

cups-usb-paperout.patchD22-Oct-20251.3 KiB5348

cups-web-devices-timeout.patchD22-Oct-2025758 2016

cups.gniD22-Oct-20251.5 KiB4134

cups.pc.inD22-Oct-2025637 3025

cups.specD22-Oct-202518.3 KiB563461

cups.yamlD22-Oct-2025670 184

cupsprinter.pngD22-Oct-20252.1 KiB

fix-httpAddrGetList-test-case-fail.patchD22-Oct-20251.4 KiB4537

generate_mime_convs.pyD22-Oct-20251 KiB3517

install-shD22-Oct-20255.5 KiB234145

install.pyD22-Oct-20253.2 KiB10274

ohos-add-openssl.patchD22-Oct-202544.7 KiB1,6831,682

ohos-cups-badfd.patchD22-Oct-20253.1 KiB11399

ohos-filetypes-crash.patchD22-Oct-20252.6 KiB6359

ohos-hilog-print.patchD22-Oct-20252.7 KiB8178

ohos-modify-pthread.patchD22-Oct-2025332 1311

ohos-multi-file-print.patchD22-Oct-2025432 1513

ohos-ppdfile-not-generated.patchD22-Oct-2025717 1512

ohos-uni-print-driver-path.patchD22-Oct-2025967 2524

ohos-usb-manager.patchD22-Oct-202542.9 KiB1,1861,185

ohos-usb-print.patchD22-Oct-202554.1 KiB1,8581,856

ohos-verify-backend.patchD22-Oct-2025442 1413

ohos_ip_conflict.patchD22-Oct-202513.5 KiB390356

README.OpenSource

1[
2    {
3        "Name"                  : "CUPS",
4        "License"               : "Apache 2.0 License",
5        "License File"          : "LICENSE",
6        "Version Number"        : "v2.4.12",
7        "Owner"                 : "baozewei@huawei.com",
8        "Upstream URL"          : "https://github.com/OpenPrinting/cups/releases/download/v2.4.12/cups-2.4.12-source.tar.gz",
9        "Description"           : "OpenPrinting CUPS is the most current version of CUPS, a standards-based, open source printing system for Linux® and other Unix®-like operating systems"
10    }
11]
12

README.md

1OpenPrinting CUPS v2.4.12
2=========================
3
4![Version](https://img.shields.io/github/v/release/openprinting/cups?include_prereleases)
5![Apache 2.0](https://img.shields.io/github/license/openprinting/cups)
6[![Build and Test](https://github.com/OpenPrinting/cups/workflows/Build%20and%20Test/badge.svg)](https://github.com/OpenPrinting/cups/actions/workflows/build.yml)
7[![Coverity Scan](https://img.shields.io/coverity/scan/23806)](https://scan.coverity.com/projects/openprinting-cups)
8
9
10Introduction
11------------
12
13OpenPrinting CUPS is the most current version of CUPS, a standards-based, open
14source printing system for Linux® and other Unix®-like operating systems.  CUPS
15supports printing to:
16
17- [AirPrint™][1] and [IPP Everywhere™][2] printers,
18- Network and local (USB) printers with Printer Applications, and
19- Network and local (USB) printers with (legacy) PPD-based printer drivers.
20
21CUPS provides the System V ("lp") and Berkeley ("lpr") command-line interfaces,
22a configurable web interface, a C API, and common print filters, drivers, and
23backends for printing.  The [cups-filters][3] project provides additional
24filters and drivers.
25
26CUPS is licensed under the Apache License Version 2.0 with an exception to allow
27linking against GNU GPL2-only software.  See the files `LICENSE` and `NOTICE`
28for more information.
29
30> Note: Apple maintains a separate repository for the CUPS that ships with macOS
31> and iOS at <https://github.com/apple/cups>.
32
33[1]: https://support.apple.com/en-us/HT201311
34[2]: https://www.pwg.org/ipp/everywhere.html
35[3]: https://github.com/openprinting/cups-filters
36
37
38Reading the Documentation
39-------------------------
40
41Initial documentation to get you started is provided in the root directory of
42the CUPS sources:
43
44- `CHANGES.md`: A list of changes in the current major release of CUPS.
45- `CONTRIBUTING.md`: Guidelines for contributing to the CUPS project.
46- `CREDITS.md`: A list of past contributors to the CUPS project.
47- `DEVELOPING.md`: Guidelines for developing code for the CUPS project.
48- `INSTALL.md`: Instructions for building and installing CUPS.
49- `LICENSE`: The CUPS license agreement (Apache 2.0).
50- `NOTICE`: Copyright notices and exceptions to the CUPS license agreement.
51- `README.md`: This file.
52- `REPORTING_ISSUES.md`: Instructions what information to provide when reporting an issue.
53
54Once you have installed the software you can access the documentation (and a
55bunch of other stuff) online at <http://localhost:631/> and using the `man`
56command, for example `man cups`.
57
58If you're having trouble getting that far, the documentation is located under
59the `doc/help` and `man` directories.
60
61*Please read the documentation before asking questions.*
62
63
64Setting Up Printers
65-------------------
66
67CUPS includes a web-based administration tool that allows you to manage
68printers, classes, and jobs on your server.  Open <http://localhost:631/admin/>
69in your browser to access the printer administration tools.  You will be asked
70for the administration password (root or any other user in the "sys", "system",
71"root", "admin", or "lpadmin" group on your system) when performing any
72administrative function.
73
74The `lpadmin` command is used to manage printers from the command-line.  For
75example, the following command creates a print queue called "myprinter" for an
76IPP Everywhere printer at address "11.22.33.44":
77
78    lpadmin -p myprinter -E -v "ipp://11.22.33.44/ipp/print" -m everywhere
79
80The `-p` option specifies the printer name.  The `-E` option enables the printer
81and accepts new print jobs immediately.  The `-v` option specifies the *device
82URI* for the printer, which tells CUPS how to communicate with the printer.  And
83the `-m` option specifies the model (driver) to use, in this case the IPP
84Everywhere ("everywhere") driver that is used for AirPrint and IPP Everywhere
85printers as well as shared printers and printers supported through Printer
86Applications.
87
88Legacy printers are supported using PPD (PostScript Printer Description) files
89that describe printer capabilities and driver programs needed for each printer.
90CUPS includes several sample PPD files for common legacy printers:
91
92   Driver                       | PPD Name
93   -----------------------------|------------------------------
94   Dymo Label Printers          | drv:///sample.drv/dymo.ppd
95   Intellitech Intellibar       | drv:///sample.drv/intelbar.ppd
96   EPSON 9-pin Series           | drv:///sample.drv/epson9.ppd
97   EPSON 24-pin Series          | drv:///sample.drv/epson24.ppd
98   Generic PCL Laser Printer    | drv:///sample.drv/generpcl.ppd
99   Generic PostScript Printer   | drv:///sample.drv/generic.ppd
100   HP DeskJet Series            | drv:///sample.drv/deskjet.ppd
101   HP LaserJet Series           | drv:///sample.drv/laserjet.ppd
102   OKIDATA 9-Pin Series         | drv:///sample.drv/okidata9.ppd
103   OKIDATA 24-Pin Series        | drv:///sample.drv/okidat24.ppd
104   Zebra CPCL Label Printer     | drv:///sample.drv/zebracpl.ppd
105   Zebra EPL1 Label Printer     | drv:///sample.drv/zebraep1.ppd
106   Zebra EPL2 Label Printer     | drv:///sample.drv/zebraep2.ppd
107   Zebra ZPL Label Printer      | drv:///sample.drv/zebra.ppd
108
109The sample drivers provide basic printing capabilities, but generally do not
110exercise the full potential of the printers or CUPS.  Other drivers provide
111greater printing capabilities.
112
113You can run the `lpinfo -m` command to list all of the available drivers:
114
115    lpinfo -m
116
117Similarly, the `lpinfo -v` command lists the available printers and their device
118URIs:
119
120    lpinfo -v
121
122Once you know the device URI and driver name, add the printer using the
123`lpadmin` command:
124
125    lpadmin -p PRINTER-NAME -E -v "DEVICE-URI" -m DRIVER-NAME
126
127
128Printing Files
129--------------
130
131CUPS provides both the System V `lp` and Berkeley `lpr` commands for printing:
132
133    lp FILENAME
134    lpr FILENAME
135
136Both the `lp` and `lpr` commands support printing options:
137
138    lp -o media=A4 -o resolution=600dpi FILENAME
139    lpr -o media=A4 -o resolution=600dpi FILENAME
140
141CUPS recognizes many types of images files as well as PDF, PostScript, and text
142files, so you can print those files directly rather than through an application.
143
144If you have an application that generates output specifically for your printer
145then you need to use the `-oraw` or `-l` options:
146
147    lp -o raw FILENAME
148    lpr -l FILENAME
149
150This will prevent the filters from misinterpreting your print file.
151
152
153Legal Stuff
154-----------
155
156Copyright © 2020-2025 by OpenPrinting
157
158Copyright © 2007-2020 by Apple Inc.
159
160Copyright © 1997-2007 by Easy Software Products.
161
162CUPS is provided under the terms of the Apache License, Version 2.0 with
163exceptions for GPL2/LGPL2 software.  A copy of this license can be found in the
164file `LICENSE`.  Additional legal information is provided in the file `NOTICE`.
165
166Unless required by applicable law or agreed to in writing, software distributed
167under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
168CONDITIONS OF ANY KIND, either express or implied.  See the License for the
169specific language governing permissions and limitations under the License.
170

README_zh.md

1# 三方开源软件CUPS
2## CUPS简介
3CUPS(Common Unix Printing System)是一种开源打印系统,现在由OpenPrinting组织维护。CUPS主要功能包括打印队列管理、打印驱动程序管理、网络打印支持等。CUPS支持多种打印协议,包括IPP(Internet Printing Protocol)、LPD(Line Printer Daemon Protocol)、AppSocket等。
4
5CUPS支持以下类型的打印机:
6- AirPrint和IPP Everywhere认证的打印机;
7- 带打印机应用程序的网络和USB打印机;
8- 基于PPD(PostScript Printer Definition)打印驱动程序的网络和本地(USB)打印机。
9
10您也可以通过[CUPS官网主页](https://github.com/OpenPrinting/cups)了解更多关于CUPS项目的信息。
11
12## 引入背景简述
13OpenHarmony南向生态发展过程中,需要对存量市场的打印机进行兼容。使用CUPS打印系统能直接对接市场上大部分的打印机,也减少了打印机驱动适配OpenHarmony系统的难度。
14
15## 目录结构
16```
17- LICENSE                           版权文件
18- OAT.xml                           OAT.xml过滤配置文件
19- README.OpenSource                 项目README.OpenSource文件
20- README.md                         英文说明
21- README_zh.md                      中文说明
22- backport-CVE-xxx.patch            CVE修复补丁
23- cups-x.x.x-source.tar.gz          cups源码压缩tar包
24- backport-xxx.patch                上游更新补丁列表
25- cups-xxx.patch                    上游更新补丁列表
26- cups.spec                         上游更新记录说明
27- cups.yaml                         上游yaml文件
28- ohos-xxx.patch                    适配OpenHarmony编译补丁文件
29- cups_single_file.patch            适配OpenHarmony编译补丁文件
30- pthread_cancel.patch              适配OpenHarmony编译补丁文件
31- install.sh                        适配OpenHarmony编译sh脚本文件
32- generate_mime_convs.py            适配OpenHarmony编译python脚本文件
33```
34
35## 如何使用
36### 1、头文件引入
37```c
38#include <cups/cups-private.h>
39```
40### 2、添加编译依赖
41在您的 bundle.json 文件 添加
42```json
43"deps": {
44  "third_party": [
45    "cups"
46  ]
47}
48```
49在您的BUILD.gn需要的地方添加依赖
50```json
51deps += [ "//third_party/cups:cups" ]
52```
53### 3、接口使用示例
54```c
55// 使用CUPS接口查询打印机能力示例
56ipp_t *request; /* IPP Request */
57ipp_t *response; /* IPP response */
58http_t *http = NULL;
59char scheme[HTTP_MAX_URI]; // 协议类型
60char username[HTTP_MAX_URI]; // 请求用户名
61char host[HTTP_MAX_URI]; // 打印机ip
62int port; // 打印机端口
63// 声明需要查询哪些打印机能力,此处为所有
64static const char * const pattrs[] = {
65    "all"
66};
67
68// 使用打印机ip和端口连接打印机
69http = httpConnect2(host, port, NULL, AF_UNSPEC, HTTP_ENCRYPTION_IF_REQUESTED, 1, TIME_OUT, NULL);
70if (http == nullptr) {
71    return;
72}
73// 构造获取打印机能力的request
74request = ippNewRequest(IPP_OP_GET_PRINTER_ATTRIBUTES);
75// 指定请求uri
76ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printerUri.c_str());
77// 指定请求的用户
78ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name", NULL, cupsUser());
79// 指定请求哪些打印机属性
80ippAddStrings(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes",
81(int)(sizeof(pattrs) / sizeof(pattrs[0])), NULL, pattrs);
82// 调用CUPS接口发送ipp请求
83response = cupsDoRequest(http, request, "/");
84// 处理请求结果
85if (cupsLastError() > IPP_STATUS_OK_CONFLICTING) {
86    ippDelete(response);
87    return;
88}
89// 关闭http
90httpClose(http);
91```
92
93### 相关仓
94[third_party_cups-filters](https://gitee.com/openharmony/third_party_cups-filters)
95
96[print_print_fwk](https://gitee.com/openharmony/print_print_fwk)
97
98### 参与贡献
99[如何贡献](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/contribute/参与贡献.md)
100
101[Commit message规范](https://gitee.com/openharmony/device_qemu/wikis/Commit%20message%E8%A7%84%E8%8C%83)
102
103