blob: 9f51967bc667bc1d96ba2ed65bdea6c9e752e551 (
plain) (
tree)
|
|
/* POSIX implementation of "api.h" interface to be used in non-web contexts */
#include <stdio.h>
void platformDependentPersistInt(int n) {
FILE* fp = fopen("/tmp/persisted.txt", "w+");
fprintf(fp, "%d", n);
fclose(fp);
}
int platformDependentRetrieveInt() {
FILE* fp = fopen("/tmp/persisted.txt", "r");
int persisted = fgetc(fp);
return persisted;
}
|