/* POSIX implementation of "api.h" interface to be used in non-web contexts */ #include 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; }