| 1 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- |
| 2 |
* |
| 3 |
* Copyright (C) 2008-2009 Richard Hughes <[email protected]> |
| 4 |
* |
| 5 |
* Licensed under the GNU Lesser General Public License Version 2.1 |
| 6 |
* |
| 7 |
* This library is free software; you can redistribute it and/or |
| 8 |
* modify it under the terms of the GNU Lesser General Public |
| 9 |
* License as published by the Free Software Foundation; either |
| 10 |
* version 2.1 of the License, or (at your option) any later version. |
| 11 |
* |
| 12 |
* This library is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
* Lesser General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU Lesser General Public |
| 18 |
* License along with this library; if not, write to the Free Software |
| 19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 |
*/ |
| 21 |
|
| 22 |
#if !defined (__PACKAGEKIT_H_INSIDE__) && !defined (PK_COMPILATION) |
| 23 |
#error "Only <packagekit.h> can be included directly." |
| 24 |
#endif |
| 25 |
|
| 26 |
#ifndef __PK_PACKAGE_IDS_H |
| 27 |
#define __PK_PACKAGE_IDS_H |
| 28 |
|
| 29 |
#include <glib.h> |
| 30 |
|
| 31 |
G_BEGIN_DECLS |
| 32 |
|
| 33 |
/* rationale: |
| 34 |
* |
| 35 |
* '%': breaks printf |
| 36 |
* '|': used as the filename separator |
| 37 |
* '~': conary |
| 38 |
* '@': conary |
| 39 |
* |
| 40 |
* If this has to be changed, also change: |
| 41 |
* - backends/urpmi/helpers/urpmi-dispatched-backend.pl |
| 42 |
* - python/packagekit/backend.py |
| 43 |
*/ |
| 44 |
#define PK_PACKAGE_IDS_DELIM "&" |
| 45 |
|
| 46 |
gchar **pk_package_ids_from_id (const gchar *package_id); |
| 47 |
gchar **pk_package_ids_from_string (const gchar *package_id); |
| 48 |
gboolean pk_package_ids_check (gchar **package_ids); |
| 49 |
gchar *pk_package_ids_to_string (gchar **package_ids); |
| 50 |
gboolean pk_package_ids_present_id (gchar **package_ids, |
| 51 |
const gchar *package_id); |
| 52 |
gchar **pk_package_ids_add_id (gchar **package_ids, |
| 53 |
const gchar *package_id); |
| 54 |
gchar **pk_package_ids_add_ids (gchar **package_ids, |
| 55 |
gchar **package_ids_new); |
| 56 |
gchar **pk_package_ids_remove_id (gchar **package_ids, |
| 57 |
const gchar *package_id); |
| 58 |
|
| 59 |
/* compat defines for old versions */ |
| 60 |
|
| 61 |
/** |
| 62 |
* pk_package_ids_from_text: |
| 63 |
* @package_id: A single package_id |
| 64 |
* |
| 65 |
* Form a composite string array of package_id's from |
| 66 |
* a delimited string |
| 67 |
* |
| 68 |
* Return value: (transfer full): the string array, or %NULL if invalid, free with g_strfreev() |
| 69 |
* |
| 70 |
* Deprecated: Use pk_package_ids_from_string() |
| 71 |
*/ |
| 72 |
#define pk_package_ids_from_text pk_package_ids_from_string |
| 73 |
|
| 74 |
/** |
| 75 |
* pk_package_ids_to_text: |
| 76 |
* @package_ids: a string array of package_id's |
| 77 |
* |
| 78 |
* Cats the string array of package_id's into one delimited string |
| 79 |
* Return value: a string representation of all the package_id's. |
| 80 |
* |
| 81 |
* Deprecated: pk_package_ids_to_string() |
| 82 |
*/ |
| 83 |
#define pk_package_ids_to_text pk_package_ids_to_string |
| 84 |
|
| 85 |
G_END_DECLS |
| 86 |
|
| 87 |
#endif /* __PK_PACKAGE_IDS_H */ |