MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / SDL_strtol

Function SDL_strtol

deps/SDL2/src/stdlib/SDL_string.c:860–883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858}
859
860long
861SDL_strtol(const char *string, char **endp, int base)
862{
863#if defined(HAVE_STRTOL)
864 return strtol(string, endp, base);
865#else
866 size_t len;
867 long value = 0;
868
869 if (!base) {
870 if ((SDL_strlen(string) > 2) && (SDL_strncmp(string, "0x", 2) == 0)) {
871 base = 16;
872 } else {
873 base = 10;
874 }
875 }
876
877 len = SDL_ScanLong(string, base, &value);
878 if (endp) {
879 *endp = (char *) string + len;
880 }
881 return value;
882#endif /* HAVE_STRTOL */
883}
884
885unsigned long
886SDL_strtoul(const char *string, char **endp, int base)

Callers 5

SDL_atoiFunction · 0.85
SDL_vsnprintfFunction · 0.85
get_visualinfoFunction · 0.85
X11_CreateWindowFunction · 0.85

Calls 3

SDL_strlenFunction · 0.85
SDL_strncmpFunction · 0.85
SDL_ScanLongFunction · 0.85

Tested by

no test coverage detected