more simplification, got gtk.c under 3k lines
[gcalctool.git] / gcalctool / parser_mac.h
blobfeb2ffe4a4189e7cda0954a6b8567aade1589098
2 /* $Header$
4 * Copyright (C) 2004-2007 Sami Pietila
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 * 02111-1307, USA.
22 #ifndef PARSER_MAC_H
23 #define PARSER_MAC_H
25 #define PARSER_MIN(a, b) (a < b) ? a : b;
27 #define YY_INPUT(buf, result, max) {\
28 int l = strlen(parser_state.buff);\
29 int remaining = l - parser_state.i;\
30 int c = PARSER_MIN(remaining, max);\
31 memcpy(buf, parser_state.buff + parser_state.i, c);\
32 parser_state.i += c;\
33 result = (c) ? c : YY_NULL;\
36 #endif /*PARSER_MAC_H*/