[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [virt-tools-list] [libosinfo 3/3] API to retrieve checksum for driver files



On Wed, Dec 12, 2012 at 03:21:30AM +0200, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak gnome org>
> 
> Keeping this API agnostic of MD5 so that we can later switch to another
> hashing alogirthm without breaking the API.

algorithm

>  /**
> + * osinfo_device_driver_get_file_checksum:
> + * @driver: a #OsinfoDeviceDriver instance
> + * @file: The name of the driver file for which checksum is requested
> + * @checksum_type: (out) (allow-none): place-holder to return type of the
> + *                                     checksum into, or NULL
> + *
> + * Retrieves the expected checksum for the given driver file @file.
> + *
> + * Returns: The file checksum
> + */
> +const gchar *osinfo_device_driver_get_file_checksum(OsinfoDeviceDriver *driver,
> +                                                    const gchar *file,
> +                                                    GChecksumType *checksum_type)

I'd prefer a
gboolean osinfo_device_driver_check_file(OsinfoDeviceDriver *driver, const char *file, GError **error);
rather than forcing every app to do md5/sha1/... checks by hands while we
can easily do it for them.

Christophe

Attachment: pgpMAMyp44PLU.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]