aboutsummaryrefslogtreecommitdiffstats
path: root/docs/dev/exceptions.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/dev/exceptions.rst')
0 files changed, 0 insertions, 0 deletions
ref='#n75'>75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
/*
 * Copyright (C) 2001 - 2004 Mike Wray <mike.wray@hp.com>
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of the
 * License, or  (at your option) any later version. This library 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 */

/** @file
 * Lexical analysis.
 */

#include "sys_string.h"
#include "lexis.h"
#include <errno.h>

/** Check if a value lies in a (closed) range.
 *
 * @param x value to test
 * @param lo low end of the range
 * @param hi high end of the range
 * @return 1 if x is in the interval [lo, hi], 0 otherwise
 */
inline static int in_range(int x, int lo, int hi){
    return (lo <= x) && (x <= hi);
}

/** Determine if a string is an (unsigned) decimal number.
 * 
 * @param s pointer to characters to test
 * @param n length of string