URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 40 |
Rev 1765 |
/*
|
/*
|
FUNCTION
|
FUNCTION
|
<<atoi>>, <<atol>>---string to integer
|
<<atoi>>, <<atol>>---string to integer
|
|
|
INDEX
|
INDEX
|
atoi
|
atoi
|
INDEX
|
INDEX
|
atol
|
atol
|
|
|
ANSI_SYNOPSIS
|
ANSI_SYNOPSIS
|
#include <stdlib.h>
|
#include <stdlib.h>
|
int atoi(const char *<[s]>);
|
int atoi(const char *<[s]>);
|
long atol(const char *<[s]>);
|
long atol(const char *<[s]>);
|
|
|
TRAD_SYNOPSIS
|
TRAD_SYNOPSIS
|
#include <stdlib.h>
|
#include <stdlib.h>
|
int atoi(<[s]>)
|
int atoi(<[s]>)
|
char *<[s]>;
|
char *<[s]>;
|
|
|
long atol(<[s]>)
|
long atol(<[s]>)
|
char *<[s]>;
|
char *<[s]>;
|
|
|
|
|
DESCRIPTION
|
DESCRIPTION
|
<<atoi>> converts the initial portion of a string to an <<int>>.
|
<<atoi>> converts the initial portion of a string to an <<int>>.
|
<<atol>> converts the initial portion of a string to a <<long>>.
|
<<atol>> converts the initial portion of a string to a <<long>>.
|
|
|
<<atoi(s)>> is implemented as <<(int)strtol(s, NULL, 10).>>
|
<<atoi(s)>> is implemented as <<(int)strtol(s, NULL, 10).>>
|
<<atol(s)>> is implemented as <<strtol(s, NULL, 10).>>
|
<<atol(s)>> is implemented as <<strtol(s, NULL, 10).>>
|
|
|
RETURNS
|
RETURNS
|
The functions return the converted value, if any. If no conversion was
|
The functions return the converted value, if any. If no conversion was
|
made, <<0>> is returned.
|
made, <<0>> is returned.
|
|
|
PORTABILITY
|
PORTABILITY
|
<<atoi>> is ANSI.
|
<<atoi>> is ANSI.
|
|
|
No supporting OS subroutines are required.
|
No supporting OS subroutines are required.
|
*/
|
*/
|
|
|
/*
|
/*
|
* Andy Wilson, 2-Oct-89.
|
* Andy Wilson, 2-Oct-89.
|
*/
|
*/
|
|
|
#include <stdlib.h>
|
#include <stdlib.h>
|
#include <_ansi.h>
|
#include <_ansi.h>
|
|
|
int
|
int
|
_DEFUN (atoi, (s),
|
_DEFUN (atoi, (s),
|
_CONST char *s)
|
_CONST char *s)
|
{
|
{
|
return (int) strtol (s, NULL, 10);
|
return (int) strtol (s, NULL, 10);
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.