aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_music.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-03 16:14:26 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-03 16:14:26 +0100
commitce43b1cd1caa539af687425f58a6999a20807878 (patch)
tree34631aef16b6eb1d5d650fe9e900916f9810215d /src/ft_get_music.c
parentMakefile update (diff)
download42-cub3d-ce43b1cd1caa539af687425f58a6999a20807878.tar.gz
42-cub3d-ce43b1cd1caa539af687425f58a6999a20807878.tar.bz2
42-cub3d-ce43b1cd1caa539af687425f58a6999a20807878.tar.xz
42-cub3d-ce43b1cd1caa539af687425f58a6999a20807878.tar.zst
42-cub3d-ce43b1cd1caa539af687425f58a6999a20807878.zip
Going full stack is bav
Diffstat (limited to 'src/ft_get_music.c')
-rw-r--r--src/ft_get_music.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/ft_get_music.c b/src/ft_get_music.c
index 3d40ddf..eb25af3 100644
--- a/src/ft_get_music.c
+++ b/src/ft_get_music.c
@@ -20,18 +20,18 @@ static void
{
uint8_t len;
- len = ft_strlen(mlist.music_path);
+ len = ft_strlen(mlist->music_path);
if (FT_OS == 2)
len += 22;
else
len += 18;
- ft_memdel((void**)&mlist.music_cmd);
- if (!(mlist.music_cmd = (char *)malloc((len + 1) * sizeof(char))))
+ ft_memdel((void**)&mlist->music_cmd);
+ if (!(mlist->music_cmd = (char *)malloc((len + 1) * sizeof(char))))
return ;
if (FT_OS == 2)
{
- ft_sprintf(mlist.music_cmd, "aplay -f cd -t wav -q %s",
- mlist.music_path);
+ ft_sprintf(mlist->music_cmd, "aplay -f cd -t wav -q %s",
+ mlist->music_path);
}
else {}
}
@@ -41,26 +41,26 @@ int8_t
{
if (!(*words) || !(*(words + 1)) || (*(words + 2)))
{
- ft_sprintf(clist.errmsg, FT_ERR_ARGS);
+ ft_sprintf(clist->errmsg, FT_ERR_ARGS);
return (-1);
}
if (ft_check_ext(*(words + 1), ".wav") < 0)
{
- ft_sprintf(clist.errmsg, FT_ERR_NOT_A_WAV);
+ ft_sprintf(clist->errmsg, FT_ERR_NOT_A_WAV);
return (-1);
}
- ft_memdel((void**)&clist.mlist.music_path);
- if (!(clist.mlist.music_path = ft_strdup(*(words + 1))))
+ ft_memdel((void**)&clist->mlist.music_path);
+ if (!(clist->mlist.music_path = ft_strdup(*(words + 1))))
{
- ft_sprintf(clist.errmsg, FT_ERR_ALLOCATE);
+ ft_sprintf(clist->errmsg, FT_ERR_ALLOCATE);
return (-1);
}
- if (ft_check_not_found(clist.mlist.music_path) < 0)
+ if (ft_check_not_found(clist->mlist.music_path) < 0)
{
- ft_sprintf(clist.errmsg, FT_ERR_RD_MUSIC);
+ ft_sprintf(clist->errmsg, FT_ERR_RD_MUSIC);
return (-1);
}
- clist.mlist.ismusic = 1;
- ft_set_music_cmd(clist.mlist);
+ clist->mlist.ismusic = 1;
+ ft_set_music_cmd(&clist->mlist);
return (0);
}