comparison pwfile.c @ 22:ec01c579024a

Add fully interactive mode
author Guido Berhoerster <guido+pwm@berhoerster.name>
date Thu, 07 Sep 2017 12:40:50 +0200
parents efef93e54c5f
children
comparison
equal deleted inserted replaced
21:ee4d36c85287 22:ec01c579024a
825 pws3_record_set_field(pws3_record, url_field); 825 pws3_record_set_field(pws3_record, url_field);
826 } 826 }
827 } 827 }
828 828
829 int 829 int
830 pwfile_create_record(struct pwm_ctx *ctx, struct record *record) 830 pwfile_create_pws_record(struct pwm_ctx *ctx, struct record *record)
831 { 831 {
832 struct pws3_record *pws3_record; 832 struct pws3_record *pws3_record;
833 const unsigned char *uuid; 833 const unsigned char *uuid;
834 struct record_id_entry *entry; 834 struct record_id_entry *entry;
835 835
851 851
852 return (0); 852 return (0);
853 } 853 }
854 854
855 int 855 int
856 pwfile_modify_record(struct pwm_ctx *ctx, unsigned int id, 856 pwfile_modify_pws_record(struct pwm_ctx *ctx, unsigned int id,
857 struct record *record) 857 struct record *record)
858 { 858 {
859 const unsigned char *uuid; 859 const unsigned char *uuid;
860 860
861 uuid = record_id_tree_get_uuid(ctx->record_id_tree, id); 861 uuid = record_id_tree_get_uuid(ctx->record_id_tree, id);
869 869
870 return (0); 870 return (0);
871 } 871 }
872 872
873 int 873 int
874 pwfile_remove_record(struct pwm_ctx *ctx, unsigned int id) 874 pwfile_remove_pws_record(struct pwm_ctx *ctx, unsigned int id)
875 { 875 {
876 const unsigned char *uuid; 876 const unsigned char *uuid;
877 struct record_id_entry *entry; 877 struct record_id_entry *entry;
878 878
879 uuid = record_id_tree_get_uuid(ctx->record_id_tree, id); 879 uuid = record_id_tree_get_uuid(ctx->record_id_tree, id);
938 pws3_field_destroy(empty_group_field); 938 pws3_field_destroy(empty_group_field);
939 939
940 ctx->unsaved_changes = 1; 940 ctx->unsaved_changes = 1;
941 941
942 return (0); 942 return (0);
943 }
944
945 struct record *
946 pwfile_create_record(void)
947 {
948 struct record *record;
949
950 record = xmalloc(sizeof (struct record));
951 record->ctime = (time_t)0;
952 record->mtime = (time_t)0;
953 record->group = NULL;
954 record->title = NULL;
955 record->username = NULL;
956 record->password = NULL;
957 record->notes = NULL;
958 record->url = NULL;
959
960 return (record);
943 } 961 }
944 962
945 struct record * 963 struct record *
946 pwfile_get_record(struct pwm_ctx *ctx, unsigned int id) 964 pwfile_get_record(struct pwm_ctx *ctx, unsigned int id)
947 { 965 {