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

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* swap.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/06 05:36:42 by tgrekov #+# #+# */
/* Updated: 2024/07/17 08:35:38 by tgrekov ### ########.fr */
/* */
/* ************************************************************************** */

Definition in file swap.c.

#include <ft_printf.h>
#include "../stack.h"
Include dependency graph for swap.c:

Go to the source code of this file.

Functions

static int _swap (t_stack stack)
 Swap the first two elements in stack.
 
void swap (t_stack *stack, int mode)
 Swap the first two elements in stacks 1, 2, or both, depending on whether mode is set to 0, 1, or 2.
 

Function Documentation

◆ _swap()

static int _swap ( t_stack  stack)
static

Swap the first two elements in stack.

Parameters
[in,out]stack
Return values
int

Definition at line 29 of file swap.c.

Here is the caller graph for this function:

◆ swap()

void swap ( t_stack stack,
int  mode 
)

Swap the first two elements in stacks 1, 2, or both, depending on whether mode is set to 0, 1, or 2.

Parameters
[in,out]stack
[in]mode

Definition at line 48 of file swap.c.

References _swap(), and ft_printf().

Here is the call graph for this function:
Here is the caller graph for this function: