1 | /* Inline Functions for keyword-list.{h,cc}. |
2 | |
3 | Copyright (C) 2002-2003 Free Software Foundation, Inc. |
4 | Written by Bruno Haible <bruno@clisp.org>. |
5 | |
6 | This file is part of GNU GPERF. |
7 | |
8 | This program is free software: you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by |
10 | the Free Software Foundation; either version 3 of the License, or |
11 | (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
20 | |
21 | /* -------------------------- Keyword_List class --------------------------- */ |
22 | |
23 | /* Access to first element of list. */ |
24 | INLINE Keyword * |
25 | Keyword_List::first () const |
26 | { |
27 | return _car; |
28 | } |
29 | |
30 | /* Access to next element of list. */ |
31 | INLINE Keyword_List *& |
32 | Keyword_List::rest () |
33 | { |
34 | return _cdr; |
35 | } |
36 | |
37 | /* ------------------------- KeywordExt_List class ------------------------- */ |
38 | |
39 | /* Access to first element of list. */ |
40 | INLINE KeywordExt * |
41 | KeywordExt_List::first () const |
42 | { |
43 | return static_cast<KeywordExt*>(_car); |
44 | } |
45 | |
46 | /* Access to next element of list. */ |
47 | INLINE KeywordExt_List *& |
48 | KeywordExt_List::rest () |
49 | { |
50 | return *reinterpret_cast<KeywordExt_List**>(&_cdr); |
51 | } |
52 | |