fix node free
[protos/libecoli.git] / lib / ecoli_node_expr.h
index 651ac7c..4f21d81 100644 (file)
@@ -1,28 +1,5 @@
-/*
- * Copyright (c) 2016, Olivier MATZ <zer0@droids-corp.org>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of the University of California, Berkeley nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright 2016, Olivier MATZ <zer0@droids-corp.org>
  */
 
 #ifndef ECOLI_NODE_EXPR_
@@ -30,8 +7,6 @@
 
 #include <ecoli_node.h>
 
-/* XXX remove the _new for all other nodes */
-
 /**
  * Callback function type for evaluating a variable
  *
  *   A user-defined context passed to all callback functions, which
  *   can be used to maintain a state or store global information.
  * @param var
- *   The parsed result referencing the variable.
+ *   The parse result referencing the variable.
  * @return
  *   0 on success (*result must be set), or -errno on error (*result
  *   is undefined).
  */
 typedef int (*ec_node_expr_eval_var_t)(
        void **result, void *userctx,
-       const struct ec_parsed *var);
+       const struct ec_parse *var);
 
 /**
  * Callback function type for evaluating a prefix-operator
@@ -63,7 +38,7 @@ typedef int (*ec_node_expr_eval_var_t)(
  * @param operand
  *   The evaluated expression on which the operation should be applied.
  * @param var
- *   The parsed result referencing the operator.
+ *   The parse result referencing the operator.
  * @return
  *   0 on success (*result must be set, operand is freed),
  *   or -errno on error (*result is undefined, operand is not freed).
@@ -71,23 +46,23 @@ typedef int (*ec_node_expr_eval_var_t)(
 typedef int (*ec_node_expr_eval_pre_op_t)(
        void **result, void *userctx,
        void *operand,
-       const struct ec_parsed *operator);
+       const struct ec_parse *operator);
 
 typedef int (*ec_node_expr_eval_post_op_t)(
        void **result, void *userctx,
        void *operand,
-       const struct ec_parsed *operator);
+       const struct ec_parse *operator);
 
 typedef int (*ec_node_expr_eval_bin_op_t)(
        void **result, void *userctx,
        void *operand1,
-       const struct ec_parsed *operator,
+       const struct ec_parse *operator,
        void *operand2);
 
 typedef int (*ec_node_expr_eval_parenthesis_t)(
        void **result, void *userctx,
-       const struct ec_parsed *open_paren,
-       const struct ec_parsed *close_paren,
+       const struct ec_parse *open_paren,
+       const struct ec_parse *close_paren,
        void * value);
 
 typedef void (*ec_node_expr_eval_free_t)(
@@ -112,7 +87,7 @@ struct ec_node_expr_eval_ops {
 };
 
 int ec_node_expr_eval(void **result, const struct ec_node *node,
-       struct ec_parsed *parsed, const struct ec_node_expr_eval_ops *ops,
+       struct ec_parse *parse, const struct ec_node_expr_eval_ops *ops,
        void *userctx);
 
 #endif