skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

uint32_scan.c (304B)


      1 /* ISC license. */
      2 
      3 #include <skalibs/uint32.h>
      4 #include <skalibs/uint64.h>
      5 #include "fmtscan-internal.h"
      6 
      7 size_t uint32_scan_base (char const *s, uint32_t *u, uint8_t base)
      8 {
      9   uint64_t uu ;
     10   size_t pos = uint64_scan_base_max(s, &uu, base, UINT32_MAX) ;
     11   if (pos) *u = (uint32_t)uu ;
     12   return pos ;
     13 }