static char *autocomplete_replace(char *str, t_bin *bin, int *index, t_cmd *cmd) { char *new_word; if ((new_word = get_new_word(bin)) != NULL) { if (*index != 0 && is_alpha(str[*index - 1]) == 1) str = gere_alt_back(index, str, cmd); str = put_in_str(str, *index, new_word); free(new_word); } return (str); }
t_bool checksum(t_bit *bits, t_stock *stock) { t_str str; t_crc crc8; t_bool rtn; str = put_in_str(bits); crc8 = hr_crc32((char*)str.str, ft_strlen((char*)str.str), 0, TRUE); ft_putendl((char*)str.str); if (crc8 == (t_crc)str.crc8) rtn = TRUE; free(str.str); reset_str(bits); stock->bit = NULL; return (rtn); }