-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdebug.c
More file actions
59 lines (54 loc) · 1.24 KB
/
Copy pathdebug.c
File metadata and controls
59 lines (54 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*********************************************************************************************
Description: data and files for debugging
Copyright : All right reserved by .
Author :
Date : 2024/04/09
***********************************************************************************************/
#include <stdio.h>
#include "debug.h"
FILE *gf[4] = {0},
*gfq[4] = {0},
*gft[4] = {0},
*gfi[4] = {0};
int open_qti_files()
{
char fn[1024] = {0};
int i = 0;
for (; i < 4; ++i)
{
sprintf(fn, "./output/q%d.txt", i);
gfq[i] = fopen(fn, "w");
sprintf(fn, "./output/t%d.txt", i);
gft[i] = fopen(fn, "w");
sprintf(fn, "./output/i%d.txt", i);
gfi[i] = fopen(fn, "w");
}
return 0;
}
int open_debug_files()
{
char fn[1024] = {0};
int i = 0;
for (; i < 4; ++i)
{
sprintf(fn, "./output/fp%d.txt", i);
gf[i] = fopen(fn, "w");
}
return 0;
}
int close_files()
{
int i = 0;
for (; i < 4; ++i)
{
if (gf[i] != 0)
fclose(gf[i]);
if (gfq[i] != 0)
fclose(gfq[i]);
if (gft[i] != 0)
fclose(gft[i]);
if (gfi[i] != 0)
fclose(gfi[i]);
}
return 0;
}