tgrekov-push_swap
HIVE push_swap July 2024
Loading...
Searching...
No Matches
main.c File Reference

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/06 04:07:48 by tgrekov #+# #+# */
/* Updated: 2024/07/16 12:26:16 by tgrekov ### ########.fr */
/* */
/* ************************************************************************** */

Definition in file main.c.

#include <stdlib.h>
#include "stack/stack.h"
Include dependency graph for main.c:

Go to the source code of this file.

Functions

int input (int argc, char **argv, t_stack *stack)
 Parse and validate program input, initialize stacks and fill the first stack.
 
int sort (t_stack *stack)
 Output all instructions required to sort stack a.
 

Function Documentation

◆ input()

int input ( int  argc,
char **  argv,
t_stack stack 
)

Parse and validate program input, initialize stacks and fill the first stack.

Parameters
[in]argc
[in]argv
[out]stack
Return values
int

Definition at line 134 of file input.c.

References arr_free(), err(), init_stacks(), and parse_args().

Here is the call graph for this function:

◆ sort()

int sort ( t_stack stack)

Output all instructions required to sort stack a.

Parameters
[in,out]stack
Return values
int

Definition at line 148 of file sort.c.

References err(), get_minix(), is_sorted(), pick(), push(), rot_i(), and swap().

Here is the call graph for this function: