"Fossies" - the Fresh Open Source Software Archive

Member "cook-2.34/cook/expr.h" (25 Sep 2010, 1991 Bytes) of package /linux/misc/old/cook-2.34.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "expr.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  *      cook - file construction tool
    3  *      Copyright (C) 1990-1993, 1995, 1997, 2001, 2006-2008 Peter Miller
    4  *
    5  *      This program is free software; you can redistribute it and/or modify
    6  *      it under the terms of the GNU General Public License as published by
    7  *      the Free Software Foundation; either version 3 of the License, or
    8  *      (at your option) any later version.
    9  *
   10  *      This program is distributed in the hope that it will be useful,
   11  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13  *      GNU General Public License for more details.
   14  *
   15  *      You should have received a copy of the GNU General Public License
   16  *      along with this program. If not, see
   17  *      <http://www.gnu.org/licenses/>.
   18  */
   19 
   20 #ifndef COOK_EXPR_H
   21 #define COOK_EXPR_H
   22 
   23 #include <common/ac/stddef.h>
   24 #include <cook/expr/position.h>
   25 
   26 struct expr_ty; /* forward */
   27 struct opcode_list_ty; /* existence */
   28 struct match_ty; /* existence */
   29 
   30 typedef struct expr_method_ty expr_method_ty;
   31 struct expr_method_ty
   32 {
   33         char    *name;
   34         size_t  size;
   35         void    (*destructor)(struct expr_ty *);
   36         int     (*equal)(const struct expr_ty *, const struct expr_ty *);
   37         void    (*code_generate)(const struct expr_ty *,
   38                         struct opcode_list_ty *);
   39 };
   40 
   41 typedef struct expr_ty expr_ty;
   42 struct expr_ty
   43 {
   44         expr_method_ty  *method;
   45         long            e_references;
   46         expr_position_ty e_position;
   47 };
   48 
   49 expr_ty *expr_copy(expr_ty *);
   50 void expr_delete(expr_ty *);
   51 int expr_eval_condition(const expr_ty *, const struct match_ty *);
   52 struct string_list_ty *expr_evaluate(const expr_ty *,
   53         const struct match_ty *);
   54 int expr_equal(const expr_ty *, const expr_ty *);
   55 void expr_code_generate(const expr_ty *, struct opcode_list_ty *);
   56 
   57 /* PRIVATE: derived expr classes only... */
   58 expr_ty *expr_private_new(expr_method_ty *);
   59 
   60 #endif /* COOK_EXPR_H */