Home | History | Annotate | Download | only in libFLAC

Lines Matching refs:tempfilename

127 static FLAC__bool simple_iterator_copy_file_prefix_(FLAC__Metadata_SimpleIterator *iterator, FILE **tempfile, char **tempfilename, FLAC__bool append);
128 static FLAC__bool simple_iterator_copy_file_postfix_(FLAC__Metadata_SimpleIterator *iterator, FILE **tempfile, char **tempfilename, int fixup_is_last_code, off_t fixup_is_last_flag_offset, FLAC__bool backup);
135 static FLAC__bool open_tempfile_(const char *filename, const char *tempfile_path_prefix, FILE **tempfile, char **tempfilename, FLAC__Metadata_SimpleIteratorStatus *status);
136 static FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, char **tempfilename, FLAC__Metadata_SimpleIteratorStatus *status);
137 static void cleanup_tempfile_(FILE **tempfile, char **tempfilename);
1400 char *tempfilename;
1413 if(!open_tempfile_(chain->filename, tempfile_path_prefix, &tempfile, &tempfilename, &status)) {
1415 cleanup_tempfile_(&tempfile, &tempfilename);
1420 cleanup_tempfile_(&tempfile, &tempfilename);
1439 cleanup_tempfile_(&tempfile, &tempfilename);
1444 cleanup_tempfile_(&tempfile, &tempfilename);
1451 if(!transport_tempfile_(chain->filename, &tempfile, &tempfilename, &status))
2905 char *tempfilename;
2929 if(!simple_iterator_copy_file_prefix_(iterator, &tempfile, &tempfilename, append))
2934 cleanup_tempfile_(&tempfile, &tempfilename);
2939 cleanup_tempfile_(&tempfile, &tempfilename);
2944 if(!simple_iterator_copy_file_postfix_(iterator, &tempfile, &tempfilename, fixup_is_last_code, fixup_is_last_flag_offset, block==0))
3033 FLAC__bool simple_iterator_copy_file_prefix_(FLAC__Metadata_SimpleIterator *iterator, FILE **tempfile, char **tempfilename, FLAC__bool append)
3041 if(!open_tempfile_(iterator->filename, iterator->tempfile_path_prefix, tempfile, tempfilename, &iterator->status)) {
3042 cleanup_tempfile_(tempfile, tempfilename);
3046 cleanup_tempfile_(tempfile, tempfilename);
3053 FLAC__bool simple_iterator_copy_file_postfix_(FLAC__Metadata_SimpleIterator *iterator, FILE **tempfile, char **tempfilename, int fixup_is_last_code, off_t fixup_is_last_flag_offset, FLAC__bool backup)
3059 cleanup_tempfile_(tempfile, tempfilename);
3064 cleanup_tempfile_(tempfile, tempfilename);
3078 cleanup_tempfile_(tempfile, tempfilename);
3083 cleanup_tempfile_(tempfile, tempfilename);
3096 cleanup_tempfile_(tempfile, tempfilename);
3101 cleanup_tempfile_(tempfile, tempfilename);
3109 if(!transport_tempfile_(iterator->filename, tempfile, tempfilename, &iterator->status))
3216 FLAC__bool open_tempfile_(const char *filename, const char *tempfile_path_prefix, FILE **tempfile, char **tempfilename, FLAC__Metadata_SimpleIteratorStatus *status)
3220 if(0 == (*tempfilename = (char*)safe_malloc_add_3op_(strlen(filename), /*+*/strlen(tempfile_suffix), /*+*/1))) {
3224 strcpy(*tempfilename, filename);
3225 strcat(*tempfilename, tempfile_suffix);
3234 if(0 == (*tempfilename = (char*)safe_malloc_add_4op_(strlen(tempfile_path_prefix), /*+*/strlen(p), /*+*/strlen(tempfile_suffix), /*+*/2))) {
3238 strcpy(*tempfilename, tempfile_path_prefix);
3239 strcat(*tempfilename, "/");
3240 strcat(*tempfilename, p);
3241 strcat(*tempfilename, tempfile_suffix);
3244 if(0 == (*tempfile = fopen(*tempfilename, "w+b"))) {
3252 FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, char **tempfilename, FLAC__Metadata_SimpleIteratorStatus *status)
3257 FLAC__ASSERT(0 != tempfilename);
3258 FLAC__ASSERT(0 != *tempfilename);
3267 cleanup_tempfile_(tempfile, tempfilename);
3274 if(0 != rename(*tempfilename, filename)) {
3275 cleanup_tempfile_(tempfile, tempfilename);
3280 cleanup_tempfile_(tempfile, tempfilename);
3285 void cleanup_tempfile_(FILE **tempfile, char **tempfilename)
3292 if(0 != *tempfilename) {
3293 (void)unlink(*tempfilename);
3294 free(*tempfilename);
3295 *tempfilename = 0;