opensc
NPCI secure-component & UPI Lite / Lite X wallet reimplementation
Loading...
Searching...
No Matches
store.h
Go to the documentation of this file.
1#ifndef LITE_STORE_H
2#define LITE_STORE_H
3
4#include <stddef.h>
5
8
10typedef struct lite_store {
11 void *ctx;
13 long (*get)(void *ctx, const char *file, const char *key, char *out, size_t cap);
14 int (*set)(void *ctx, const char *file, const char *key, const char *val);
15 int (*remove)(void *ctx, const char *file, const char *key);
17
22
23#endif
void lite_store_mem_free(lite_store *s)
Frees an in-memory store created by lite_store_mem_new().
lite_store * lite_store_mem_new(void)
Allocates an in-memory store (for tests). Free with lite_store_mem_free().
SharedPreferences-shaped store, namespaced by file (e.g. "NPCICLVAULT", "DataUPI").
Definition store.h:10
int(* remove)(void *ctx, const char *file, const char *key)
Removes file/key. 0 on success.
Definition store.h:15
void * ctx
Backend-private state.
Definition store.h:11
long(* get)(void *ctx, const char *file, const char *key, char *out, size_t cap)
Reads file/key into out (NUL-terminated); returns length, or -1 if absent/too small....
Definition store.h:13
int(* set)(void *ctx, const char *file, const char *key, const char *val)
Writes file/key=val. 0 on success.
Definition store.h:14