OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [stdlib/] [atoi.c] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
/*
2
FUNCTION
3
   <<atoi>>, <<atol>>---string to integer
4
 
5
INDEX
6
        atoi
7
INDEX
8
        atol
9
 
10
ANSI_SYNOPSIS
11
        #include <stdlib.h>
12
        int atoi(const char *<[s]>);
13
        long atol(const char *<[s]>);
14
 
15
TRAD_SYNOPSIS
16
        #include <stdlib.h>
17
       int atoi(<[s]>)
18
       char *<[s]>;
19
 
20
       long atol(<[s]>)
21
       char *<[s]>;
22
 
23
 
24
DESCRIPTION
25
   <<atoi>> converts the initial portion of a string to an <<int>>.
26
   <<atol>> converts the initial portion of a string to a <<long>>.
27
 
28
   <<atoi(s)>> is implemented as <<(int)strtol(s, NULL, 10).>>
29
   <<atol(s)>> is implemented as <<strtol(s, NULL, 10).>>
30
 
31
RETURNS
32
   The functions return the converted value, if any. If no conversion was
33
   made, <<0>> is returned.
34
 
35
PORTABILITY
36
<<atoi>> is ANSI.
37
 
38
No supporting OS subroutines are required.
39
*/
40
 
41
/*
42
 * Andy Wilson, 2-Oct-89.
43
 */
44
 
45
#include <stdlib.h>
46
#include <_ansi.h>
47
 
48
int
49
_DEFUN (atoi, (s),
50
        _CONST char *s)
51
{
52
  return (int) strtol (s, NULL, 10);
53
}
54
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.