/***********************************************************************************
 * Chaga string arithmetic library                                                 *
 * Copyright (C) 2026 Robert James Bruce                                           *
 *                                                                                 *
 * This file is part of the Chaga string arithmetic library.                       *
 *                                                                                 *
 * The Chaga string arithmetic library is free software: you can redistribute it   * 
 * and/or modify it under the terms of the GNU General Public License as published *
 * by the Free Software Foundation, either version 3 of the License, or (at your   *
 * option) any later version.                                                      *
 *                                                                                 *
 * The Chaga string arithmetic 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 General Public *
 * License for more details.                                                       *
 *                                                                                 *
 * You should have received a copy of the GNU General Public License               *
 * along with the Chaga compiler. If not, see <https://www.gnu.org/licenses/>.     *
 ***********************************************************************************/
#ifndef LIBCHAGA_GENERAL_FUNCTIONS
#define LIBCHAGA_GENERAL_FUNCTIONS 1 
#endif


#include <stdio.h>
#include <stdlib.h>


#ifndef LIBCHAGA_DATA_STRUCTURES
#include "libchaga-data_structures.h"
#endif


digit_stack_node * push_digit_stack (digit_stack_node *, unsigned char);
digit_stack_node * pop_digit_stack (digit_stack_node *);
unsigned char top_digit_stack (digit_stack_node *);
digit_queue_node * add_digit_queue (digit_queue_node *, unsigned char);
digit_queue_node * free_digit_queue (digit_queue_node *);
psnc * packed_string_number_component_release_memory (psnc *);
psnc * packed_string_number_component_copy_number (psnc *, psnc *);
long long int count_num_digits_in_packed_string_integer (psint *);
psint_list_node * add_psint_element_to_list (psint_list_node *, psint *);
psint_list_node * create_two_element_psint_list (psint *, psint *);
runtime_expression_node * push_operand_runtime_expression_stack (runtime_expression_node *, chaga_operand_type, void *, unsigned char);
runtime_expression_node * pop_runtime_expression_stack (runtime_expression_node *);
runtime_expression_node * add_operator_element_runtime_expression (runtime_expression_node *, chaga_operator_type);
runtime_expression_node * add_operand_element_runtime_expression (runtime_expression_node *, chaga_operand_type, void *, unsigned char);
unsigned char evaluate_runtime_expression_return_boolean_result (runtime_expression_node *);
psint * evaluate_runtime_expression_return_integer_result_for_set_statement (runtime_expression_node *);
psflt * evaluate_runtime_expression_return_float_result_for_set_statement (runtime_expression_node *);
unsigned char * evaluate_runtime_expression_return_boolean_result_for_set_statement (runtime_expression_node *);
runtime_expression_node * evaluate_runtime_expression (runtime_expression_node *);
