Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
lzop2_thread.c
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2* *
3* Licensa de Copia (C) <2022> <Aurora Boreal> *
4* *
5* Este programa e software livre: voce pode redistribuir isto e/ou *
6* modificar isto sobre os termos do GNU Licensa Geral Pública como 12
7* publicado pela Fundacao de Software Livre, tanto a versão 3 da *
8* Licensa, ou (dependendo da sua opcao) qualquer versao posterior. *
9* *
10* Este programa e distribuido na esperanca que isto vai ser util, *
11* mas SEM QUALQUER GARANTIA; sem ate mesmo a implicada garantia de *
12* COMERCIALIZAcaO ou CABIMENTO PARA UM FIM PARTICULAR. Veja a *
13* Licensa Geral Publica para mais detalhes. *
14* *
15* Você deve ter recebido uma cópia da LICENSA GERAL PUBLICA e a GNU *
16* Licensa Publica Menor junto com este programa *
17* Se não, veja <http://www.gnu.org/licenses/>. *
18* *
19* Suporte: sourceforge.net github.com *
20* *
21* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
22
23* Pereira: arsoftware25@gmail.com ricardo@arsoftware.net.br *
24* Koci: arsoftware10@gmail.com amanda@arsoftware.net. br *
25
26 pereira1001@users.sourceforge.net
27 */
28
29
30
31unsigned __stdcall my_thread_function_v27_8(void * my_argument_z )
32{
33 my_thread_struct_z * ptr_my_struct_z = (void *) my_argument_z;
34 assert(ptr_my_struct_z);
35 if(NULL == ptr_my_struct_z->dest)
36 {
37 goto saida_amanda;
38 }
39
40 pedro_dprintf(-1, "bytes to extract %lld\n", ptr_my_struct_z->size_of_input_file_copy_z);
41
42 if(0 != ptr_my_struct_z->offset_z)
43 {
44
45 pedro_dprintf(-1, "seek to %lld\n", ptr_my_struct_z->offset_z);
46
47 if(
48 0 != _fseeki64(
49 ptr_my_struct_z->input_file,
50 ptr_my_struct_z->offset_z,
52 )
53 )
54 {
55 ptr_my_struct_z->retvalue = 403; //File access error
56 goto saida_amanda;
57 }
58 }
59
60 //aqui amor...
61
62 ptr_my_struct_z->dest_is_FILE_z = true;
63 pedro_dprintf(-1, "antes da descompressao\n");
64 ptr_my_struct_z->retvalue = decompress_file_c_01(ptr_my_struct_z->input_file, NULL, ptr_my_struct_z);
65 pedro_dprintf(-1, "depois da descompressao\n");
66 if(119 == ptr_my_struct_z->internal_error_arp)
67 {
68 ptr_my_struct_z->retvalue = 119;
69 }
70 else if(6 == ptr_my_struct_z->internal_error_arp)
71 {
72 ptr_my_struct_z->retvalue = ptr_my_struct_z->internal_error_arp;
73 }
74 else
75 {
76 if(ptr_my_struct_z->retvalue)
77 {
78 pedro_dprintf(-1, "error 2 7 \n");
79 ptr_my_struct_z->retvalue = 8; //Decompression error
80 }
81 }
82
83saida_amanda:;
84
85 if (intcancel_8)
86 {
87 ptr_my_struct_z->retvalue = 119;//User abort
88 }
89
90 if(ptr_my_struct_z->input_file )
91 {
92 fclose(ptr_my_struct_z->input_file);
93 }
94
96 {
97 thread_return_value_z_8 = ptr_my_struct_z->retvalue;
98 }
99
100 if(ptr_my_struct_z->dest)
101 {
102 fclose(ptr_my_struct_z->dest);
103 }
104 //Sleep(2000);
105
106 free(my_argument_z);
107 _endthreadex(0);
108
109 return 27+51;
110}
void pedro_dprintf(int amanda_level, char *format,...)
Definition pedro.c:43
#define assert(condition)
Definition lz4.c:273
Definition stdio_v3.h:23
int64_t offset_z
Definition stdio_v3.h:44
int64_t size_of_input_file_copy_z
Definition stdio_v3.h:46
int retvalue
Definition stdio_v3.h:39
bool dest_is_FILE_z
Definition stdio_v3.h:32
FILE * dest
Definition stdio_v3.h:26
int internal_error_arp
Definition stdio_v3.h:36
FILE * input_file
Definition stdio_v3.h:35
#define SEEK_SET
Definition zconf.h:498
int intcancel_8
Definition compress2dll.c:140
int thread_return_value_z_8
Definition compress2_2_z.c:272
int decompress_file_c_01(FILE *f_in_z, FILE *f_out_z, my_thread_struct_z *amanda)
Definition compress2_z.c:84
unsigned __stdcall my_thread_function_v27_8(void *my_argument_z)
Definition lzop2_thread.c:31
#define NULL
Definition getopt1.c:37