MiniDevil As beautiful as a shell
drawing_utils.c
Go to the documentation of this file.
1 /* ************************************************************************** */
2 /* */
3 /* ::: :::::::: */
4 /* drawing_utils.c :+: :+: :+: */
5 /* +:+ +:+ +:+ */
6 /* By: baelgadi <baelgadi@student.42.fr> +#+ +:+ +#+ */
7 /* +#+#+#+#+#+ +#+ */
8 /* Created: 2026/02/17 17:49:09 by zotaj-di #+# #+# */
9 /* Updated: 2026/03/04 03:34:02 by baelgadi ### ########.fr */
10 /* */
11 /* ************************************************************************** */
12 
13 #include "minishell_ui.h"
14 
22 void print_at(int row, int col, const char *str)
23 {
24  ft_printf("\033[%d;%dH%s", row, col, str);
25 }
26 
33 void draw_hline(int width, const char *color)
34 {
35  int i;
36 
37  if (color)
38  write(STDOUT_FILENO, color, ft_strlen(color));
39  i = 0;
40  while (i++ < width)
41  write(STDOUT_FILENO, "─", 3);
42  if (color)
43  write(STDOUT_FILENO, RESET, ft_strlen(RESET));
44 }
void draw_hline(int width, const char *color)
Draw a horizontal line of dashes with optional color.
Definition: drawing_utils.c:33
void print_at(int row, int col, const char *str)
Move the terminal cursor to [row, col] and write str.
Definition: drawing_utils.c:22
UI mode structures, macros & function prototypes.
#define RESET
Definition: minishell_ui.h:37