MCPcopy Create free account
hub / github.com/TheOfficialFloW/VitaShell / readConfigBuffer

Function readConfigBuffer

config.c:196–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196int readConfigBuffer(void *buffer, int size, ConfigEntry *entries, int n_entries) {
197 int res = 0;
198 char line[MAX_CONFIG_LINE_LENGTH];
199 char *p = buffer;
200
201 // Skip UTF-8 bom
202 uint32_t bom = 0xBFBBEF;
203 if (memcmp(p, &bom, 3) == 0) {
204 p += 3;
205 size -= 3;
206 }
207
208 do {
209 memset(line, 0, sizeof(line));
210 res = GetLine(p, size, line);
211
212 if (res > 0) {
213 readEntry(line, entries, n_entries);
214 size -= res;
215 p += res;
216 }
217 } while (res > 0);
218
219 return 0;
220}
221
222int readConfig(const char *path, ConfigEntry *entries, int n_entries) {
223 void *buffer = NULL;

Callers 3

readConfigFunction · 0.85
loadLanguageFunction · 0.85
loadThemeFunction · 0.85

Calls 2

GetLineFunction · 0.85
readEntryFunction · 0.85

Tested by

no test coverage detected