minishell
ft_swap.c File Reference
#include "ft_mem.h"
Include dependency graph for ft_swap.c:

Go to the source code of this file.

Functions

void _ft_swap (unsigned char *a, unsigned char *b, size_t bytes)
 
void ft_swap (void *a, void *b, size_t bytes)
 

Function Documentation

◆ _ft_swap()

void _ft_swap ( unsigned char *  a,
unsigned char *  b,
size_t  bytes 
)

Definition at line 15 of file ft_swap.c.

16 {
17  unsigned char tmp;
18 
19  if (a == NULL || b == NULL || a == b)
20  return ;
21  while (0 < bytes)
22  {
23  tmp = *a;
24  *a = *b;
25  *b = tmp;
26  a++;
27  b++;
28  bytes--;
29  }
30 }
Here is the caller graph for this function:

◆ ft_swap()

void ft_swap ( void *  a,
void *  b,
size_t  bytes 
)

Definition at line 32 of file ft_swap.c.

33 {
34  _ft_swap(a, b, bytes);
35 }
void _ft_swap(unsigned char *a, unsigned char *b, size_t bytes)
Definition: ft_swap.c:15
Here is the call graph for this function:
Here is the caller graph for this function: