2023-06-25 15:14:06 +02:00
|
|
|
#ifndef __LIBCPROJECT_TERMINAL__
|
|
|
|
#define __LIBCPROJECT_TERMINAL__
|
2023-01-05 19:28:05 +01:00
|
|
|
|
2023-08-07 00:11:07 +02:00
|
|
|
#include <errno.h>
|
2023-01-07 19:38:01 +01:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
2023-01-05 19:28:05 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
2023-07-31 23:51:37 +02:00
|
|
|
#include "array_list.h"
|
2023-01-07 19:38:01 +01:00
|
|
|
#include "character.h"
|
2023-06-25 19:32:45 +02:00
|
|
|
#include "hash_map.h"
|
2023-01-05 19:28:05 +01:00
|
|
|
#include "linked_list.h"
|
|
|
|
#include "queue.h"
|
|
|
|
#include "stack.h"
|
2023-06-25 15:07:34 +02:00
|
|
|
#include "types.h"
|
2023-01-05 19:28:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Read a line from stdin.
|
2023-08-09 21:08:15 +02:00
|
|
|
*
|
|
|
|
* @return string_t
|
2023-06-24 21:06:45 +02:00
|
|
|
* @since v1.0.0
|
2023-01-05 19:28:05 +01:00
|
|
|
*/
|
2023-06-25 15:03:04 +02:00
|
|
|
string_t terminal_input();
|
2023-01-05 19:28:05 +01:00
|
|
|
|
2023-06-24 21:06:45 +02:00
|
|
|
/**
|
2024-09-25 14:26:15 +02:00
|
|
|
* @brief Print a int.
|
2023-06-24 21:06:45 +02:00
|
|
|
*
|
2024-09-25 14:26:15 +02:00
|
|
|
* @param value
|
2023-06-24 21:06:45 +02:00
|
|
|
* @since v1.0.0
|
|
|
|
*/
|
2024-09-25 14:26:15 +02:00
|
|
|
void terminal_print_int(void* value);
|
2023-01-05 19:28:05 +01:00
|
|
|
|
2023-06-24 21:06:45 +02:00
|
|
|
/**
|
2024-09-25 14:26:15 +02:00
|
|
|
* @brief Print a boolean.
|
2023-06-24 21:06:45 +02:00
|
|
|
*
|
|
|
|
* @param value
|
2024-09-25 14:26:15 +02:00
|
|
|
* @since v5.0.0
|
2023-06-24 21:06:45 +02:00
|
|
|
*/
|
2024-09-25 14:26:15 +02:00
|
|
|
void terminal_print_bool(void* value);
|
2023-01-05 19:28:05 +01:00
|
|
|
|
2023-06-24 21:06:45 +02:00
|
|
|
/**
|
|
|
|
* @brief Print a long.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v1.0.0
|
|
|
|
*/
|
2023-01-05 19:28:05 +01:00
|
|
|
void terminal_print_long(void* value);
|
|
|
|
|
2023-06-24 21:06:45 +02:00
|
|
|
/**
|
|
|
|
* @brief Print a unsigned long.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v1.0.0
|
|
|
|
*/
|
2023-01-05 19:28:05 +01:00
|
|
|
void terminal_print_unsigned_long(void* value);
|
|
|
|
|
2024-09-25 14:26:15 +02:00
|
|
|
/**
|
|
|
|
* @brief Print a float.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v5.0.0
|
|
|
|
*/
|
|
|
|
void terminal_print_float(void* value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Print a double.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v5.0.0
|
|
|
|
*/
|
|
|
|
void terminal_print_double(void* value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Print a int8_t.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v5.0.0
|
|
|
|
*/
|
|
|
|
void terminal_print_int8_t(void* value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Print a int16_t.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v5.0.0
|
|
|
|
*/
|
|
|
|
void terminal_print_int16_t(void* value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Print a int32_t.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v5.0.0
|
|
|
|
*/
|
|
|
|
void terminal_print_int32_t(void* value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Print a int64_t.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v5.0.0
|
|
|
|
*/
|
|
|
|
void terminal_print_int64_t(void* value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Print a uint8_t.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v5.0.0
|
|
|
|
*/
|
|
|
|
void terminal_print_uint8_t(void* value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Print a uint16_t.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v5.0.0
|
|
|
|
*/
|
|
|
|
void terminal_print_uint16_t(void* value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Print a uint32_t.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v5.0.0
|
|
|
|
*/
|
|
|
|
void terminal_print_uint32_t(void* value);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Print a uint64_t.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v5.0.0
|
|
|
|
*/
|
|
|
|
void terminal_print_uint64_t(void* value);
|
|
|
|
|
2023-06-24 21:06:45 +02:00
|
|
|
/**
|
|
|
|
* @brief Print a char.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v1.0.0
|
|
|
|
*/
|
2023-01-05 19:28:05 +01:00
|
|
|
void terminal_print_char(void* value);
|
|
|
|
|
2024-09-25 14:26:15 +02:00
|
|
|
/**
|
|
|
|
* @brief Print an array.
|
|
|
|
*
|
|
|
|
* @param array
|
|
|
|
* @param array_size
|
|
|
|
* @param element_size
|
|
|
|
* @param print_element
|
|
|
|
* @since v1.0.0
|
|
|
|
*/
|
|
|
|
void terminal_print_array(void* array, size_t array_size, size_t element_size, void (*print_element)(void*));
|
|
|
|
|
2023-06-24 21:06:45 +02:00
|
|
|
/**
|
|
|
|
* @brief Print a string.
|
|
|
|
*
|
|
|
|
* @param value
|
|
|
|
* @since v1.0.0
|
|
|
|
*/
|
2023-01-05 19:28:05 +01:00
|
|
|
void terminal_print_string(void* value);
|
|
|
|
|
2023-06-24 21:06:45 +02:00
|
|
|
/**
|
|
|
|
* @brief Print a stack.
|
|
|
|
*
|
|
|
|
* @param stack
|
|
|
|
* @param print_element
|
|
|
|
* @since v1.0.0
|
|
|
|
*/
|
2023-01-05 19:28:05 +01:00
|
|
|
void terminal_print_stack(struct stack* stack, void (*print_element)(void*));
|
|
|
|
|
2023-06-24 21:06:45 +02:00
|
|
|
/**
|
|
|
|
* @brief Print a queue.
|
|
|
|
*
|
|
|
|
* @param queue
|
|
|
|
* @param print_element
|
|
|
|
* @since v1.0.0
|
|
|
|
*/
|
2023-01-05 19:28:05 +01:00
|
|
|
void terminal_print_queue(struct queue* queue, void (*print_element)(void*));
|
|
|
|
|
2023-06-24 21:06:45 +02:00
|
|
|
/**
|
|
|
|
* @brief Print a linked list.
|
|
|
|
*
|
|
|
|
* @param linked_list
|
|
|
|
* @param print_element
|
|
|
|
* @since v1.0.0
|
|
|
|
*/
|
2023-01-05 19:28:05 +01:00
|
|
|
void terminal_print_linked_list(struct linked_list* linked_list, void (*print_element)(void*));
|
|
|
|
|
2023-06-25 19:32:45 +02:00
|
|
|
/**
|
|
|
|
* @brief Print a hash map.
|
|
|
|
*
|
|
|
|
* @param hash_map
|
|
|
|
* @param print_element
|
|
|
|
* @since v2.0.0
|
|
|
|
*/
|
|
|
|
void terminal_print_hash_map(struct hash_map* hash_map, void (*print_element)(void*));
|
|
|
|
|
2023-07-31 23:51:37 +02:00
|
|
|
/**
|
|
|
|
* @brief Print an array list.
|
|
|
|
*
|
2023-08-09 21:08:15 +02:00
|
|
|
* @param list
|
2023-07-31 23:51:37 +02:00
|
|
|
* @param print_element
|
2023-08-05 15:03:53 +02:00
|
|
|
* @since v3.0.0
|
2023-07-31 23:51:37 +02:00
|
|
|
*/
|
|
|
|
void terminal_print_array_list(struct array_list* list, void (*print_element)(void*));
|
|
|
|
|
2023-01-05 19:28:05 +01:00
|
|
|
#endif
|