MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / parse_time

Function parse_time

tinyemu/fs_utils.c:226–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226int parse_time(uint32_t *psec, uint32_t *pnsec, const char **pp)
227{
228 const char *p;
229 uint32_t v, m;
230 p = *pp;
231 if (parse_uint32(psec, &p) < 0)
232 return -1;
233 v = 0;
234 if (*p == '.') {
235 p++;
236 /* XXX: inefficient */
237 m = 1000000000;
238 v = 0;
239 while (*p >= '0' && *p <= '9') {
240 m /= 10;
241 v += (*p - '0') * m;
242 p++;
243 }
244 }
245 *pnsec = v;
246 *pp = p;
247 return 0;
248}
249
250int parse_file_id(FSFileID *pval, const char **pp)
251{

Callers 1

filelist_load_recFunction · 0.85

Calls 1

parse_uint32Function · 0.85

Tested by

no test coverage detected