pmartin / pocketbook-demo

A few demos of C/C++ applications for Pocketbook Touch Lux ereaders
MIT License
67 stars 10 forks source link

Demo: Usage of the configuration functions #31

Open orontee opened 1 year ago

orontee commented 1 year ago

inkview.h advertise for many functions related to "configuration":

iconfig * OpenConfig(const char *path, iconfigedit *ce);
int RefreshConfig(iconfig **cfg); //update memory copy config from his file
int SaveConfig(iconfig *cfg);
void CloseConfig(iconfig *cfg);
void CloseConfigNoSave(iconfig *cfg);

int ReadInt(iconfig *cfg, const char *name, int deflt);
long long ReadLongLong(iconfig *cfg, const char *name, long long deflt);
const char *ReadString(iconfig *cfg, const char *name, const char *deflt);
const char *ReadSecret(iconfig *cfg, const char *name, const char *deflt);
...

It would be interesting to have a demo dedicated to those functions. I could not find any public repository using this part of the SDK.

orontee commented 1 year ago

I finally found one application using those functions: https://github.com/JuanJakobo/Pocketbook-Read-offline/tree/main ... and successfully used most of the config related stuff there: https://github.com/orontee/taranis/blob/v1.4.0-rc0/src/config.cc