Skip to content

Commit

Permalink
fix module
Browse files Browse the repository at this point in the history
  • Loading branch information
rask24 committed Feb 20, 2024
1 parent 9c44fc3 commit 0397d60
Show file tree
Hide file tree
Showing 29 changed files with 43 additions and 84 deletions.
5 changes: 2 additions & 3 deletions include/checker.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/14 10:26:54 by reasuke #+# #+# */
/* Updated: 2024/02/19 12:11:08 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:19:45 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#ifndef CHECKER_H
# define CHECKER_H

# include "../libft/libft.h"
# include "types.h"
# include "push_swap.h"

void sort_based_on_operation(t_stack **p_a, t_stack **p_b);

Expand Down
23 changes: 0 additions & 23 deletions include/main.h

This file was deleted.

7 changes: 1 addition & 6 deletions include/push_swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/10 12:37:54 by reasuke #+# #+# */
/* Updated: 2024/02/13 12:45:48 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:19:53 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

Expand All @@ -21,9 +21,4 @@
# include <stdlib.h>
# include <unistd.h>

int check_args(int argc, char **argv);
t_stack *generate_stack(int argc, char **argv);

void sort(t_stack **p_a, t_stack **p_b);

#endif
3 changes: 1 addition & 2 deletions src/initialization/check_args.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/11 14:44:55 by reasuke #+# #+# */
/* Updated: 2024/02/19 12:56:30 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:19:12 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "initialization.h"
#include "push_swap.h"

static bool _has_not_digit(int argc, char **argv)
{
Expand Down
3 changes: 1 addition & 2 deletions src/initialization/exit_with_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/11 14:38:17 by reasuke #+# #+# */
/* Updated: 2024/02/13 11:46:04 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:19:14 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "initialization.h"
#include "push_swap.h"

void exit_with_error(void)
{
Expand Down
3 changes: 1 addition & 2 deletions src/initialization/generate_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/11 19:04:40 by reasuke #+# #+# */
/* Updated: 2024/02/14 14:28:39 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:19:17 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "initialization.h"
#include "push_swap.h"

int *_allocate_int_array(int size_a)
{
Expand Down
5 changes: 3 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/10 12:37:36 by reasuke #+# #+# */
/* Updated: 2024/02/19 12:06:15 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:21:01 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "initialization.h"
#include "sort.h"

#ifdef LEAK
# ifdef __APPLE__
Expand Down
3 changes: 1 addition & 2 deletions src/sort/is_sorted_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/10 18:47:11 by reasuke #+# #+# */
/* Updated: 2024/02/13 14:01:58 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:18:06 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "sort.h"

bool is_sorted_stack(t_stack *st)
Expand Down
3 changes: 1 addition & 2 deletions src/sort/large_sort/greedy_operation.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/10 10:43:16 by reasuke #+# #+# */
/* Updated: 2024/02/14 16:40:21 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:17:27 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "large_sort.h"
#include "push_swap.h"
#include "stack_operations.h"

static t_stack *_find_opt_st_b(t_stack **p_b)
Expand Down
3 changes: 1 addition & 2 deletions src/sort/large_sort/large_sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/22 16:55:10 by reasuke #+# #+# */
/* Updated: 2024/02/15 12:34:14 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:17:35 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "large_sort.h"
#include "push_swap.h"
#include "sort.h"
#include "stack_operations.h"

Expand Down
3 changes: 1 addition & 2 deletions src/sort/large_sort/push_b_segmented.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/11 22:57:28 by reasuke #+# #+# */
/* Updated: 2024/02/14 14:31:29 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:17:46 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "large_sort.h"
#include "push_swap.h"
#include "stack_operations.h"

static int _calc_segment_id(int target, int n, int segs)
Expand Down
3 changes: 1 addition & 2 deletions src/sort/large_sort/set_cost.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/08 12:17:33 by reasuke #+# #+# */
/* Updated: 2024/02/14 14:15:57 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:17:50 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "large_sort.h"
#include "push_swap.h"

static int _calc_insertion_threshold(t_stack **p_a, t_stack *st_b)
{
Expand Down
3 changes: 1 addition & 2 deletions src/sort/large_sort/set_is_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/14 14:44:38 by reasuke #+# #+# */
/* Updated: 2024/02/14 16:42:11 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:17:53 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "large_sort.h"
#include "push_swap.h"

static int _calc_max_segment(t_stack *st_b)
{
Expand Down
3 changes: 1 addition & 2 deletions src/sort/large_sort/set_min_cost_opt_method.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/09 10:23:28 by reasuke #+# #+# */
/* Updated: 2024/02/14 15:44:15 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:18:02 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "large_sort.h"
#include "push_swap.h"

static int _calc_cost(t_stack *st_b, t_method method)
{
Expand Down
3 changes: 1 addition & 2 deletions src/sort/micro_sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/15 16:32:27 by reasuke #+# #+# */
/* Updated: 2024/02/13 15:38:56 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:18:10 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "sort.h"
#include "stack_operations.h"

Expand Down
3 changes: 1 addition & 2 deletions src/sort/nano_sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/12 15:58:22 by reasuke #+# #+# */
/* Updated: 2024/02/11 12:54:19 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:18:22 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "sort.h"
#include "stack_operations.h"

Expand Down
3 changes: 1 addition & 2 deletions src/sort/sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/15 15:10:35 by reasuke #+# #+# */
/* Updated: 2024/02/11 12:54:21 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:18:25 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "sort.h"

void sort(t_stack **p_a, t_stack **p_b)
Expand Down
4 changes: 2 additions & 2 deletions src/stack_operations/do_double_n_operations.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/10 19:22:50 by reasuke #+# #+# */
/* Updated: 2024/02/10 19:29:43 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:15:32 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "stack_operations.h"

void do_double_n_operations(t_stack **p_a, t_stack **p_b, int n,
void (*operation)(t_stack **, t_stack **))
Expand Down
4 changes: 2 additions & 2 deletions src/stack_operations/do_single_n_operations.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/10 19:22:26 by reasuke #+# #+# */
/* Updated: 2024/02/10 19:29:08 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:15:35 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "stack_operations.h"

void do_single_n_operations(t_stack **p_st, int n,
void (*operation)(t_stack **))
Expand Down
4 changes: 2 additions & 2 deletions src/stack_operations/push.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/15 15:56:53 by reasuke #+# #+# */
/* Updated: 2024/02/07 15:05:10 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:15:37 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "stack_operations.h"

void push_stack(t_stack **p_s1, t_stack **p_s2)
{
Expand Down
4 changes: 2 additions & 2 deletions src/stack_operations/reverse_rotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/23 17:18:15 by reasuke #+# #+# */
/* Updated: 2024/02/07 15:04:58 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:15:40 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "stack_operations.h"

void reverse_rotate_stack(t_stack **p_stack)
{
Expand Down
4 changes: 2 additions & 2 deletions src/stack_operations/rotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/15 14:05:46 by reasuke #+# #+# */
/* Updated: 2024/02/07 15:05:17 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:15:43 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "stack_operations.h"

void rotate_stack(t_stack **p_stack)
{
Expand Down
4 changes: 2 additions & 2 deletions src/stack_operations/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/15 13:28:54 by reasuke #+# #+# */
/* Updated: 2024/02/07 15:05:21 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:15:51 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "stack_operations.h"

void swap_stack(t_stack **p_stack)
{
Expand Down
4 changes: 2 additions & 2 deletions src/utils/clear_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/23 15:46:24 by reasuke #+# #+# */
/* Updated: 2024/02/07 15:05:27 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:14:41 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "utils.h"

void clear_stack(t_stack **p_stack, void (*del)(void *))
{
Expand Down
4 changes: 2 additions & 2 deletions src/utils/get_content.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/08 07:43:54 by reasuke #+# #+# */
/* Updated: 2024/02/08 07:44:10 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:14:37 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "utils.h"

t_content *get_content(t_stack *st)
{
Expand Down
4 changes: 2 additions & 2 deletions src/utils/get_first_index.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/17 18:27:37 by reasuke #+# #+# */
/* Updated: 2024/02/10 20:56:13 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:14:47 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "utils.h"

int get_first_index(t_stack **p_stack)
{
Expand Down
4 changes: 2 additions & 2 deletions src/utils/get_second_index.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/17 18:28:02 by reasuke #+# #+# */
/* Updated: 2024/02/10 20:56:06 by reasuke ### ########.fr */
/* Updated: 2024/02/20 14:14:50 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"
#include "utils.h"

int get_second_index(t_stack **p_stack)
{
Expand Down
Loading

0 comments on commit 0397d60

Please sign in to comment.