This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

atoll(), strtoll(), strtoull() -- where are they?


My application uses long long's and unsigned long longs. How do I get these using CYGWIN?

I tried downloading glib

>From a mail from Fergus Henderson,

     http://sources.redhat.com/ml/cygwin/1998-07/msg00424.html

I have

#ifdef _CYGWIN

// ascii to unsigned long long

unsigned long long atoull(char *str){
	long long result = 0;
	while (*str >= '0' && *str <= '9') {
		result = (result*10) - (*str++ - '0');
	}
	return result;
}

// ascii to long long

long long atoll(char *str){
	long long result = 0;
	int negative=0;
	
	while (*str == ' ' || *str == '\t')
		str++;
	if (*str == '+')
		str++;
	else if (*str == '-') {
		negative = 1;
		str++;
	}
	
	while (*str >= '0' && *str <= '9') {
		result = (result*10) - (*str++ - '0');
	}

	return negative ? result : -result;
}

#else

#define atoull(x) strtoull(x, 0, 10);

#endif

But this is just an approximation. Is there a plan to support atoll(),
strtoll(), strtoull()?

I checked glibc-2.2.4 and indeed it is there, although it is not clear
how to separate it. Why is it CYGWIN does not do glib?

>From another email to this list,

	http://sources.redhat.com/ml/cygwin/1998-07/msg00409.html

these are apparently part of the C standard.

Thanks for your attention

Tom Howland

cygcheck -s -v -r

Cygnus Win95/NT Configuration Diagnostics
Current System Time: Thu Sep  6 17:07:15 2001

WinNT Ver 5.0 build 2195 Service Pack 2

Path:	/usr/X11R6/bin
	/usr/local/bin
	/home/tomh/scripts
	/cygdrive/c/tom/old/pub/scripts
	/usr/local/bin
	/usr/bin
	/bin
	/usr/X11R6/bin
	/cygdrive/c/oracle/ora81/bin
	/cygdrive/c/Program C
	/oracle/ora81/bin
	/cygdrive/c/Program Files/Oracle/jre/1.1.7/bin
	/usr/bin
	/cygdrive/c/WINNT/system32
	/cygdrive/c/WINNT
	/cygdrive/c/WINNT/System32/Wbem
	/cygdrive/c/Program Files/Microsoft Visual Studio/Common/Tools/WinNT
	/cygdrive/c/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin
	/cygdrive/c/Program Files/Microsoft Visual Studio/Common/Tools
	/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/bin

SysDir: C:\WINNT\System32
WinDir: C:\WINNT

PWD = `/tmp'
USER = `Administrator'
MAKE_MODE = `unix'
HOME = `/home/tomh'

NUMBER_OF_PROCESSORS = `1'
PROMPT = `$P$G'
LOGONSERVER = `\\TOMH'
FCEDIT = `emacs'
OS2LIBPATH = `C:\WINNT\system32\os2\dll;'
COLORFGBG = `0;default;15'
COMSPEC = `C:\WINNT\system32\cmd.exe'
WINDOWID = `4194306'
PAGER = `less'
!C: = `C:\cygwin\usr\X11R6\bin'
SYSTEMDRIVE = `C:'
HOSTNAME = `TOMH'
INCLUDE = `C:\Program Files\Microsoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC98\mfc\include;C:\Program Files\Microsoft Visual Studio\VC98\include'
PROCESSOR_REVISION = `060a'
t = `'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
COMPUTERNAME = `TOMH'
WINDIR = `C:\WINNT'
USERPROFILE = `C:\Documents and Settings\tomh'
TERMINFO = `/usr/local/share/terminfo'
HOMESHARE = `\\xacctfileserver\tomh$'
PROGRAMFILES = `C:\Program Files'
VISUAL = `emacs'
!:: = `::\'
LESS = `-I'
MACHTYPE = `i686-pc-cygwin'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 6 Stepping 10, GenuineIntel'
OS = `Windows_NT'
PROCESSOR_ARCHITECTURE = `x86'
TEMP = `/cygdrive/c/DOCUME~1/tomh/LOCALS~1/Temp'
T = `'
EDITOR = `emacs'
PROCESSOR_LEVEL = `6'
SYSTEMROOT = `C:\WINNT'
COLORTERM = `rxvt-xpm'
HOMEDRIVE = `H:'
LIB = `C:\Program Files\Microsoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\VC98\lib'
DISPLAY = `127.0.0.1:0.0'
ALLUSERSPROFILE = `C:\Documents and Settings\All Users'
SHLVL = `2'
APPDATA = `C:\Documents and Settings\tomh\Application Data'
COMMONPROGRAMFILES = `C:\Program Files\Common Files'
HOMEPATH = `\'
USERDOMAIN = `XACCT_US'
USERNAME = `tomh'
SHELL = `/bin/sh'
CVSROOT = `:pserver:tomh@10.0.0.40:/export/home/cvs'
HOSTTYPE = `i686'
WF_RESOURCES = `C:\oracle\ora81\WF\RES\WFUS.RES'
OSTYPE = `cygwin'
TERM = `rxvt'
PGDATA = `/usr/share/postgresql/data'
french = `204.210.233.171'
_ = `/usr/bin/cygcheck'
TZ = `PST8PDT7,M4.1.0/2,M10.5.0/2'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x00000022
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/d
  (default) = `d:'
  flags = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/u
  (default) = `u:'
  flags = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\Cygnus Solutions
  (default) = (unsupported type)
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = `C:/cygwin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = `C:/cygwin/bin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = `C:/cygwin/lib'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options

a:  fd           N/A    N/A                    
c:  hd  FAT32   9576Mb  87% CP    UN           
d:  cd           N/A    N/A                    
e:  net NTFS   104193Mb  55% CP CS UN PA FC     Departments
f:  net NTFS   15311Mb  93% CP CS UN PA FC     Development work space
g:  net NTFS   28615Mb  93% CP CS UN PA FC     
u:  net NTFS    2938Mb  18%          PA        ??

C:\cygwin\bin  /usr/bin  system  binmode
C:\cygwin\lib  /usr/lib  system  binmode
C:\cygwin  /        system  binmode
d:    /d       user    textmode
u:    /u       user    textmode
c:    /cygdrive/c  user    binmode,noumount
e:    /cygdrive/e  user    binmode,noumount
f:    /cygdrive/f  user    binmode,noumount
g:    /cygdrive/g  user    binmode,noumount

Found: C:\cygwin\bin\bash.exe
Found: C:\cygwin\bin\cat.exe
Found: C:\cygwin\bin\cpp.exe
Found: C:\cygwin\bin\find.exe
Found: C:\cygwin\bin\gcc.exe
Found: C:\cygwin\bin\gdb.exe
Found: C:\cygwin\bin\ld.exe
Found: C:\cygwin\bin\ls.exe
Found: C:\cygwin\bin\make.exe
Found: C:\cygwin\bin\sh.exe

   73k 2001/08/03 C:\cygwin\usr\local\bin\cygltdl-3.dll - os=4.0 img=1.0 sys=4.0
                  "cygltdl-3.dll" v0.0 ts=2001/8/1 16:22
   56k 2000/12/03 C:\cygwin\bin\cygbz21.0.dll - os=4.0 img=1.0 sys=4.0
                  "cygbz21.0.dll" v0.0 ts=2000/11/20 15:53
   81k 2001/04/28 C:\cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitcl30.dll" v0.0 ts=2001/4/28 15:57
   35k 2001/04/28 C:\cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitk30.dll" v0.0 ts=2001/4/28 15:57
  390k 2001/04/28 C:\cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtcl80.dll" v0.0 ts=2001/4/28 15:56
    5k 2001/04/28 C:\cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
   10k 2001/04/28 C:\cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtclreg80.dll" v0.0 ts=2001/4/28 15:56
  623k 2001/04/28 C:\cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtk80.dll" v0.0 ts=2001/4/28 15:57
   18k 2000/10/23 C:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm.dll" v0.0 ts=2000/10/22 19:26
   21k 2001/06/20 C:\cygwin\bin\cygintl.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl.dll" v0.0 ts=2001/6/20 10:09
   45k 2001/07/04 C:\cygwin\bin\cygjbig1.dll - os=4.0 img=1.0 sys=4.0
                  "cygjbig1.dll" v0.0 ts=2001/7/3 20:25
  245k 2001/06/12 C:\cygwin\bin\cygtiff3.dll - os=4.0 img=1.0 sys=4.0
                  "cygtiff3.dll" v0.0 ts=2001/6/12 10:25
   17k 2001/06/28 C:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory4.dll" v0.0 ts=2001/1/6 20:34
   21k 2001/06/28 C:\cygwin\bin\cyghistory5.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory5.dll" v0.0 ts=2001/6/27 19:27
  108k 2001/06/28 C:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline4.dll" v0.0 ts=2001/1/6 20:34
  135k 2001/06/28 C:\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline5.dll" v0.0 ts=2001/6/27 19:27
   41k 2001/07/04 C:\cygwin\bin\cygXpm-noX4.dll - os=4.0 img=1.0 sys=4.0
                  "cygXpm-noX4.dll" v0.0 ts=2001/7/3 18:21
   45k 2001/07/04 C:\cygwin\bin\cygXpm-X4.dll - os=4.0 img=1.0 sys=4.0
                  "cygXpm-X4.dll" v0.0 ts=2000/11/19 18:45
   49k 2001/02/03 C:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                  "cygz.dll" v0.0 ts=2001/2/3 12:35
  119k 2001/06/06 C:\cygwin\bin\cygjpeg6b.dll - os=4.0 img=1.0 sys=4.0
                  "cygjpeg6b.dll" v0.0 ts=2001/6/5 21:27
  163k 2001/05/06 C:\cygwin\bin\cygpng2.dll - os=4.0 img=1.0 sys=4.0
                  "cygpng2.dll" v0.0 ts=2001/5/5 21:05
   45k 2001/04/25 C:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
                  "cygform5.dll" v0.0 ts=2001/4/24 22:28
   26k 2001/04/25 C:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu5.dll" v0.0 ts=2001/4/24 22:27
  156k 2001/04/25 C:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++5.dll" v0.0 ts=2001/4/24 22:29
  226k 2001/04/25 C:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses5.dll" v0.0 ts=2001/4/24 22:17
   15k 2001/04/25 C:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel5.dll" v0.0 ts=2001/4/24 22:27
  678k 2001/05/21 C:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2001/5/20 20:28
    Cygwin DLL version info:
        dll major: 1003
        dll minor: 2
        dll epoch: 19
        dll bad signal mask: 19005
        dll old termios: 5
        dll malloc env: 28
        api major: 0
        api minor: 39
        shared data: 3
        dll identifier: cygwin1
        mount registry: 2
        cygnus registry name: Cygnus Solutions
        cygwin registry name: Cygwin
        program options name: Program Options
        cygwin mount registry name: mounts v2
        cygdrive flags: cygdrive flags
        cygdrive prefix: cygdrive prefix
        cygdrive default prefix: 
        build date: Sun May 20 23:28:17 EDT 2001
        shared id: cygwin1S3

Use -h to see help about each section



------------------------------------------------------------------------

shhhhh! They might be listening ...
bomb Ron Brown KGB Legion of Doom supercomputer Ft. Knox assassination
jihad JFK encryption BATF Treasury Khaddafi cryptographic DES


I used to be with it, but then they changed what IT was ... Now, what's
it seems weird and scary..." - Abe Simpson


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]