From patchwork Mon Dec 7 22:19:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: morganamilo X-Patchwork-Id: 1818 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 9FA691C996DCF for ; Mon, 7 Dec 2020 22:31:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1, MAILING_LIST_MULTI=-1,RCVD_IN_MSPIKE_H4=-0.01,RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001,T_DMARC_POLICY_NONE=0.01 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-BL-Results: [127.0.0.19] Received: from mail.archlinux.org (mail.archlinux.org [95.216.189.61]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Mon, 7 Dec 2020 22:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1607379738; bh=PwmpjPbAhXfZuxHuLJf9acQaideBPcozjZwR3VHS2IA=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Reply-To; b=sLYXa7wh/3/co//VcO79kC77kppHFl1LXvFV2jfsvFsh0uFb69oU/MoLpRqvLkJi8 taoStID7Y21xiimObwywldgoYJNUkkEYy03It2LrtH3yHcU4Nj+xipBwvSo5Wdx82q /T8RsjU/GygQ1gYqX09j3Z70ZrBEwUFyrZ3gyPTezbL4DroW+4EtlHEPchq2/EbM2t t9SCyGY3m0TTxjaDV+knssfCilXJArRIksAfplbP3dgG5jyIQfvr7SO8jVKOeLuir5 /NuUlVSPel3gvLSyXMvKCJ3L5uXdcscqPTmm8AUwcHDe4DNUG0wT+WHOPv+SFxg5Bi izbvL6CNzD68z6gP0k/orHows1XKrUEB5svx4+SNnmO6qgkBqfnoaXNXvaMG8Xq6iY Uoymg/ae4bLPT/B5X6A97CdPULkHT79v7zc6bVONDyUD5Law3NtWHp+txynIvwyVs0 dlkLXBslB+nnqtYHPL9QRFlV8nfsuISvCMlCI1d09BXrAiJDveoVQy/5BxjGay2buO FOI2MNCiEQq/Tgd+m4NGj8LwNsJABW8G+YAVay7ahZFve9BXCUWZKoYdFkVsgasHzC R3l/loBvuUi2fZPFLmBQThZsyITop+WWu02lxbOZr9EQZZJXz/i1wi2oDENkCpAjbz byIdDw5ZjSPrHTN6IfDELh4o= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-rsa; t=1607380290; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=EKaOstTmMsabBPWFn0lweRyEaf91AIDFjES4bBYzCGQ=; b=B8+Eg3IIcCmfTUbPKzJacLfoA1F4DJpL5UsOn3x2Dn/bXSrV8sTbZ2jwJEmdgbxjBxqU8n UXiyGpsqlXiYN4QkAxSJt8icJSM+8SY/h+4SlQhwtfMyPBwwF6GptRonOehbZ9236W7ADY 3Zv7BAh7DyPtfMvo0G3uSURFjfiJN+npoDynxzbb+r3v9KRlPmJObljccN3yFYiqju6lhK GrC26azyFZShfookh30bmx2hU5YPlqlDDC0fKfJFb3xqCBF7I9vdKRF03Q8QsmbNeputtE f8mZJOkG/j/1L53azvt1eVa6cJbubVOOzh497Y0MnFrjeyDWyxH8oRMVeEQBBD1uu1/46C 83s5TWzXGivrXzzFsqtjkmGdQLT7Gp7Ahlq1cqBRIwiVy75f5BSy6lf9L2wVaKwbXRoj8u WjRXmPQFqt7afR27pNgA5ZkAeJLxY+wsXyy5r7YNUg/BuPkcZsFUs6heQZaAmb/pwbzddC 9MqMmdppbsA8FJgfToGC0LCmPcVP7/Spi3dtgE6z91BjqbIro3RvVTTDOZ0a8Sg/daTh0P 1aQFZ4iB2mGkfT9P672Wt4tbwY9i6VreqXYMLY3QYbQRaedneRw5gJj3xkAdvSbweOUaZw OWez723T0frhd8VA1ydPRZ+cRBcFUf46JNFfSbmo3P1MklhgBkQLA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-ed25519; t=1607380290; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=EKaOstTmMsabBPWFn0lweRyEaf91AIDFjES4bBYzCGQ=; b=9ghHoTY0rYoEiRMOymj8LlLnMyi4b3geRdIgmMjLP/TeK5VCh93b54UH01xiw8Vc/j9PcR hWReolN/Wmk942AQ== From: morganamilo DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-ed25519; t=1607379732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EKaOstTmMsabBPWFn0lweRyEaf91AIDFjES4bBYzCGQ=; b=Te9khUBJ8y9mb61s608h2CbDiVf8X4UZXFBIaURRq5yfsuQ9q2rI+mmLYS9SVk++ogz6Lf AnsR/3VsAjM0FBDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-rsa; t=1607379732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EKaOstTmMsabBPWFn0lweRyEaf91AIDFjES4bBYzCGQ=; b=hM8f28FNuIeBSCe+cTwaNnRFjYl0DDxjxkQwn3qj9v4mJLjV2Db0rORqTHMbNUGEYRfc0k JzmfQoxlqsKl8SgUH/owqNg1JOOKVP3m5BQRueeVx+GfVcHQrUhxvaMzGWYuPOZznrRImM E+N+L6geE37uTv924MDwGdCljcL5ArqBFko1bYKX30i6Q4TPIbR5yWJY+rqG8xj3kVVeCU zf+Rg8Tzzlv32LXqo744VVznIMSiDEKIpV69smuoNWx5HvkkjAszcgmKXWKNOsViqrdtLc W2D7jObLqqxMWclshXxckFEAOHh5AZKg+6nAz8xhJshEYO9yl5pzobh5htiE9s/ZmYD4jX WmZHz2mlni9WvI3cJi+cSNY6aaBDXu0RJKYYUWA2BMuqLkmZaf+GlXUYzkNQKGE0LT7VMW dnWug72MsgQmjP0YefOKSb/GxpGiMM4/zthH6jcFPkcUmikrMOXznJlVwPBHhLBLV9quNQ 2vBWmDYPxqsfNif2iZsyJWVdnYWSJcs8QF5kiyylnmAnPFLPZ1u5Qbh5En082DEX8/Y4uI MgWbUHUjVCHff3l4LMdYGwKieZEBja8kYi5Jvu31XdmMAQT89t/6aOBl2KTToAp+z4hWg4 qvf7RAUsc0n6/CD86IaWejtbroa/dAUn5yPUqkeQvbIxVP/BLXRd4= To: pacman-dev@archlinux.org Date: Mon, 7 Dec 2020 22:19:44 +0000 Message-Id: <20201207221956.667322-12-morganamilo@archlinux.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201207221956.667322-1-morganamilo@archlinux.org> References: <20201207221956.667322-1-morganamilo@archlinux.org> MIME-Version: 1.0 Subject: [pacman-dev] [PATCH 11/23] doc: document files and groups X-BeenThere: pacman-dev@archlinux.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Discussion list for pacman development Errors-To: pacman-dev-bounces@archlinux.org Sender: "pacman-dev" Authentication-Results: mail.archlinux.org; auth=pass smtp.auth=luna smtp.mailfrom=pacman-dev-bounces@archlinux.org --- lib/libalpm/alpm.h | 102 +++++++++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 46 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 5ee99711..30bfb06d 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -94,44 +94,82 @@ typedef struct __alpm_pkg_t alpm_pkg_t; /** Transaction structure used internally by libalpm */ typedef struct __alpm_trans_t alpm_trans_t; -/* - * Structures +/** @addtogroup alpm_api ALPM + * @brief The libalpm Public API + * @{ */ -/** Package group */ -typedef struct _alpm_group_t { - /** group name */ - char *name; - /** list of alpm_pkg_t packages */ - alpm_list_t *packages; -} alpm_group_t; +/** @addtogroup alpm_files Files + * @brief Functions for package files + * @{ + */ /** File in a package */ typedef struct _alpm_file_t { - char *name; - off_t size; - mode_t mode; + /** Name of the file */ + char *name; + /** Size of the file */ + off_t size; + /** The file's permissions */ + mode_t mode; } alpm_file_t; /** Package filelist container */ typedef struct _alpm_filelist_t { - size_t count; - alpm_file_t *files; + /** Amount of files in the array */ + size_t count; + /** An array of files */ + alpm_file_t *files; } alpm_filelist_t; /** Local package or package file backup entry */ typedef struct _alpm_backup_t { - char *name; - char *hash; + /** Name of the file (without .pacsave extension) */ + char *name; + /** Hash of the filename (used internally) */ + char *hash; } alpm_backup_t; +/** Determines whether a package filelist contains a given path. + * The provided path should be relative to the install root with no leading + * slashes, e.g. "etc/localtime". When searching for directories, the path must + * have a trailing slash. + * @param filelist a pointer to a package filelist + * @param path the path to search for in the package + * @return a pointer to the matching file or NULL if not found + */ +alpm_file_t *alpm_filelist_contains(alpm_filelist_t *filelist, const char *path); + +/* End of alpm_files */ +/** @} */ -/** @addtogroup alpm_api ALPM - * @brief The libalpm Public API +/** @addtogroup alpm_groups Groups + * @brief Functions for package groups * @{ */ +/** Package group */ +typedef struct _alpm_group_t { + /** group name */ + char *name; + /** list of alpm_pkg_t packages */ + alpm_list_t *packages; +} alpm_group_t; + +/** Find group members across a list of databases. + * If a member exists in several databases, only the first database is used. + * IgnorePkg is also handled. + * @param dbs the list of alpm_db_t * + * @param name the name of the group + * @return the list of alpm_pkg_t * (caller is responsible for alpm_list_free) + */ +alpm_list_t *alpm_find_group_pkgs(alpm_list_t *dbs, const char *name); + +/* End of alpm_groups */ +/** @} */ + + /** @addtogroup alpm_errors Error Codes * Error codes returned by libalpm. * @{ @@ -2031,34 +2069,6 @@ int alpm_pkg_mtree_close(const alpm_pkg_t *pkg, struct archive *archive); /** @} */ -/* - * Filelists - */ - -/** Determines whether a package filelist contains a given path. - * The provided path should be relative to the install root with no leading - * slashes, e.g. "etc/localtime". When searching for directories, the path must - * have a trailing slash. - * @param filelist a pointer to a package filelist - * @param path the path to search for in the package - * @return a pointer to the matching file or NULL if not found - */ -alpm_file_t *alpm_filelist_contains(alpm_filelist_t *filelist, const char *path); - - -/* - * Groups - */ - -/** Find group members across a list of databases. - * If a member exists in several databases, only the first database is used. - * IgnorePkg is also handled. - * @param dbs the list of alpm_db_t * - * @param name the name of the group - * @return the list of alpm_pkg_t * (caller is responsible for alpm_list_free) - */ -alpm_list_t *alpm_find_group_pkgs(alpm_list_t *dbs, const char *name); - /* * Sync */