Kernel registry
Posted: Mon Jan 23, 2023 7:05 pm
Hi,
Something that I haven't seen "spoken" of here very much is a kernel registry, some way to keep information available using a kernel call.
For example, an application may want to store the top-left pixel position at close time so that it can use that same position when it loads next time. Something like:
I think XML would be a good source to do this, but decided to make my own using my own format.
To create the two entries above, a couple of calls such as:
To retrieve a value:
Anyway, if you are interested in what I have come up with, have a look here.
A (drop-in) demo/skeleton source code is included. The main idea was to be simple and easy to use. The code is currently experimental since I haven't tested it thoroughly. Comments are welcome.
Thanks,
Ben
Something that I haven't seen "spoken" of here very much is a kernel registry, some way to keep information available using a kernel call.
For example, an application may want to store the top-left pixel position at close time so that it can use that same position when it loads next time. Something like:
Code: Select all
"kernel/ApplicationName/Main/Window/Top = 100"
"kernel/ApplicationName/Main/Window/Left = 100"
To create the two entries above, a couple of calls such as:
Code: Select all
registry_write_int("/Kernel/ApplicationName/Main/Window/Top", 100);
registry_write_int("/Kernel/ApplicationName/Main/Window/Left", 100);
Code: Select all
int ret = 0, Left;
ret = registry_read_int("/Kernel/ApplicationName/Main/Window/Top", &Left);
if (ret == sizeof(int))
; // Left now contains the value of 100
A (drop-in) demo/skeleton source code is included. The main idea was to be simple and easy to use. The code is currently experimental since I haven't tested it thoroughly. Comments are welcome.
Thanks,
Ben