updated config

This commit is contained in:
wt committed 2025-09-04 15:24:48 +07:00
1 parent ced999e944
commit cb6052a9d3
19 files changed
+331 -155

No files matched your search

+17
View File
@@ -139,3 +139,20 @@ pscanf(const char *path, const char *fmt, ...)
return (n == EOF) ? -1 : n;
}
int
lscanf(FILE *fp, const char *key, const char *fmt, void *res)
{
int n;
char line[256];
n = -1;
while (fgets(line, sizeof(line), fp))
if (strncmp(line, key, strlen(key)) == 0) {
n = sscanf(line + strlen(key), fmt, res);
break;
}
rewind(fp);
return (n == 1) ? 1 : -1;
}