1 /* 2 * Copyright 2002-2007, Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Author: 6 * Daniel Reinhold, danielre@users.sf.net 7 */ 8 9 10 #include <stdlib.h> 11 12 13 int 14 atoi(const char* num) 15 { 16 return (int) strtol(num, NULL, 10); 17 } 18 19 20 unsigned int 21 atoui(const char* num) 22 { 23 return (unsigned int) strtoul(num, NULL, 10); 24 } 25 26 27 long 28 atol(const char* num) 29 { 30 return strtol(num, NULL, 10); 31 } 32 33 34 unsigned long 35 atoul(const char* num) 36 { 37 return strtoul(num, NULL, 10); 38 } 39 40 41 long long int 42 atoll(const char* num) 43 { 44 return strtoll(num, NULL, 10); 45 } 46