Mercurial > projects > pwm
diff pwfile.h @ 10:17fb30016e64
Enable access to record and file metadata
Add info command to show file metadata.
Enable display of creation and modification dates of records.
author | Guido Berhoerster <guido+pwm@berhoerster.name> |
---|---|
date | Fri, 28 Jul 2017 15:53:57 +0200 |
parents | a7e41e1a79c8 |
children | efef93e54c5f |
line wrap: on
line diff
--- a/pwfile.h Fri Jul 28 09:53:46 2017 +0200 +++ b/pwfile.h Fri Jul 28 15:53:57 2017 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 Guido Berhoerster <guido+pwm@berhoerster.name> + * Copyright (C) 2017 Guido Berhoerster <guido+pwm@berhoerster.name> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -51,6 +51,14 @@ struct record_id_tree; +struct metadata { + int version; + char *user; + char *host; + char *application; + time_t timestamp; +}; + struct record { char *title; char *group; @@ -58,6 +66,8 @@ char *password; char *notes; char *url; + time_t ctime; + time_t mtime; }; void pwfile_init(struct pwm_ctx *ctx); @@ -66,6 +76,8 @@ int pwfile_write_file(struct pwm_ctx *); union list_item ** pwfile_create_list(struct pwm_ctx *); void pwfile_destroy_list(union list_item **); +struct metadata * pwfile_get_metadata(struct pwm_ctx *); +void pwfile_destroy_metadata(struct metadata *); int pwfile_create_record(struct pwm_ctx *, struct record *); int pwfile_modify_record(struct pwm_ctx *, unsigned int, struct record *);