136 |
} |
} |
137 |
} |
} |
138 |
} |
} |
139 |
|
|
140 |
|
/* |
141 |
|
* history_general_free: free general history |
142 |
|
*/ |
143 |
|
|
144 |
|
void |
145 |
|
history_general_free () |
146 |
|
{ |
147 |
|
t_history *ptr_history; |
148 |
|
|
149 |
|
while (history_general) |
150 |
|
{ |
151 |
|
ptr_history = history_general->next_history; |
152 |
|
if (history_general->text) |
153 |
|
free (history_general->text); |
154 |
|
free (history_general); |
155 |
|
history_general = ptr_history; |
156 |
|
} |
157 |
|
history_general = NULL; |
158 |
|
history_general_last = NULL; |
159 |
|
history_general_ptr = NULL; |
160 |
|
num_history_general = 0; |
161 |
|
} |
162 |
|
|
163 |
|
|
164 |
|
/* |
165 |
|
* history_buffer_free: free history for a buffer |
166 |
|
*/ |
167 |
|
|
168 |
|
void |
169 |
|
history_buffer_free (void *buffer) |
170 |
|
{ |
171 |
|
t_history *ptr_history; |
172 |
|
|
173 |
|
while (((t_gui_buffer *)(buffer))->history) |
174 |
|
{ |
175 |
|
ptr_history = ((t_gui_buffer *)(buffer))->history->next_history; |
176 |
|
if (((t_gui_buffer *)(buffer))->history->text) |
177 |
|
free (((t_gui_buffer *)(buffer))->history->text); |
178 |
|
free (((t_gui_buffer *)(buffer))->history); |
179 |
|
((t_gui_buffer *)(buffer))->history = ptr_history; |
180 |
|
} |
181 |
|
((t_gui_buffer *)(buffer))->history = NULL; |
182 |
|
((t_gui_buffer *)(buffer))->last_history = NULL; |
183 |
|
((t_gui_buffer *)(buffer))->ptr_history = NULL; |
184 |
|
((t_gui_buffer *)(buffer))->num_history = 0; |
185 |
|
} |