Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
dirent_ronkko.h
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
3 #2023 X March 21 19:50 PM Brasília Time
4
5* *
6* Licensa de Copia (C) <2024> <Aurora Boreal> *
7* *
8* Este programa e software livre: voce pode redistribuir isto e/ou *
9* modificar isto sobre os termos do GNU Licensa Geral Pública como 25
10* publicado pela Fundacao de Software Livre, tanto a versão 3 da *
11* Licensa, ou (dependendo da sua opcao) qualquer versao posterior. *
12* *
13* Este programa e distribuido na esperanca que isto vai ser util, *
14* mas SEM QUALQUER GARANTIA; sem ate mesmo a implicada garantia de *
15* COMERCIALIZAcaO ou CABIMENTO PARA UM FIM PARTICULAR. Veja a *
16* Licensa Geral Publica para mais detalhes. *
17* *
18* Você deve ter recebido uma cópia da LICENSA GERAL PUBLICA e a GNU *
19* Licensa Publica Menor junto com este programa *
20* Se não, veja <http://www.gnu.org/licenses/>. *
21* *
22* Suporte: sourceforge.net github.com *
23* *
24* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
25
26* Pereira: arsoftware25@gmail.com ricardo@arsoftware.net.br *
27* xcx: arsoftware10@gmail.com charli@arsoftware.net.br *
28 Yasmin: yasmin@arsoftware.net.br *
29 pereira1001@users.sourceforge.net
30 */
31
32#include <sys/utime.h>
33#include <windows.h>
34#include <stdint.h>
35#include <stdio.h>
36#include <stdlib.h>
37#include <string.h>
38#include <time.h>
39#include <errno.h>
40#include <fcntl.h>
41#include <ctype.h>
42#include <math.h>
43#include <wctype.h>
44#include <wchar.h>
45#include <stdarg.h>
46#include <stddef.h>
47#include <setjmp.h>
48#include <locale.h>
49#include <signal.h>
50#include <limits.h>
51#include <float.h>
52#include <iso646.h>
53
54#undef NDEBUG
55#include <assert.h>
56#include <psapi.h>
57#include <process.h>
58
59#include <stdbool.h>
60#include <dirent.h>
61#include <sys\stat.h>
62
66
67
81int amanda_s_smart_ape(__attribute__((unused)) char *initial_path_amanda_s_smart_ape,
82 bool recurse_on_subfolders_amanda_s_smart_ape, enum amanda__mode amanda_mode,
83 __attribute__((unused)) bool is_callback)
84{
85
86 struct oi_amanda *oi_amanda_ptr = calloc(1, sizeof(struct oi_amanda));
87
88 struct oi_amanda *oi_amanda_ptr_inicial = oi_amanda_ptr;
89
90 struct oi_amanda *to_call_free______amanda_s_smart_ape;
91
92 WIN32_FIND_DATAW ffd = {0};
93 static char szDir[AMANDA__SIZE];
94 static char szDir_i[AMANDA__SIZE];
95 static char lpcszFolder[AMANDA__SIZE];
96
98 // for ScanFolder
99 static __time64_t s_arp_3;
100 static VAL_data VAL_data_i;
101 int64_t size_i;
102 __attribute__((unused)) int len_i;
103 if (I_MODE_IS_SCANFOLDER == amanda_mode)
104 {
106 }
107
110 // for EnumerateFolder
111
112 int skip_ar = 0;
113
115 // keeping this here int debug_counter_amanda_s_smart_ape = 8;
116
117 strcpy(lpcszFolder, initial_path_amanda_s_smart_ape); //"C:\\Ava\\back\\test_i");
118
119 // strcpy(lpcszFolder, "C:\\");
120
121 // strcpy(lpcszFolder, "C:\\Program Files");//deu? sim querida...
122
123 if (strlen(lpcszFolder))
124 {
125 if ('\\' == lpcszFolder[strlen(lpcszFolder) - 1])
126 {
127 lpcszFolder[strlen(lpcszFolder) - 1] = 0;
128 }
129 }
130
131 // strcpy(oi_amanda_ptr->whole_path_i, lpcszFolder);
132 strcpy(szDir, lpcszFolder);
133 strcat(szDir, "\\*");
134
135 oi_amanda_ptr->parent_hFind_amanda_s_smart______ape = INVALID_HANDLE_VALUE;
136
137 oi_amanda_ptr->previous_amanda_s_smart_ape = NULL;
138
139loop_again_amanda_s_smart_ape:;
140
141 if (1 == 0)
142 {
143 goto loop_again_amanda_s_smart_ape;
144 }
145
146 pedro_dprintf(IS_DEBUG_APE__, "path total %s\n", szDir);
147 // assert(0 && "mais amor?...");
148
149 pedro_dprintf(IS_DEBUG_APE__, "endereco da struct na entrada %p\n", oi_amanda_ptr);
150 {
151 int r_temp = size_of_WCHAR_mem_r(szDir);
152 WCHAR *ar_temp = (void *)malloc(r_temp);
153 WCHAR *ar_temp2 = (void *)malloc(r_temp);
154 oi_amanda_ptr->current_hFind_amanda_s_smart_____ape = FindFirstFileW(permissive_name_m_(amanda_asciitowide_1_(szDir, ar_temp), ar_temp2), &ffd);
155
156 free(ar_temp);
157 free(ar_temp2);
158 }
159 pedro_dprintf(-1, "ok1 \n");
160 if (INVALID_HANDLE_VALUE == oi_amanda_ptr->current_hFind_amanda_s_smart_____ape)
161 {
162 pedro_dprintf(-1, "INVALID_HANDLE_VALUE\n");
163 pedro_dprintf(-1, "path %s\n", szDir);
164 if (oi_amanda_ptr == oi_amanda_ptr_inicial)
165 {
166 pedro_dprintf(-1, "free forçado final on %x\n", oi_amanda_ptr);
167 free(oi_amanda_ptr);
168 oi_amanda_ptr = NULL;
169 goto no_entries_i; // se é um subdiretorio tem . e .. experimente
170 }
171
172 goto keep_running_amanda_s_smart_ape;
173 }
174
175 do
176 {
177
179 {
180 pedro_dprintf(IS_DEBUG_APE__, "Called cancel \n");
181 goto exit_me_forced_amanda_s_smart_ape;
182 }
183
184 if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
185 {
186
187 char *ar_temp_char = (void *)malloc(AMANDA__SIZE);
188
189 if (is_valid__Pk_folder(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)))
190 {
191
192 ; // Mr. Do.
193
194 pedro_dprintf(-1, "2 dir -> %s\n", valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
195
196 if (INVALID_HANDLE_VALUE == oi_amanda_ptr->parent_hFind_amanda_s_smart______ape)
197 {
198
199 if (NULL == oi_amanda_ptr->entry______i)
200 {
201 oi_amanda_ptr->entry______i = calloc(1, strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) + 3);
202 }
203 else
204 {
205 free(oi_amanda_ptr->entry______i);
206 oi_amanda_ptr->entry______i = calloc(1, strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) + 3);
207 }
208
209 strcpy(oi_amanda_ptr->entry______i, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
210 }
211 else
212 {
213
214 if (NULL == oi_amanda_ptr->entry______i)
215 {
216 oi_amanda_ptr->entry______i = calloc(1, strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) +
217 strlen(oi_amanda_ptr->whole_entry_above_i) +
218 strlen("\\") + 3);
219 }
220 else
221 {
222 free(oi_amanda_ptr->entry______i);
223 oi_amanda_ptr->entry______i = calloc(1, strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) +
224 strlen(oi_amanda_ptr->whole_entry_above_i) +
225 strlen("\\") + 3);
226 }
227
228 strcpy(oi_amanda_ptr->entry______i, oi_amanda_ptr->whole_entry_above_i);
229 strcat(oi_amanda_ptr->entry______i, "\\");
230 strcat(oi_amanda_ptr->entry______i, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
231 }
232
233 free(ar_temp_char);
234 ar_temp_char = NULL;
235
236 if (recurse_on_subfolders_amanda_s_smart_ape)
237 {
238 oi_amanda_ptr->subfolder_amanda_s_smart_ape = calloc(1, sizeof(struct oi_amanda));
239
240 oi_amanda_ptr->subfolder_amanda_s_smart_ape->previous_amanda_s_smart_ape = oi_amanda_ptr;
241
243 {
244 oi_amanda_ptr->subfolder_amanda_s_smart_ape->whole_entry_above_i = calloc(1, strlen(oi_amanda_ptr->entry______i) + 3);
245 }
246 else
247 {
249 oi_amanda_ptr->subfolder_amanda_s_smart_ape->whole_entry_above_i = calloc(1, strlen(oi_amanda_ptr->entry______i) + 3);
250 }
251
253 oi_amanda_ptr->entry______i);
254
257 }
258
259 strcpy(szDir, lpcszFolder);
260 strcat(szDir, "\\");
261 strcat(szDir, oi_amanda_ptr->entry______i);
262
263 if (is_callback)
264 {
265 strcpy(file_got_pk, oi_amanda_ptr->entry______i);
266
268 {
269 meu_fn_pk_(0, 0);
270 }
271 }
272
273 if (NULL == oi_amanda_ptr->whole_entry_i)
274 {
275 oi_amanda_ptr->whole_entry_i = calloc(1, strlen(szDir) + strlen("\\*") + 3);
276 }
277 else
278 {
279 free(oi_amanda_ptr->whole_entry_i);
280 oi_amanda_ptr->whole_entry_i = calloc(1, strlen(szDir) + strlen("\\*") + 3);
281 }
282
283 strcpy(oi_amanda_ptr->whole_entry_i, szDir);
284
285 /*
286
287
288 aqui tem a entrada inteira...
289
290 dir ->
291
292 oi_amanda_ptr->whole_entry_i -- com path inicial
293 oi_amanda_ptr->entry______i -- so a entrada....
294
295 //vamos converter para utf-8?...
296
297 */
298
299 strcat(szDir, "\\*");
300 // assert(0 && "3");
301
302 pedro_dprintf(IS_DEBUG_APE__, "oi_amanda_ptr->current_hFind_amanda_s_smart_____ape == %x\n", oi_amanda_ptr->current_hFind_amanda_s_smart_____ape);
303
304 pedro_dprintf(IS_DEBUG_APE__, "dir %s\n", oi_amanda_ptr->entry______i);
305 pedro_dprintf(IS_DEBUG_APE__, "dir %s\n", oi_amanda_ptr->whole_entry_i);
306 pedro_dprintf(IS_DEBUG_APE__, "*************************************\n");
307
308 if (recurse_on_subfolders_amanda_s_smart_ape)
309 {
310 /*
311 setor de folders
312 */
313
314 strcpy(whole_entry_i, oi_amanda_ptr->whole_entry_i);
315 strcpy(entry_______i, oi_amanda_ptr->entry______i);
316
317 if (I_MODE_IS_SCANFOLDER == amanda_mode)
318 {
319
321 get_timestamp_arp(whole_entry_i, &s_arp_3, &VAL_data_i);
322
324 atime_i,
325 mtime_i,
326 ctime_i,
327 0,
328 _ftelli64(my___temp_file_i),
330 true,
331 true,
332 0);
333 }
334
335 if (I_MODE_IS_ENUMFOLDER_1 == amanda_mode)
336 {
337 skip_ar = 0;
338
339 if (true || mode_is_VAL_arp) // hack as usual
340 {
341 }
342 else
343 {
344 if (258 < strlen(whole_entry_i)) // not in use anymore
345 {
346 static char temp_ar[AMANDA__SIZE] = {0};
347
348 snprintf(temp_ar, AMANDA__SIZE - 3, "Skipping folder %s because the path is too large for windows", szDir);
349 skip_ar = 1;
350 add_more_one(temp_ar);
351 warning_flag = 28;
353 }
354 }
355
356 if (0 == skip_ar)
357 {
359 {
360 amanda_itens++;
361 }
362 else
363 {
365
367 }
368 }
369
370 while (pause_flag_ar)
371 {
372 Sleep(50);
373
374 if (fatal_exit_k)
375 {
377 break;
378 }
379 }
380 if (fatal_exit_k)
381 {
383 }
384 }
385 }
386
387 if (recurse_on_subfolders_amanda_s_smart_ape)
388 {
389 oi_amanda_ptr = oi_amanda_ptr->subfolder_amanda_s_smart_ape;
390 }
391
392 pedro_dprintf(IS_DEBUG_APE__, "endereco da struct na passagem %p\n", oi_amanda_ptr);
393
394 if (recurse_on_subfolders_amanda_s_smart_ape)
395 {
396 goto loop_again_amanda_s_smart_ape;
397 }
398 }
399 else
400 {
401 free(ar_temp_char);
402 pedro_dprintf(-1, "3 . ou .. \n");
403 continue;
404 }
405 }
406 else
407 {
408
409 char *ar_temp_char = (void *)malloc(AMANDA__SIZE);
410
411 pedro_dprintf(-1, "4 file -> %s\n", valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
412
413 if (INVALID_HANDLE_VALUE == oi_amanda_ptr->parent_hFind_amanda_s_smart______ape)
414 {
415 if (NULL == oi_amanda_ptr->entry______i)
416 {
417 oi_amanda_ptr->entry______i = calloc(1, strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) + 3);
418 }
419 else
420 {
421 free(oi_amanda_ptr->entry______i);
422 oi_amanda_ptr->entry______i = calloc(1, strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) + 3);
423 }
424 strcpy(oi_amanda_ptr->entry______i, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
425 }
426 else
427 {
428 if (NULL == oi_amanda_ptr->entry______i)
429 {
430 oi_amanda_ptr->entry______i = calloc(1, strlen(oi_amanda_ptr->whole_entry_above_i) + strlen("\\") + strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) + 3);
431 }
432 else
433 {
434 free(oi_amanda_ptr->entry______i);
435 oi_amanda_ptr->entry______i = calloc(1, strlen(oi_amanda_ptr->whole_entry_above_i) + strlen("\\") + strlen(valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char)) + 3);
436 }
437 strcpy(oi_amanda_ptr->entry______i, oi_amanda_ptr->whole_entry_above_i);
438 strcat(oi_amanda_ptr->entry______i, "\\");
439 strcat(oi_amanda_ptr->entry______i, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
440 }
441 free(ar_temp_char);
442 ar_temp_char = NULL;
443 strcpy(szDir_i, lpcszFolder);
444 strcat(szDir_i, "\\");
445 strcat(szDir_i, oi_amanda_ptr->entry______i);
446
447 if (is_callback)
448 {
449 strcpy(file_got_pk, oi_amanda_ptr->entry______i);
451 {
452 meu_fn_pk_(1, getfilesize_ar(szDir_i));
453 }
454 }
455
456 if (NULL == oi_amanda_ptr->whole_entry_i)
457 {
458 oi_amanda_ptr->whole_entry_i = calloc(1, strlen(szDir_i) + 1);
459 }
460 else
461 {
462 free(oi_amanda_ptr->whole_entry_i);
463 oi_amanda_ptr->whole_entry_i = calloc(1, strlen(szDir_i) + 1);
464 }
465
466 strcpy(oi_amanda_ptr->whole_entry_i, szDir_i);
467
468 pedro_dprintf(IS_DEBUG_APE__, "oi_amanda_ptr->current_hFind_amanda_s_smart_____ape == %x\n", oi_amanda_ptr->current_hFind_amanda_s_smart_____ape);
469
470 pedro_dprintf(IS_DEBUG_APE__, "file %s\n", oi_amanda_ptr->entry______i);
471 pedro_dprintf(IS_DEBUG_APE__, "file %s\n", oi_amanda_ptr->whole_entry_i);
472 pedro_dprintf(IS_DEBUG_APE__, "*************************************\n");
473
474 {
475 /*
476 setor de arquivo
477 */
478
479 strcpy(whole_entry_i, oi_amanda_ptr->whole_entry_i);
480 strcpy(entry_______i, oi_amanda_ptr->entry______i);
481
482 if (I_MODE_IS_SCANFOLDER == amanda_mode)
483 {
484
485 {
486 static char my_copy_of_filename_ar[AMANDA__SIZE];
487
488 char *ar_temp_char = (void *)malloc(AMANDA__SIZE);
489
490 strcpy(my_copy_of_filename_ar, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
491
492 free(ar_temp_char);
493
494 strtolower_ar(my_copy_of_filename_ar);
495 {
496 bool achei_o_match = false;
497 const char *my_str_literal = global_patern_ar; //"* *.txt *.ini";
498 char *token, *str, *tofree;
499 tofree = str = strdup(my_str_literal); // We own str's memory now.
500 while ((token = strsep(&str, " ")))
501 {
502 if (strlen(token))
503 {
504 achei_o_match = strmatch(my_copy_of_filename_ar, token,
505 strlen(my_copy_of_filename_ar), strlen(token));
506 }
507 if (achei_o_match)
508 {
509 break;
510 }
511 }
512 free(tofree);
513
514 if (false == true_if_include_i)
515 {
516 if (achei_o_match)
517 {
518 achei_o_match = false;
519 }
520 else
521 {
522 achei_o_match = true;
523 }
524 }
525
526 if (achei_o_match)
527 {
528 /*
529 strcpy(temp_del_entry_i, fixo_path_ar);
530 strcat(temp_del_entry_i, "\\");
531 strcat(temp_del_entry_i, final_file_or_folder_ar);
532 */
533
534 {
535 /*
536 strcpy(dest_entry_i, global_temp_folder_i);
537 strcat(dest_entry_i, "\\");
538 strcat(dest_entry_i, final_file_or_folder_ar);
539 */
540 // if(check_temp_folder_passed_i(global_temp_folder_i, whole_entry_i))
541 {
542 /*
543 stripfilenameandpath(dest_entry_i, dir_out_entry_i, NULL);
544
545 rspmakedir_v2(dir_out_entry_i);
546
547 file_copy_i(temp_del_entry_i, dest_entry_i);
548
549 stripfilenameandpath(temp_del_entry_i, dir_out_entry_2_i, NULL);
550
551 set_folder_time(dir_out_entry_2_i, dir_out_entry_i);
552 */
553 }
554
555 if (is_update_i)
556 {
557
558 get_timestamp_arp(whole_entry_i, &s_arp_3, &VAL_data_i);
559
560 {
562 WCHAR *ar_temp = (void *)malloc(r_temp);
563 WCHAR *ar_temp2 = (void *)malloc(r_temp);
564 attributes_i = GetFileAttributesW(
566 free(ar_temp);
567 free(ar_temp2);
568 }
569
570 /*
571
572 I will keep this for historical reasons...
573
574 {
575
576 int64_t a_i = -1;
577 int b_i = -1;
578
579 if(a_i == b_i)
580 {
581
582 }
583
584 }
585 */
586 if (INVALID_FILE_ATTRIBUTES != attributes_i)
587 {
588 ;
589 }
590 else
591 {
592 attributes_i = 0x20;
593 }
594
595 // [12608] temp_del_entry_i C:\Ava\back\extract_k\taglib-1.11.1\bindings\CMakeLists.txt _amanda_debug_
596
597 {
598
599#define THE_SIZE_I (1 << 17)
600
601 char *buf_i = malloc(THE_SIZE_I);
602 __attribute__((unused)) int len_i;
603 FILE *the_file_i;
604 {
606 WCHAR *ar_temp = /* */ (void *)malloc(r_temp);
607 WCHAR *ar_temp2 = /* */ (void *)malloc(r_temp);
608
609 the_file_i = _wfopen(permissive_name_m_(amanda_asciitowide_1_(whole_entry_i, ar_temp), ar_temp2), L"rb");
610
611 free(ar_temp);
612 free(ar_temp2);
613 }
614 if (the_file_i)
615 {
618 atime_i,
619 mtime_i,
620 ctime_i,
622 _ftelli64(my___temp_file_i),
624 false,
625 true,
627 size_i = 0;
628 while ((len_i = fread(buf_i, 1, THE_SIZE_I, the_file_i)))
629 {
630 ;
631 if ((fwrite(buf_i, 1, len_i, my___temp_file_i)) != (size_t)len_i)
632 {
633 fatal_exit_k = 12345100;
634 }
635 size_i += len_i;
636 }
637
638 fclose(the_file_i);
639 }
640 else
641 {
642 files_that_cannot_be_read_update++; // precisa melhorar isto e mostrar uma lista de arquivos que nao puderam ser lidos...
643 }
644
645 free(buf_i);
646 }
647 }
648 }
649 }
650 }
651 }
652 }
653
654 if (I_MODE_IS_ENUMFOLDER_1 == amanda_mode)
655 {
656 while (pause_flag_ar)
657 {
658 Sleep(50);
659
660 if (fatal_exit_k)
661 {
663 break;
664 }
665 }
666 if (fatal_exit_k)
667 {
669 }
670
671 skip_ar = 0;
672 if (true || mode_is_VAL_arp)
673 {
674 }
675 else
676 {
677 if (258 < strlen(whole_entry_i))
678 {
679 static char temp_ar[AMANDA__SIZE] = {0};
680
681 snprintf(temp_ar, 600, "Skipping folder %s because the path is too large for windows", szDir);
682 skip_ar = 1;
683 add_more_one(temp_ar);
684 warning_flag = 28;
686 }
687 }
688
689 if (0 == skip_ar)
690 {
692 {
693 amanda_itens++;
694 static char my_copy_of_filename_ar[AMANDA__SIZE];
695
696 char *ar_temp_char = (void *)malloc(AMANDA__SIZE);
697
698 strcpy(my_copy_of_filename_ar, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
699
700 free(ar_temp_char);
701
702 strtolower_ar(my_copy_of_filename_ar);
703 {
704 bool achei_o_match = false;
705 const char *my_str_literal = global_patern_ar; //"* *.txt *.ini";
706 char *token, *str, *tofree;
707
708 tofree = str = strdup(my_str_literal); // We own str's memory now.
709 while ((token = strsep(&str, " ")))
710 {
711 if (strlen(token))
712 {
713 achei_o_match = strmatch(my_copy_of_filename_ar, token,
714 strlen(my_copy_of_filename_ar), strlen(token));
715 }
716 if (achei_o_match)
717 {
718 break;
719 }
720 }
721
722 free(tofree);
723
725 {
726 if (achei_o_match)
727 {
728 achei_o_match = false;
729 }
730 else
731 {
732 achei_o_match = true;
733 }
734 }
735
736 if (achei_o_match)
737 {
738 static char file_or_folder_to_process___[AMANDA__SIZE]; // = {0};
739
740 strcpy(file_or_folder_to_process___, fixo_path_ar);
741
742 if (strlen(file_or_folder_to_process___))
743 {
744 if ('\\' != file_or_folder_to_process___[strlen(file_or_folder_to_process___) - 1])
745 {
746 strcat(file_or_folder_to_process___, "\\");
747 }
748 }
749
750 strcat(file_or_folder_to_process___, entry_______i);
751 trocadordebackslashtras(file_or_folder_to_process___);
752 amanda_pereira_total_size += getfilesize_ar(file_or_folder_to_process___);
753 }
754 }
755 }
756 else
757 {
758 static char my_copy_of_filename_ar[AMANDA__SIZE];
759
760 char *ar_temp_char = (void *)malloc(AMANDA__SIZE);
761
762 strcpy(my_copy_of_filename_ar, valquiria_wide_to_utf8(ffd.cFileName, ar_temp_char));
763
764 free(ar_temp_char);
765
766 strtolower_ar(my_copy_of_filename_ar);
767 {
768 bool achei_o_match = false;
769 const char *my_str_literal = global_patern_ar; //"* *.txt *.ini";
770 char *token, *str, *tofree;
771 tofree = str = strdup(my_str_literal); // We own str's memory now.
772 while ((token = strsep(&str, " ")))
773 {
774 if (strlen(token))
775 {
776 achei_o_match = strmatch(my_copy_of_filename_ar, token,
777 strlen(my_copy_of_filename_ar), strlen(token));
778 }
779 if (achei_o_match)
780 {
781 break;
782 }
783 }
784
785 free(tofree);
786
788 {
789 if (achei_o_match)
790 {
791 achei_o_match = false;
792 }
793 else
794 {
795 achei_o_match = true;
796 }
797 }
798
799 if (achei_o_match)
800 {
802 }
803 }
804
806 }
807 }
808
809 while (pause_flag_ar)
810 {
811 Sleep(50);
812
813 if (fatal_exit_k)
814 {
816 break;
817 }
818 }
819
820 if (fatal_exit_k)
821 {
823 }
824 }
825 }
826
827 /*
828
829 oi_amanda_ptr->entry______i -- entrada
830 oi_amanda_ptr->whole_entry_i -- com diretorio
831
832 */
833 }
834
835 // porque nao amor?...da pelo menos pra testar isto
836
837 entrada_again_smart_ape_from_amanda:;
838
839 if (1 == 0)
840 {
841 goto entrada_again_smart_ape_from_amanda;
842 }
843
844 } while (FindNextFileW(oi_amanda_ptr->current_hFind_amanda_s_smart_____ape, &ffd) != 0);
845
846exit_me_forced_amanda_s_smart_ape:;
847
848 pedro_dprintf(IS_DEBUG_APE__, "endereco da struct na saida %p\n", oi_amanda_ptr);
849
850 pedro_dprintf(-1, "previous %p\n", oi_amanda_ptr->previous_amanda_s_smart_ape);
851
852 FindClose(oi_amanda_ptr->current_hFind_amanda_s_smart_____ape);
853
854keep_running_amanda_s_smart_ape:; // one less bug..
855
856 if (oi_amanda_ptr_inicial != oi_amanda_ptr)
857 {
858
859 pedro_dprintf(IS_DEBUG_APE__, "nao � tem que processar\n");
860 // vamos l�...debugar isto bem amor... /* here for historical reasons
861
862 assert(NULL != oi_amanda_ptr->previous_amanda_s_smart_ape);
863
864 pedro_dprintf(IS_DEBUG_APE__, "free on %x\n", oi_amanda_ptr);
865
866 to_call_free______amanda_s_smart_ape = oi_amanda_ptr;
867
868 oi_amanda_ptr = oi_amanda_ptr->previous_amanda_s_smart_ape;
869
870 if (to_call_free______amanda_s_smart_ape->entry______i)
871 {
872 free(to_call_free______amanda_s_smart_ape->entry______i);
873 to_call_free______amanda_s_smart_ape->entry______i = NULL;
874 }
875
876 if (to_call_free______amanda_s_smart_ape->whole_entry_above_i)
877 {
878 free(to_call_free______amanda_s_smart_ape->whole_entry_above_i);
879 to_call_free______amanda_s_smart_ape->whole_entry_above_i = NULL;
880 }
881
882 if (to_call_free______amanda_s_smart_ape->whole_entry_i)
883 {
884 free(to_call_free______amanda_s_smart_ape->whole_entry_i);
885 to_call_free______amanda_s_smart_ape->whole_entry_i = NULL;
886 }
887
888 free(to_call_free______amanda_s_smart_ape);
889
890 pedro_dprintf(IS_DEBUG_APE__, "novo endereco de oi_amanda_ptr %x\n", oi_amanda_ptr);
891
892 goto entrada_again_smart_ape_from_amanda;
893 }
894
895 pedro_dprintf(-1, "free final on %x\n", oi_amanda_ptr);
896
897 if (oi_amanda_ptr->entry______i)
898 {
899 free(oi_amanda_ptr->entry______i);
900 oi_amanda_ptr->entry______i = NULL;
901 }
902
903 if (oi_amanda_ptr->whole_entry_above_i)
904 {
905 free(oi_amanda_ptr->whole_entry_above_i);
906 oi_amanda_ptr->whole_entry_above_i = NULL;
907 }
908
909 if (oi_amanda_ptr->whole_entry_i)
910 {
911 free(oi_amanda_ptr->whole_entry_i);
912 oi_amanda_ptr->whole_entry_i = NULL;
913 }
914
915 free(oi_amanda_ptr);
916
917no_entries_i:;
918
919 return 0;
920}
921
925
926
927
928
929
930
931
932
933
934
935
936
937
938int main()
939{
940 printf("Une running...");
941
942 return 0;
943}
#define FILE_ATTRIBUTE_DIRECTORY
Definition 7zTypes.h:146
#define AMANDA__SIZE
Definition arp.h:149
amanda__mode
Definition arp.h:238
@ I_MODE_IS_ENUMFOLDER_1
Definition arp.h:240
@ I_MODE_IS_SCANFOLDER
Definition arp.h:239
@ ARP_EXCLUDE_FILES
Definition arp_2.h:6
wchar_t * permissive_name_m_(const wchar_t *wname, WCHAR *ar_temp)
Definition tar_1_33.c:279
int size_of_WCHAR_mem_r(char *in_string)
Definition tar_1_33.c:694
void pedro_dprintf(int amanda_level, char *format,...)
Definition pedro.c:43
WCHAR * amanda_asciitowide_1_(char *pUTF8, WCHAR *ar_temp)
Definition tar_1_33.c:677
char warning_flag
Definition create_zen_ar.c:354
void add_more_one(char *data_ar)
Definition create_zen_ar.c:383
int files_that_cannot_be_read_update
Definition create_zen_ar.c:312
void get_timestamp_arp(char *file_arp, __time64_t *s_arp, VAL_data *VAL_data_arp)
Definition tar_1_33.c:3939
void dump_file_new_ar(struct tar_stat_info *parent, char const *name, char *initial_path_ar)
Definition create_zen_ar.c:2432
int64_t folders_count
Definition create_zen_ar.c:357
__int64 ricard0_itens_processed
Definition create_zen_ar.c:2568
void strtolower_ar(char *path)
Definition create_zen_ar.c:669
__int64 amanda_itens
Definition create_zen_ar.c:2567
char fixo_path_ar[AMANDA__SIZE]
Definition create_zen_ar.c:2545
char pause_flag_ar
Definition create_zen_ar.c:353
int64_t amanda_pereira_total_size
Definition create_zen_ar.c:340
enum mode_is_include_or_exclude mode_is_include_or_exclude__
Definition create_zen_ar.c:349
bool strmatch(char str[], char pattern[], int n, int m)
Definition create_zen_ar.c:2493
#define THE_SIZE_I
int amanda_s_smart_ape(__attribute__((unused)) char *initial_path_amanda_s_smart_ape, bool recurse_on_subfolders_amanda_s_smart_ape, enum amanda__mode amanda_mode, __attribute__((unused)) bool is_callback)
Definition dirent_ronkko.h:81
int main()
Definition dirent_ronkko.h:938
bool is_valid__Pk_folder(char *the_path_k__p)
Definition enum_files_and_folders_1.c:57
#define IS_DEBUG_APE__
Definition enum_files_and_folders_1.c:32
char whole_entry_i[AMANDA__SIZE]
Definition enum_files_and_folders_1.c:55
bool cancel_me_amanda_smart_ape
Definition enum_files_and_folders_1.c:52
void get_file_time_pk(char *file_or_folder_to_process, char *timestamp_pk)
Definition enum_files_and_folders_1.c:72
char entry_______i[AMANDA__SIZE]
Definition enum_files_and_folders_1.c:54
void trocadordebackslashtras(char *path)
Definition extract_kkk.c:2087
int __stdcall check_item_z_june_24(char *filename_utf8)
Definition libarchive_update_i.c:203
void __stdcall add_more_one_z_june_24(time_t atime_i, time_t mtime_i, time_t birthtime_i, int64_t filesize_i, int64_t file_offset_i, char *item_entry_i, bool is_dir_i, bool in_use_i, int64_t attributes_i)
Definition libarchive_update_i.c:79
#define assert(condition)
Definition lz4.c:273
#define __attribute__(unused_ric_since_2004)
Definition main_cr.c:84
__int64 getfilesize_ar(char *infile_ar)
Definition tar_1_33.c:2432
Definition arp.h:153
Definition enum_files_and_folders_1.c:40
char * whole_entry_above_i
Definition enum_files_and_folders_1.c:43
HANDLE current_hFind_amanda_s_smart_____ape
Definition enum_files_and_folders_1.c:49
struct oi_amanda * previous_amanda_s_smart_ape
Definition enum_files_and_folders_1.c:46
char * whole_entry_i
Definition enum_files_and_folders_1.c:42
struct oi_amanda * subfolder_amanda_s_smart_ape
Definition enum_files_and_folders_1.c:47
char * entry______i
Definition enum_files_and_folders_1.c:41
HANDLE parent_hFind_amanda_s_smart______ape
Definition enum_files_and_folders_1.c:48
char * strsep(char **stringp, const char *delim)
Definition tar_1_33.c:7425
char file_got_pk[1024]
Definition tar_1_33.c:88
__time64_t atime_i
Definition tar_1_33.c:151
char global_patern_ar[20000]
Definition tar_1_33.c:621
__time64_t ctime_i
Definition tar_1_33.c:152
bool mode_is_VAL_arp
Definition tar_1_33.c:594
char * valquiria_wide_to_utf8(WCHAR *pUSC2_maria, char *ar_temp_char)
Definition tar_1_33.c:766
bool only_get_number_of_files_ar_v27
Definition tar_1_33.c:120
FILE * my___temp_file_i
Definition tar_1_33.c:142
bool is_update_i
Definition tar_1_33.c:159
bool true_if_include_i
Definition tar_1_33.c:11018
meu_fn_pk meu_fn_pk_
Definition tar_1_33.c:95
__time64_t mtime_i
Definition tar_1_33.c:153
int64_t attributes_i
Definition tar_1_33.c:147
char date_got_pk[1024]
Definition tar_1_33.c:89
int fatal_exit_k
Definition tar_1_33.c:3217
#define NULL
Definition getopt1.c:37
const char * str
Table column heading string.
Definition list.c:109