62#define uchar unsigned char
66#define uint unsigned int
70#define ushort unsigned short
76#define CHUNK_P (1 << 17)
229 static char filename_copy_p[1027];
230 static char filename_copy_2_p[1027];
232 strcpy(filename_copy_2_p, filename_p);
234 ptr_p = filename_copy_2_p;
247 ptr_p =
strrstr(filename_copy_p,
".");
251 strcpy(extension_p, ptr_p + 1);
265 FILE *my_input_file =
NULL;
266 FILE *my_file_p =
NULL;
276 int return_value_p = 0;
279 bool found_p =
false;
288 adjusted_filename_in_temp_p[0] = 0;
290 if (0 == constructed_chunk_p[0] && 1 == constructed_chunk_p[0])
297 if (strlen(the_extension_p) && 3 == strlen(the_extension_p))
299 for (i_p = 1; i_p < 100; i_p++)
302 sprintf(temp_p,
"%03d", i_p);
304 if (0 == strcmp(the_extension_p, temp_p))
324 strcpy(first_chunk_p, filename_utf_8_p);
326 ptr_p =
strrstr(first_chunk_p,
".");
330 if (0 == strlen(adjusted_filename_in_temp_p))
338 if (
'\\' != temp_folder_name_p[strlen(temp_folder_name_p) - 1])
340 strcat(temp_folder_name_p,
"\\");
343 strcat(temp_folder_name_p, adjusted_filename_in_temp_p);
344 strcpy(adjusted_filename_in_temp_p, temp_folder_name_p);
346 pedro_dprintf(-1,
"file in temp folder %s\n", adjusted_filename_in_temp_p);
352 WCHAR *ar_temp = (
void *)malloc(r_temp);
353 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
363 return_value_p = 5112;
371 sprintf(first_chunk_p + strlen(first_chunk_p),
".%03d", counter_p);
376 WCHAR *ar_temp = (
void *)malloc(r_temp);
377 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
389 return_value_p = 5113;
397 WCHAR *ar_temp = (
void *)malloc(r_temp);
398 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
413 len_p = fread(buf_p, 1,
CHUNK_P, my_input_file);
415 check_write_p = fwrite(buf_p, 1, len_p, my_file_p);
417 if (check_write_p != len_p)
419 return_value_p = 5114;
430 fclose(my_input_file);
431 my_input_file =
NULL;
438 if (-1 == return_value_p)
452 fclose(my_input_file);
454 if (0 == return_value_p && did_p)
460 return return_value_p;
467 int return_value_p = 0;
472 int64_t remaining_slice_p;
473 FILE *input__p =
NULL;
474 FILE *output_p =
NULL;
476 char *temp_data_p =
NULL;
487 if (
NULL == output_p &&
NULL != output_p &&
500 remaining_p = original_size_p;
505 WCHAR *ar_temp = (
void *)malloc(r_temp);
506 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
517 return_value_p = 5101;
526 strcpy(out_file_p, filename_utf_8_p);
528 sprintf(out_file_p + strlen(out_file_p),
533 WCHAR *ar_temp = (
void *)malloc(r_temp);
534 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
541 strcpy(out_file_p, filename_utf_8_p);
543 sprintf(out_file_p + strlen(out_file_p),
550 WCHAR *ar_temp = (
void *)malloc(r_temp);
551 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
565 len_p = fread(temp_data_p, 1,
min(remaining_slice_p,
CHUNK_P), input__p);
567 check_write_p = fwrite(temp_data_p, 1, len_p, output_p);
569 if (check_write_p != len_p)
571 return_value_p = 5102;
576 remaining_slice_p -= len_p;
577 remaining_p -= len_p;
579 if (0 == remaining_p)
586 WCHAR *ar_temp = (
void *)malloc(r_temp);
587 WCHAR *ar_temp2 = (
void *)malloc(r_temp);
607 return_value_p = 5104;
636 return return_value_p;
#define AMANDA__SIZE
Definition arp.h:149
wchar_t * permissive_name_m_(const wchar_t *wname, WCHAR *ar_temp)
Definition tar_1_33.c:279
void pedro_dprintf(int amanda_level, char *format,...)
Definition pedro.c:43
int stripfilenameandpath(char *path, char *onlypath, char *onlyfilename)
Definition extract_kkk.c:554
int __fastcall split_in_multiple_volumes_p(char *filename_utf_8_p)
Definition multi_volume_p.c:463
int __fastcall detect_multi_volume_p(char *filename_utf_8_p, char *adjusted_filename_in_temp_p)
Definition multi_volume_p.c:261
int size_of_WCHAR_mem_r(char *in_string)
Definition tar_1_33.c:694
#define CHUNK_P
Definition multi_volume_p.c:76
int __stdcall split_compressed_file_p(int64_t slice_in_bytes_p_)
Definition multi_volume_p.c:639
int64_t slice_in_bytes_p
Definition multi_volume_p.c:78
char * ar_gettemppath_z(void)
Definition tar_1_33.c:11455
char * strrstr(char *s1, char *s2)
Definition extract_kkk.c:469
void __fastcall get_extension_p(char *filename_p, char *extension_p)
Definition multi_volume_p.c:225
WCHAR * amanda_asciitowide_1_(char *pUTF8, WCHAR *ar_temp)
Definition tar_1_33.c:677
__int64 getfilesize_ar(char *infile_ar)
Definition tar_1_33.c:2432
#define min(a, b)
Definition compress42.c:304
wchar_t * permissive_name_m_v27(const wchar_t *wname, WCHAR *ar_temp)
copy of permissive_name_m_, because in some API calls you need to conversions to a wide path this is ...
Definition tar_1_33.c:376
int ret_arp_
Definition tar_1_33.c:592
char error_message_k[AMANDA__SIZE]
Definition tar_1_33.c:176
#define s1(x)
Definition Sha256.c:142
#define NULL
Definition getopt1.c:37