return ret;
}
-int _gif_encode_open_file(gif_file_s *gif_file)
+static int _gif_encode_open_file(GifFileType *gft)
{
mm_util_fenter();
- mm_util_retvm_if(gif_file == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
+ mm_util_retvm_if(gft == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
- if ((gif_file->GifFile = EGifOpenFileName(GIF_TMP_FILE, 0, NULL)) == NULL) {
+ if ((gft = EGifOpenFileName(GIF_TMP_FILE, 0, NULL)) == NULL) {
mm_util_error("could not open file");
return MM_UTIL_ERROR_INVALID_OPERATION;
}
return MM_UTIL_ERROR_NONE;
}
-int _gif_encode_close_file(gif_file_s *gif_file)
+static int _gif_encode_close_file(GifFileType *gft)
{
mm_util_fenter();
- mm_util_retvm_if(gif_file == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
- mm_util_retvm_if(gif_file->GifFile == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
+ mm_util_retvm_if(gft == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
- if (EGifCloseFile(gif_file->GifFile, NULL) == GIF_ERROR) {
+ if (EGifCloseFile(gft, NULL) == GIF_ERROR) {
mm_util_error("could not close file");
return MM_UTIL_ERROR_INVALID_OPERATION;
}
- gif_file->GifFile = NULL;
+ gft = NULL;
return MM_UTIL_ERROR_NONE;
}
mm_util_fenter();
if (gif_file->filename != NULL) {
- ret = _gif_encode_open_file(gif_file);
+ ret = _gif_encode_open_file(gif_file->GifFile);
mm_util_retvm_if(ret != MM_UTIL_ERROR_NONE, ret, "_gif_encode_open_file failed");
} else if (gif_file->enc_buffer != NULL && gif_file->enc_buffer_size != NULL) {
ret = _gif_encode_open_mem(gif_file);
if (EGifPutScreenDesc(gif_file->GifFile, gif_file->width, gif_file->height,
8 /* color_res */, 0 /* background_color */, NULL) == GIF_ERROR) {
mm_util_error("could not put screen description");
- _gif_encode_close_file(gif_file);
+ _gif_encode_close_file(gif_file->GifFile);
return MM_UTIL_ERROR_INVALID_OPERATION;
}
mm_util_fenter();
- ret = _gif_encode_close_file(gif_file);
+ ret = _gif_encode_close_file(gif_file->GifFile);
mm_util_retvm_if(ret != MM_UTIL_ERROR_NONE, ret, "_gif_encode_close_file failed");
if (gif_file->filename != NULL) {
mm_util_retm_if(gif_file == NULL, "Invalid parameter");
if (gif_file->GifFile != NULL) {
- ret = _gif_encode_close_file(gif_file);
+ ret = _gif_encode_close_file(gif_file->GifFile);
mm_util_retm_if(ret != MM_UTIL_ERROR_NONE, "_gif_encode_close_file failed");
}