satyr 0.42
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
rpm.h File Reference

RPM-related structures and utilities. More...

#include <stdbool.h>
#include <inttypes.h>
#include <json.h>

Go to the source code of this file.

Data Structures

struct  sr_rpm_consistency
 
struct  sr_rpm_package
 

Enumerations

enum  sr_package_role { SR_ROLE_UNKNOWN = 0 , SR_ROLE_AFFECTED }
 

Functions

struct sr_rpm_packagesr_rpm_package_new (void)
 
void sr_rpm_package_init (struct sr_rpm_package *package)
 
void sr_rpm_package_free (struct sr_rpm_package *package, bool recursive)
 
int sr_rpm_package_cmp (struct sr_rpm_package *package1, struct sr_rpm_package *package2)
 
int sr_rpm_package_cmp_nvr (struct sr_rpm_package *package1, struct sr_rpm_package *package2)
 
int sr_rpm_package_cmp_nevra (struct sr_rpm_package *package1, struct sr_rpm_package *package2)
 
struct sr_rpm_packagesr_rpm_package_append (struct sr_rpm_package *dest, struct sr_rpm_package *item)
 
int sr_rpm_package_count (struct sr_rpm_package *packages)
 
struct sr_rpm_packagesr_rpm_package_sort (struct sr_rpm_package *packages)
 
struct sr_rpm_packagesr_rpm_package_uniq (struct sr_rpm_package *packages)
 
struct sr_rpm_packagesr_rpm_package_get_by_name (const char *name, char **error_message)
 
struct sr_rpm_packagesr_rpm_package_get_by_path (const char *path, char **error_message)
 
char * sr_rpm_package_to_json (struct sr_rpm_package *package, bool recursive)
 
int sr_rpm_package_from_json (struct sr_rpm_package **rpm_package, json_object *list, bool recursive, char **error_message)
 
bool sr_rpm_package_parse_nvr (const char *text, char **name, char **version, char **release)
 
bool sr_rpm_package_parse_nevra (const char *text, char **name, uint32_t *epoch, char **version, char **release, char **architecture)
 
struct sr_rpm_consistencysr_rpm_consistency_new (void)
 
void sr_rpm_consistency_init (struct sr_rpm_consistency *consistency)
 
void sr_rpm_consistency_free (struct sr_rpm_consistency *consistency, bool recursive)
 
int sr_rpm_consistency_cmp (struct sr_rpm_consistency *consistency1, struct sr_rpm_consistency *consistency2)
 
int sr_rpm_consistency_cmp_recursive (struct sr_rpm_consistency *consistency1, struct sr_rpm_consistency *consistency2)
 
struct sr_rpm_consistencysr_rpm_consistency_append (struct sr_rpm_consistency *dest, struct sr_rpm_consistency *item)
 

Detailed Description

RPM-related structures and utilities.

Definition in file rpm.h.

Enumeration Type Documentation

◆ sr_package_role

enum sr_package_role

Definition at line 38 of file rpm.h.

Function Documentation

◆ sr_rpm_consistency_append()

struct sr_rpm_consistency * sr_rpm_consistency_append ( struct sr_rpm_consistency dest,
struct sr_rpm_consistency item 
)

Appends 'item' at the end of the list 'dest'.

Returns
This function returns the 'dest' consistency info. If 'dest' is NULL, it returns the 'item' consistency info.

◆ sr_rpm_package_append()

struct sr_rpm_package * sr_rpm_package_append ( struct sr_rpm_package dest,
struct sr_rpm_package item 
)

Appends 'item' at the end of the list 'dest'.

Returns
This function returns the 'dest' package. If 'dest' is NULL, it returns the 'item' package.

◆ sr_rpm_package_cmp()

int sr_rpm_package_cmp ( struct sr_rpm_package package1,
struct sr_rpm_package package2 
)

Compares two packages.

Parameters
package1It must be non-NULL pointer. It's not modified by calling this function.
package2It must be non-NULL pointer. It's not modified by calling this function.
Returns
Returns 0 if the packages are same. Returns negative number if package1 is found to be 'less' than package2. Returns positive number if package1 is found to be 'greater' than package2.

◆ sr_rpm_package_cmp_nevra()

int sr_rpm_package_cmp_nevra ( struct sr_rpm_package package1,
struct sr_rpm_package package2 
)

Compares two packages by their name, epoch, version, release and architecture.

Parameters
package1It must be non-NULL pointer. It's not modified by calling this function.
package2It must be non-NULL pointer. It's not modified by calling this function.
Returns
Returns 0 if the packages are same. Returns negative number if package1 is found to be 'less' than package2. Returns positive number if package1 is found to be 'greater' than package2.

◆ sr_rpm_package_cmp_nvr()

int sr_rpm_package_cmp_nvr ( struct sr_rpm_package package1,
struct sr_rpm_package package2 
)

Compares two packages by their name, version and release.

Parameters
package1It must be non-NULL pointer. It's not modified by calling this function.
package2It must be non-NULL pointer. It's not modified by calling this function.
Returns
Returns 0 if the packages are same. Returns negative number if package1 is found to be 'less' than package2. Returns positive number if package1 is found to be 'greater' than package2.

◆ sr_rpm_package_count()

int sr_rpm_package_count ( struct sr_rpm_package packages)

Returns the number of packages in the list.