__PREFIX_BEGIN__
//-----------------------------------------------------------------------------
// Copyright © 2005 - Philip Howard - All rights reserved
//
// 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//-----------------------------------------------------------------------------
// package	libh/string
// homepage	http://libh.slashusr.org/
//-----------------------------------------------------------------------------
// author	Philip Howard
// email	libh at ipal dot org
// homepage	http://phil.ipal.org/
//-----------------------------------------------------------------------------
// This file is best viewed using a fixed spaced font such as Courier
// and in a display at least 120 columns wide.
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// file		libh/string.h
//
// purpose      Define resources used by the string library.
//-----------------------------------------------------------------------------
#ifndef __STRING_H__
#define __STRING_H__
__PREFIX_END__

__INCLUDE_BEGIN__
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
__INCLUDE_END__

__DEFINE_BEGIN__
//-----------------------------------------------------------------------------
// function alias macros
//-----------------------------------------------------------------------------
#define str_to_i	strtol
#define str_to_si	strtol
#define str_to_ui	strtoul
#define str_to_l	strtol
#define str_to_sl	strtol
#define str_to_ul	strtoul

#define str_to_d	strtod

//-----------------------------------------------------------------------------
// In glibc (from 2.1 to 2.3.1) strtold() is majorly broken so leave the
// internal version of str_to_ld in use.  Enable this define only when
// a version of glibc with a working strtold() is used.
//-----------------------------------------------------------------------------
// #define str_to_ld	strtold

//-----------------------------------------------------------------------------
// Define these according to the environment.
//-----------------------------------------------------------------------------
#if defined(HAVE_C99) && HAVE_C99==1

#define str_to_ll	strtoll
#define str_to_ull	strtoull

#else

#define str_to_ll	strtoq
#define str_to_ull	strtouq

#endif

__DEFINE_END__

__SUFFIX_BEGIN__
#endif /* __STRING_H__ */
__SUFFIX_END__

