arith.h revision 178625
1113094Sphk/*- 2135482Sphk * Copyright (c) 1995 3113094Sphk * The Regents of the University of California. All rights reserved. 4113094Sphk * 5113094Sphk * Redistribution and use in source and binary forms, with or without 6113094Sphk * modification, are permitted provided that the following conditions 7113094Sphk * are met: 8113094Sphk * 1. Redistributions of source code must retain the above copyright 9113094Sphk * notice, this list of conditions and the following disclaimer. 10113094Sphk * 2. Redistributions in binary form must reproduce the above copyright 11113094Sphk * notice, this list of conditions and the following disclaimer in the 12113094Sphk * documentation and/or other materials provided with the distribution. 13113094Sphk * 4. Neither the name of the University nor the names of its contributors 14113094Sphk * may be used to endorse or promote products derived from this software 15113094Sphk * without specific prior written permission. 16113094Sphk * 17113094Sphk * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18113094Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19113094Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20113094Sphk * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21113094Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22113094Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23113094Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24113094Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25113094Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26113094Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27113094Sphk * SUCH DAMAGE. 28135482Sphk * 29135482Sphk * @(#)arith.h 1.1 (Berkeley) 5/4/95 30135482Sphk * $FreeBSD: head/bin/sh/arith.h 178625 2008-04-27 20:46:45Z stefanf $ 31135482Sphk */ 32135482Sphk 33135482Sphk#include "shell.h" 34135482Sphk 35135482Sphk#define DIGITS(var) (3 + (2 + CHAR_BIT * sizeof((var))) / 3) 36135482Sphk 37135482Sphkextern char *arith_buf, *arith_startbuf; 38135482Sphk 39135482Sphkarith_t arith(char *); 40135482Sphkvoid arith_lex_reset(void); 41135482Sphkint expcmd(int, char **); 42113094Sphk