Initial commit

master
teknomunk 1 year ago
parent d6f28d6294
commit efa672661b

1
.gitignore vendored

@ -0,0 +1 @@
.*

@ -0,0 +1,26 @@
#include "fs_list.h"
#include <string.h>
#include <stdio.h>
int fs_list_get( const char* filename )
{
FILE* f;
int pos = 0;
f = fopen(filename,"r");
fscanf( f, "%d", &pos );
fclose(f);
return pos;
}
void fs_list_set( const char* path, int value )
{
char tmp_filename[512];
snprintf( tmp_filename, 512, "%s.tmp", path );
FILE* f = fopen(tmp_filename,"w");
fprintf( f, "%d", value );
fclose(f);
rename( tmp_filename, path );
}

@ -0,0 +1,5 @@
#pragma once
int fs_list_get( const char* path );
void fs_list_set( const char* path, int value );
Loading…
Cancel
Save