From patchwork Mon Dec 7 22:19:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: morganamilo X-Patchwork-Id: 1813 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 384441C99671C for ; Mon, 7 Dec 2020 22:22:27 +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,SPF_HELO_PASS=-0.001,T_DMARC_POLICY_NONE=0.01 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-BL-Results: Received: from mail.archlinux.org (mail.archlinux.org [IPv6:2a01:4f9:c010:3052::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Mon, 7 Dec 2020 22:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1607379728; bh=+V6JiqHdHMpB+x3gluPCJE1qUbe5hS1X0g7N+RK/Vog=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Reply-To; b=RUqz94MXIN/KedTXVqfPM7psTwK//SfjhhndJoWE4bxcgAwTmM9INt00EWUPuZ2Ct Dk2j+n1uKMkgP3O6K9qZtMHRPz39r2GksgAraHO5IvZ1UhgGXY5S2f9nI3ffZBYHp8 7840tAnbw8ORzyYNDRftHIf+e1ljtSsV8Kr3BgKEqGmNNHBFCJK9N6SElCa0A1oG74 g7X+UmnKU3DikzH8Ym4Bu61hTjys1Z8J4W1wEsFWyaqEUL3yuyKNUe1VZEHKR52u3/ PjmYJ+YRoJW2ceoGsvsWUuinKdKcw8rPCPQnvpedT+suz9wn4QqQ59dh8EHUuvoYiW o6Dfh/cZeYt5iEbHXvl0StIYGVfC9BlYbYOsCFGoAALnArRdTr382EV3N9LKrW6PFt OKmjsQ7mmOcZ2Xtm6ZJiytx3ccNtUHt7BpyL8TF5xuRhFS7ycWkKYmIRaduKn+HmOb HX1wd4prJYawz6qCeas7CQzWUhSXJJLiXhQEOauXbz36SG7hJzlx/Vnsqzol5tSoWP g3CgtX8HCziUXVW1ZW52CIpQz72frLXVEFgXFTRYl83HeWxCcUD6gwrzZ2R1IanZRS nspwJhpzHUbvqzNqeDNy9m51g85hrX/0ZAXvEtjceSg2gMDzdrbyhsfCDbASQG7fNv T174WCNr3pWdCHQREABps7cs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-ed25519; t=1607379733; 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=vjl+2ONJxVfZ04xVq0FgLRlooLCxiXytIRv5HpjsVRk=; b=2mgLeONTeVIIrpvwcmZ2g5/FmlPh1/F3h9aWBssA6mfhRbFL+KlCI8ZbXwdsU70XHLo0ij nhmBB9WuNi/divCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-rsa; t=1607379733; 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=vjl+2ONJxVfZ04xVq0FgLRlooLCxiXytIRv5HpjsVRk=; b=Bc/7IhDxRy5UnVgBKpvqnmlR0+3HB5//uZL29TAEn/jaJlGvBwKUm/P3/jiZ35Rnl7vn31 JH/shHPAA+S8nUfSN/g4xzjvl1b7hxvBbTlVBgMjQRxTFeUoEjUaa8vqTm4XkIsc5e+YJN vM4Qz595aZ/8WUNUyavLCTcR5aqyM2NwORD67mhega+fQa5f8wkW0jduiBrakgf4yC1yEl /stI7UZGD2B10jNMKBGY64RzuPlOLm0Kq+pHC+OQS+Ii82cw474O/MqIf7ne/EhVCUgfT9 JZ/WjTHbVEcUL8mzS8BWs2VsbZEhtfgBcA0GOHyEJlrTUgvd3AkpBYzDzxJdoq87gEmtKO lW+P3243s+XfYQVulexvE2qK7Vw1BcbT12G9jK1O/CBRwmjyWQyqZCiOJD6gViySyxmNL7 gFYGsGOYc+7jpVgKSBpyxqz+JAQROmbuTQhq7rKwcpHkTUjZWHs6jXUiLYFBIbXTzVfyXy i6LXd+UkOHuuXtgq/Fn3BYPGcS0iYDHShaL+NV9aCABi8CMPkW70cYFzQ2cBD5BaVcwiC6 hwEFhP1L/ZasYEzi+ajAL1fGcBbC5J36iaovUvbB1R4jKzuxMcXcEmuTsXeL61aNwzOlfE VLoRyIZuWgJ5EvfKrVpNBEDZW+ZduVgrpCuMJKBU/smeSFgytW0Vk= From: morganamilo DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-rsa; t=1607379725; 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=vjl+2ONJxVfZ04xVq0FgLRlooLCxiXytIRv5HpjsVRk=; b=tf7rg2yxZKsr+vqSE9CSbcfsRtFSvdKj4XZiwg2AKwWF4cPPU0Byg4NyC57kVMAIzqhjGX dEsQHjRQG2zELGFW6d7SkXAi4/sBH9COIhqZO6PgwrcJLcPYCqvnJo4DfN0o7z/towrGyV j1BQsYSahVvcGRGTM1Spz/vn+aXQuZIQhIRk9TBQ7qsIr64eBZbz+vq6Lrum0mKnES2N+t j2uVk8pt8Mg00FpUXgO7VKXCo7UoVOz15iXOO93WLI/e4nxNKKKBKRZCkPPCot8R+ydZ1q vuIdKUqD0bPKSNOZmf8aPSXxZhNIZz7dpQI36wBvJb0z090701Bc6FoP404vZ9U4N5AP6c eUD3tyn4IjVHd+YL7jVMJh1qX56qdVQLG15GBApa+ThqulCp0IopuI3CQRZXOyVLo9bHQn jyNFlCB8RUl5gBgkR8+fJ0kUGyAuYSGGVhB+g+g8z5d/Vj0TENZBUv3DHmjzu8UFS32WcZ FqvJIV6xi0Rg2TDAS9OvftY5GHlxKOBMGL/DLEZZWDAWkdtiat/NRe5lA4kZd1VgjgnjIR 98hsGVIXhXvIWWBgtR6RJJNOEHaL+TE3mrrWVuqM6RQquXyjM+1o2rmAj+hir2Il6U2rkr 0CMgKjrYFgi537Qau63MlvmEH9cAMfNCbmY4+7QpoGZJvNxqHwe/s= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-ed25519; t=1607379725; 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=vjl+2ONJxVfZ04xVq0FgLRlooLCxiXytIRv5HpjsVRk=; b=69lrZgUYWLW/xI/VjGQKN7cNAiscjKtk5AUO/d01QiXPBuLuS1CLTBaRS4v8WDN+UfFakS Muf3gba/qxfc4fBQ== To: pacman-dev@archlinux.org Date: Mon, 7 Dec 2020 22:19:37 +0000 Message-Id: <20201207221956.667322-5-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 04/23] doc: document handle 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 | 58 ++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 1c2422ca..178c8f6a 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -243,6 +243,36 @@ const char *alpm_strerror(alpm_errno_t err); /* End of alpm_errors */ /** @} */ + +/** \addtogroup alpm_handle Handle + * @brief Functions to initialize and release libalpm + * @{ + */ + +/** Initializes the library. + * Creates handle, connects to database and creates lockfile. + * This must be called before any other functions are called. + * @param root the root path for all filesystem operations + * @param dbpath the absolute path to the libalpm database + * @param err an optional variable to hold any error return codes + * @return a context handle on success, NULL on error, err will be set if provided + */ +alpm_handle_t *alpm_initialize(const char *root, const char *dbpath, + alpm_errno_t *err); + +/** Release the library. + * Disconnects from the database, removes handle and lockfile + * This should be the last alpm call you make. + * After this returns, handle should be considered invalid and cannot be reused + * in any way. + * @param myhandle the context handle + * @return 0 on success, -1 on error + */ +int alpm_release(alpm_handle_t *handle); + +/* End of alpm_handle */ +/** @} */ + typedef int64_t alpm_time_t; /* @@ -1915,34 +1945,6 @@ char *alpm_compute_sha256sum(const char *filename); /** @} */ -/** \addtogroup alpm_interface Interface Functions - * @brief Functions to initialize and release libalpm - * @{ - */ - -/** Initializes the library. - * Creates handle, connects to database and creates lockfile. - * This must be called before any other functions are called. - * @param root the root path for all filesystem operations - * @param dbpath the absolute path to the libalpm database - * @param err an optional variable to hold any error return codes - * @return a context handle on success, NULL on error, err will be set if provided - */ -alpm_handle_t *alpm_initialize(const char *root, const char *dbpath, - alpm_errno_t *err); - -/** Release the library. - * Disconnects from the database, removes handle and lockfile - * This should be the last alpm call you make. - * After this returns, handle should be considered invalid and cannot be reused - * in any way. - * @param myhandle the context handle - * @return 0 on success, -1 on error - */ -int alpm_release(alpm_handle_t *handle); - -/** @} */ - /** Remove the database lock file * @param handle the context handle * @return 0 on success, -1 on error