2323#include "decode.c"
2424
2525#define MAX_ERROR_MSG 0x1000
26- #define MAX_CNTF 50 // 최대 검출 파일 개수 //
26+ #define MAX_CNTF 50 // 최대 검출 파일 개수 //
2727
2828typedef struct Data_storage
2929{
30- char fname [20 ]; // 파일 이름 //
31- uint jcnt ; // 주민번호 개수 //
32- uint dcnt ; // 운전면허 개수 //
33- uint fgcnt ; // 외국인등록번호 개수 //
34- uint pcnt ; // 여권번호 개수 //
35- uint fsize ; // 파일 크기 //
36- char stat ; // 파일 상태 //
37- char fpath [300 ]; // 파일 경로 //
30+ char fname [20 ]; // 파일 이름 //
31+ uint jcnt ; // 주민번호 개수 //
32+ uint dcnt ; // 운전면허 개수 //
33+ uint fgcnt ; // 외국인등록번호 개수 //
34+ uint pcnt ; // 여권번호 개수 //
35+ uint fsize ; // 파일 크기 //
36+ char stat ; // 파일 상태 //
37+ char fpath [300 ]; // 파일 경로 //
3838
3939
4040}data_storage ;
4141
42- data_storage ds [MAX_CNTF ]; // 파일기준의 data구조체 //
42+ data_storage ds [MAX_CNTF ]; // 파일기준의 data구조체 //
4343
44- static gchar * path ; // 파일경로 //
45- static int cntf = 0 ; // 파일개수 cnt //
46- static char chkfname [20 ];
47- static int chk_tf ; // chk_true or false //
48- //uint data_flag = 1; // 어떤종류의 민감정보인지 확인하기위한 flag //
44+ static gchar * path ; // 검사 파일경로 //
45+ static gchar * vsf_path ; // 검사결과 리스트 선택 파일경로 //
46+ static int cntf = 0 ; // 파일개수 cnt //
47+ static char chk_fname [20 ]; // 정규식돌고있는 파일이름 //
48+ static int chk_tf ; // chk_true or false //
49+ //uint data_flag = 1; // 민감정보 종류 확인 flag //
4950
5051
5152GtkWidget * detect_window ,
@@ -72,11 +73,11 @@ void d_folder_btn_clicked (GtkButton *d_folder_btn, gpointer *data);
7273void d_close_btn_clicked (GtkButton * d_close_btn , gpointer * data );
7374void d_detect_entry_activate (GtkEntry * d_detect_entry , gpointer * data );
7475
75- gboolean view_selection_func (GtkTreeSelection * selection ,
76- GtkTreeModel * model ,
77- GtkTreePath * path ,
78- gboolean path_currently_selected ,
79- gpointer userdata );
76+ gboolean view_selection_func (GtkTreeSelection * selection ,
77+ GtkTreeModel * model ,
78+ GtkTreePath * path ,
79+ gboolean path_currently_selected ,
80+ gpointer userdata );
8081
8182static GtkTreeModel * create_and_fill_model (void );
8283static GtkWidget * create_view_and_model (void );
@@ -179,15 +180,15 @@ char match_regex_jnfg (regex_t *r, const char *to_match, char *filepath, struct
179180 // 주민번호 유효성 통과 //
180181 if (jtmp == chk )
181182 {
182- int res = strcmp (chkfname , file -> d_name ); // 같은파일 = 0 //
183+ int res = strcmp (chk_fname , file -> d_name ); // 같은파일 = 0 //
183184
184185 if (res != 0 )
185186 {
186187 cntf ++ ;
187188 }
188189
189190 // 읽고있는중인 파일 이름 저장 //
190- strcpy (chkfname , file -> d_name );
191+ strcpy (chk_fname , file -> d_name );
191192
192193 // 검출된 주민등록번호의 수 //
193194 ds [cntf ].jcnt ++ ;
@@ -204,15 +205,15 @@ char match_regex_jnfg (regex_t *r, const char *to_match, char *filepath, struct
204205 // 외국인등록번호 유효성 통과 //
205206 if (fgtmp == chk )
206207 {
207- int res = strcmp (chkfname , file -> d_name ); // 같은파일 = 0 //
208+ int res = strcmp (chk_fname , file -> d_name ); // 같은파일 = 0 //
208209
209210 if (res != 0 )
210211 {
211212 cntf ++ ;
212213 }
213214
214215 // 읽고있는중인 파일 이름 저장 //
215- strcpy (chkfname , file -> d_name );
216+ strcpy (chk_fname , file -> d_name );
216217
217218 // 검출된 외국인등록번호의 수 //
218219 ds [cntf ].fgcnt ++ ;
@@ -268,15 +269,15 @@ char match_regex_d (regex_t *r, const char *to_match, char *filepath, struct dir
268269 //운전면허 정규식 검사 통과//
269270 if (i == 0 )
270271 {
271- int res = strcmp (chkfname , file -> d_name ); //같은파일 = 0 //
272+ int res = strcmp (chk_fname , file -> d_name ); //같은파일 = 0 //
272273
273274 if (res != 0 )
274275 {
275276 cntf ++ ;
276277 }
277278
278279 // 읽고있는중인 파일 이름 저장 //
279- strcpy (chkfname , file -> d_name );
280+ strcpy (chk_fname , file -> d_name );
280281
281282 // 검출된 운전면허의 수 //
282283 ds [cntf ].dcnt ++ ;
@@ -332,15 +333,15 @@ char match_regex_p (regex_t *r, const char *to_match, char *filepath, struct dir
332333 // 운전면허 정규식 검사 통과 //
333334 if (i == 0 )
334335 {
335- int res = strcmp (chkfname , file -> d_name ); // 같은파일 = 0 //
336+ int res = strcmp (chk_fname , file -> d_name ); // 같은파일 = 0 //
336337
337338 if (res != 0 )
338339 {
339340 cntf ++ ;
340341 }
341342
342343 // 읽고있는중인 파일 이름 저장 //
343- strcpy (chkfname , file -> d_name );
344+ strcpy (chk_fname , file -> d_name );
344345
345346 // 검출된 운전면허의 수 //
346347 ds [cntf ].pcnt ++ ;
@@ -465,7 +466,7 @@ int scan_dir (gchar *path)
465466 memset (buffer , 0 , sizeof (buffer ));
466467 fclose (fp );
467468 printf ("Close FILE\n" );
468- chkfname [0 ] = 0 ; // 초기화 //
469+ chk_fname [0 ] = 0 ; // 초기화 //
469470 }
470471 }
471472 closedir (dp );
@@ -807,21 +808,19 @@ view_selection_func (GtkTreeSelection *selection,
807808
808809 if (gtk_tree_model_get_iter (model , & iter , path ))
809810 {
810- gchar * name ;
811-
812- gtk_tree_model_get (model , & iter , d_treeview_filelocation , & name , -1 );
811+ gtk_tree_model_get (model , & iter , d_treeview_filelocation , & vsf_path , -1 );
813812
814813 if (!path_currently_selected )
815814 {
816- g_print ("%s is going to be selected .\n" , name );
815+ g_print ("%s 선택 .\n" , vsf_path );
817816 }
818817
819818 else
820819 {
821- g_print ("%s is going to be unselected .\n" , name );
820+ g_print ("%s 선택 해제 .\n" , vsf_path );
822821 }
823822
824- g_free (name );
823+ g_free (vsf_path );
825824 }
826825
827826 return TRUE; /* allow selection state to change */
0 commit comments