home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / clib / atol.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-09  |  950 b   |  59 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: atol.c,v 1.1 1996/12/12 16:07:05 aros Exp $
  4.  
  5.     Desc: ANSI C function abs()
  6.     Lang: english
  7. */
  8. #include <ctype.h>
  9. #include <stdio.h>
  10.  
  11. /*****************************************************************************
  12.  
  13.     NAME */
  14. #include <stdlib.h>
  15.  
  16.     long atol (
  17.  
  18. /*  SYNOPSIS */
  19.     const char * str)
  20.  
  21. /*  FUNCTION
  22.     Convert a string of digits into an integer.
  23.  
  24.     INPUTS
  25.     str - The string which should be converted. Leading
  26.         whitespace are ignored. The number may be prefixed
  27.         by a '+' or '-'.
  28.  
  29.     RESULT
  30.     The absolute value of j.
  31.  
  32.     NOTES
  33.  
  34.     EXAMPLE
  35.     // returns 1
  36.     atol ("  \t +1");
  37.  
  38.     // returns 1
  39.     atol ("1");
  40.  
  41.     // returns -1
  42.     atol ("  \n -1");
  43.  
  44.     BUGS
  45.  
  46.     SEE ALSO
  47.     labs(), fabs()
  48.  
  49.     INTERNALS
  50.  
  51.     HISTORY
  52.     12.12.1996 digulla created
  53.  
  54. ******************************************************************************/
  55. {
  56.     return strtol (str, (char **)NULL, 10);
  57. } /* atol */
  58.  
  59.