Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
strtoll.c
Package: vlc-1.0.5.zip [view]
Upload User: kjfoods
Upload Date: 2020-07-06
Package Size: 29949k
Code Size: 3k
Category:
midi program
Development Platform:
Unix_Linux
- /*****************************************************************************
- * strtoll.c: C strtoll() replacement
- *****************************************************************************
- * Copyright © 1998-2008 the VideoLAN project
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
- #ifdef HAVE_CONFIG_H
- # include <config.h>
- #endif
- #include <stdlib.h>
- #include <string.h>
- long long int strtof( const char *nptr, char **endptr, int base )
- {
- long long i_value = 0;
- int sign = 1, newbase = base ? base : 10;
- nptr += strspn( nptr, "t " );
- if( *nptr == '-' )
- {
- sign = -1;
- nptr++;
- }
- /* Try to detect base */
- if( *nptr == '0' )
- {
- newbase = 8;
- nptr++;
- if( *nptr == 'x' )
- {
- newbase = 16;
- nptr++;
- }
- }
- if( base && newbase != base )
- {
- if( endptr ) *endptr = (char *)nptr;
- return i_value;
- }
- switch( newbase )
- {
- case 10:
- while( *nptr >= '0' && *nptr <= '9' )
- {
- i_value *= 10;
- i_value += ( *nptr++ - '0' );
- }
- if( endptr ) *endptr = (char *)nptr;
- break;
- case 16:
- while( (*nptr >= '0' && *nptr <= '9') ||
- (*nptr >= 'a' && *nptr <= 'f') ||
- (*nptr >= 'A' && *nptr <= 'F') )
- {
- int i_valc = 0;
- if(*nptr >= '0' && *nptr <= '9') i_valc = *nptr - '0';
- else if(*nptr >= 'a' && *nptr <= 'f') i_valc = *nptr - 'a' +10;
- else if(*nptr >= 'A' && *nptr <= 'F') i_valc = *nptr - 'A' +10;
- i_value *= 16;
- i_value += i_valc;
- nptr++;
- }
- if( endptr ) *endptr = (char *)nptr;
- break;
- default:
- i_value = strtol( nptr, endptr, newbase );
- break;
- }
- return i_value * sign;
- }