/*
 * $Header: /smsa/bsd:include/limits.h:bsd.riscix1_2  1.13  $
 * $Source: /smsa/bsd:include/limits.h: $
 *
 * Copyright (c) 1989 Acorn Computers Ltd., Cambridge, England
 */

#ifndef __limits_h
#define __limits_h

#define CHAR_BIT 8	/* number of bits for smallest object (byte) */
#define SCHAR_MIN (-128) /* minimum value for a signed char */
#define SCHAR_MAX 127	/* maximum value for a signed char */
#define UCHAR_MAX 255	/* maximum value for an unsigned char */
#ifdef	__STDC__
/* In ANSI mode, plain "char" is unsigned, but use of "signed" overrides */
#define CHAR_MIN 0	/* minimum value for a char */
#define CHAR_MAX 255	/* maximum value for a char */
#else
/* In PCC mode, plain "char" is signed since "signed" is not available */
#define CHAR_MIN (-128)	/* minimum value for a char */
#define CHAR_MAX 127	/* maximum value for a char */
#endif

#define SHRT_MIN  (-0x8000)	/* minimum value for a short int */
#define SHRT_MAX  0x7fff	/* maximum value for a short int */
#define USHRT_MAX 65535U	/* maximum value for an unsigned short int */
#define INT_MIN   (~0x7fffffff)	/* minimum value for an int */
				/* (-2147483648 and 0x80000000 are unsigned) */
#define INT_MAX   0x7fffffff	/* maximum value for an int */
#define UINT_MAX  0xffffffff	/* maximum value for an unsigned int */
#define LONG_MIN  (~0x7fffffff)	/* minimum value for a long int */
#define LONG_MAX  0x7fffffff	/* maximum value for a long int */
#define ULONG_MAX 0xffffffffU	/* maximum value for an unsigned long int */

#ifndef	_POSIX_SOURCE
#define WORD_BIT 32
#define LONG_BIT 32
#endif

#define MB_LEN_MAX         1

#define _POSIX_ARG_MAX     4096
#define _POSIX_CHILD_MAX   6
#define _POSIX_LINK_MAX    8
#define _POSIX_MAX_CANON   255
#define _POSIX_MAX_INPUT   255
#define _POSIX_NAME_MAX    14
#define _POSIX_NGROUPS_MAX 0
#define _POSIX_OPEN_MAX    16
#define _POSIX_PATH_MAX    255
#define _POSIX_PIPE_BUF    512

#define NGROUPS_MAX        16

#if 0
/*
 * The values for ARG_MAX, CHILD_MAX and OPEN_MAX may not be constant,
 * they may instead depend on the specific system configuration
 * determined at kernel start-up time.  POSIX allows the definitions
 * to be omitted (as done here); to determine the actual value for a
 * running system, use sysconf(_SC_xxxx_MAX).  The values shown below
 * are typical but CHILD_MAX in particular varies with system memory
 * size.
 *	ARG_MAX            24576
 *	CHILD_MAX          40
 *	OPEN_MAX           64
 */
#endif

#define LINK_MAX           32767
#define MAX_CANON          255
#define MAX_INPUT          255
#define NAME_MAX           255
#define	_NAME_MAX	255

#ifndef	_POSIX_SOURCE
#define PASS_MAX           8
#endif

#define PATH_MAX           1023
#define PIPE_BUF           4096


#ifndef	_POSIX_SOURCE

#define NL_ARGMAX          9
#define NL_LANGMAX         255
#define NL_MSGMAX          INT_MAX
#define NL_NMAX            1
#define NL_SETMAX          255
#define NL_TEXTMAX         255

#ifndef	_BSD_C
#define NZERO              20
#endif
#endif/*_POSIX_SOURCE*/

#define TMP_MAX 1000000000

#define FLT_DIG      6
#define FLT_MIN  1.17549435e-38F
#define FLT_MAX  3.40282347e+38F

#define DBL_DIG      15
#define DBL_MIN  2.22507385850720138e-308
#define DBL_MAX  1.79769313486231571e+308

#endif/*__limits_h*/
